Source for file DBMS_FIELD_HEADLINE.phpclass

Documentation is available at DBMS_FIELD_HEADLINE.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_HEADLINE.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   layout
  8.   *
  9.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   * @version pk-05-12-11
  13.   *
  14.   ***/
  15.  
  16. global $OCSP_CONF;
  17.  
  18. if (!isset($OCSP_CONF['DBMSFLD_PATH'])) $OCSP_CONF['DBMSFLD_PATH']=dirname(__FILE__)._OCSP_DIRSEP_;
  19. require_once $OCSP_CONF['DBMSFLD_PATH']."DBMS_FIELD_LAYOUT.phpclass";
  20.  
  21. /**
  22.   * Class DBMS_FIELD_HEADLINE
  23.   *
  24.   * @project    Open CSP-Management
  25.   * @package    dbms_field
  26.   * @category   layout
  27.   *
  28.   * @author     Peter Krebs <p.krebs@wpus.at>
  29.   * @copyright  &copy; 2002-2004 by Landesverlag Unternehmensservice
  30.   * @copyright  &copy; 2005 by WURM und Partner Unternehmensservice
  31.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  32.   *
  33.   * @version pk-05-12-11
  34.   *
  35.   ***/
  36.  
  37.     // ###########################################################
  38.     // OBJECT (CONST) VAR DECLARATION
  39.     // ###########################################################
  40.  
  41.     var $className       = "Headline";
  42.  
  43.     /**
  44.       * source file of the class
  45.       *
  46.       * @var string $classSrcFile 
  47.       * @since pk-05-12-11
  48.       ***/
  49.     var $classSrcFile=__FILE__;
  50.  
  51.     /**
  52.       * @var string $colType 
  53.       * @since pk-05-12-11
  54.       ***/
  55.     var $colType="th";
  56.     
  57.     
  58.     // ###########################################################
  59.     // OBJECT SETTINGS METHODS
  60.     // ###########################################################
  61.  
  62.     /**
  63.       * returns an array of field to bie shown in the edit form
  64.       * by using editTbl_echoForm
  65.       *
  66.       * the array is in the form:
  67.       *
  68.       * <code>
  69.       * [_sectionName_]
  70.       *      [TITLE] -> string
  71.       *      [_rowName_]
  72.       *         [FLDLAB]  (complete html code with <td></td>)
  73.       *         [FLDVAL] (complete html code with <td></td>)
  74.       *         [FLDTIT] (title of the label column)
  75.       * </code>
  76.       *
  77.       * NOTE as this is not implemented in the whole classTree at the moment ensure all parents use
  78.       * editTbl_echoForm() in theire editTblForm otherwise you'll get a mismatch of field order
  79.       *
  80.       * @param boolean $debug 
  81.       *
  82.       * @returns array
  83.       *
  84.       * @since pk-06-04-26
  85.       * @version pk-06-07-17 HIDDEN added to array
  86.       * @version pk-06-08-15 FLDTIT added
  87.       * @version pk-06-09-12 Tabs & Link showQuery added
  88.       *
  89.       ***/
  90.     function editTbl_getFieldEditArr($debug=FALSE{
  91.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_HEADLINE::editTbl_getFieldEditArr","",0);
  92.         
  93.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  94.         unset($a_ret['SHOW']['FLD_ALLOW']);
  95.         
  96.         $a_ret['LAYOUT']['FLD_LABTDADD']=array(
  97.             'FLDLAB'=>"Spaltenart",
  98.             'FLDVAL'=>"
  99.                     <select name=\"colType\" size=\"1\">
  100.                         <option value=\"th\">th</option>
  101.                         <option value=\"td class='fldName'\" ".($this->colType=="td class='fldName'" "selected " "").">td class='fldName'</option>
  102.                         <option value=\"td\" ".($this->colType=="td" "selected " "").">td</option>
  103.                     </select>\n"
  104.  
  105.         );
  106.         unset($a_ret['LAYOUT']['FLD_TABIDX']);
  107.         unset($a_ret['LAYOUT']['FLD_VALTDADD']);
  108.         unset($a_ret['LAYOUT']['FLD_SIZE']);
  109.         unset($a_ret['LAYOUT']['FLD_INPUTADD']);
  110.         unset($a_ret['LAYOUT']['FLD_ADDTAG']);
  111.         unset($a_ret['LIST']);
  112.         
  113.         return $a_ret;
  114.     }
  115.  
  116.     /**
  117.       * save the filed definition form
  118.       *
  119.       * @returns boolean
  120.       *
  121.       * @version pk-05-12-11
  122.       *
  123.       ***/
  124.     function save({
  125.         if (parent::save()) {
  126.             $this->enableNew       =FALSE;
  127.             $this->enableEdit      =FALSE;
  128.             $this->enableCopy      =FALSE;
  129.         
  130.             $this->addTag          ="";
  131.             $this->fieldtd_add     ="";
  132.             
  133.             $this->allowNull       =TRUE;
  134.             $this->nullErrMsg      ="";            
  135.             $this->myHelpUrl       ="";
  136.             
  137.             $this->showInList      =FALSE;
  138.         
  139.             $this->colType         =$_POST['colType']// <pk-05-12-11 />
  140.         
  141.             return TRUE;
  142.         }
  143.     }
  144.  
  145.     // ###########################################################
  146.     // OBJECT DATA METHODS
  147.     // ###########################################################
  148.  
  149.  
  150.     // ###########################################################
  151.     // OBJECT HTML FORM METHODS
  152.     // ###########################################################
  153.  
  154.     /**
  155.       * returns the row columns for a field row
  156.       *
  157.       * @param int $mode 
  158.       * @param mixed $aValue 
  159.       * @param boolean $debug 
  160.       *
  161.       * @return string 
  162.       *
  163.       * @since pk-05-08-27
  164.       *
  165.       ***/
  166.     function getFieldRowCols($mode,$aValue=NULL,$debug=FALSE)
  167.     {
  168.         return $this->getLabelColTag(FALSE,"",$debug);
  169.     }
  170.  
  171.  
  172.     /**
  173.       * returns nothig because only label is shown in this type
  174.       *
  175.       * @param int $mode 
  176.       * @param mixed $aValue 
  177.       * @param boolean $debug 
  178.       *
  179.       * @return NULL 
  180.       *
  181.       * @since pk-04-09-08
  182.       *
  183.       ***/
  184.     function getFieldTag($mode,$aValue=NULL,$debug=FALSE{
  185.         $debug=($debug || $this->fldDebug);
  186.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_HEADLINE::getFieldTag($mode)");
  187.         return "";
  188.     }
  189.  
  190.     /**
  191.       * returns the html code for the headline (2 cols th tag)
  192.       *
  193.       * @param bool $useTh      NOT used
  194.       * @param string $style    css style command
  195.       * @param bool $debug      NOT used
  196.       *
  197.       * @return string 
  198.       *
  199.       * @version pk-05-02-24 labeltd_add added
  200.       * @version pk-05-12-11
  201.       *
  202.       ***/
  203.     function getLabelColTag($useTh=FALSE,$style="",$debug=FALSE{
  204.         if ($debugecho "<p><b>DBMS_FIELD_HEADLINE::getLabelColTag(...)</b> (".get_class($this).")</p>";
  205.                 
  206.         $ret "<".$this->colType." ".$style." colspan=\"2\" align=\"center\" style=\"width: 100%;text-align:center\"".$this->labeltd_add.">";
  207.         $ret .= $this->label;
  208.         $ret .= "</".$this->colType.">";
  209.         return $ret;
  210.     }
  211.  
  212.  
  213.  
  214.     // ###########################################################
  215.     // SEARCH FORM METHODS
  216.     // ###########################################################
  217.  
  218.  
  219.     // ###########################################################
  220.     // OBJECT HTML FORM METHODS
  221.     // ###########################################################
  222.  
  223.  
  224.     // ###########################################################
  225.     // OBJECT VALUE CHECK METHODS
  226.     // ###########################################################
  227.  
  228.            // --------------------------------------------------------
  229.     // jOCSP
  230.     // -------------------------------------------------------- 
  231.         
  232.     /**
  233.      * returns options of an ext js field config object
  234.      * 
  235.      * NOTE the return string is NOT enclosed by {}
  236.      * 
  237.      * @param boolean $debug 
  238.      * 
  239.      * @return string (json)
  240.      * 
  241.      * @since pk-08-09-09
  242.      */
  243.     public function getExtJSConfigOptions($debug=False)
  244.     {
  245.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DMBS_FIELD_HEADLINE::getExtJSConfigOptions()");
  246.  
  247.         $arr_ret array(
  248.                 'xtype' => "'panel'",
  249.                 'html'  => "'<h2>" pcf_js_escape($this->label"</h2>'"
  250.             );
  251.         
  252.         return $arr_ret;
  253.     }
  254.  
  255. // end class DBMS_FIELD_HEADLINE
  256. ?>

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