Source for file DBMS_FIELD_INFOTEXT.phpclass

Documentation is available at DBMS_FIELD_INFOTEXT.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_INFOTEXT.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
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   ***/
  14.  
  15. pcf_require_class('DBMS_FIELD_LAYOUT' dirname(__FILE__"/");
  16.  
  17. /**
  18.   * Class DBMS_FIELD_INFOTEXT
  19.   *
  20.   * @project    Open CSP-Management
  21.   * @package    dbms_field
  22.   * @category   layout
  23.   *
  24.   * @author     Peter Krebs <p.krebs@lvus.at>
  25.   * @copyright  &copy; 2002-2005 by LVUS
  26.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  27.   *
  28.   * @version pk-05-02-08 infotext as template
  29.   * @version $Id: DBMS_FIELD_INFOTEXT.phpclass,v 1.5 2008/11/02 11:39:36 pitlinz Exp $
  30.   * 
  31.   */
  32.  
  33.     // ###########################################################
  34.     // OBJECT (CONST) VAR DECLARATION
  35.     // ###########################################################
  36.  
  37.     var $className       = "Infotext";
  38.  
  39.     /**
  40.       * @var string infotext as template
  41.       ***/
  42.     var $infotext        = "";
  43.  
  44.     /**
  45.       * source file of the class
  46.       *
  47.       * @var string $classSrcFile 
  48.       * @since pk-05-01-20
  49.       ***/
  50.     var $classSrcFile=__FILE__;
  51.  
  52.     // ###########################################################
  53.     // OBJECT SETTINGS METHODS
  54.     // ###########################################################
  55.  
  56.     /**
  57.       * returns an array of field to bie shown in the edit form
  58.       * by using editTbl_echoForm
  59.       *
  60.       * the array is in the form:
  61.       *
  62.       * <code>
  63.       * [_sectionName_]
  64.       *      [TITLE] -> string
  65.       *      [_rowName_]
  66.       *         [FLDLAB]  (complete html code with <td></td>)
  67.       *         [FLDVAL] (complete html code with <td></td>)
  68.       * </code>
  69.       *
  70.       * @param boolean $debug 
  71.       *
  72.       * @returns array
  73.       *
  74.       * @version pk-07-02-14
  75.       *
  76.       ***/
  77.     function editTbl_getFieldEditArr($debug=FALSE{
  78.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_LAYOUT_LINKBTTN::editTbl_getFieldEditArr","",0);
  79.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  80.  
  81.            $a_ret['INFOTEXT']=array(
  82.             'TITLE'=>"InfoText",
  83.                'INFOTXT' => array(
  84.                        'FLDLAB' => 'Anzeigetext',
  85.                        'FLDVAL' => "<textarea name=\"infotext\" rows=\"3\" cols=\"40\">" htmlspecialchars(trim($this->infotext)) ."</textarea>"
  86.                    )
  87.  
  88.                );
  89.            
  90.            return $a_ret;
  91.     }
  92.     
  93.     
  94.     /**
  95.       * echos the filed definition form
  96.       *
  97.     function editTblForm($showSize=FALSE,$showNull=TRUE,$showValueList=FALSE) {
  98.         if (($this->myFrmId) && (is_object($GLOBALS['DBMS_FORMS'][$this->myFrmId]))) { ?>
  99.             <tr>
  100.                 <td class="fldName" colspan="2" align="center">Formular: <?php echo $GLOBALS['DBMS_FORMS'][$this->myFrmId]->frmName; ?></td>
  101.             </tr>
  102.         <?php } ?>
  103.  
  104.             <tr>
  105.                 <td class="fldName">DEBUGING</td>
  106.                 <td class="fldValue"><input name="fldDebug" value="1" type="checkbox" <?php echo ($this->fldDebug ? "checked" : ""); ?>> ein
  107.             </tr>
  108.             <tr>
  109.                 <td class="fldName">Feld:</td>
  110.                 <td class="fldValue"><?php echo $this->myName; ?></td>
  111.             </tr>
  112.             <tr>
  113.                 <td class="fldName">Label:</td>
  114.                 <td class="fldValue">
  115.                     <input name="label" size="30" value="<?php echo $this->label; ?>">
  116.                 </td>
  117.             </tr>
  118.             <tr>
  119.                 <td class="fldName"><a href="javascript:{alert('Formatierungscode f�r die <td> Spalte');}">td add:</a></td>
  120.                 <td class="fldValue">
  121.                     <input name="labeltd_add" value="<?php echo htmlspecialchars($this->labeltd_add); ?>" size="30">
  122.                 </td>
  123.             <tr>
  124.             <tr>
  125.                 <td class="fldName"><a href="javascript:{alert('Formatierungscode f�r die <td> Spalte des Feldes');}">Field td add:</a></td>
  126.                 <td class="fldValue">
  127.                     <input name="fieldtd_add" value="<?php echo htmlspecialchars($this->fieldtd_add); ?>" size="30">
  128.                 </td>
  129.             <tr>
  130.             <tr>
  131.                 <td class="fldName"><a href="javascript:{alert('Eingabefeld geht �ber 2 Spalten');}">Label-Col Ausblenden</a></td>
  132.                 <td class="fldValue">
  133.                      <input type="checkbox" name="labelcol_hide" value="1" <?php echo ($this->labelcol_hide ? "checked" : "")?> >Label Spalte nicht anzeigen
  134.                 </td>
  135.             <tr>
  136.             <tr>
  137.                 <td class="fldName">
  138.                     <a href="#" onClick="alert('Anzeigetext Template');">Text:</a>
  139.                     <a href="#" onClick="popup_window('<?php echo $GLOBALS['PROJECT']['SYSTEMURL']?>help/templatevars.html',500,400)">
  140.                         <img src="<?php echo $GLOBALS['PROJECT']['SYSIMGURL']; ?>form_buttons/icon_help.gif" border="0" alt="Template Hilfe">
  141.                     </a>
  142.                 </td>
  143.                 <td class="fldValue">
  144.                     <textarea name="infotext" rows="3" cols="30"><?php echo htmlspecialchars($this->infotext); ?></textarea>
  145.                 </td>
  146.             </tr>
  147.             <tr>
  148.                 <td class="fldName">Hidden</td>
  149.                 <td class="fldValue">
  150.                     <input name="hideNew"  type="checkbox" <?php echo ($this->hideNew ?  "checked" : ""); ?> value="1"> Neuanlagen
  151.                     <input name="hideEdit" type="checkbox" <?php echo ($this->hideEdit ? "checked" : "");?> value="1"> �ndern
  152.                     <input name="hideCopy" type="checkbox" <?php echo ($this->hideCopy ? "checked" : "");?> value="1"> Kopieren
  153.                     <input name="showInList" type="checkbox" <?php echo ($this->showInList ? "" : "checked");?> value="1"> Liste
  154.                 </td>
  155.             </tr>
  156.         <?php
  157.     }
  158.  
  159.     */
  160.  
  161.     /**
  162.       * save the filed definition form
  163.       *
  164.       * @return boolean (always true)
  165.       *
  166.       ***/
  167.     function save($debug=False{
  168.         
  169.         $bol_ret parent::save($debug);
  170.         
  171.         $this->isSearchable    =FALSE;
  172.         $this->showInList      =False;
  173.         $this->enableNew       =FALSE;
  174.         $this->enableEdit      =FALSE;
  175.         $this->enableCopy      =FALSE;
  176.         $this->size            =0;
  177.         $this->maxlength       =0;
  178.         $this->defaultValue    ="";
  179.         $this->addTag          ="";
  180.         $this->allowNull       =TRUE;
  181.         $this->nullErrMsg      ="";
  182.         $this->myHelpUrl       ="";
  183.  
  184.         $this->infotext        =$_POST['infotext'];
  185.         
  186.         return $bol_ret;
  187.     }
  188.  
  189.     // ###########################################################
  190.     // OBJECT DATA METHODS
  191.     // ###########################################################
  192.  
  193.  
  194.     // ###########################################################
  195.     // OBJECT HTML FORM METHODS
  196.     // ###########################################################
  197.  
  198.     /**
  199.       * returns the html code for the info text
  200.       *
  201.       * @param int $mode 
  202.       * @param array $aValue    if $aValue is an array $infotext is parsed with $aValue alse with ${$arrName}
  203.       * @param boolean $debug 
  204.       *
  205.       * @returns string
  206.       *
  207.       * @since pk-04-09-08
  208.       * @version pk-05-02-10
  209.       * @version pk-05-11-08 debug
  210.       ***/
  211.     function getFieldTag($mode,$aValue=NULL,$debug=FALSE{
  212.         $debug=($debug || $this->fldDebug);
  213.         if ($debugecho "<p><b>DBMS_FIELD_INFOTEXT::getFieldTag($mode,$aValue,...)</b> (".get_class($this)."/".$this->myName.")";
  214.  
  215.         //if ($debug) echo "<pre>".pcf_object_info($this,2,FALSE)."</pre>";
  216.         switch($mode{
  217.             case FRM_MODE_EDIT:
  218.                 if ($this->hideEditbreak;
  219.             case FRM_MODE_NEW:
  220.                 if ($this->hideNewbreak;
  221.             case FRM_MODE_COPY:
  222.                 if ($this->hideCopybreak;
  223.             default:
  224.                 if (!is_array($aValue)) {
  225.                     if (empty($this->myDataArrName)) $this->myDataArrName="DBVAL";
  226.                     global ${$this->myDataArrName};
  227.                     $aValue=${$this->myDataArrName};
  228.                 }
  229.                 pcf_require_function('pcf_tmpl_parse',__OCSP_PHPINCPATH__."common/pcf_templates.phpinc");
  230.                 return pcf_tmpl_parse($this->infotext,$aValue,$debug);
  231.         }
  232.         return "";
  233.     }
  234.  
  235.     /**
  236.       * returns $this->getFieldTag($mode,$aValue,$debug)
  237.       * after setting $this->myDataArrName
  238.       *
  239.       * @param int $mode        show mode of the field
  240.       * @param array $aValue    if $aValue is an array $infotext is parsed with $aValue alse with ${$arrName}
  241.       * @param string $arrName  ${$arrName} is the dataarray for the template
  242.       * @param boolean $debug   show debug info
  243.       *
  244.       * @return bool    TRUE if an input field is written
  245.       *
  246.       * @version pk-05-02-10
  247.       *
  248.       **/
  249.     function writeField($mode,$aValue=NULL,$arrName="DBVAL",$debug=FALSE{
  250.         $debug=($debug || $this->fldDebug);
  251.         if ($debugecho "<p><b>DBMS_FIELD_INFOTEXT::writeField($mode,\$aValue,$arrName...)</b> (".get_class($this)."/".$this->myName.")";
  252.  
  253.         $this->myDataArrName=$arrName;
  254.         echo $this->getFieldTag($mode,$aValue,$debug);
  255.     }
  256.  
  257.  
  258.     // ###########################################################
  259.     // SEARCH FORM METHODS
  260.     // ###########################################################
  261.  
  262.  
  263.     // ###########################################################
  264.     // OBJECT HTML FORM METHODS
  265.     // ###########################################################
  266.  
  267.  
  268.     // ###########################################################
  269.     // OBJECT VALUE CHECK METHODS
  270.     // ###########################################################
  271.  
  272.  
  273. // end class DBMS_FIELD_HEADLINE
  274. ?>

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