Changeset 11858

Show
Ignore:
Timestamp:
08/30/07 12:36:50 (1 year ago)
Author:
bergie
Message:

Some privatization to offset NetBlade?'s collectorization efforts, refs #102

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/application.php

    r11850 r11858  
    105105 * @package midcom 
    106106 */ 
    107 class midcom_application { 
     107class midcom_application  
     108
    108109 
    109110    /** 
     
    113114     * @access private 
    114115     */ 
    115     var $_parser; 
    116  
    117     /** 
    118      * The component loader. 
    119      * 
    120      * @var midcom_helper__componentloader 
    121      */ 
    122     var $componentloader; 
     116    private $_parser; 
    123117 
    124118    /** 
     
    130124     * @access private 
    131125     */ 
    132     var $_context = array(); 
     126    private $_context = array(); 
    133127 
    134128    /** 
     
    138132     * @access private 
    139133     */ 
    140     var $_currentcontext; 
     134    private $_currentcontext; 
    141135 
    142136    /** 
     
    146140     * @access private 
    147141     */ 
    148     var $_currentcomponent; 
     142    private $_currentcomponent; 
    149143 
    150144    /** 
     
    154148     * @access private 
    155149     */ 
    156     var $_client; 
     150    private $_client; 
    157151 
    158152    /** 
     
    164158     * @access private 
    165159     */ 
    166     var $_prefix; 
     160    private $_prefix; 
    167161 
    168162    /** 
     
    174168     * @access private 
    175169     */ 
    176     var $_status; 
     170    private $_status; 
    177171 
    178172    /** 
     
    183177     * @access private 
    184178     */ 
    185     var $_services; 
     179    private $_services; 
    186180 
    187181    /** 
     
    197191     * @var MidgardObject 
    198192     */ 
    199     var $midgard = null; 
     193    protected $midgard = null; 
     194 
     195    /** 
     196     * The component loader. 
     197     * 
     198     * @var midcom_helper__componentloader 
     199     */ 
     200    public $componentloader; 
    200201 
    201202    /** 
     
    204205     * @var midcom_helper_i18n 
    205206     */ 
    206     var $i18n = null; 
     207    public $i18n = null; 
    207208 
    208209    /** 
     
    212213       * @var midcom_helper__styleloader 
    213214     */ 
    214     var $style = null; 
     215    public $style = null; 
    215216 
    216217    /** 
     
    219220     * @var midcom_helper__cache 
    220221     */ 
    221     var $cache = null; 
     222    public $cache = null; 
    222223 
    223224    /** 
     
    226227     * @var midcom_helper__dbfactory 
    227228     */ 
    228     var $dbfactory = null; 
     229    public $dbfactory = null; 
    229230 
    230231    /** 
     
    233234     * @var midcom_services_auth 
    234235     */ 
    235     var $auth = null; 
     236    public $auth = null; 
    236237 
    237238    /** 
     
    240241     * @var midcom_services_dbclassloader 
    241242     */ 
    242     var $dbclassloader = null; 
     243    public $dbclassloader = null; 
    243244 
    244245    /** 
     
    247248     * @var midcom_services_tmp 
    248249     */ 
    249     var $tmp = null; 
     250    public $tmp = null; 
    250251 
    251252    /** 
     
    254255     * @var midcom_services_toolbars 
    255256     */ 
    256     var $toolbars = null; 
     257    public $toolbars = null; 
    257258 
    258259    /** 
     
    261262     * @var midcom_services_uimessages 
    262263     */ 
    263     var $uimessages = null; 
     264    public $uimessages = null; 
    264265 
    265266    /** 
     
    268269     * @var midcom_services_metadata 
    269270     */ 
    270     var $metadata = null; 
     271    public $metadata = null; 
    271272 
    272273    /** 
     
    276277     * @access private 
    277278     */ 
    278     var $_jshead; 
     279    private $_jshead; 
    279280 
    280281    /** 
     
    284285     * @access private 
    285286     */ 
    286     var $_prepend_jshead; 
     287    private $_prepend_jshead; 
    287288 
    288289    /** 
     
    292293     * @access private 
    293294     */ 
    294     var $_jquery_enabled = false; 
     295    private $_jquery_enabled = false; 
    295296 
    296297    /** 
     
    300301     * @access private 
    301302     */ 
    302     var $_jquery_states = array(); 
     303    private $_jquery_states = array(); 
    303304 
    304305    /** 
     
    308309     * @access private 
    309310     */ 
    310     var $_jsonload; 
     311    private $_jsonload; 
    311312 
    312313    /** 
     
    315316     * @access private 
    316317     */ 
    317     var $_meta_head = ""; 
     318    private $_meta_head = ""; 
    318319 
    319320    /** 
     
    322323     * @access private 
    323324     */ 
    324     var $_object_head = ""; 
     325    private $_object_head = ""; 
    325326 
    326327    /** 
     
    330331     * @access private 
    331332     */ 
    332     var $_style_head = ""; 
     333    private $_style_head = ""; 
    333334 
    334335    /** 
     
    338339     * @access private 
    339340     */ 
    340     var $_link_head = ""; 
     341    private $_link_head = ""; 
    341342 
    342343    /** 
     
    347348     * @see midcom_application::get_host_prefix(); 
    348349     */ 
    349     var $_cached_host_prefix; 
     350    private $_cached_host_prefix; 
    350351 
    351352    /** 
     
    356357     * @see midcom_application::get_page_prefix(); 
    357358     */ 
    358     var $_cached_page_prefix; 
     359    private $_cached_page_prefix; 
    359360 
    360361    /** 
     
    365366     * @see midcom_application::get_host_name(); 
    366367     */ 
    367     var $_cached_host_name = ''; 
     368    private $_cached_host_name = ''; 
    368369 
    369370    /** 
     
    393394     * Midgard Page URL). This may be needed when MidCOM is run by wrapper. 
    394395     */ 
    395     function initialize() 
     396    public function initialize() 
    396397    { 
    397398        debug_push_class(__CLASS__, __FUNCTION__); 
     
    523524     * @see midcom_application::_process() 
    524525     */ 
    525     function codeinit()  
     526    public function codeinit()  
    526527    { 
    527528        $oldcontext = $this->_currentcontext; 
     
    558559     * Style template, usually <(content)>. 
    559560     */ 
    560     function content()  
     561    public function content()  
    561562    { 
    562563        debug_push_class(__CLASS__, __FUNCTION__);     
     
    660661     * @return int                        The ID of the newly created context. 
    661662     */ 
    662     function dynamic_load($url, $config = array(), $type = MIDCOM_REQUEST_CONTENT)  
     663    public function dynamic_load($url, $config = array(), $type = MIDCOM_REQUEST_CONTENT)  
    663664    { 
    664665        debug_push_class(__CLASS__, __FUNCTION__); 
     
    761762     * <b>WARNING:</b> Anything done after calling this method will be lost. 
    762763     */ 
    763     function finish() 
     764    public function finish() 
    764765    { 
    765766        debug_push_class(__CLASS__, __FUNCTION__); 
     
    825826     * @access private 
    826827     */ 
    827     function _process() { 
     828    private function _process() { 
    828829        debug_push_class(__CLASS__, __FUNCTION__); 
    829830 
     
    10771078     * @access private 
    10781079     */ 
    1079     function _handle($path = NULL) 
     1080    private function _handle($path = NULL) 
    10801081    { 
    10811082        debug_push_class(__CLASS__, __FUNCTION__); 
     
    10841085        if (!isset($path)) $path = $opath; 
    10851086 
    1086         switch ($this->get_context_data(MIDCOM_CONTEXT_REQUESTTYPE)) 
    1087         { 
    1088             case MIDCOM_REQUEST_CONTENT: 
    1089                 $handler =& $this->componentloader->get_interface_class($path); 
    1090                 break; 
    1091  
    1092             case MIDCOM_REQUEST_CONTENTADM: 
    1093                 $handler =& $this->componentloader->get_contentadmin_class($path); 
    1094                 break; 
    1095  
    1096             default: 
    1097                 debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
    1098                 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:"  . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
    1099                 break; 
    1100         } 
     1087        if ($this->get_context_data(MIDCOM_CONTEXT_REQUESTTYPE) != MIDCOM_REQUEST_CONTENT) 
     1088        { 
     1089            debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
     1090            $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:"  . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
     1091        } 
     1092         
     1093        $handler =& $this->componentloader->get_interface_class($path); 
    11011094 
    11021095        $this->_set_context_data($this->_parser->fetch_object(), MIDCOM_CONTEXT_CONTENTTOPIC); 
     
    11701163     * @access private 
    11711164     */ 
    1172     function _checkobject($object) 
     1165    private function _checkobject($object) 
    11731166    { 
    11741167        debug_push_class(__CLASS__, __FUNCTION__); 
     
    11771170 
    11781171        $adminmode = false; 
    1179         switch ($this->_context[$this->_currentcontext][MIDCOM_CONTEXT_REQUESTTYPE]) 
    1180         { 
    1181             case MIDCOM_REQUEST_CONTENT: 
    1182                 $concept_component =& $this->componentloader->get_component_class($path); 
    1183                 if ( $concept_component === Null ) { 
    1184                     $path = 'midcom.core.nullcomponent'; 
    1185                     $this->_set_context_data($path,MIDCOM_CONTEXT_COMPONENT); 
    1186                     $concept_component =& $this->componentloader->get_component_class( $path ); 
    1187                 } 
    1188                 break; 
    1189  
    1190             case MIDCOM_REQUEST_CONTENTADM: 
    1191                 $concept_component =& $this->componentloader->get_contentadmin_class($path); 
    1192                 $adminmode = true; 
    1193                 break; 
    1194  
    1195             default: 
    1196                 debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
    1197                 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
    1198                 break; 
     1172        if ($this->_context[$this->_currentcontext][MIDCOM_CONTEXT_REQUESTTYPE] != MIDCOM_REQUEST_CONTENT) 
     1173        { 
     1174            debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
     1175            $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
     1176        } 
     1177         
     1178        $concept_component =& $this->componentloader->get_component_class($path); 
     1179        if ($concept_component === null)  
     1180        { 
     1181            $path = 'midcom.core.nullcomponent'; 
     1182            $this->_set_context_data($path, MIDCOM_CONTEXT_COMPONENT); 
     1183            $concept_component =& $this->componentloader->get_component_class($path); 
    11991184        } 
    12001185 
     
    12331218     * @access private 
    12341219     */ 
    1235     function & _loadconfig($object) { 
     1220    private function & _loadconfig($object)  
     1221    { 
    12361222        debug_push("midcom_application::_loadconfig"); 
    12371223 
     
    12601246     * @access private 
    12611247     */ 
    1262     function _output() 
     1248    private function _output() 
    12631249    { 
    12641250        debug_push_class(__CLASS__, __FUNCTION__); 
     
    12721258        } 
    12731259 
    1274         switch ($this->get_context_data(MIDCOM_CONTEXT_REQUESTTYPE)) 
    1275         { 
    1276             case MIDCOM_REQUEST_CONTENT: 
    1277                 $component =& $this->componentloader->get_component_class($this->get_context_data(MIDCOM_CONTEXT_COMPONENT)); 
    1278                 break; 
    1279  
    1280             case MIDCOM_REQUEST_CONTENTADM: 
    1281                 $component =& $this->componentloader->get_contentadmin_class($this->get_context_data(MIDCOM_CONTEXT_COMPONENT)); 
    1282                 break; 
    1283  
    1284             default: 
    1285                 debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
    1286                 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
    1287                 break; 
    1288         } 
     1260        if ($this->get_context_data(MIDCOM_CONTEXT_REQUESTTYPE) != MIDCOM_REQUEST_CONTENT) 
     1261        { 
     1262            debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
     1263            $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
     1264        } 
     1265         
     1266        $component =& $this->componentloader->get_component_class($this->get_context_data(MIDCOM_CONTEXT_COMPONENT)); 
    12891267        $component->show_content($this->_currentcontext); 
    12901268 
     
    14381416     * @return midcom_helper__componentloader The reference of the component loader in use. 
    14391417     */ 
    1440     function & get_component_loader () { 
     1418    public function & get_component_loader ()  
     1419    { 
    14411420        return $this->componentloader; 
    14421421    }