[TASK] Merge extra_page_cm_options into backend 65/32665/4
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 9 Sep 2014 07:17:43 +0000 (09:17 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Wed, 10 Sep 2014 08:25:42 +0000 (10:25 +0200)
Move the lines of the hook of extra_page_cm_options into EXT:backend
to cleanup up the core.

Resolves: #55136
Releases: 6.3
Change-Id: I318888775f4ec02caec6b0cb35f1e461f748224d
Reviewed-on: http://review.typo3.org/32665
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
composer.json
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/extra_page_cm_options/Classes/ExtraPageContextMenuOptions.php [deleted file]
typo3/sysext/extra_page_cm_options/Migrations/Code/ClassAliasMap.php [deleted file]
typo3/sysext/extra_page_cm_options/composer.json [deleted file]
typo3/sysext/extra_page_cm_options/ext_emconf.php [deleted file]
typo3/sysext/extra_page_cm_options/ext_icon.gif [deleted file]
typo3/sysext/extra_page_cm_options/ext_tables.php [deleted file]
typo3/sysext/extra_page_cm_options/locallang.xlf [deleted file]
typo3/sysext/impexp/locallang_csh.xlf
typo3/sysext/lang/locallang_core.xlf

index 2586420..f54c3a3 100644 (file)
@@ -69,7 +69,6 @@
                "typo3/cms-documentation": "self.version",
                "typo3/cms-extbase": "self.version",
                "typo3/cms-extensionmanager": "self.version",
-               "typo3/cms-extra-page-cm-options": "self.version",
                "typo3/cms-feedit": "self.version",
                "typo3/cms-felogin": "self.version",
                "typo3/cms-filelist": "self.version",
index 6d5705a..e663add 100644 (file)
@@ -275,6 +275,99 @@ class ClickMenu {
                                        $menuItems['pasteafter'] = $this->DB_paste($table, -$uid, 'after', $elInfo);
                                }
                        }
