[TASK] Add notification about composer mode 41/41941/5
authorNicole Cordes <cordes@cps-it.de>
Fri, 24 Jul 2015 21:43:54 +0000 (23:43 +0200)
committerBenjamin Mack <benni@typo3.org>
Sat, 25 Jul 2015 08:59:29 +0000 (10:59 +0200)
If the system was installed with composer, the user should better not
use the extension manager. This patch adds a notification to remind the
user that the system might break otherwise.

This is the first step before some extension manager functionality
will be disabled in the following TYPO3 version.

Resolves: #68527
Releases: master
Change-Id: I72a05481d9dda8a72e3962c45b7a6c5d49d27e01
Reviewed-on: http://review.typo3.org/41941
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/extensionmanager/Classes/Controller/ListController.php
typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf
typo3/sysext/extensionmanager/Resources/Private/Templates/List/Ter.html

index 71b6b11..89d1664 100644 (file)
@@ -14,8 +14,10 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
 use TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility;
 use TYPO3\CMS\Extensionmanager\Utility\Repository\Helper;
@@ -66,11 +68,31 @@ class ListController extends AbstractController {
        }
 
        /**
+        * Adds an information about composer mode
+        */
+       protected function addComposerModeNotification() {
+               if (Bootstrap::getInstance()->usesComposerClassLoading()) {
+                       $this->addFlashMessage(
+                               LocalizationUtility::translate(
+                                       'composerMode.message',
+                                       'extensionmanager'
+                               ),
+                               LocalizationUtility::translate(
+                                       'composerMode.title',
+                                       'extensionmanager'
+                               ),
+                               FlashMessage::WARNING
+                       );
+               }
+       }
+
+       /**
         * Shows list of extensions present in the system
         *
         * @return void
         */
        public function indexAction() {
+               $this->addComposerModeNotification();
                $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensionsWithAdditionalInformation();
                $this->view->assign('extensions', $availableAndInstalledExtensions);
                $this->handleTriggerArguments();
@@ -110,6 +132,7 @@ class ListController extends AbstractController {
         * @return void
         */
        public function terAction($search = '') {
+               $this->addComposerModeNotification();
                if (!empty($search)) {
                        $extensions = $this->extensionRepository->findByTitleOrAuthorNameOrExtensionKey($search);
                } else {
@@ -127,6 +150,7 @@ class ListController extends AbstractController {
         * @return void
         */
        public function distributionsAction() {
+               $this->addComposerModeNotification();
                $importExportInstalled = ExtensionManagementUtility::isLoaded('impexp');
                if ($importExportInstalled) {
                        try {
index f90e95a..31e62c1 100644 (file)
                        <trans-unit id="installExtension">
                                <source>Install Extension</source>
                        </trans-unit>
+                       <trans-unit id="composerMode.title">
+                               <source>Composer mode</source>
+                       </trans-unit>
+                       <trans-unit id="composerMode.message">
+                               <source>The system is set to composer mode. Please notice that it might break if you try to add an extension with the Extension Manager. You should rather use composer to add further extensions to your system.</source>
+                       </trans-unit>
                        <trans-unit id="installedExtensions">
                                <source>Installed Extensions</source>
                        </trans-unit>