Added TSconfig option (options.overridePageModule) for replacing the default Page...
[Packages/TYPO3.CMS.git] / typo3 / alt_clickmenu.php
index 3865098..2d13b9e 100755 (executable)
@@ -585,6 +585,9 @@ class clickMenu {
         */
        function DB_edit($table,$uid)   {
                global $BE_USER;
+                       // If another module was specified, replace the default Page module with the new one
+               $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
+               $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
 
                $editOnClick='';
                $loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
@@ -593,14 +596,14 @@ class clickMenu {
                if (
                                $this->iParts[0]=='pages' && 
                                $this->iParts[1] && 
-                               $GLOBALS['BE_USER']->check('modules','web_layout')
+                               $GLOBALS['BE_USER']->check('modules', $pageModule)
                        )       {
                        $theIcon = t3lib_iconWorks::skinImg($this->backPath,'gfx/edit_page.gif','width="12" height="12"');
                        $this->editPageIconSet=1;
                        if ($BE_USER->uc['classicPageEditMode'] || !t3lib_extMgm::isLoaded('cms'))      {
                                $addParam='&editRegularContentFromId='.intval($this->iParts[1]);
                        } else {
-                               $editOnClick="top.fsMod.recentIds['web']=".intval($this->iParts[1]).";top.goToModule('web_layout',1);";
+                               $editOnClick="top.fsMod.recentIds['web']=".intval($this->iParts[1]).";top.goToModule('".$pageModule."',1);";
                        }
                }
                if (!$editOnClick)      {
@@ -1131,10 +1134,9 @@ class SC_alt_clickmenu {
                // Internal:
        var $content='';                                // Content accumulation
        var $doc;                                               // Template object 
-       var $includeOnce=array();               // Files to include_once() - set in init() function
+       var $include_once=array();              // Files to include_once() - set in init() function
        var $extClassArray=array();             // Internal array of classes for extending the clickmenu
        var $dontDisplayTopFrameCM=0;   // If set, then the clickmenu will NOT display in the top frame.
-       var $backPath='';
 
        /**
         * Constructor function for script class.
@@ -1152,8 +1154,8 @@ class SC_alt_clickmenu {
                $this->MCONF['name']='xMOD_alt_clickmenu.php';
 
                        // Takes the backPath as a parameter BUT since we are worried about someone forging a backPath (XSS security hole) we will check with sent md5 hash:
-               $inputBP = explode('|',t3lib_div::GPvar('backPath'));
-               if (count($inputBP)==2 && $inputBP[1]==md5($inputBP[0].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
+               $inputBP = explode('|',$this->backPath);
+               if (count($inputBP)==2 && $inputBP[1]==t3lib_div::shortMD5($inputBP[0].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
                        $this->backPath = $inputBP[0];
                } else {
                        $this->backPath = $BACK_PATH;
@@ -1298,8 +1300,7 @@ $SOBE = t3lib_div::makeInstance('SC_alt_clickmenu');
 $SOBE->init();
 
 // Include files?
-reset($SOBE->includeOnce);     
-while(list(,$INC_FILE)=each($SOBE->includeOnce))       {include_once($INC_FILE);}
+foreach($SOBE->include_once as $INC_FILE)      include_once($INC_FILE);
 
 $SOBE->main();
 $SOBE->printContent();