Source for file DBMS_FIELD_DBTBLLIST.phpclass

Documentation is available at DBMS_FIELD_DBTBLLIST.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_DBTBLLIST.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   string
  8.   *
  9.   * @author     Peter Krebs <p.krebs@lvus.at>
  10.   * @copyright  &copy; 2002-2005 by Peter Krebs and Landesverlag Unternehmensservice
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   * @version pk-05-06-16
  14.   *
  15.   ***/
  16.  
  17. if (empty($GLOBALS['OCSP']['PHPFORMPATH'])) $GLOBALS['OCSP']['PHPFORMPATH']=dirname(__FILE__)."/";
  18.  
  19. // <pk-05-12-08>
  20. if (!class_exists("DBMS_FIELD_DBLOOKUPSELECTLIST")) {
  21.     require_once dirname(__FILE__)."/DBMS_FIELD_DBLOOKUPSELECTLIST.phpclass";
  22. }
  23. // </pk-05-12-08>
  24.  
  25. /**
  26.   * Class DBMS_FIELD_DBTBLLIST
  27.   *
  28.   * @project    Open CSP-Management
  29.   * @package    dbms_field
  30.   * @category   string
  31.   *
  32.   * @author     Peter Krebs <p.krebs@lvus.at>
  33.   * @copyright  &copy; 2002-2005 by Peter Krebs and Landesverlag Unternehmensservice
  34.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  35.   *
  36.   * @since pk-04-10-07
  37.   * @version pk-05-12-08 changed parent class
  38.   *
  39.   ***/
  40.  
  41.     // ###########################################################
  42.     // OBJECT (CONST) VAR DECLARATION
  43.     // ###########################################################
  44.  
  45.      var $className       = "DbTblList";
  46.  
  47.     /**
  48.       * source file of the class
  49.       *
  50.       * @var string $classSrcFile 
  51.       * @since pk-05-02-19
  52.       ***/
  53.     var $classSrcFile=__FILE__;
  54.  
  55.     // ###########################################################
  56.     // OBJECT SETTINGS METHODS
  57.     // ###########################################################
  58.  
  59.     /**
  60.       * returns an array of field to bie shown in the edit form
  61.       * by using editTbl_echoForm
  62.       *
  63.       * the array is in the form:
  64.       *
  65.       * <code>
  66.       * [_sectionName_]
  67.       *      [TITLE] -> string
  68.       *      [_rowName_]
  69.       *         [FLDLAB]  (complete html code with <td></td>)
  70.       *         [FLDVAL] (complete html code with <td></td>)
  71.       * </code>
  72.       *
  73.       * @param boolean $debug 
  74.       *
  75.       * @returns array
  76.       *
  77.       * @since pk-06-05-08
  78.       *
  79.       ***/
  80.     function editTbl_getFieldEditArr($debug=FALSE{
  81.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DBSELECTLIST::editTbl_getFieldEditArr","",0);
  82.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  83.  
  84.         $a_ret['SELECT']['FLD_VALQUERY']        =NULL// unset parent field
  85.         $a_ret['SELECT']['FLD_LSTVALISHTML']    =NULL;
  86.         $a_ret['SELECT']['FLD_LSTADDVALUES']=array(
  87.                 'FLDLAB'=>"Tabelle hinzuf&uuml;gen",
  88.                 'FLDVAL'=>"<input name=\"allowAddValues\" type=\"checkbox\"".($this->allowAddValues ? "checked" "")." value=\"1\">ja<br />
  89.                            <b>ACHTUNG</b>eine neue Tabelle wird nicht automatisch angelegt.
  90.                           "
  91.         );
  92.         $a_ret['DBLOOKUP']                      =NULL// unset parent lookup section as we use show tables as query
  93.  
  94.         return $a_ret;
  95.  
  96.     }
  97.  
  98.     /**
  99.       * echos the filed definition form
  100.       *
  101.       * @param boolean $showSize 
  102.       * @param boolean $showDBFields 
  103.       *
  104.       * @deprecated since pk-06-05-08
  105.       *
  106.       ***/
  107.      function editTblForm($debug=FALSE{
  108.         $a_FieldEditArr=$this->editTbl_getFieldEditArr($debug);
  109.  
  110.         $this->editTbl_echoForm($a_FieldEditArr,$debug);
  111.     }
  112.  
  113.  
  114.     /**
  115.       * save the filed definition form
  116.       *
  117.       * @return bool 
  118.       *
  119.       ***/
  120.     function save({
  121.         $ret=parent::save();
  122.         $this->query            ="SHOW TABLES";
  123.         $this->lstValueIsHtml   =FALSE;
  124.  
  125.         return $ret;
  126.     }
  127.  
  128.     // ###########################################################
  129.     // OBJECT DATA METHODS
  130.     // ###########################################################
  131.  
  132.     /**
  133.       * sets populates $this->myValues array from the database
  134.       *
  135.       * @param string $arrName 
  136.       * @param bool $debug 
  137.       *
  138.       ***/
  139.     function setMyValues($arrName="DBVAL",$debug=FALSE{
  140.         $debug=($this->fldDebug || $debug);
  141.         if ($debugecho "<p><b>DBMS_FIELD_DBTBLLIST::setMyValues($arrName,...)</b> (".get_class($this).")</p>";
  142.         if ($cursor=$GLOBALS['USRDB']->query($this->query)) {
  143.             while($row=$cursor->fetchArrayNum()) {
  144.                 if (!empty($row[0])) $this->myValues[$row[0]]=$row[0];
  145.             }
  146.         }
  147.     }
  148.  
  149.     // ###########################################################
  150.     // OBJECT HTML FORM METHODS
  151.     // ###########################################################
  152.  
  153.  
  154.     // ###########################################################
  155.     // SEARCH FORM METHODS
  156.     // ###########################################################
  157.  
  158.  
  159.     // ###########################################################
  160.     // OBJECT HTML FORM METHODS
  161.     // ###########################################################
  162.  
  163.  
  164.     // ###########################################################
  165.     // OBJECT VALUE CHECK METHODS
  166.     // ###########################################################
  167.  
  168.  
  169. // end class DBMS_FIELD_DBTBLLIST
  170. ?>

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