Annotation of /mambo/branches/4.6/index.php
Parent Directory
|
Revision Log
Revision 948 - (view) (download)
| 1 : | csouza | 129 | <?php |
| 2 : | /** | ||
| 3 : | andphe | 815 | * Main file for Mambo |
| 4 : | * @package Mambo | ||
| 5 : | cauld | 948 | * @copyright Refer to copyright.php |
| 6 : | csouza | 129 | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 : | andphe | 815 | * @author Mambo Foundation Inc see README.php |
| 8 : | neilt | 453 | */ |
| 9 : | csouza | 129 | |
| 10 : | /** Set flag that this is a parent file */ | ||
| 11 : | if (!defined('_VALID_MOS')) define( '_VALID_MOS', 1 ); | ||
| 12 : | |||
| 13 : | enjoyman | 841 | $dir = isset($adminside)?"../":""; |
| 14 : | enjoyman | 813 | |
| 15 : | if ( !file_exists($dir.'configuration.php' ) || filesize( $dir.'configuration.php' ) < 10 ) { | ||
| 16 : | andphe | 815 | header("Location: ".$dir."installation/index.php"); |
| 17 : | exit(); | ||
| 18 : | enjoyman | 813 | } |
| 19 : | |||
| 20 : | csouza | 129 | $protects = array('_REQUEST', '_GET', '_POST', '_COOKIE', '_FILES', '_SERVER', '_ENV', 'GLOBALS', '_SESSION'); |
| 21 : | foreach ($protects as $protect) { | ||
| 22 : | csouza | 154 | if ( in_array($protect , array_keys($_REQUEST)) || |
| 23 : | in_array($protect , array_keys($_GET)) || | ||
| 24 : | in_array($protect , array_keys($_POST)) || | ||
| 25 : | in_array($protect , array_keys($_COOKIE)) || | ||
| 26 : | in_array($protect , array_keys($_FILES))) { | ||
| 27 : | die("Invalid Request."); | ||
| 28 : | } | ||
| 29 : | csouza | 129 | } |
| 30 : | |||
| 31 : | /** | ||
| 32 : | andphe | 815 | * used to leave the input element without trim it |
| 33 : | csouza | 129 | */ |
| 34 : | define( "_MOS_NOTRIM", 0x0001 ); | ||
| 35 : | andphe | 815 | /** |
| 36 : | * used to leave the input element with all HTML tags | ||
| 37 : | */ | ||
| 38 : | csouza | 129 | define( "_MOS_ALLOWHTML", 0x0002 ); |
| 39 : | andphe | 815 | /** |
| 40 : | * used to leave the input element without convert it to numeric | ||
| 41 : | */ | ||
| 42 : | csouza | 129 | define( "_MOS_ALLOWRAW", 0x0004 ); |
| 43 : | andphe | 815 | /** |
| 44 : | * used to leave the input element without slashes | ||
| 45 : | */ | ||
| 46 : | csouza | 129 | define( "_MOS_NOMAGIC", 0x0008 ); |
| 47 : | andphe | 815 | |
| 48 : | /** | ||
| 49 : | * function to sanitize input values from arrays | ||
| 50 : | * | ||
| 51 : | * This function provides a way to sanitize inputs, should be used to obtain values from | ||
| 52 : | * _POST, _GET, _COOKIES, etc; a default value can be passed to be used in case that not | ||
| 53 : | * values are founded to the element, a binary mask can be passed to discard some of test, | ||
| 54 : | *, this value is matched with _MOS_NOTRIM, _MOS_ALLOWHTML and, _MOS_ALLOWRAW, currently | ||
| 55 : | * 3 test are do it, trim, strip html and convert the value to numeric when is possible. | ||
| 56 : | * | ||
| 57 : | * Example of use: | ||
| 58 : | * | ||
| 59 : | * To get task variable from the URL and select the view like default task, you can use: | ||
| 60 : | * | ||
| 61 : | * <code>$task = mosGetParam ($_GET,"task","view");</code> | ||
| 62 : | * | ||
| 63 : | * To get task variable from the URL, select the view like default task, allows HTML and | ||
| 64 : | * without trim you can use : | ||
| 65 : | * | ||
| 66 : | * <code>$task = mosGetParam ($_GET,"task","view",_MOS_NOTRIM+_MOS_ALLOWHTML);</code> | ||
| 67 : | * | ||
| 68 : | * @acces public | ||
| 69 : | * @param array &$arr reference to array which contains the value | ||
| 70 : | * @param string $name name of element searched | ||
| 71 : | * @param mixed $def default value to use if nothing is founded | ||
| 72 : | * @param int $mask mask to select checks that will do it | ||
| 73 : | * @return mixed value from the selected element or default value if nothing was found | ||
| 74 : | */ | ||
| 75 : | csouza | 129 | function mosGetParam( &$arr, $name, $def=null, $mask=0 ) { |
| 76 : | csouza | 154 | if (isset( $arr[$name] )) { |
| 77 : | if (is_array($arr[$name])) foreach ($arr[$name] as $key=>$element) $result[$key] = mosGetParam ($arr[$name], $key, $def, $mask); | ||
| 78 : | else { | ||
| 79 : | $result = $arr[$name]; | ||
| 80 : | if (!($mask&_MOS_NOTRIM)) $result = trim($result); | ||
| 81 : | if (!is_numeric( $result)) { | ||
| 82 : | if (!($mask&_MOS_ALLOWHTML)) $result = strip_tags($result); | ||
| 83 : | if (!($mask&_MOS_ALLOWRAW)) { | ||
| 84 : | if (is_numeric($def)) $result = intval($result); | ||
| 85 : | } | ||
| 86 : | } | ||
| 87 : | cauld | 734 | if (!get_magic_quotes_gpc()) { |
| 88 : | alwarren | 760 | $result = addslashes( $result ); |
| 89 : | cauld | 734 | } |
| 90 : | csouza | 154 | } |
| 91 : | return $result; | ||
| 92 : | } else { | ||
| 93 : | return $def; | ||
| 94 : | } | ||
| 95 : | csouza | 129 | } |
| 96 : | |||
| 97 : | andphe | 815 | /** |
| 98 : | * Converts a normal URL to a Search Engine Friendly URL | ||
| 99 : | * | ||
| 100 : | * This function uses the mosSEF class to determine the correct way in that the URL | ||
| 101 : | * should be converted. | ||
| 102 : | * | ||
| 103 : | * Example of use: | ||
| 104 : | * | ||
| 105 : | * <code>$link = sefRelToAbs("index.php?option=com_content&task=view&id=$articleid");</code> | ||
| 106 : | * | ||
| 107 : | * returns something like content/view/10/5/ | ||
| 108 : | * | ||
| 109 : | * @access public | ||
| 110 : | * @param string $string URL to be converted | ||
| 111 : | * @return string Search Engine Friendly URL converted | ||
| 112 : | */ | ||
| 113 : | csouza | 129 | function sefRelToAbs ($string) { |
| 114 : | counterpoi | 238 | t $sef =& mosSEF::getInstance(); |
| 115 : | csouza | 154 | return $sef->sefRelToAbs($string); |
| 116 : | csouza | 129 | } |
| 117 : | |||
| 118 : | andphe | 815 | /** |
| 119 : | * sets or returns the current side (frontend/backend) | ||
| 120 : | * | ||
| 121 : | * This function returns TRUE when the user are in the backend area; this is set to | ||
| 122 : | * TRUE when are invocated /administrator/index.php, /administrator/index2.php | ||
| 123 : | * or /administrator/index3.php, to set this value is not a normal use. | ||
| 124 : | * | ||
| 125 : | * @access public | ||
| 126 : | * @param bool $val value used to set the adminSide value, not planned to be used by users | ||
| 127 : | * @return bool TRUE when the user are in backend area, FALSE when are in frontend | ||
| 128 : | */ | ||
| 129 : | alwarren | 757 | function adminSide($val='') { |
| 130 : | andphe | 815 | static $adminside; |
| 131 : | if (is_null($adminside)) { | ||
| 132 : | $adminside = ($val == '') ? 0 : $val; | ||
| 133 : | } else { | ||
| 134 : | $adminside = ($val == '') ? $adminside : $val; | ||
| 135 : | } | ||
| 136 : | return $adminside; | ||
| 137 : | alwarren | 757 | } |
| 138 : | |||
| 139 : | andphe | 815 | |
| 140 : | /** | ||
| 141 : | * sets or returns the index type | ||
| 142 : | * | ||
| 143 : | * This function returns 1, 2 or 3 depending of called file index.php, index2.php or index3.php. | ||
| 144 : | * | ||
| 145 : | * @access private | ||
| 146 : | * @param int $val value used to set the indexType value, not planned to be used by users | ||
| 147 : | * @return int return 1, 2 or 3 depending of called file | ||
| 148 : | */ | ||
| 149 : | |||
| 150 : | enjoyman | 813 | function indexType($val='') |
| 151 : | { | ||
| 152 : | andphe | 815 | static $indextype; |
| 153 : | if (is_null($indextype)) { | ||
| 154 : | $indextype = ($val == '') ? 1 : $val; | ||
| 155 : | } else { | ||
| 156 : | $indextype = ($val == '') ? $indextype : $val; | ||
| 157 : | } | ||
| 158 : | return $indextype; | ||
| 159 : | alwarren | 757 | } |
| 160 : | |||
| 161 : | neilt | 656 | if (!isset($adminside)) $adminside = 0; |
| 162 : | if (!isset($indextype)) $indextype = 1; | ||
| 163 : | csouza | 129 | |
| 164 : | alwarren | 757 | adminSide($adminside); |
| 165 : | indexType($indextype); | ||
| 166 : | |||
| 167 : | csouza | 529 | require_once (dirname(__FILE__).'/includes/database.php'); |
| 168 : | require_once(dirname(__FILE__).'/includes/core.classes.php'); | ||
| 169 : | mambo | 157 | $configuration =& mamboCore::getMamboCore(); |
| 170 : | $configuration->handleGlobals(); | ||
| 171 : | |||
| 172 : | alwarren | 757 | $adminside = adminSide(); |
| 173 : | $indextype = indexType(); | ||
| 174 : | mambo | 157 | |
| 175 : | csouza | 129 | require($configuration->rootPath().'/includes/version.php'); |
| 176 : | $_VERSION =& new version(); | ||
| 177 : | |||
| 178 : | csouza | 530 | |
| 179 : | csouza | 129 | $version = $_VERSION->PRODUCT .' '. $_VERSION->RELEASE .'.'. $_VERSION->DEV_LEVEL .' ' |
| 180 : | . $_VERSION->DEV_STATUS | ||
| 181 : | .' [ '.$_VERSION->CODENAME .' ] '. $_VERSION->RELDATE .' ' | ||
| 182 : | . $_VERSION->RELTIME .' '. $_VERSION->RELTZ; | ||
| 183 : | |||
| 184 : | if (phpversion() < '4.2.0') require_once( $configuration->rootPath() . '/includes/compat.php41x.php' ); | ||
| 185 : | if (phpversion() < '4.3.0') require_once( $configuration->rootPath() . '/includes/compat.php42x.php' ); | ||
| 186 : | adi | 737 | if (phpversion() < '5.0.0') require_once( $configuration->rootPath() . '/includes/compat.php5xx.php' ); |
| 187 : | csouza | 129 | |
| 188 : | $local_backup_path = $configuration->rootPath().'/administrator/backups'; | ||
| 189 : | $media_path = $configuration->rootPath().'/media/'; | ||
| 190 : | $image_path = $configuration->rootPath().'/images/stories'; | ||
| 191 : | csouza | 252 | $lang_path = $configuration->rootPath().'/language'; |
| 192 : | csouza | 129 | $image_size = 100; |
| 193 : | |||
| 194 : | counterpoi | 238 | t $database =& mamboDatabase::getInstance(); |
| 195 : | csouza | 129 | $database->debug(mamboCore::get('mosConfig_debug')); |
| 196 : | |||
| 197 : | csouza | 252 | |
| 198 : | csouza | 129 | if (!$adminside) { |
| 199 : | csouza | 154 | $sefcode = $configuration->rootPath().'/components/com_sef/sef.php'; |
| 200 : | if (file_exists($sefcode)) require_once($sefcode); | ||
| 201 : | else require_once($configuration->rootPath().'/includes/sef.php'); | ||
| 202 : | $urlerror = 0; | ||
| 203 : | if (mamboCore::get('mosConfig_sef') AND $indextype == 3) { | ||
| 204 : | counterpoi | 238 | t $sef =& mosSEF::getInstance(); |
| 205 : | csouza | 154 | $urlerror = $sef->sefRetrieval(mamboCore::get('mosConfig_register_globals')); |
| 206 : | $indextype = 1; | ||
| 207 : | } | ||
| 208 : | csouza | 129 | } |
| 209 : | |||
| 210 : | /** retrieve some possible request string (or form) arguments */ | ||
| 211 : | $type = mosGetParam($_REQUEST, 'type', 1); | ||
| 212 : | $act = mosGetParam( $_REQUEST, 'act', '' ); | ||
| 213 : | $do_pdf = mosGetParam( $_REQUEST, 'do_pdf', 0 ); | ||
| 214 : | $id = mosGetParam( $_REQUEST, 'id', 0 ); | ||
| 215 : | $task = mosGetParam($_REQUEST, 'task', ''); | ||
| 216 : | $act = strtolower(mosGetParam($_REQUEST, 'act', '')); | ||
| 217 : | $section = mosGetParam($_REQUEST, 'section', ''); | ||
| 218 : | $no_html = strtolower(mosGetParam($_REQUEST, 'no_html', '')); | ||
| 219 : | neilt | 488 | $cid = (array) mosGetParam( $_POST, 'cid', array() ); |
| 220 : | csouza | 129 | |
| 221 : | counterpoi | 422 | t ini_set('session.use_trans_sid', 0); |
| 222 : | t ini_set('session.use_cookies', 1); | ||
| 223 : | t ini_set('session.use_only_cookies', 1); | ||
| 224 : | t | ||
| 225 : | counterpoi | 449 | t |
| 226 : | csouza | 556 | /* initialize i18n */ |
| 227 : | $lang = $configuration->current_language->name; | ||
| 228 : | $charset = $configuration->current_language->charset; | ||
| 229 : | $gettext =& phpgettext(); | ||
| 230 : | $gettext->debug = $configuration->mosConfig_locale_debug; | ||
| 231 : | $gettext->has_gettext = $configuration->mosConfig_locale_use_gettext; | ||
| 232 : | andphe | 908 | $language = new mamboLanguage($lang); |
| 233 : | $gettext->setlocale($lang, $language->getSystemLocale()); | ||
| 234 : | csouza | 556 | $gettext->bindtextdomain($lang, $configuration->rootPath().'/language'); |
| 235 : | andphe | 908 | $gettext->bind_textdomain_codeset($lang, $charset); |
| 236 : | csouza | 556 | $gettext->textdomain($lang); |
| 237 : | #$gettext =& phpgettext(); dump($gettext); | ||
| 238 : | |||
| 239 : | csouza | 129 | if ($adminside) { |
| 240 : | csouza | 154 | // Start ACL |
| 241 : | require_once($configuration->rootPath().'/includes/gacl.class.php' ); | ||
| 242 : | require_once($configuration->rootPath().'/includes/gacl_api.class.php' ); | ||
| 243 : | $acl = new gacl_api(); | ||
| 244 : | // Handle special admin side options | ||
| 245 : | $option = strtolower(mosGetParam($_REQUEST,'option','com_admin')); | ||
| 246 : | csouza | 252 | |
| 247 : | $domain = substr($option, 4); | ||
| 248 : | counterpoi | 422 | t session_name(md5(mamboCore::get('mosConfig_live_site'))); |
| 249 : | t session_start(); | ||
| 250 : | csouza | 556 | // restore some session variables |
| 251 : | $my = new mosUser(); | ||
| 252 : | $my->getSession(); | ||
| 253 : | ninekrit | 876 | $configuration->offlineCheck($my, $database); // check installation folder removed? |
| 254 : | csouza | 556 | if (mosSession::validate($my)) { |
| 255 : | mosSession::purge(); | ||
| 256 : | } else { | ||
| 257 : | mosSession::purge(); | ||
| 258 : | $my = null; | ||
| 259 : | } | ||
| 260 : | counterpoi | 422 | t if (!$my AND $option == 'login') { |
| 261 : | csouza | 154 | require_once($configuration->rootPath().'/includes/authenticator.php'); |
| 262 : | counterpoi | 238 | t $authenticator =& mamboAuthenticator::getInstance(); |
| 263 : | csouza | 154 | $my = $authenticator->loginAdmin($acl); |
| 264 : | } | ||
| 265 : | counterpoi | 422 | t // Handle the remaining special options |
| 266 : | t elseif ($option == 'logout') { | ||
| 267 : | t require($configuration->rootPath().'/administrator/logout.php'); | ||
| 268 : | t exit(); | ||
| 269 : | csouza | 154 | } |
| 270 : | // We can now create the mainframe object | ||
| 271 : | $mainframe =& new mosMainFrame($database, $option, '..', true); | ||
| 272 : | // Provided $my is set, we have a valid admin side session and can include remaining code | ||
| 273 : | if ($my) { | ||
| 274 : | mamboCore::set('currentUser', $my); | ||
| 275 : | counterpoi | 422 | t if ($option == 'simple_mode') $admin_mode = 'on'; |
| 276 : | t elseif ($option == 'advanced_mode') $admin_mode = 'off'; | ||
| 277 : | t else $admin_mode = mosGetParam($_SESSION, 'simple_editing', ''); | ||
| 278 : | t $_SESSION['simple_editing'] = mosGetParam($_POST, 'simple_editing', $admin_mode); | ||
| 279 : | t require_once($configuration->rootPath().'/administrator/includes/admin.php'); | ||
| 280 : | csouza | 154 | require_once( $configuration->rootPath().'/includes/mambo.php' ); |
| 281 : | require_once ($configuration->rootPath().'/includes/mambofunc.php'); | ||
| 282 : | require_once ($configuration->rootPath().'/includes/mamboHTML.php'); | ||
| 283 : | require_once( $configuration->rootPath().'/administrator/includes/mosAdminMenus.php'); | ||
| 284 : | require_once($configuration->rootPath().'/administrator/includes/admin.php'); | ||
| 285 : | require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); | ||
| 286 : | csouza | 403 | require_once( $configuration->rootPath() . '/components/com_content/content.class.php' ); |
| 287 : | counterpoi | 238 | t $_MAMBOTS =& mosMambotHandler::getInstance(); |
| 288 : | csouza | 252 | |
| 289 : | csouza | 403 | |
| 290 : | csouza | 154 | // If no_html is set, we avoid starting the template, and go straight to the component |
| 291 : | if ($no_html) { | ||
| 292 : | if ($path = $mainframe->getPath( "admin" )) require $path; | ||
| 293 : | exit(); | ||
| 294 : | } | ||
| 295 : | $configuration->initGzip(); | ||
| 296 : | // When adminside = 3 we assume that HTML is being explicitly written and do nothing more | ||
| 297 : | if ($adminside != 3) { | ||
| 298 : | $path = $configuration->rootPath().'/administrator/templates/'.$mainframe->getTemplate().'/index.php'; | ||
| 299 : | require_once($path); | ||
| 300 : | $configuration->doGzip(); | ||
| 301 : | } | ||
| 302 : | else { | ||
| 303 : | csouza | 302 | if (!isset($popup)) { |
| 304 : | csouza | 252 | $pop = mosGetParam($_REQUEST, 'pop', ''); |
| 305 : | counterpoi | 419 | t if ($pop) require($configuration->rootPath()."/administrator/popups/$pop"); |
| 306 : | t else require($configuration->rootPath()."/administrator/popups/index3pop.php"); | ||
| 307 : | csouza | 252 | $configuration->doGzip(); |
| 308 : | } | ||
| 309 : | csouza | 154 | } |
| 310 : | } | ||
| 311 : | counterpoi | 422 | t // If $my was not set, the only possibility is to offer a login screen |
| 312 : | csouza | 154 | else { |
| 313 : | $configuration->initGzip(); | ||
| 314 : | $path = $configuration->rootPath().'/administrator/templates/'.$mainframe->getTemplate().'/login.php'; | ||
| 315 : | require_once( $path ); | ||
| 316 : | $configuration->doGzip(); | ||
| 317 : | } | ||
| 318 : | csouza | 129 | } |
| 319 : | // Finished admin side; the rest is user side code: | ||
| 320 : | else { | ||
| 321 : | csouza | 154 | $option = $configuration->determineOptionAndItemid(); |
| 322 : | $Itemid = $configuration->get('Itemid'); | ||
| 323 : | csouza | 129 | |
| 324 : | csouza | 154 | $mainframe =& new mosMainFrame($database, $option, '.'); |
| 325 : | counterpoi | 223 | t if ($option == 'login') $configuration->handleLogin(); |
| 326 : | t elseif ($option == 'logout') $configuration->handleLogout(); | ||
| 327 : | t | ||
| 328 : | counterpoi | 238 | t $session =& mosSession::getCurrent(); |
| 329 : | counterpoi | 419 | t $my =& new mosUser(); |
| 330 : | csouza | 154 | $my->getSessionData(); |
| 331 : | mamboCore::set('currentUser',$my); | ||
| 332 : | $configuration->offlineCheck($my, $database); | ||
| 333 : | $gid = intval( $my->gid ); | ||
| 334 : | // gets template for page | ||
| 335 : | $cur_template = $mainframe->getTemplate(); | ||
| 336 : | csouza | 129 | |
| 337 : | csouza | 154 | require_once( $configuration->rootPath().'/includes/frontend.php' ); |
| 338 : | require_once( $configuration->rootPath().'/includes/mambo.php' ); | ||
| 339 : | require_once ($configuration->rootPath().'/includes/mambofunc.php'); | ||
| 340 : | require_once ($configuration->rootPath().'/includes/mamboHTML.php'); | ||
| 341 : | csouza | 129 | |
| 342 : | csouza | 154 | if ($indextype == 2 AND $do_pdf == 1 ) { |
| 343 : | include_once('includes/pdf.php'); | ||
| 344 : | exit(); | ||
| 345 : | } | ||
| 346 : | csouza | 129 | |
| 347 : | csouza | 154 | /** detect first visit */ |
| 348 : | $mainframe->detect(); | ||
| 349 : | csouza | 129 | |
| 350 : | csouza | 154 | /** @global mosPlugin $_MAMBOTS */ |
| 351 : | counterpoi | 238 | t $_MAMBOTS =& mosMambotHandler::getInstance(); |
| 352 : | csouza | 154 | require_once( $configuration->rootPath().'/editor/editor.php' ); |
| 353 : | require_once( $configuration->rootPath() . '/includes/gacl.class.php' ); | ||
| 354 : | require_once( $configuration->rootPath() . '/includes/gacl_api.class.php' ); | ||
| 355 : | counterpoi | 270 | t require_once( $configuration->rootPath() . '/components/com_content/content.class.php' ); |
| 356 : | csouza | 154 | $acl = new gacl_api(); |
| 357 : | csouza | 403 | |
| 358 : | csouza | 154 | /** Get the component handler */ |
| 359 : | require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); | ||
| 360 : | csouza | 236 | $c_handler =& mosComponentHandler::getInstance(); |
| 361 : | csouza | 154 | $c_handler->startBuffer(); |
| 362 : | csouza | 129 | |
| 363 : | csouza | 154 | if (!$urlerror AND $path = $mainframe->getPath( 'front' )) { |
| 364 : | counterpoi | 238 | t $menuhandler =& mosMenuHandler::getInstance(); |
| 365 : | csouza | 154 | $ret = $menuhandler->menuCheck($Itemid, $option, $task, $gid); |
| 366 : | $menuhandler->setPathway($Itemid); | ||
| 367 : | csouza | 252 | if ($ret) { |
| 368 : | counterpoi | 390 | t require ($path); |
| 369 : | csouza | 252 | } |
| 370 : | csouza | 154 | else mosNotAuth(); |
| 371 : | } | ||
| 372 : | else { | ||
| 373 : | header ('HTTP/1.1 404 Not Found'); | ||
| 374 : | csouza | 183 | $mainframe->setPageTitle(T_('404 Error - page not found')); |
| 375 : | csouza | 154 | include ($configuration->rootPath().'/page404.php'); |
| 376 : | } | ||
| 377 : | csouza | 129 | |
| 378 : | csouza | 154 | $c_handler->endBuffer(); |
| 379 : | csouza | 129 | |
| 380 : | csouza | 154 | $configuration->initGzip(); |
| 381 : | csouza | 129 | |
| 382 : | csouza | 154 | $configuration->standardHeaders(); |
| 383 : | counterpoi | 270 | t if (mosGetParam($_GET, 'syndstyle', '') == 'yes') mosMainBody(); |
| 384 : | t elseif ($indextype == 1) { | ||
| 385 : | csouza | 154 | // loads template file |
| 386 : | if ( !file_exists( 'templates/'. $cur_template .'/index.php' ) ) { | ||
| 387 : | csouza | 183 | echo '<font color=\"red\"><b>'.T_('Template File Not Found! Looking for template').'</b></font>'.$cur_template; |
| 388 : | csouza | 154 | } else { |
| 389 : | require_once( 'templates/'. $cur_template .'/index.php' ); | ||
| 390 : | counterpoi | 238 | t $mambothandler =& mosMambotHandler::getInstance(); |
| 391 : | csouza | 154 | $mambothandler->loadBotGroup('system'); |
| 392 : | $mambothandler->trigger('afterTemplate', array($configuration)); | ||
| 393 : | echo "<!-- ".time()." -->"; | ||
| 394 : | } | ||
| 395 : | } | ||
| 396 : | elseif ($indextype == 2) { | ||
| 397 : | if ( $no_html == 0 ) { | ||
| 398 : | // needed to seperate the ISO number from the language file constant _ISO | ||
| 399 : | $iso = split( '=', _ISO ); | ||
| 400 : | // xml prolog | ||
| 401 : | echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; | ||
| 402 : | andphe | 815 | ?> |
| 403 : | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 404 : | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 405 : | <head> | ||
| 406 : | <link rel="stylesheet" href="templates/<?php echo $cur_template;?>/css/template_css.css" type="text/css" /> | ||
| 407 : | <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> | ||
| 408 : | <meta name="robots" content="noindex, nofollow"> | ||
| 409 : | </head> | ||
| 410 : | <body class="contentpane"> | ||
| 411 : | <?php mosMainBody(); ?> | ||
| 412 : | </body> | ||
| 413 : | </html> | ||
| 414 : | <?php | ||
| 415 : | csouza | 154 | } else { |
| 416 : | mosMainBody(); | ||
| 417 : | } | ||
| 418 : | } | ||
| 419 : | csouza | 129 | |
| 420 : | csouza | 154 | $configuration->doGzip(); |
| 421 : | csouza | 129 | } |
| 422 : | // displays queries performed for page | ||
| 423 : | counterpoi | 419 | t if ($configuration->get('mosConfig_debug') AND $adminside != 3) $database->displayLogged(); |
| 424 : | csouza | 129 | |
| 425 : | andphe | 815 | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

