[BUGFIX] Add stdWrap for excludeUidList for HMENU.
[Packages/TYPO3.CMS.git] / typo3 / sysext / extra_page_cm_options / class.tx_extrapagecmoptions.php
index 2a8f5c8..fdd4277 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2008 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]
@@ -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();
@@ -107,10 +107,9 @@ class tx_extrapagecmoptions {
                        }
 
                                // 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;
@@ -141,7 +140,7 @@ class tx_extrapagecmoptions {
 
                                // 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.
@@ -163,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