Source for file OCSP_CMS_CONF.phpclass

Documentation is available at OCSP_CMS_CONF.phpclass

  1. <?php
  2. /**
  3.   * openCSP class file OCSP_CMS_CONF.phpclass
  4.   *
  5.   * @project Open CSP-Management
  6.   * @package cms
  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-15.07.2008
  12.   * @version $Id: OCSP_CMS_CONF.phpclass,v 1.3 2008/08/08 02:00:43 pitlinz Exp $
  13.   */
  14.  
  15.     // ---------------------------------------------------------
  16.     // requirements
  17.     // ---------------------------------------------------------
  18.  
  19.     pcf_require_class('OCSP_CONF',__OCSP_PHPINCPATH__ "common/");
  20.  
  21.     require_once __OCSP_PHPINCPATH__ "default_config" _OCSP_DIRSEP_ "cms.conf.phpinc";
  22. /**
  23.   * openCSP class OCSP_CMS_CONF
  24.   *
  25.   * @project Open CSP-Management
  26.   * @package cms
  27.   *
  28.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  29.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  30.   *
  31.   * @since pk-15.07.2008
  32.   * @version $Id: OCSP_CMS_CONF.phpclass,v 1.3 2008/08/08 02:00:43 pitlinz Exp $
  33.   * 
  34.   *  possible settings:
  35.   *  ------------------------------------------------------------
  36.   * 
  37.   *  MEN_REWRITE_URL: rewrite template (example /$*MEN_TITLE$/menu/$*PROJ_ID$/$*MEN_ID$/$*PAG_ID$/)
  38.   *  CMS_URL:         url to call for cms content
  39.   */
  40. class OCSP_CMS_CONF extends OCSP_CONF
  41. {
  42.     // ---------------------------------------------------------------------------
  43.     // constants
  44.     // ---------------------------------------------------------------------------
  45.     
  46.     /**
  47.      * @constant string CLASS_SRC_FILE
  48.      */
  49.     const CLASS_SRC_FILE = __FILE__;
  50.  
  51.     // ---------------------------------------------------------------------------
  52.     // class (static)
  53.     // ---------------------------------------------------------------------------
  54.     
  55.     /*** class vars ------------------------------------------------------ */
  56.     
  57.     /*** class methods --------------------------------------------------- */
  58.     
  59.     // ---------------------------------------------------------------------------
  60.     // object vars
  61.     // ---------------------------------------------------------------------------
  62.     
  63.     /*** compostion --------------------------------------------------- */
  64.     
  65.     /*** attributes  -------------------------------------------------- */
  66.     
  67.     // ---------------------------------------------------------------------------
  68.     // factory / construct
  69.     // ---------------------------------------------------------------------------
  70.     
  71.     /**
  72.      * returns the instance for a system
  73.      *
  74.      * @param string $system 
  75.      * 
  76.      * @return OCSP_CMS_CONF 
  77.      */
  78.     public static function &getInstance($system='OCSP_CMS',$debug=False)
  79.     {        
  80.         if ($debugechoDebugMethod(__FILE__,"static","OCSP_CMS_CONF::getInstance({$system})");
  81.         
  82.         if (empty($system))
  83.         {
  84.             throw new Exception(_OCSP_EXCEP_NOID_);
  85.         }
  86.         
  87.         if (isset(self::$instanceList[$system]))
  88.         {
  89.             if ($debugechoDebugLine(__FILE__,__LINE__,"object set");
  90.             if (!pcf_is_instance_of(self::$instanceList[$system],'OCSP_CMS_CONF'))
  91.             {
  92.                 $obj_new new OCSP_CMS_CONF($system);
  93.                 $obj_new->setConfArrays(self::$instanceList[$system]->getConfArrays());
  94.                 unset(self::$instanceList[$system]);
  95.                 self::$instanceList[$system$obj_new;    
  96.                 if ($debugechoDebugLine(__FILE__,__LINE__,"<pre>" print_r(self::$instanceList[$system],True"</pre>");            
  97.             }
  98.             return self::$instanceList[$system];
  99.         }
  100.         
  101.         self::$instanceList[$systemnew OCSP_CMS_CONF($system);
  102.         return self::$instanceList[$system];                
  103.     }
  104.             
  105.     // ---------------------------------------------------------------------------
  106.     // getter / setter
  107.     // ---------------------------------------------------------------------------    
  108.  
  109.     
  110.    /**
  111.      * returns the state arr in $GLOBALS['OCSP_CMS']['PAGESTATE']
  112.      * 
  113.      * @param int $state 
  114.      * 
  115.      * @return array 
  116.      */
  117.     public function getPageStateDesc($state)
  118.     {
  119.         if ($arr_states self::getValue('PAGESTATE'))
  120.         {
  121.             if (isset($arr_states[intval($state)]))
  122.             {
  123.                 return $arr_states[intval($state)];
  124.             }
  125.         
  126.         
  127.         return array(
  128.             'NAME'        =>'undefined state',
  129.             'SHOW'        =>False,
  130.             'DIRECTSHOW'=>False,     
  131.             'DELETEGRP' => 'ADMIN',    
  132.             'ICON'        =>OCSP_CONF::getInstance('OCSP')->getValue('SYSIMGURL')."icons-22x22/mb_warning.gif",
  133.             'GROUP'        =>-99                
  134.         );        
  135.     }    
  136.     
  137.     /**
  138.      * returns an array with the online page states states
  139.      *
  140.      * @return array 
  141.      */
  142.     public function getPageOnlineStates()
  143.     {
  144.         if ($arr_states self::getValue('PAGESTATE'))
  145.         {
  146.             $arr_ret array();
  147.             foreach($arr_states as $int_id => $arr_state)
  148.             {
  149.                 if (isset($arr_state['SHOW'])  && $arr_state['SHOW']
  150.                 {
  151.                     $arr_ret[$int_id;
  152.                 }
  153.             }
  154.             return $arr_ret;
  155.         else {
  156.             throw new Exception(_OCSP_EXCEP_NOTCONFIGURED_ ":PAGESTATES are not set");
  157.         }
  158.          
  159.     }
  160.     
  161. }
  162.  
  163. ?>

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