Source for file DBMS_FIELD_LAYOUT_CHKBOXGRP.phpclass

Documentation is available at DBMS_FIELD_LAYOUT_CHKBOXGRP.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_LAYOUT_CHKBOXGRP.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   layout
  8.   *
  9.   * @author     Peter Krebs <p.krebs@lvus.at>
  10.   * @copyright  &copy; 2002-2005 by LVUS <http://www.lvus.at>
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   * @since pk-05-12-28
  14.   *
  15.   ***/
  16.  
  17. require_once $GLOBALS['OCSP']['DBMSFLD_PATH']."DBMS_FIELD_FLDGROUP.phpclass";
  18.  
  19.  
  20. /**
  21.   * Class DBMS_FIELD_LAYOUT_CHKBOXGRP
  22.   *
  23.   * @project    Open CSP-Management
  24.   * @package    dbms_field
  25.   * @category   layout
  26.   *
  27.   * @author     Peter Krebs <p.krebs@lvus.at>
  28.   * @copyright  &copy; 2002-2005 by LVUS <http://www.lvus.at>
  29.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  30.   *
  31.   * @since pk-05-12-28
  32.   *
  33.   ***/
  34.  
  35.     // ###########################################################
  36.     // OBJECT (CONST) VAR DECLARATION
  37.     // ###########################################################
  38.  
  39.     /**
  40.       * @var string $className 
  41.       ***/
  42.     var $className  = "chkBoxGroup";
  43.  
  44.     /**
  45.       * @var string $grpfldSep 
  46.       ***/
  47.     var $grpfldSep ="<br />";
  48.     
  49.     /**
  50.       * @var boolean $addSubLabels 
  51.       ***/
  52.     var $addSubLabels=TRUE;
  53.  
  54.     /**
  55.       * source file of the class
  56.       * (without $GLOBALS['PROJECT']['PATH']
  57.       *
  58.       * @var string $classSrcFile 
  59.       ***/
  60.     var $classSrcFile=__FILE__;
  61.         
  62.     // ###########################################################
  63.     // OBJECT SETTINGS METHODS
  64.     // ###########################################################
  65.  
  66.     /**
  67.       * save the filed definition form
  68.       *
  69.       * @returns boolean
  70.       *
  71.       ***/
  72.     function save({
  73.         $b_ret=parent::save();
  74.         $this->addSubLabels=TRUE;
  75.         return $b_ret;
  76.     }
  77.  
  78.     // ###########################################################
  79.     // OBJECT DATA METHODS
  80.     // ###########################################################
  81.  
  82.  
  83.     // ###########################################################
  84.     // OBJECT HTML FORM METHODS
  85.     // ###########################################################
  86.  
  87.  
  88.     /**
  89.       * html output of the field (no value)
  90.       *
  91.       * @param int      $mode       show mode of the field
  92.       * @param mixed    $aValue     value of the field
  93.       * @param string   $arrName    array in Name of the html input form <input name=ARRNAME[FIELDNAME]>
  94.       *                              it also needs to be a global array global ${$arrName}
  95.       * @param bool     $debug      show debug info
  96.       *
  97.       * @return bool    TRUE if an input field is written
  98.       *
  99.       * @version pk-04-12-28
  100.       * @version pk-05-02-04 set $fld->myDataArrName
  101.       *
  102.       ***/
  103.     function getFieldTag($mode,$aValue="",$debug=FALSE{
  104.         global ${$this->myDataArrName};
  105.  
  106.         $debug=($debug || $this->fldDebug)/* <pk-04-12-28 /> */
  107.         if ($debug{
  108.             echoDebug(__FILE__,"<p><b>DBMS_FIELD_LAYOUT_CHKBOXGRP::getFieldTag($mode,$aValue,$debug)</b></p>",0);
  109.         }
  110.  
  111.         $fldLst=$this->getMyForm()->getFields();
  112.         $sep="";$comma="";
  113.         $ret="";
  114.         if ($debugechoDebug(__FILE__,"<blockquote><p>myKey: ".$this->getKey()."<br />Fields: </p><pre>".print_r($this->grpfldList,TRUE)."</pre>",1);
  115.         foreach($fldLst as $key => $fld{
  116.             if ($debugechoDebug(__FILE__,"<p>Checking Field: ".$fld->getKey()."</p>",2);
  117.             if (in_array($fld->getKey(),$this->grpfldList)) {
  118.                 if (!$fld->isHidden()) {
  119.                     $fld->setDataArrName($this->myDataArrName)/* <pk-05-02-04 /> */
  120.                     if ($debugechoDebug(__FILE__,"<blockquote>Adding Field: ".($fld->getKey())." (".get_class($fld->getKey()).") Value: ".${$this->myDataArrName}[$fld->getName()]."</blockquote>",2);
  121.                     $ret.=$sep;
  122.                     $ret.=$fld->getFieldTag($mode,${$this->myDataArrName}[$fld->getName()],$debug,FALSE);
  123.                     $ret.=" ".$fld->getLabel()." ";
  124.                     $GLOBALS['TMP_GRPFIELDS_'.$this->myFrmId].=$comma.$fld->getName();
  125.                     $comma=",";
  126.                     $sep $this->grpfldSep;
  127.                 else {
  128.                     if ($debugechoDebug(__FILE__,"<blockqoute>Found but hidden</blockquote>",1);
  129.                 }
  130.             }
  131.         }
  132.         if ($debugechoDebug(__FILE__,"</blockquote>",1);
  133.         $ret.=$this->addTag;
  134.         return $ret;
  135.     }
  136.  
  137.  
  138.     // ###########################################################
  139.     // SEARCH FORM METHODS
  140.     // ###########################################################
  141.  
  142.  
  143.     // ###########################################################
  144.     // OBJECT HTML FORM METHODS
  145.     // ###########################################################
  146.  
  147.  
  148.     // ###########################################################
  149.     // OBJECT VALUE CHECK METHODS
  150.     // ###########################################################
  151.  
  152.  
  153. // end class DBMS_FIELD_LAYOUT_CHKBOXGRP
  154. ?>

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