Source for file index2.php

Documentation is available at index2.php

  1. <?php
  2. /**
  3. * @version $Id: index2.php 323 2005-10-02 14:37:07Z stingrey $
  4. * @package Joomla
  5. * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
  7. * Joomla! is free software. This version may have been modified pursuant
  8. * to the GNU General Public License, and as distributed it includes or
  9. * is derivative of works licensed under the GNU General Public License or
  10. * other free or open source software licenses.
  11. * See COPYRIGHT.php for copyright notices and details.
  12. */
  13.  
  14. // Set flag that this is a parent file
  15. define( '_VALID_MOS', 1 );
  16.  
  17. include_once( 'globals.php' );
  18. require_once( 'configuration.php' );
  19. require_once( 'includes/joomla.php' );
  20.  
  21. // displays offline/maintanance page or bar
  22. if ($mosConfig_offline == 1) {
  23. require( 'offline.php' );
  24. }
  25.  
  26. // load system bot group
  27. $_MAMBOTS->loadBotGroup( 'system' );
  28.  
  29. // trigger the onStart events
  30. $_MAMBOTS->trigger( 'onStart' );
  31.  
  32. if (file_exists( 'components/com_sef/sef.php' )) {
  33. require_once( 'components/com_sef/sef.php' );
  34. } else {
  35. require_once( 'includes/sef.php' );
  36. }
  37. require_once( 'includes/frontend.php' );
  38.  
  39. // retrieve some expected url (or form) arguments
  40. $option = strtolower( mosGetParam( $_REQUEST, 'option' ) );
  41. $Itemid = strtolower( mosGetParam( $_REQUEST, 'Itemid',0 ) );
  42. $no_html = intval( mosGetParam( $_REQUEST, 'no_html', 0 ) );
  43. $act = mosGetParam( $_REQUEST, 'act', '' );
  44. $do_pdf = intval( mosGetParam( $_REQUEST, 'do_pdf', 0 ) );
  45.  
  46. // mainframe is an API workhorse, lots of 'core' interaction routines
  47. $mainframe = new mosMainFrame( $database, $option, '.' );
  48. $mainframe->initSession();
  49.  
  50. // trigger the onAfterStart events
  51. $_MAMBOTS->trigger( 'onAfterStart' );
  52.  
  53. // get the information about the current user from the sessions table
  54. $my = $mainframe->getUser();
  55. // patch to lessen the impact on templates
  56. if ($option == 'search') {
  57. $option = 'com_search';
  58. }
  59.  
  60. // loads english language file by default
  61. if ($mosConfig_lang=='') {
  62. $mosConfig_lang = 'english';
  63. }
  64. include_once( 'language/' . $mosConfig_lang . '.php' );
  65.  
  66.  
  67. if ($option == 'login') {
  68. $mainframe->login();
  69. mosRedirect('index.php');
  70. } else if ($option == 'logout') {
  71. $mainframe->logout();
  72. mosRedirect( 'index.php' );
  73. }
  74.  
  75. if ( $do_pdf == 1 ){
  76. include ('includes/pdf.php');
  77. exit();
  78. }
  79.  
  80.  
  81. // detect first visit
  82. $mainframe->detect();
  83.  
  84. $gid = intval( $my->gid );
  85.  
  86. $cur_template = $mainframe->getTemplate();
  87.  
  88. // precapture the output of the component
  89. require_once( $mosConfig_absolute_path . '/editor/editor.php' );
  90.  
  91. ob_start();
  92. if ($path = $mainframe->getPath( 'front' )) {
  93. $task = mosGetParam( $_REQUEST, 'task', '' );
  94. $ret = mosMenuCheck( $Itemid, $option, $task, $gid );
  95. if ($ret) {
  96. require_once( $path );
  97. } else {
  98. mosNotAuth();
  99. }
  100. } else {
  101. echo _NOT_EXIST;
  102. }
  103. $_MOS_OPTION['buffer'] = ob_get_contents();
  104. ob_end_clean();
  105.  
  106. initGzip();
  107.  
  108. header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
  109. header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
  110. header( 'Cache-Control: no-store, no-cache, must-revalidate' );
  111. header( 'Cache-Control: post-check=0, pre-check=0', false );
  112. header( 'Pragma: no-cache' );
  113.  
  114. // display the offline alert if an admin is logged in
  115. if (defined( '_ADMIN_OFFLINE' )) {
  116. include( 'offlinebar.php' );
  117. }
  118.  
  119. // start basic HTML
  120. if ( $no_html == 0 ) {
  121. // needed to seperate the ISO number from the language file constant _ISO
  122. $iso = split( '=', _ISO );
  123. // xml prolog
  124. echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
  125. ?>
  126. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  127. <html xmlns="http://www.w3.org/1999/xhtml">
  128. <head>
  129. <link rel="stylesheet" href="templates/<?php echo $cur_template;?>/css/template_css.css" type="text/css" />
  130. <link rel="shortcut icon" href="<?php echo $mosConfig_live_site; ?>/images/favicon.ico" />
  131. <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
  132. <meta name="robots" content="noindex, nofollow">
  133. </head>
  134. <body class="contentpane">
  135. <?php mosMainBody(); ?>
  136. </body>
  137. </html>
  138. <?php
  139. } else {
  140. mosMainBody();
  141. }
  142. doGzip();
  143. ?>

Documentation generated on Mon, 24 Oct 2005 12:21:05 +0800 by phpDocumentor 1.3.0RC3