[!!!][TASK] Drop disableBigButtons in page module 63/41063/8
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 9 Jul 2015 20:31:05 +0000 (22:31 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 9 Jul 2015 22:09:59 +0000 (00:09 +0200)
Disabling the by default enabled disableBigButtons TSconfig option
disables the option_showBigButtons property of PageLayoutView, so
some funny buttons in page module top bar and some misplaced buttons
to edit rte elements are enabled.

Easy, isn't it?!

This option is dropped now.

Resolves: #68020
Releases: master
Change-Id: Ifea0cebac3a4f1e5c23a54e2acb5aba26a83998d
Reviewed-on: http://review.typo3.org/41063
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-68020-DroppedDisableBigButtons.rst [new file with mode: 0644]
typo3/sysext/t3editor/res/jslib/parse_typoscript/tokenizetyposcript.js

index 5138f50..0e5f064 100644 (file)
@@ -957,7 +957,6 @@ class PageLayoutController {
                $dbList->agePrefixes = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears');
                $dbList->id = $this->id;
                $dbList->nextThree = MathUtility::forceIntegerInRange($this->modTSconfig['properties']['editFieldsAtATime'], 0, 10);
-               $dbList->option_showBigButtons = $this->modTSconfig['properties']['disableBigButtons'] === '0';
                $dbList->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
                $dbList->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0;
                if (!$dbList->nextThree) {
index 1f02989..7c8ad4a 100644 (file)
@@ -53,13 +53,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public $pages_noEditColumns = 0;
 
        /**
-        * If TRUE, shows big buttons for editing page properties, moving, creating elements etc. in the columns view.
-        *
-        * @var int
-        */
-       public $option_showBigButtons = 1;
-
-       /**
         * If TRUE, new-wizards are linked to rather than the regular new-element list.
         *
         * @var int
@@ -162,13 +155,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public $itemLabels = array();
 
        /**
-        * Used to store the RTE setup of a particular page
-        *
-        * @var array
-        */
-       protected $rteSetup = array();
-
-       /**
         * @var \TYPO3\CMS\Backend\Clipboard\Clipboard
         */
        protected $clipboard;
@@ -388,9 +374,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public function getTable_tt_content($id) {
                $this->initializeLanguages();
                $this->initializeClipboard();
-               // Initialize:
-               $RTE = $this->getBackendUser()->isRTE();
-               $lMarg = 1;
                $pageTitleParamForAltDoc = '&recTitle=' . rawurlencode(BackendUtility::getRecordTitle('pages', BackendUtility::getRecordWSOL('pages', $id), TRUE));
                /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
                $pageRenderer = $this->getPageLayoutController()->doc->getPageRenderer();
@@ -499,9 +482,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                        TRUE,
                                                        !$this->tt_contentConfig['languageMode']
                                                );
-                                               $isRTE = $RTE && $this->isRTEforField('tt_content', $row, 'bodytext');
                                                $innerContent = '<div ' . ($row['_ORIG_uid'] ? ' class="ver-element"' : '') . '>'
-                                                       . $this->tt_content_drawItem($row, $isRTE) . '</div>';
+                                                       . $this->tt_content_drawItem($row) . '</div>';
                                                $singleElementHTML .= '<div class="t3-page-ce-body-inner">' . $innerContent . '</div>'
                                                        . $this->tt_content_drawFooter($row);
                                                $isDisabled = $this->isDisabled('tt_content', $row);
@@ -735,68 +717,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        $out .= BackendUtility::cshItem($this->descrTable, 'language_list');
                }
 
-               // Add the big buttons to page:
-               if ($this->option_showBigButtons) {
-                       $bArray = array();
-                       if (!$this->getPageLayoutController()->current_sys_language) {
-                               if ($this->ext_CALC_PERMS & Permission::PAGE_EDIT) {
-                                       $bArray[0] = $this->getPageLayoutController()->doc->t3Button(
-                                               BackendUtility::editOnClick('&edit[pages][' . $id . ']=edit'),
-                                               $this->getLanguageService()->getLL('editPageProperties')
-                                       );
-                               }
-                       } else {
-                               if ($this->doEdit && $this->getBackendUser()->check('tables_modify', 'pages_language_overlay')) {
-                                       list($languageOverlayRecord) = BackendUtility::getRecordsByField(
-                                               'pages_language_overlay',
-                                               'pid',
-                                               $id,
-                                               'AND sys_language_uid=' . (int)$this->getPageLayoutController()->current_sys_language
-                                       );
-                                       $bArray[0] = $this->getPageLayoutController()->doc->t3Button(
-                                               BackendUtility::editOnClick('&edit[pages_language_overlay][' . $languageOverlayRecord['uid'] . ']=edit'),
-                                               $this->getLanguageService()->getLL('editPageProperties_curLang')
-                                       );
-                               }
-                       }
-                       if ($this->ext_CALC_PERMS & Permission::PAGE_DELETE || $this->ext_CALC_PERMS & Permission::PAGE_EDIT) {
-                               $bArray[1] = $this->getPageLayoutController()->doc->t3Button(
-                                       'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')])) . ';',
-                                       $this->getLanguageService()->getLL('move_page')
-                               );
-                       }
-                       if ($this->ext_CALC_PERMS & Permission::PAGE_NEW) {
-                               $parameters = [
-                                       'id' => $id,
-                                       'pagesOnly' => 1,
-                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                               ];
-                               $bArray[2] = $this->getPageLayoutController()->doc->t3Button(
-                                       'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', $parameters)) . ';',
-                                       $this->getLanguageService()->getLL('newPage2')
-                               );
-                       }
-                       if ($this->doEdit && $this->ext_function == 1) {
-                               $bArray[3] = $this->getPageLayoutController()->doc->t3Button(
-                                       'window.location.href='
-                                               . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('new_content_element') . '&id=' . $id
-                                               . '&sys_language_uid=' . $this->getPageLayoutController()->current_sys_language
-                                               . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . ';',
-                                       $this->getLanguageService()->getLL('newPageContent2')
-                               );
-                       }
-                       $out = '
-                               <table border="0" cellpadding="4" cellspacing="0" class="typo3-page-buttons">
-                                       <tr>
-                                               <td>' . implode('</td>
-                                               <td>', $bArray) . '</td>
-                                               <td>' . BackendUtility::cshItem($this->descrTable, 'button_panel') . '</td>
-                                       </tr>
-                               </table>
-                               <br />
-                               ' . $out;
-               }
-               // Return content:
                return $out;
        }
 
