Source for file dummyfield.php

Documentation is available at dummyfield.php

  1. <?php
  2. /**
  3. * a dummy field does not exist in the database but stores data in the form
  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 'field.php';
  18.  
  19. /**
  20. * a dummy field does not exist in the database but stores data in the form
  21. *
  22. * @package    Bumblebee
  23. * @subpackage FormsLibrary
  24. */
  25. class DummyField extends Field {
  26.  
  27.   /**
  28.   *  Create a new dummy field
  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 DummyField($name, $longname="", $description="") {
  35.     parent::Field($name, $longname, $description);
  36.   }
  37.  
  38.   function displayInTable($cols=3) {
  39.     $t = "<input type='hidden' name='{$this->namebase}{$this->name}' "
  40.              ."value='".xssqw($this->value)."' />";
  41.     return $t;
  42.   }
  43.  
  44.   function update($data) {
  45.     return 0;
  46.   }
  47.  
  48.   function isValid() {
  49.     return 1;
  50.   }
  51.  
  52.   function set($value) {
  53.   }
  54.  
  55.   function sqlSetStr($name='', $force=false) {
  56.     return '';
  57.   }
  58.  
  59. } // class DummyField
  60.  

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