+                       $subname = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('subname');
+                       $localItems = array();
+                       if (!$this->cmLevel && !in_array('moreoptions', $this->disabledItems, TRUE)) {
+                               // Creating menu items here:
+                               if ($this->editOK) {
+                                       $localItems[] = 'spacer';
+                                       $localItems['moreoptions'] = $this->linkItem(
+                                               $this->label('more'),
+                                               $this->excludeIcon(''),
+                                               'top.loadTopMenu(\'' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript() . '&cmLevel=1&subname=moreoptions\');return false;',
+                                               FALSE,
+                                               TRUE
+                                       );
+                                       $menuItemHideUnhideAllowed = FALSE;
+                                       $hiddenField = '';
+                                       // Check if column for disabled is defined
+                                       if (isset($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'])) {
+                                               $hiddenField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
+                                               if (
+                                                       $hiddenField !== '' && !empty($GLOBALS['TCA'][$table]['columns'][$hiddenField]['exclude']
+                                                       && $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $hiddenField))
+                                               ) {
+                                                       $menuItemHideUnhideAllowed = TRUE;
+                                               }
+                                       }
+                                       if ($menuItemHideUnhideAllowed && !in_array('hide', $this->disabledItems, TRUE)) {
+                                               $localItems['hide'] = $this->DB_hideUnhide($table, $this->rec, $hiddenField);
+                                       }
+                                       $anyEnableColumnsFieldAllowed = FALSE;
+                                       // Check if columns are defined
+                                       if (isset($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
+                                               $columnsToCheck = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns'];
+                                               if ($table === 'pages' && !empty($columnsToCheck)) {
+                                                       $columnsToCheck[] = 'extendToSubpages';
+                                               }
+                                               foreach ($columnsToCheck as $currentColumn) {
+                                                       if (
+                                                               !empty($GLOBALS['TCA'][$table]['columns'][$currentColumn]['exclude'])
+                                                               && $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $currentColumn)
+                                                       ) {
+                                                               $anyEnableColumnsFieldAllowed = TRUE;
+                                                       }
+                                               }
+                                       }
+                                       if ($anyEnableColumnsFieldAllowed && !in_array('edit_access', $this->disabledItems, TRUE)) {
+                                               $localItems['edit_access'] = $this->DB_editAccess($table, $uid);
+                                       }
+                                       if ($table === 'pages' && $this->editPageIconSet && !in_array('edit_pageproperties', $this->disabledItems, TRUE)) {
+                                               $localItems['edit_pageproperties'] = $this->DB_editPageProperties($uid);
+                                       }
+                               }
+                               // Find delete element among the input menu items and insert the local items just before that:
+                               $c = 0;
+                               $deleteFound = FALSE;
+                               foreach ($menuItems as $key => $value) {
+                                       $c++;
+                                       if ($key === 'delete') {
+                                               $deleteFound = TRUE;
+                                               break;
+                                       }
+                               }
+                               if ($deleteFound) {
+                                       // .. subtract two... (delete item + its spacer element...)
+                                       $c -= 2;
+                                       // and insert the items just before the delete element.
+                                       array_splice($menuItems, $c, 0, $localItems);
+                               } else {
+                                       $menuItems = array_merge($menuItems, $localItems);
+                               }
+                       } elseif ($subname === 'moreoptions') {
+                               // If the page can be edited, then show this:
+                               if ($this->editOK) {
+                                       if (($table === 'pages' || $table === 'tt_content') && !in_array('move_wizard', $this->disabledItems, TRUE)) {
+                                               $localItems['move_wizard'] = $this->DB_moveWizard($table, $uid, $this->rec);
+                                       }
+                                       if (($table === 'pages' || $table === 'tt_content') && !in_array('new_wizard', $this->disabledItems, TRUE)) {
+                                               $localItems['new_wizard'] = $this->DB_newWizard($table, $uid, $this->rec);
+                                       }
+                                       if ($table === 'pages' && !in_array('perms', $this->disabledItems, TRUE) && $GLOBALS['BE_USER']->check('modules', 'web_perm')) {
+                                               $localItems['perms'] = $this->DB_perms($table, $uid, $this->rec);
+                                       }
+                                       if (!in_array('db_list', $this->disabledItems, TRUE) && $GLOBALS['BE_USER']->check('modules', 'web_list')) {
+                                               $localItems['db_list'] = $this->DB_db_list($table, $uid, $this->rec);
+                                       }
+                               }
+                               // Temporary mount point item:
+                               if ($table === 'pages') {
+                                       $localItems['temp_mount_point'] = $this->DB_tempMountPoint($uid);
+                               }
+                               // Merge the locally created items into the current menu items passed to this function.
+                               $menuItems = array_merge($menuItems, $localItems);
+                       }
+
                        // Delete:
                        $elInfo = array(GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, $this->rec), $GLOBALS['BE_USER']->uc['titleLen']));
                        if (!in_array('delete', $this->disabledItems) && !$root && !$DBmount && $GLOBALS['BE_USER']->isPSet($lCP, $table, 'delete')) {
diff --git a/typo3/sysext/extra_page_cm_options/Classes/ExtraPageContextMenuOptions.php b/typo3/sysext/extra_page_cm_options/Classes/ExtraPageContextMenuOptions.php
deleted file mode 100644 (file)
index f526992..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-namespace TYPO3\CMS\ExtraPageCmOptions;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Class to add extra context menu options
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class ExtraPageContextMenuOptions {
-
-       /**
-        * Adding various standard options to the context menu.
-        * This includes both first and second level.
-        *
-        * @param object $backRef The calling object. Value by reference.
-        * @param array $menuItems Array with the currently collected menu items to show.
-        * @param string $table Table name of clicked item.
-        * @param integer $uid UID of clicked item.
-        * @return array Modified $menuItems array
-        */
-       public function main(&$backRef, $menuItems, $table, $uid) {
-               // Accumulation of local items.
-               $localItems = array();
-               $subname = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('subname');
-               // Detecting menu level
-               // LEVEL: Primary menu.
-               if (!in_array('moreoptions', $backRef->disabledItems) && !$backRef->cmLevel) {
-                       // Creating menu items here:
-                       if ($backRef->editOK) {
-                               $localLanguage = $GLOBALS['LANG']->includeLLFile('EXT:extra_page_cm_options/locallang.xlf', FALSE);
-                               $localItems[] = 'spacer';
-                               $localItems['moreoptions'] = $backRef->linkItem(
-                                       $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('label', $localLanguage)),
-                                       $backRef->excludeIcon(''),
-                                       'top.loadTopMenu(\'' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript() . '&cmLevel=1&subname=moreoptions\');return false;',
-                                       0,
-                                       1
-                               );
-                               $menuItemHideUnhideAllowed = FALSE;
-                               $hiddenField = '';
-                               // Check if column for disabled is defined
-                               if (isset($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']) && isset($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'])) {
-                                       $hiddenField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
-                                       if (
-                                               $hiddenField !== '' && !empty($GLOBALS['TCA'][$table]['columns'][$hiddenField])
-                                               && (!empty($GLOBALS['TCA'][$table]['columns'][$hiddenField]['exclude'])
-                                                       && $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $hiddenField))
-                                       ) {
-                                               $menuItemHideUnhideAllowed = TRUE;
-                                       }
-                               }
-                               if ($menuItemHideUnhideAllowed && !in_array('hide', $backRef->disabledItems)) {
-                                       $localItems['hide'] = $backRef->DB_hideUnhide($table, $backRef->rec, $hiddenField);
-                               }
-                               $anyEnableColumnsFieldAllowed = FALSE;
-                               // Check if columns are defined
-                               if (isset($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
-                                       $columnsToCheck = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns'];
-                                       if ($table === 'pages' && !empty($columnsToCheck)) {
-                                               $columnsToCheck[] = 'extendToSubpages';
-                                       }
-                                       foreach ($columnsToCheck as $currentColumn) {
-                                               if (
-                                                       isset($GLOBALS['TCA'][$table]['columns'][$currentColumn])
-                                                       && (!empty($GLOBALS['TCA'][$table]['columns'][$currentColumn]['exclude'])
-                                                               && $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $currentColumn))
-                                               ) {
-                                                       $anyEnableColumnsFieldAllowed = TRUE;
-                                               }
-                                       }
-                               }
-                               if ($anyEnableColumnsFieldAllowed && !in_array('edit_access', $backRef->disabledItems)) {
-                                       $localItems['edit_access'] = $backRef->DB_editAccess($table, $uid);
-                               }
-                               if ($table === 'pages' && $backRef->editPageIconSet && !in_array('edit_pageproperties', $backRef->disabledItems)) {
-                                       $localItems['edit_pageproperties'] = $backRef->DB_editPageProperties($uid);
-                               }
-                       }
-                       // Find delete element among the input menu items and insert the local items just before that:
-                       $c = 0;
-                       $deleteFound = FALSE;
-                       foreach ($menuItems as $key => $value) {
-                               $c++;
-                               if ($key === 'delete') {
-                                       $deleteFound = TRUE;
-                                       break;
-                               }
-                       }
-                       if ($deleteFound) {
-                               // .. subtract two... (delete item + its spacer element...)
-                               $c -= 2;
-                               // and insert the items just before the delete element.
-                               array_splice($menuItems, $c, 0, $localItems);
-                       } else {
-                               $menuItems = array_merge($menuItems, $localItems);
-                       }
-               } elseif ($subname === 'moreoptions') {
-                       // If the page can be edited, then show this:
-                       if ($backRef->editOK) {
-                               if (($table === 'pages' || $table === 'tt_content') && !in_array('move_wizard', $backRef->disabledItems)) {
-                                       $localItems['move_wizard'] = $backRef->DB_moveWizard($table, $uid, $backRef->rec);
-                               }
-                               if (($table === 'pages' || $table === 'tt_content') && !in_array('new_wizard', $backRef->disabledItems)) {
-                                       $localItems['new_wizard'] = $backRef->DB_newWizard($table, $uid, $backRef->rec);
-                               }
-                               if ($table === 'pages' && !in_array('perms', $backRef->disabledItems) && $GLOBALS['BE_USER']->check('modules', 'web_perm')) {
-                                       $localItems['perms'] = $backRef->DB_perms($table, $uid, $backRef->rec);
-                               }
-                               if (!in_array('db_list', $backRef->disabledItems) && $GLOBALS['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['temp_mount_point'] = $backRef->DB_tempMountPoint($uid);
-                       }
-                       // Merge the locally made items into the current menu items passed to this function.
-                       $menuItems = array_merge($menuItems, $localItems);
-               }
-               return $menuItems;
-       }
-
-}
diff --git a/typo3/sysext/extra_page_cm_options/Migrations/Code/ClassAliasMap.php b/typo3/sysext/extra_page_cm_options/Migrations/Code/ClassAliasMap.php
deleted file mode 100644 (file)
index 41810fa..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-return array(
-       'tx_extrapagecmoptions' => 'TYPO3\\CMS\\ExtraPageCmOptions\\ExtraPageContextMenuOptions',
-);
diff --git a/typo3/sysext/extra_page_cm_options/composer.json b/typo3/sysext/extra_page_cm_options/composer.json
deleted file mode 100644 (file)
index 1518ed0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-       "name": "typo3/cms-extra-page-cm-options",
-       "type": "typo3-cms-framework",
-       "description": "TYPO3 Core",
-       "homepage": "http://typo3.org",
-       "license": ["GPL-2.0+"],
-       "version": "6.3.0",
-
-       "require": {
-               "typo3/cms-core": "*"
-       },
-       "replace": {
-               "extra_page_cm_options": "*"
-       },
-       "extra": {
-               "typo3/cms": {
-                       "Package": {
-                               "partOfFactoryDefault": true
-                       }
-               }
-       }
-}
diff --git a/typo3/sysext/extra_page_cm_options/ext_emconf.php b/typo3/sysext/extra_page_cm_options/ext_emconf.php
deleted file mode 100644 (file)
index 4ed0dc8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-$EM_CONF[$_EXTKEY] = array(
-       'title' => 'Extra Click Menu Options',
-       'description' => 'Adds a submenu with extra options for page and tt_content click-menus.',
-       'category' => 'be',
-       'state' => 'stable',
-       'uploadfolder' => 0,
-       'createDirs' => '',
-       'clearCacheOnLoad' => 0,
-       'author' => 'Kasper Skaarhoj',
-       'author_email' => 'kasperYYYY@typo3.com',
-       'author_company' => 'Curby Soft Multimedia',
-       'version' => '6.3.0',
-       '_md5_values_when_last_written' => '',
-       'constraints' => array(
-               'depends' => array(
-                       'typo3' => '6.3.0-6.3.99',
-               ),
-               'conflicts' => array(),
-               'suggests' => array(),
-       ),
-);
diff --git a/typo3/sysext/extra_page_cm_options/ext_icon.gif b/typo3/sysext/extra_page_cm_options/ext_icon.gif
deleted file mode 100644 (file)
index 338c9f0..0000000
Binary files a/typo3/sysext/extra_page_cm_options/ext_icon.gif and /dev/null differ
diff --git a/typo3/sysext/extra_page_cm_options/ext_tables.php b/typo3/sysext/extra_page_cm_options/ext_tables.php
deleted file mode 100644 (file)
index 46e4ca3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-if (TYPO3_MODE === 'BE') {
-       $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][] = array(
-               'name' => 'TYPO3\\CMS\\ExtraPageCmOptions\\ExtraPageContextMenuOptions',
-       );
-}
diff --git a/typo3/sysext/extra_page_cm_options/locallang.xlf b/typo3/sysext/extra_page_cm_options/locallang.xlf
deleted file mode 100644 (file)
index 0e55fc6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0">
-       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="extra_page_cm_options">
-               <header/>
-               <body>
-                       <trans-unit id="label" xml:space="preserve">
-                               <source>More options...</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
\ No newline at end of file
index ce75fdf..d9f3e67 100644 (file)
@@ -20,7 +20,7 @@
                                <source>Exporting records from TYPO3</source>
                        </trans-unit>
                        <trans-unit id="export.description" xml:space="preserve">
