Changeset 22740
- Timestamp:
- 06/30/09 14:54:44 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/ragnaroek/midcom/midcom.core/support/midgard-root-ragnaland.php
r22690 r22740 12 12 13 13 define('MIDCOM_ROOT', dirname(dirname(__FILE__)) . '/Midcom/ragnaroek'); 14 15 // Ragnaroek uses more memory in some operations than standard settings allow 16 // FIXME: Set sensible but big values instead of removing limits completely 17 @ini_set('memory_limit', -1); 18 @ini_set('max_execution_time', 0); 14 19 15 20 // Figure out a root topic … … 41 46 // Prepare $_MIDGARD superglobal to be Ragnaroek-compatible 42 47 $_MIDGARD['user'] = 0; 48 $_MIDGARD['admin'] = false; 43 49 $request_config = $_MIDGARD_CONNECTION->get_request_config(); 44 50 if (!$request_config) … … 124 130 $element = $name[1]; 125 131 $request_config = $_MIDGARD_CONNECTION->get_request_config(); 132 133 // Sensible fallback if we don't have a style or ROOT element 134 $root_fallback = '<html><head><?php $_MIDCOM->print_head_elements(); ?></head><body><?php $_MIDCOM->content(); $_MIDCOM->uimessages->show(); $_MIDCOM->toolbars->show(); ?></body></html>'; 135 126 136 switch ($element) 127 137 { … … 135 145 if (!$style) 136 146 { 147 if ($element == 'ROOT') 148 { 149 return $root_fallback; 150 } 137 151 return ''; 138 152 } … … 143 157 if (count($elements) == 0) 144 158 { 159 if ($element == 'ROOT') 160 { 161 return $root_fallback; 162 } 145 163 return ''; 146 164 } 147 return preg_replace_callback("/<\\(([a-zA-Z0-9 _-]+)\\)>/", 'mgd_element', $elements[0]->value); 165 else 166 { 167 $value = $elements[0]->value; 168 } 169 return preg_replace_callback("/<\\(([a-zA-Z0-9 _-]+)\\)>/", 'mgd_element', $value); 148 170 } 149 171 } … … 183 205 // Display the template 184 206 eval('?>' . mgd_preparse_compat('<(ROOT)>')); 185 /**186 * <html>187 * <head>188 * <?php189 * $_MIDCOM->print_head_elements();190 * ?>191 * </head>192 * <body>193 * <?php194 * $_MIDCOM->content();195 * ?>196 * </body>197 * </html>198 */199 207 ?>
