Source for file DBMS_FIELD_DBMS_FORMFIELDOBJECT.phpclass

Documentation is available at DBMS_FIELD_DBMS_FORMFIELDOBJECT.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_DBMS_FORMFIELDOBJECT.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   text
  8.   *
  9.   * @author     Peter Krebs <p.krebs@lvus.at>
  10.   * @copyright  (c) 2002-2005 by Peter Krebs and LVUS
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   ***/
  14.  
  15. require_once $GLOBALS['OCSP']['DBMSFLD_PATH']."DBMS_FIELD.phpclass";
  16.  
  17. /**
  18.   * Class file DBMS_FIELD_DBMS_FORMFIELDOBJECT.phpclass
  19.   *
  20.   * stores a serialized form field to a text colomun
  21.   *
  22.   * @project    Open CSP-Management
  23.   * @package    dbms_field
  24.   * @category   int
  25.   *
  26.   * @author     Peter Krebs <p.krebs@lvus.at>
  27.   * @copyright  (c) 2002-2005 by Peter Krebs and LVUS
  28.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  29.   *
  30.   * @since      pk-06-07-22
  31.   *
  32.   ***/
  33.  
  34.     // -----------------------------------------------------------
  35.     // OBJECT (CONST) VAR DECLARATION
  36.     // -----------------------------------------------------------
  37.  
  38.     /**
  39.       * the name (human readable) of the object
  40.       * @var string $className 
  41.       ***/
  42.     var $className      = "Form Field Object";
  43.  
  44.     /**
  45.       * source file of the class
  46.       * @var string $classSrcFile 
  47.       ***/
  48.     var $classSrcFile=__FILE__;
  49.  
  50.     /**
  51.       * a comma seperated list of datatypes available for the field
  52.       * @var string $datatypesAvail 
  53.       ***/
  54.     var $datatypesAvail="any";
  55.  
  56.     // -----------------------------------------------------------
  57.     // FIELD DEFINITION DATA METHODS
  58.     // -----------------------------------------------------------
  59.  
  60.     /**
  61.       * returns an array of field to bie shown in the edit form
  62.       * by using editTbl_echoForm
  63.       *
  64.       * the array is in the form:
  65.       *
  66.       * <code>
  67.       * [_sectionName_]
  68.       *      [TITLE] -> string
  69.       *      [_rowName_]
  70.       *         [FLDLAB]  (complete html code with <td></td>)
  71.       *         [FLDVAL] (complete html code with <td></td>)
  72.       * </code>
  73.       *
  74.       * NOTE as this is not implemented in the whole classTree at the moment ensure all parents use
  75.       * editTbl_echoForm() in theire editTblForm otherwise you'll get a mismatch of field order
  76.       *
  77.       * @param boolean $debug 
  78.       *
  79.       * @returns array
  80.       *
  81.       * @since pk-06-04-26
  82.       * @version pk-06-07-17 HIDDEN added to array
  83.       *
  84.       ***/
  85.     function editTbl_getFieldEditArr($debug=FALSE{
  86.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DBMS_FORMFIELDOBJECT::editTbl_getFieldEditArr","",0);
  87.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  88.  
  89.         // unset fields that does not make sense here
  90.         unset($a_ret['COMMON']['FRM_DEFVAL']);
  91.         unset($a_ret['VALCHECKS']);
  92.         unset($a_ret['LAYOUT']['FLD_SIZE']);
  93.         unset($a_ret['LAYOUT']['FLD_INPUTADD']);
  94.  
  95.         $a_avialTyps=explode(";",$this->datatypesAvail);
  96.  
  97.         $a_ret['FIELDDEF']=array(
  98.             'TITLE'=>'Datentypen',
  99.             'DATATYPES'=>array(
  100.                 'FLDLAB'=>"Verfügbar"
  101.             )
  102.         );
  103.  
  104.         $a_ret['FIELDDEF']['FLDVAL']="
  105.                             <select name=\"datatypesAvail\" size=\"12\" MULTIPLE>
  106.                                 <option value=\"any\">Jeder</option>
  107.                           ";
  108.         foreach($GLOBALS['DBFLDTYPES_DESC'as $s_type => $s_naame{
  109.            $a_ret['FIELDDEF']['FLDVAL'].="
  110.                                 <option value=\"$s_type\"";
  111.            if (in_array($s_type,$a_avialTyps)) $a_ret['FIELDDEF']['FLDVAL'].=" slectted ";
  112.            $a_ret['FIELDDEF']['FLDVAL'].=">$s_name</option>\n";
  113.  
  114.         }
  115.  
  116.         $a_ret['FIELDDEF']['FLDVAL'].="
  117.                             </select>";
  118.  
  119.         return $a_ret;
  120.     }
  121.  
  122.     /**
  123.       * show the filed definition form
  124.       *
  125.       * as not all field classes are now updated to use editTbl_echoForm
  126.       * DBMS_FIELD uses this by default. We have to change this here.
  127.       *
  128.       * @param bool $showSize       show size input
  129.       * @param bool $showNull       show input field to handle null values
  130.       *
  131.       * @deprecated only for compatibility reason here
  132.       *
  133.       ***/
  134.     function editTblForm($showSize=TRUE,$showNull=TRUE{
  135.         echo $this->editTbl_echoForm($this->editTbl_getFieldEditArr($debug),$debug);
  136.     }
  137.  
  138.     /**
  139.       * saves the posted values into the object
  140.       * (does not store the object to the database this have to be done by the form object)
  141.       *
  142.       * @return boolean 
  143.       *
  144.       ***/
  145.     function save({
  146.         $ret=parent::save();
  147.  
  148.  
  149.         return $ret;
  150.     }
  151.  
  152.  
  153.  
  154. }
  155. ?>

Documentation generated on Thu, 08 Jan 2009 17:41:06 +0100 by phpDocumentor 1.4.0a2