-                               <source>To export TYPO3 T3D/XML files you click any record icon or page in the page tree (including the root page!), select "More options" (requires the extensions "extra_page_cm_options" to be installed) and then "Export to .t3d". This will bring up the export interface where you can configure options for your export session.</source>
+                               <source>To export TYPO3 T3D/XML files you click any record icon or page in the page tree (including the root page!), select "More options" and then "Export to .t3d". This will bring up the export interface where you can configure options for your export session.</source>
                        </trans-unit>
                        <trans-unit id="export.details" xml:space="preserve">
                                <source>There are a number of methods by which you can export data from TYPO3:
@@ -271,7 +271,7 @@ Entering a file name to save to makes it possible to write your export directly
                                <source>Importing TYPO3 records</source>
                        </trans-unit>
                        <trans-unit id="import.description" xml:space="preserve">
-                               <source>To import TYPO3 T3D/XML files into the page tree you click any page in the page tree (including the root page!), select "More options" (requires the extensions "extra_page_cm_options" to be installed) and then "Import from .t3d". This will bring up the import interface where you can select a file to import or upload a new one.</source>
+                               <source>To import TYPO3 T3D/XML files into the page tree you click any page in the page tree (including the root page!), select "More options" and then "Import from .t3d". This will bring up the import interface where you can select a file to import or upload a new one.</source>
                        </trans-unit>
                        <trans-unit id="import.details" xml:space="preserve">
                                <source>&lt;b&gt;Tip: Import into a Sys Folder&lt;/b&gt;
index b829008..ce1c032 100644 (file)
@@ -877,6 +877,9 @@ Would you like to save now in order to refresh the display?</source>
                        <trans-unit id="cm.expandBranch" xml:space="preserve">
                                <source>Expand Branch</source>
                        </trans-unit>
+                       <trans-unit id="cm.more" xml:space="preserve">
+                               <source>More options...</source>
+                       </trans-unit>
                        <trans-unit id="tree.defaultPageTitle" xml:space="preserve">
                                <source>[Default Title]</source>
                        </trans-unit>