Source for file DBMS_FIELD_LAYOUT_LINKBTTN.phpclass

Documentation is available at DBMS_FIELD_LAYOUT_LINKBTTN.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_LAYOUT_LINKBTTN.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 Peter Krebs and Landesverlag Unternehmensservice
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   * @version pk-05-12-11
  14.   *
  15.   ***/
  16.  
  17. if (!class_exists("DBMS_FIELD")) {
  18.     if (!file_exists($GLOBALS['OCSP']['DBMSFLD_PATH']."DBMS_FIELD_LAYOUT.phpclass")) {
  19.         if (file_exists(dirname(__FILE__)."/DBMS_FIELD_LAYOUT.phpclass")) {
  20.             $GLOBALS['OCSP']['DBMSFLD_PATH']=dirname(__FILE__)."/";
  21.         }
  22.     }
  23.     require_once $GLOBALS['OCSP']['DBMSFLD_PATH']."DBMS_FIELD_LAYOUT.phpclass";
  24. }
  25.  
  26. /**
  27.   * Class DBMS_FIELD_LAYOUT_LINKBTTN
  28.   *
  29.   * @project    Open CSP-Management
  30.   * @package    dbms_field
  31.   * @category   layout
  32.   *
  33.   * @author     Peter Krebs <p.krebs@wpus.at>
  34.   * @copyright  &copy; 2002-2004 by Landesverlag Unternehmensservice
  35.   * @copyright  &copy; 2005 by WURM und Partner Unternehmensservice
  36.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  37.   *
  38.   * @since pk-06-09-12
  39.   *
  40.   ***/
  41.  
  42.     // ###########################################################
  43.     // OBJECT (CONST) VAR DECLARATION
  44.     // ###########################################################
  45.  
  46.     var $className       = "LINKBUTTON";
  47.  
  48.     /**
  49.       * source file of the class
  50.       *
  51.       * @var string $classSrcFile 
  52.       ***/
  53.     var $classSrcFile=__FILE__;
  54.  
  55.  
  56.     // ###########################################################
  57.     // OBJECT SETTINGS 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.       * @param boolean $debug 
  75.       *
  76.       * @returns array
  77.       *
  78.       ***/
  79.     function editTbl_getFieldEditArr($debug=FALSE{
  80.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_LAYOUT_LINKBTTN::editTbl_getFieldEditArr","",0);
  81.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  82.  
  83.         unset($a_ret['COMMON']['FRM_DBCOL']);
  84.         unset($a_ret['COMMON']['FRM_DBDESC']);
  85.         unset($a_ret['COMMON']['FRM_DEFVAL']);
  86.         unset($a_ret['VALCHECKS']);
  87.  
  88.         unset($a_ret['LAYOUT']['FLD_SIZE']);
  89.         unset($a_ret['LAYOUT']['FLD_TABIDX']);
  90.         unset($a_ret['LAYOUT']['FLD_INPUTADD']);
  91.         unset($a_ret['LAYOUT']['FLD_HELPURL']);
  92.         $a_ret['LAYOUT']['LNKBTNINFO']=array(
  93.             'FLDLAB'=>"Formularwert:",
  94.             'FLDVAL'=>"Der Listen Link wird dargestellt"
  95.         );
  96.         unset($a_ret['SHOW']['FLD_ALLOW']);
  97.  
  98.         $a_ret['LIST']['FLD_LISTSHOW']=array(
  99.             'FLDLAB'=>"Listen Anzeige",
  100.             'FLDVAL'=>"<input name=\"SHOWINLIST\" type=\"checkbox\" ".($this->showInList ? "checked" "")." value=\"1\"> in Liste"
  101.         );
  102.         unset($a_ret['LIST']['FLD_LSTLAB']);
  103.         unset($a_ret['LIST']['FLD_LISTTDADD']);
  104.  
  105.         return $a_ret;
  106.     }
  107.  
  108.     /**
  109.       * echos the filed definition form
  110.       * as not all classes alread have the method editTbl_getFieldEditArr
  111.       * we had to implement this here
  112.       *
  113.       * @param boolean $debug 
  114.       *
  115.       * @deprecated since pk-06-09-12
  116.       *
  117.       ***/
  118.      function editTblForm($debug=FALSE{
  119.         $a_FieldEditArr=$this->editTbl_getFieldEditArr($debug);
  120.         $this->editTbl_echoForm($a_FieldEditArr,$debug);
  121.     }
  122.  
  123.     /**
  124.       * save the filed definition form
  125.       *
  126.       * @returns boolean
  127.       *
  128.       * @version pk-05-12-11
  129.       *
  130.       ***/
  131.     function save({
  132.         $ret=parent::save();
  133.  
  134.         $this->defaultValue    ="";
  135.         $this->allowNull       =TRUE;
  136.         $this->nullErrMsg      ="";
  137.         $this->lstColSpan      =0;
  138.         //$this->label           =$this->lstLink['TEXT'];
  139.  
  140.         $this->enableNew       =TRUE;
  141.         $this->enableEdit      =TRUE;
  142.         $this->enableCopy      =TRUE;
  143.         $this->isSearchable    =FALSE;
  144.  
  145.         return TRUE;
  146.     }
  147.  
  148.     // ###########################################################
  149.     // OBJECT DATA METHODS
  150.     // ###########################################################
  151.  
  152.  
  153.     // ###########################################################
  154.     // OBJECT HTML FORM METHODS
  155.     // ###########################################################
  156.  
  157.     /**
  158.       * returns the html code for the field value input / show
  159.       * adds $this->myName to ${$this->myDataArrName}['_DBMS_FIELDS']
  160.       *
  161.       * @param int $mode 
  162.       * @param mixed $aValue 
  163.       * @param boolean $debug 
  164.       *
  165.       * @returns string
  166.       *
  167.       ***/
  168.     function getFieldTag($mode,$aValue=NULL,$debug=FALSE{
  169.         $debug=($debug || $this->fldDebug);
  170.         if ($debugecho "<p><b>DBMS_FIELD_LAYOUT_LINKBTTN::getFieldTag($mode,$aValue,...)</b> (".get_class($this).")";
  171.  
  172.         switch($mode{
  173.             case FRM_MODE_NEW:
  174.             case FRM_MODE_EDIT:
  175.             case FRM_MODE_COPY:
  176.                 return parent::getFieldTag($mode,$aValue,$debug);
  177.             default:
  178.                 return ""// no html output of the field value
  179.         }
  180.     }
  181.  
  182.     /**
  183.       * returns the html code for a editable formular element
  184.       *
  185.       * @param mixed $aValue the value to set
  186.       * @param string $arrName 
  187.       * @param string $nameAdd  append something to name like "[VALUE]" for search forms
  188.       * @param boolean $debug since pk-06-08-09
  189.       *
  190.       * @returns string
  191.       *
  192.       ***/
  193.     function getInputTag($aValue,$arrName="DBVAL",$nameAdd="",$debug=FALSE{
  194.         $debug=($debug || $this->fldDebug);
  195.         if ($debugecho "<p><b>DBMS_FIELD_LAYOUT_LINKBTTN::getInputTag($mode,$aValue,...)</b> (".get_class($this).")";
  196.  
  197.         require_once $GLOBALS['OCSP']['PHPINCPATH']."common/pcf_templates.phpinc";
  198.         if (is_array($this->lstLink)) {
  199.             global ${$arrName};
  200.             $s_ret ="<a ".pcf_tmpl_parse($this->lstLink['A'],${$arrName}).">";
  201.             $s_ret.=pcf_tmpl_parse($this->lstLink['TEXT'],${$arrName});
  202.             $s_ret.="</a>";
  203.             return $s_ret;
  204.         }
  205.     }
  206.     /**
  207.       * do nothing because we have no input col
  208.       *
  209.       * @param int $mode 
  210.       * @param mixed $aValue 
  211.       * @param string $arrName 
  212.       * @param bool $debug 
  213.       *
  214.       * @return bool 
  215.       *
  216.       ***/
  217.     function writeInputCol($mode,$aValue="",$arrName="DBVAL",$debug=FALSE{
  218.         return FALSE;
  219.     }
  220.  
  221.     // ###########################################################
  222.     // SEARCH FORM METHODS
  223.     // ###########################################################
  224.  
  225.  
  226.     // ###########################################################
  227.     // OBJECT HTML FORM METHODS
  228.     // ###########################################################
  229.  
  230.  
  231.     // ###########################################################
  232.     // OBJECT VALUE CHECK METHODS
  233.     // ###########################################################
  234.  
  235.  
  236. // end class DBMS_FIELD_LAYOUT_LINKBTTN
  237. ?>

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