Source for file idfield.php

Documentation is available at idfield.php

  1. <?php
  2. /**
  3. * a textfield object designed to hold the database key (or id) field
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage FormsLibrary
  11. */
  12.  
  13. /** Load ancillary functions */
  14. require_once 'inc/typeinfo.php';
  15.  
  16. /** parent object */
  17. require_once 'textfield.php';
  18.  
  19. /**
  20. * a textfield object designed to hold the database key (or id) field
  21. *
  22. @package    Bumblebee
  23. @subpackage FormsLibrary
  24. */
  25. class IdField extends TextField {
  26.  
  27.   /**
  28.   *  Create a new field object, designed to be superclasses
  29.   *
  30.   * @param string $name   the name of the field (db name, and html field name
  31.   * @param string $longname  long name to be used in the label of the field in display
  32.   * @param string $description  used in the html title or longdesc for the field
  33.   */
  34.   function IdField($name$longname=''$description=''{
  35.     parent::TextField($name$longname$description);
  36.   }
  37.  
  38.   function displayInTable($cols=3{
  39.     if ($this->value != -1{
  40.       $this->editable = 0;
  41.       $t parent::displayInTable($cols);
  42.       $this->editable = 1;
  43.       return $t;
  44.     else {
  45.       return $this->hidden();
  46.     }
  47.   }
  48.  
  49. // class IdField
  50.  
  51.  
  52. ?>

Documentation generated on Tue, 06 Mar 2007 10:01:35 +0000 by phpDocumentor 1.3.0