Fixed bug #10597: Admin panel is not available anymore when extension fe_edit is...
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / index_ts.php
old mode 100755 (executable)
new mode 100644 (file)
index b5f50f2..11a5c32
@@ -111,7 +111,16 @@ if (!defined('PATH_tslib')) {
        define('PATH_tslib', t3lib_extMgm::extPath('cms').'tslib/');
 }
 
-require_once(PATH_t3lib.'class.t3lib_db.php');
+
+// *********************
+// Autoloader
+// *********************
+$TT->push('Register Autoloader', '');
+       require_once(PATH_t3lib . 'class.t3lib_autoloader.php');
+       t3lib_autoloader::registerAutoloader();
+$TT->pull();
+
+
 $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
 $TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
 
@@ -133,6 +142,17 @@ if (!get_magic_quotes_gpc())       {
 }
 
 
+// Hook to preprocess the current request:
+if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
+       foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
+               $hookParameters = array();
+               t3lib_div::callUserFunction($hookFunction, $hookParameters, $hookParameters);
+       }
+       unset($hookFunction);
+       unset($hookParameters);
+}
+
+
 // *********************
 // Look for extension ID which will launch alternative output engine
 // *********************
@@ -185,7 +205,7 @@ $TSFE->connectToDB();
 
        // In case of a keyword-authenticated preview, re-initialize the TSFE object:
 if ($temp_previewConfig = $TSFE->ADMCMD_preview())     {
-       $TSFE = new $temp_TSFEclassName(
+       $TSFE = t3lib_div::makeInstance('tslib_fe',
                $TYPO3_CONF_VARS,
                t3lib_div::_GP('id'),
                t3lib_div::_GP('type'),
@@ -315,15 +335,16 @@ $TT->push('Process ID','');
 $TT->pull();
 
 // *****************************************
-// Frontend editing
+// Admin Panel & Frontend editing
 // *****************************************
 if ($TSFE->beUserLogin) {
+       $BE_USER->initializeAdminPanel();
        $BE_USER->initializeFrontendEdit();
-       if ($BE_USER->frontendEdit instanceof t3lib_frontendedit) {
-               require_once(t3lib_extMgm::extPath('lang').'lang.php');
+       if ($BE_USER->adminPanel instanceof tslib_AdminPanel) {
                $LANG = t3lib_div::makeInstance('language');
                $LANG->init($BE_USER->uc['lang']);
-
+       }
+       if ($BE_USER->frontendEdit instanceof t3lib_frontendedit) {
                $BE_USER->frontendEdit->initConfigOptions();
        }
 }
@@ -518,8 +539,8 @@ $TSFE->previewInfo();
 // ******************
 // Publishing static
 // ******************
-if (is_object($BE_USER) && ($BE_USER->frontendEdit instanceof t3lib_frontendedit)) {
-       if ($BE_USER->frontendEdit->isAdminModuleEnabled('publish') && $BE_USER->frontendEdit->getExtPublishList()) {
+if (is_object($BE_USER) && ($BE_USER->adminPabel instanceof tslib_AdminPanel)) {
+       if ($BE_USER->adminPanel->isAdminModuleEnabled('publish') && $BE_USER->adminPanel->getExtPublishList()) {
                include_once(PATH_tslib.'publish.php');
        }
 }
@@ -546,8 +567,8 @@ echo $TSFE->beLoginLinkIPList();
 // *************
 // Admin panel
 // *************
-if (is_object($BE_USER) && $TSFE->beUserLogin && ($BE_USER->frontendEdit instanceof t3lib_frontendedit)) {
-       echo $BE_USER->frontendEdit->displayAdmin();
+if (is_object($BE_USER) && $TSFE->beUserLogin) {
+       echo $BE_USER->displayAdminPanel();
 }
 
 // *************