Source for file CMS_MENU_FORM.phpclass

Documentation is available at CMS_MENU_FORM.phpclass

  1. <?php
  2. /**
  3.   * openCSP class file CMS_MENU_FORM.phpclass
  4.   *
  5.   * @project Open CSP-Management
  6.   * @package default
  7.   *
  8.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  9.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.   *
  11.   * @since pk-27.10.2008
  12.   * @version $Id: CMS_MENU_FORM.phpclass,v 1.1 2008/10/28 17:46:12 pitlinz Exp $
  13.   */
  14.  
  15.     // ---------------------------------------------------------
  16.     // requirements
  17.     // ---------------------------------------------------------
  18.  
  19.     if (!defined('__OCSP_CMS_PHPINCPATH__')) require_once __OCSP_DEFAULTCONFPATH__."cms.conf.phpinc";
  20.     pcf_require_class('OCSP_FORM'__OCSP_PHPINCPATH__."db/forms/OCSP_FORM.phpclass");
  21.     pcf_require_class('CMS_TABLEOBJ',"cms/");
  22.  
  23. /**
  24.   * openCSP class CMS_MENU_FORM
  25.   *
  26.   * @project Open CSP-Management
  27.   * @package default
  28.   *
  29.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  30.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  31.   *
  32.   * @since pk-27.10.2008
  33.   * @version $Id: CMS_MENU_FORM.phpclass,v 1.1 2008/10/28 17:46:12 pitlinz Exp $
  34.   */
  35. class CMS_MENU_FORM extends OCSP_FORM
  36. {
  37.     // ---------------------------------------------------------------------------
  38.     // constants
  39.     // ---------------------------------------------------------------------------
  40.     
  41.     /**
  42.      * @constant string CLASS_SRC_FILE
  43.      */
  44.     const CLASS_SRC_FILE = __FILE__;
  45.  
  46.     // ---------------------------------------------------------------------------
  47.     // class (static)
  48.     // ---------------------------------------------------------------------------
  49.     
  50.     /*** class vars ------------------------------------------------------ */
  51.     
  52.     /*** class methods --------------------------------------------------- */
  53.     
  54.     // ---------------------------------------------------------------------------
  55.     // object vars
  56.     // ---------------------------------------------------------------------------
  57.     
  58.     /*** compostion --------------------------------------------------- */
  59.     
  60.     /*** attributes  -------------------------------------------------- */
  61.     
  62.     // ---------------------------------------------------------------------------
  63.     // factory / construct
  64.     // ---------------------------------------------------------------------------
  65.     
  66.     // ---------------------------------------------------------------------------
  67.     // getter / setter
  68.     // ---------------------------------------------------------------------------    
  69.  
  70.     /**
  71.      * sets the tableobject class and include from $dataArr and
  72.      * tries to instantiate by calling $this->getMyTblObj
  73.      * 
  74.      * if class is set in $dataArr and it could not be instantiated False is returned
  75.      * else True is returned
  76.      * 
  77.      * @param array $dataArr (normaly $_POST)
  78.      * @param boolean $debug 
  79.      * 
  80.      * @return boolean 
  81.      * 
  82.      */
  83.     function setTblObjFromSubmitData(&$dataArr,$debug=False)
  84.     {      
  85.         if ($debugechoDebugMethod(__FILE__,get_class($this),"CMS_MENU_FORM::setTblObjFromSubmitData()");
  86.         global $OCSP_CONF;
  87.         
  88.         if (isset($dataArr['FRMARRAYNAME']&& isset($dataArr[$dataArr['FRMARRAYNAME']]['MEN_OBJCLASS']))
  89.         {
  90.             $str_postClass=$dataArr[$dataArr['FRMARRAYNAME']]['MEN_OBJCLASS'];
  91.             if ($str_classSrc CMS_TABLEOBJ::menuType_getClassSrc($str_postClass))
  92.             {
  93.                 if ($debug)
  94.                 {    
  95.                     echoDebugLine(__FILE__,__LINE__,"<h1>MEN_OJBCLASS: " $str_postClass "</h1><p>src: " $str_classSrc "</p>");
  96.                 }
  97.                                 
  98.                 $this->setTblObjClass($str_postClass);
  99.                 $this->setTblObjInc($str_classSrc);
  100.                 if ($this->getMyTblObj(True,$debug))
  101.                 {
  102.                     return True;
  103.                 else {
  104.                     $this->setError($this->getLangTxt('COULD_NOT_INSTANTIATE')." ".$this->tblObj_class);
  105.                     return False;
  106.                 }                 
  107.                 
  108.             }            
  109.         }
  110.                 
  111.         return parent::setTblObjFromSubmitData($dataArr,$debug=FALSE);
  112.     }
  113.     
  114.     
  115. }
  116.  
  117. ?>

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