[BUGFIX] Add stdWrap for excludeUidList for HMENU.
[Packages/TYPO3.CMS.git] / typo3 / sysext / extra_page_cm_options / class.tx_extrapagecmoptions.php
index 90a9ec7..fdd4277 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -28,9 +28,9 @@
  * Class, adding extra context menu options
  *
  * $Id$
- * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -39,7 +39,7 @@
  *
  *   67: class tx_extrapagecmoptions
  *   79:     function main(&$backRef,$menuItems,$table,$uid)
- *  159:     function includeLL()
+ *  158:     function includeLL()
  *
  * TOTAL FUNCTIONS: 2
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -60,7 +60,7 @@
 /**
  * Class, adding extra context menu options
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tx_extrapagecmoptions
  */
@@ -83,8 +83,8 @@ class tx_extrapagecmoptions {
                $subname = t3lib_div::_GP('subname');
 
                        // Detecting menu level
-               if (!$backRef->cmLevel) {       // LEVEL: Primary menu.
-
+               // LEVEL: Primary menu.
+               if (!in_array('moreoptions', $backRef->disabledItems) && !$backRef->cmLevel) {
                                // Creating menu items here:
                        if ($backRef->editOK)   {
                                $LL = $this->includeLL();
@@ -102,15 +102,14 @@ class tx_extrapagecmoptions {
                                                $localItems['hide'] = $backRef->DB_hideUnhide($table,$backRef->rec,$TCA[$table]['ctrl']['enablecolumns']['disabled']);
                                if (!in_array('edit_access',$backRef->disabledItems) && is_array($TCA[$table]['ctrl']['enablecolumns']))
                                                $localItems['edit_access'] = $backRef->DB_editAccess($table,$uid);
-                               if (!in_array('edit_pageheader',$backRef->disabledItems) && $table=='pages' && $backRef->editPageIconSet)
-                                               $localItems['edit_pageheader'] = $backRef->DB_editPageHeader($uid);
+                               if (!in_array('edit_pageproperties',$backRef->disabledItems) && $table=='pages' && $backRef->editPageIconSet)
+                                               $localItems['edit_pageproperties'] = $backRef->DB_editPageProperties($uid);
                        }
 
                                // Find delete element among the input menu items and insert the local items just before that:
-                       reset($menuItems);
                        $c=0;
                        $deleteFound = FALSE;
-                       while(list($k)=each($menuItems))        {
+                       foreach ($menuItems as $k => $value) {
                                $c++;
                                if (!strcmp($k,'delete'))       {
                                        $deleteFound = TRUE;
@@ -135,14 +134,13 @@ class tx_extrapagecmoptions {
                        if ($backRef->editOK)   {       // If the page can be edited, then show this:
                                if (!in_array('move_wizard',$backRef->disabledItems) && ($table=='pages' || $table=='tt_content'))      $localItems['move_wizard']=$backRef->DB_moveWizard($table,$uid,$backRef->rec);
                                if (!in_array('new_wizard',$backRef->disabledItems) && ($table=='pages' || $table=='tt_content'))       $localItems['new_wizard']=$backRef->DB_newWizard($table,$uid,$backRef->rec);
-                               if (!in_array('history',$backRef->disabledItems))       $localItems['history']=$backRef->DB_history($table,$uid);
                                if (!in_array('perms',$backRef->disabledItems) && $table=='pages' && $BE_USER->check('modules','web_perm'))     $localItems['perms']=$backRef->DB_perms($table,$uid,$backRef->rec);
                                if (!in_array('db_list',$backRef->disabledItems) && $BE_USER->check('modules','web_list'))      $localItems['db_list']=$backRef->DB_db_list($table,$uid,$backRef->rec);
                        }
 
                                // Temporary mount point item:
                        if ($table=='pages')    {
-                               $localItems['perms'] = $backRef->DB_tempMountPoint($uid);
+                               $localItems['temp_mount_point'] = $backRef->DB_tempMountPoint($uid);
                        }
 
                                // Merge the locally made items into the current menu items passed to this function.
@@ -164,7 +162,8 @@ class tx_extrapagecmoptions {
        }
 }
 
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/extra_page_cm_options/class.tx_extrapagecmoptions.php'])      {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/extra_page_cm_options/class.tx_extrapagecmoptions.php']);
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/extra_page_cm_options/class.tx_extrapagecmoptions.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/extra_page_cm_options/class.tx_extrapagecmoptions.php']);
 }
-?>
+
+?>
\ No newline at end of file