Changeset 11858
- Timestamp:
- 08/30/07 12:36:50 (1 year ago)
- Files:
-
- trunk/midcom/midcom.core/midcom/application.php (modified) (46 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/application.php
r11850 r11858 105 105 * @package midcom 106 106 */ 107 class midcom_application { 107 class midcom_application 108 { 108 109 109 110 /** … … 113 114 * @access private 114 115 */ 115 var $_parser; 116 117 /** 118 * The component loader. 119 * 120 * @var midcom_helper__componentloader 121 */ 122 var $componentloader; 116 private $_parser; 123 117 124 118 /** … … 130 124 * @access private 131 125 */ 132 var$_context = array();126 private $_context = array(); 133 127 134 128 /** … … 138 132 * @access private 139 133 */ 140 var$_currentcontext;134 private $_currentcontext; 141 135 142 136 /** … … 146 140 * @access private 147 141 */ 148 var$_currentcomponent;142 private $_currentcomponent; 149 143 150 144 /** … … 154 148 * @access private 155 149 */ 156 var$_client;150 private $_client; 157 151 158 152 /** … … 164 158 * @access private 165 159 */ 166 var$_prefix;160 private $_prefix; 167 161 168 162 /** … … 174 168 * @access private 175 169 */ 176 var$_status;170 private $_status; 177 171 178 172 /** … … 183 177 * @access private 184 178 */ 185 var$_services;179 private $_services; 186 180 187 181 /** … … 197 191 * @var MidgardObject 198 192 */ 199 var $midgard = null; 193 protected $midgard = null; 194 195 /** 196 * The component loader. 197 * 198 * @var midcom_helper__componentloader 199 */ 200 public $componentloader; 200 201 201 202 /** … … 204 205 * @var midcom_helper_i18n 205 206 */ 206 var$i18n = null;207 public $i18n = null; 207 208 208 209 /** … … 212 213 * @var midcom_helper__styleloader 213 214 */ 214 var$style = null;215 public $style = null; 215 216 216 217 /** … … 219 220 * @var midcom_helper__cache 220 221 */ 221 var$cache = null;222 public $cache = null; 222 223 223 224 /** … … 226 227 * @var midcom_helper__dbfactory 227 228 */ 228 var$dbfactory = null;229 public $dbfactory = null; 229 230 230 231 /** … … 233 234 * @var midcom_services_auth 234 235 */ 235 var$auth = null;236 public $auth = null; 236 237 237 238 /** … … 240 241 * @var midcom_services_dbclassloader 241 242 */ 242 var$dbclassloader = null;243 public $dbclassloader = null; 243 244 244 245 /** … … 247 248 * @var midcom_services_tmp 248 249 */ 249 var$tmp = null;250 public $tmp = null; 250 251 251 252 /** … … 254 255 * @var midcom_services_toolbars 255 256 */ 256 var$toolbars = null;257 public $toolbars = null; 257 258 258 259 /** … … 261 262 * @var midcom_services_uimessages 262 263 */ 263 var$uimessages = null;264 public $uimessages = null; 264 265 265 266 /** … … 268 269 * @var midcom_services_metadata 269 270 */ 270 var$metadata = null;271 public $metadata = null; 271 272 272 273 /** … … 276 277 * @access private 277 278 */ 278 var$_jshead;279 private $_jshead; 279 280 280 281 /** … … 284 285 * @access private 285 286 */ 286 var$_prepend_jshead;287 private $_prepend_jshead; 287 288 288 289 /** … … 292 293 * @access private 293 294 */ 294 var$_jquery_enabled = false;295 private $_jquery_enabled = false; 295 296 296 297 /** … … 300 301 * @access private 301 302 */ 302 var$_jquery_states = array();303 private $_jquery_states = array(); 303 304 304 305 /** … … 308 309 * @access private 309 310 */ 310 var$_jsonload;311 private $_jsonload; 311 312 312 313 /** … … 315 316 * @access private 316 317 */ 317 var$_meta_head = "";318 private $_meta_head = ""; 318 319 319 320 /** … … 322 323 * @access private 323 324 */ 324 var$_object_head = "";325 private $_object_head = ""; 325 326 326 327 /** … … 330 331 * @access private 331 332 */ 332 var$_style_head = "";333 private $_style_head = ""; 333 334 334 335 /** … … 338 339 * @access private 339 340 */ 340 var$_link_head = "";341 private $_link_head = ""; 341 342 342 343 /** … … 347 348 * @see midcom_application::get_host_prefix(); 348 349 */ 349 var$_cached_host_prefix;350 private $_cached_host_prefix; 350 351 351 352 /** … … 356 357 * @see midcom_application::get_page_prefix(); 357 358 */ 358 var$_cached_page_prefix;359 private $_cached_page_prefix; 359 360 360 361 /** … … 365 366 * @see midcom_application::get_host_name(); 366 367 */ 367 var$_cached_host_name = '';368 private $_cached_host_name = ''; 368 369 369 370 /** … … 393 394 * Midgard Page URL). This may be needed when MidCOM is run by wrapper. 394 395 */ 395 function initialize()396 public function initialize() 396 397 { 397 398 debug_push_class(__CLASS__, __FUNCTION__); … … 523 524 * @see midcom_application::_process() 524 525 */ 525 function codeinit()526 public function codeinit() 526 527 { 527 528 $oldcontext = $this->_currentcontext; … … 558 559 * Style template, usually <(content)>. 559 560 */ 560 function content()561 public function content() 561 562 { 562 563 debug_push_class(__CLASS__, __FUNCTION__); … … 660 661 * @return int The ID of the newly created context. 661 662 */ 662 function dynamic_load($url, $config = array(), $type = MIDCOM_REQUEST_CONTENT)663 public function dynamic_load($url, $config = array(), $type = MIDCOM_REQUEST_CONTENT) 663 664 { 664 665 debug_push_class(__CLASS__, __FUNCTION__); … … 761 762 * <b>WARNING:</b> Anything done after calling this method will be lost. 762 763 */ 763 function finish()764 public function finish() 764 765 { 765 766 debug_push_class(__CLASS__, __FUNCTION__); … … 825 826 * @access private 826 827 */ 827 function _process() {828 private function _process() { 828 829 debug_push_class(__CLASS__, __FUNCTION__); 829 830 … … 1077 1078 * @access private 1078 1079 */ 1079 function _handle($path = NULL)1080 private function _handle($path = NULL) 1080 1081 { 1081 1082 debug_push_class(__CLASS__, __FUNCTION__); … … 1084 1085 if (!isset($path)) $path = $opath; 1085 1086 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); 1101 1094 1102 1095 $this->_set_context_data($this->_parser->fetch_object(), MIDCOM_CONTEXT_CONTENTTOPIC); … … 1170 1163 * @access private 1171 1164 */ 1172 function _checkobject($object)1165 private function _checkobject($object) 1173 1166 { 1174 1167 debug_push_class(__CLASS__, __FUNCTION__); … … 1177 1170 1178 1171 $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); 1199 1184 } 1200 1185 … … 1233 1218 * @access private 1234 1219 */ 1235 function & _loadconfig($object) { 1220 private function & _loadconfig($object) 1221 { 1236 1222 debug_push("midcom_application::_loadconfig"); 1237 1223 … … 1260 1246 * @access private 1261 1247 */ 1262 function _output()1248 private function _output() 1263 1249 { 1264 1250 debug_push_class(__CLASS__, __FUNCTION__); … … 1272 1258 } 1273 1259 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)); 1289 1267 $component->show_content($this->_currentcontext); 1290 1268 … … 1438 1416 * @return midcom_helper__componentloader The reference of the component loader in use. 1439 1417 */ 1440 function & get_component_loader () { 1418 public function & get_component_loader () 1419 { 1441 1420 return $this->componentloader; 1442 1421 }