@@ -1160,6 +1080,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         *
         * @param array $row Record array
         * @return string HTML of the footer
+        * @throws \UnexpectedValueException
         */
        protected function tt_content_drawFooter(array $row) {
                $content = '';
@@ -1314,12 +1235,11 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        /**
         * Draws the preview content for a content element
         *
-        * @param string $row Content element
-        * @param bool $isRTE Set if the RTE link can be created.
+        * @param array $row Content element
         * @return string HTML
         * @throws \UnexpectedValueException
         */
-       public function tt_content_drawItem($row, $isRTE = FALSE) {
+       public function tt_content_drawItem($row) {
                $out = '';
                $outHeader = '';
                // Make header:
@@ -1473,10 +1393,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        <span class="exampleContent">' . $out . '</span>';
                // Add header:
                $out = $outHeader . $out;
-               // Add RTE button:
-               if ($isRTE) {
-                       $out .= $this->linkRTEbutton($row);
-               }
                // Return values:
                if ($this->isDisabled('tt_content', $row)) {
                        return '<span class="text-muted">' . $out . '</span>';
@@ -1609,26 +1525,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        }
 
        /**
-        * Adds a button to edit the row in RTE wizard
-        *
-        * @param array $row The row of tt_content element
-        * @return string Button to click if you want to edit in RTE wizard.
-        */
-       public function linkRTEbutton($row) {
-               $params = array();
-               $params['table'] = 'tt_content';
-               $params['uid'] = $row['uid'];
-               $params['pid'] = $row['pid'];
-               $params['field'] = 'bodytext';
-               $params['returnUrl'] = GeneralUtility::linkThisScript();
-               $RTEonClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_rte', array('P' => $params))) . ';return false;';
-               $addButton = $this->option_showBigButtons && $this->doEdit
-                       ? $this->getPageLayoutController()->doc->t3Button($RTEonClick, $this->getLanguageService()->getLL('editInRTE'))
-                       : '';
-               return $addButton;
-       }
-
-       /**
         * Make selector box for creating new translation in a language
         * Displays only languages which are not yet present for the current page and
         * that are not disabled with page TS.
@@ -1920,64 +1816,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                return $allowedTableNames;
        }
 
-       /**
-        * Checking if the RTE is available/enabled for a certain table/field and if so, it returns TRUE.
-        * Used to determine if the RTE button should be displayed.
-        *
-        * @param string $table Table name
-        * @param array $row Record row (needed, if there are RTE dependencies based on other fields in the record)
-        * @param string $field Field name
-        * @return bool Returns TRUE if the rich text editor would be enabled/available for the field name specified.
-        */
-       public function isRTEforField($table, $row, $field) {
-               $specConf = $this->getSpecConfForField($table, $row, $field);
-               if (empty($specConf)) {
-                       return FALSE;
-               }
-               $p = BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
-               if (isset($specConf['richtext'])) {
-                       BackendUtility::fixVersioningPid($table, $row);
-                       list($tscPID, $thePidValue) = BackendUtility::getTSCpid($table, $row['uid'], $row['pid']);
-                       // If the pid-value is not negative (that is, a pid could NOT be fetched)
-                       if ($thePidValue >= 0) {
-                               if (!isset($this->rteSetup[$tscPID])) {
-                                       $this->rteSetup[$tscPID] = $this->getBackendUser()->getTSConfig('RTE', BackendUtility::getPagesTSconfig($tscPID));
-                               }
-                               $RTEtypeVal = BackendUtility::getTCAtypeValue($table, $row);
-                               $thisConfig = BackendUtility::RTEsetup($this->rteSetup[$tscPID]['properties'], $table, $field, $RTEtypeVal);
-                               if (!$thisConfig['disabled']) {
-                                       return TRUE;
-                               }
-                       }
-               }
-               return FALSE;
-       }
-
-       /**
-        * Returns "special" configuration from the "types" configuration in TCA for the record given by tablename/fieldname.
-        * Used by isRTEforField() in the process of finding whether a field has RTE enabled or not.
-        *
-        * @param string $table Table name
-        * @param array $row Record array
-        * @param string $field Field name
-        * @return array Spec. conf (if available)
-        * @access private
-        * @see isRTEforField()
-        */
-       public function getSpecConfForField($table, $row, $field) {
-               // Get types-configuration for the record:
-               $types_fieldConfig = BackendUtility::getTCAtypes($table, $row);
-               // Find the given field and return the spec key value if found:
-               if (is_array($types_fieldConfig)) {
-                       foreach ($types_fieldConfig as $vConf) {
-                               if ($vConf['field'] == $field) {
-                                       return $vConf['spec'];
-                               }
-                       }
-               }
-               return array();
-       }
-
        /*****************************************
         *
         * External renderings
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-68020-DroppedDisableBigButtons.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-68020-DroppedDisableBigButtons.rst
new file mode 100644 (file)
index 0000000..4dac5dd
--- /dev/null
@@ -0,0 +1,29 @@
+============================================
+Breaking: #68020 - Dropped DisableBigButtons
+============================================
+
+Description
+===========
+
+The TSconfig option ``mod.web_layout.disableBigButtons`` has been dropped, setting it
+to 0 has no effect anymore.
+
+
+Impact
+======
+
+The option is ignored and instances using this will not get the buttons rendered in
+page module anymore.
+
+These methods have been removed, but it is very unlikely an extension is affected:
+
+* ``TYPO3\CMS\Backend\View\PageLayoutView->linkRTEbutton()``
+* ``TYPO3\CMS\Backend\View\PageLayoutView->isRTEforField()``
+* ``TYPO3\CMS\Backend\View\PageLayoutView->getSpecConfForField()``
+
+
+Affected Installations
+======================
+
+Instances that had User / Page TSconfig with this option may have a slightly
+different Web -> Page view.
index cc5443b..7b2b332 100644 (file)
@@ -299,7 +299,6 @@ var typoscriptWords = {
        'disableAdvanced': 'reserved',
        'disableAllHeaderCode': 'reserved',
        'disableAltText': 'reserved',
-       'disableBigButtons': 'reserved',
        'disableBodyTag': 'reserved',
        'disableCacheSelector': 'reserved',
        'disableCharsetHeader': 'reserved',
@@ -1619,7 +1618,6 @@ var typoscriptWords = {
        'disableAdvanced': 'reserved',
        'disableAllHeaderCode': 'reserved',
        'disableAltText': 'reserved',
-       'disableBigButtons': 'reserved',
        'disableBodyTag': 'reserved',
        'disableCacheSelector': 'reserved',
        'disableCharsetHeader': 'reserved',