[BUGFIX] Adminpanel: Parts under "Editing" only with EXT:feedit 67/29167/8
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 14 Nov 2015 20:40:53 +0000 (21:40 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 15 Nov 2015 11:36:02 +0000 (12:36 +0100)
Some functions under "Editing" are only possible if EXT:feedit
is loaded.

Change-Id: I4a6da75c1da65702357468c6577924137c42e636
Resolves: #57172
Releases: master
Reviewed-on: https://review.typo3.org/29167
Reviewed-by: Oliver Eglseder <oliver.eglseder@in2code.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Oliver Eglseder <oliver.eglseder@in2code.de>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/frontend/Classes/View/AdminPanelView.php

index e329fc2..5042135 100755 (executable)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -50,6 +51,13 @@ class AdminPanelView
     protected $iconFactory;
 
     /**
     protected $iconFactory;
 
     /**
+     * Determines whether EXT:feedit is loaded
+     *
+     * @var bool
+     */
+    protected $extFeEditLoaded = FALSE;
+
+    /**
      * Constructor
      */
     public function __construct()
      * Constructor
      */
     public function __construct()
@@ -68,6 +76,7 @@ class AdminPanelView
         $this->saveConfigOptions();
         $typoScriptFrontend = $this->getTypoScriptFrontendController();
         // Setting some values based on the admin panel
         $this->saveConfigOptions();
         $typoScriptFrontend = $this->getTypoScriptFrontendController();
         // Setting some values based on the admin panel
+        $this->extFeEditLoaded = ExtensionManagementUtility::isLoaded('feedit');
         $typoScriptFrontend->forceTemplateParsing = $this->extGetFeAdminValue('tsdebug', 'forceTemplateParsing');
         $typoScriptFrontend->displayEditIcons = $this->extGetFeAdminValue('edit', 'displayIcons');
         $typoScriptFrontend->displayFieldEditIcons = $this->extGetFeAdminValue('edit', 'displayFieldIcons');
         $typoScriptFrontend->forceTemplateParsing = $this->extGetFeAdminValue('tsdebug', 'forceTemplateParsing');
         $typoScriptFrontend->displayEditIcons = $this->extGetFeAdminValue('edit', 'displayIcons');
         $typoScriptFrontend->displayFieldEditIcons = $this->extGetFeAdminValue('edit', 'displayFieldIcons');
@@ -91,9 +100,9 @@ class AdminPanelView
         }
         if ($typoScriptFrontend->forceTemplateParsing) {
             $typoScriptFrontend->set_no_cache('Admin Panel: Force template parsing', true);
         }
         if ($typoScriptFrontend->forceTemplateParsing) {
             $typoScriptFrontend->set_no_cache('Admin Panel: Force template parsing', true);
-        } elseif ($typoScriptFrontend->displayEditIcons) {
+        } elseif ($this->extFeEditLoaded && $typoScriptFrontend->displayEditIcons) {
             $typoScriptFrontend->set_no_cache('Admin Panel: Display edit icons', true);
             $typoScriptFrontend->set_no_cache('Admin Panel: Display edit icons', true);
-        } elseif ($typoScriptFrontend->displayFieldEditIcons) {
+        } elseif ($this->extFeEditLoaded && $typoScriptFrontend->displayFieldEditIcons) {
             $typoScriptFrontend->set_no_cache('Admin Panel: Display field edit icons', true);
         } elseif (GeneralUtility::_GP('ADMCMD_view')) {
             $typoScriptFrontend->set_no_cache('Admin Panel: Display preview', true);
             $typoScriptFrontend->set_no_cache('Admin Panel: Display field edit icons', true);
         } elseif (GeneralUtility::_GP('ADMCMD_view')) {
             $typoScriptFrontend->set_no_cache('Admin Panel: Display preview', true);
@@ -449,8 +458,12 @@ class AdminPanelView
             $newPageModule = trim($this->getBackendUser()->getTSConfigVal('options.overridePageModule'));
             $pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
             $this->extNeedUpdate = true;
             $newPageModule = trim($this->getBackendUser()->getTSConfigVal('options.overridePageModule'));
             $pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
             $this->extNeedUpdate = true;
-            $out .= $this->extGetItem('edit_displayFieldIcons', '', '<input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="0" /><input type="checkbox" id="edit_displayFieldIcons" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['edit_displayFieldIcons'] ? ' checked="checked"' : '') . ' />');
-            $out .= $this->extGetItem('edit_displayIcons', '', '<input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="0" /><input type="checkbox" id="edit_displayIcons" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['edit_displayIcons'] ? ' checked="checked"' : '') . ' />');
+            if ($this->extFeEditLoaded) {
+                $out .= $this->extGetItem('edit_displayFieldIcons', '',
+                    '<input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="0" /><input type="checkbox" id="edit_displayFieldIcons" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['edit_displayFieldIcons'] ? ' checked="checked"' : '') . ' />');
+                $out .= $this->extGetItem('edit_displayIcons', '',
+                    '<input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="0" /><input type="checkbox" id="edit_displayIcons" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['edit_displayIcons'] ? ' checked="checked"' : '') . ' />');
+            }
             $out .= $this->extGetItem('', $this->ext_makeToolBar());
             if (!GeneralUtility::_GP('ADMCMD_view')) {
                 $out .= $this->extGetItem('', '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('
             $out .= $this->extGetItem('', $this->ext_makeToolBar());
             if (!GeneralUtility::_GP('ADMCMD_view')) {
                 $out .= $this->extGetItem('', '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('