[TASK] Migrate aboutmodules to extbase
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 18 Feb 2012 23:16:30 +0000 (00:16 +0100)
committerTolleiv Nietsch <info@tolleiv.de>
Sun, 19 Feb 2012 12:02:44 +0000 (13:02 +0100)
Use extbase and fluid for aboutmodule.
Provide an install tool update wizard to load extbase and
fluid if an extension that depends on them is installed.

Change-Id: I8164c0c8afdc359a9b3dc059e14baa13915944b5
Resolves: #34086
Releases: 4.7
Reviewed-on: http://review.typo3.org/9094
Reviewed-by: Soren Malling
Tested-by: Soren Malling
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
14 files changed:
typo3/sysext/aboutmodules/Classes/Controller/ModulesController.php [new file with mode: 0644]
typo3/sysext/aboutmodules/Resources/Private/.htaccess [new file with mode: 0644]
typo3/sysext/aboutmodules/Resources/Private/Language/locallang_mod.xlf [new file with mode: 0644]
typo3/sysext/aboutmodules/Resources/Private/Layouts/Default.html [new file with mode: 0644]
typo3/sysext/aboutmodules/Resources/Private/Templates/Modules/Index.html [new file with mode: 0644]
typo3/sysext/aboutmodules/ext_emconf.php
typo3/sysext/aboutmodules/ext_tables.php
typo3/sysext/aboutmodules/mod/aboutmodules.gif [deleted file]
typo3/sysext/aboutmodules/mod/conf.php [deleted file]
typo3/sysext/aboutmodules/mod/index.php [deleted file]
typo3/sysext/aboutmodules/mod/locallang_mod.xlf [deleted file]
typo3/sysext/install/ext_localconf.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/install/updates/class.tx_coreupdates_installfluidextbase.php [new file with mode: 0644]

diff --git a/typo3/sysext/aboutmodules/Classes/Controller/ModulesController.php b/typo3/sysext/aboutmodules/Classes/Controller/ModulesController.php
new file mode 100644 (file)
index 0000000..ee1e93a
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * 'About modules' script - the default start-up module.
+ * Will display the list of main- and sub-modules available to the user.
+ * Each module will be show with description and a link to the module.
+ *
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Christian Kuhn <lolli@schwarzbu.ch>
+ * @package TYPO3
+ * @subpackage aboutmodules
+ */
+class Tx_Aboutmodules_Controller_ModulesController  extends Tx_Extbase_MVC_Controller_ActionController {
+
+       /**
+        * Show general information and the installed modules
+        *
+        * @return void
+        */
+       public function indexAction() {
+               $this->view
+                       ->assign('TYPO3Version', TYPO3_version)
+                       ->assign('copyRightNotice', t3lib_BEfunc::TYPO3_copyRightNotice())
+                       ->assign('warningMessages', t3lib_BEfunc::displayWarningMessages())
+                       ->assign('modules', $this->getModulesData())
+               ;
+       }
+
+       /**
+        * Create array with data of all main modules (Web, File, ...)
+        * and its nested sub modules
+        *
+        * @return array
+        */
+       protected function getModulesData() {
+                       /** @var $loadedModules t3lib_loadModules */
+               $loadedModules = t3lib_div::makeInstance('t3lib_loadModules');
+               $loadedModules->observeWorkspaces = TRUE;
+               $loadedModules->load($GLOBALS['TBE_MODULES']);
+
+               $mainModulesData = array();
+               foreach ($loadedModules->modules as $moduleName => $moduleInfo) {
+                       $mainModuleData = array();
+                       $moduleKey = $moduleName . '_tab';
+                       $mainModuleData['name'] = $moduleName;
+                       $mainModuleData['icon'] = substr($GLOBALS['LANG']->moduleLabels['tabs_images'][$moduleKey], strlen(PATH_site));
+                       $mainModuleData['label'] = $GLOBALS['LANG']->moduleLabels['tabs'][$moduleKey];
+                       if (is_array($moduleInfo['sub']) && count($moduleInfo['sub']) > 0) {
+                               $mainModuleData['subModules'] = $this->getSubModuleData($moduleName, $moduleInfo['sub']);
+                       }
+                       $mainModulesData[] = $mainModuleData;
+               }
+
+               return $mainModulesData;
+       }
+
+       /**
+        * Create array with data of all subModules of a specific main module
+        *
+        * @param string $moduleName Name of the main module
+        * @param array $subModulesInfo Sub module information
+        * @return array
+        */
+       protected function getSubModuleData($moduleName, array $subModulesInfo = array()) {
+               $subModulesData = array();
+
+               foreach ($subModulesInfo as $subModuleName => $subModuleInfo) {
+                       $subModuleKey = $moduleName . '_' . $subModuleName . '_tab';
+                       $subModuleData = array();
+                       $subModuleData['name'] = $subModuleName;
+                       $subModuleData['icon'] = substr($GLOBALS['LANG']->moduleLabels['tabs_images'][$subModuleKey], strlen(PATH_site));
+                       $subModuleData['label'] = $GLOBALS['LANG']->moduleLabels['tabs'][$subModuleKey];
+                       $subModuleData['shortDescription'] = $GLOBALS['LANG']->moduleLabels['labels'][$subModuleKey . 'label'];
+                       $subModuleData['longDescription'] = $GLOBALS['LANG']->moduleLabels['labels'][$subModuleKey . 'descr'];
+                       $subModulesData[] = $subModuleData;
+               }
+
+               return $subModulesData;
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/aboutmodules/Resources/Private/.htaccess b/typo3/sysext/aboutmodules/Resources/Private/.htaccess
new file mode 100644 (file)
index 0000000..3418e55
--- /dev/null
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
diff --git a/typo3/sysext/aboutmodules/Resources/Private/Language/locallang_mod.xlf b/typo3/sysext/aboutmodules/Resources/Private/Language/locallang_mod.xlf
new file mode 100644 (file)
index 0000000..aedead2
--- /dev/null
@@ -0,0 +1,17 @@
+<?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="aboutmodules">
+               <header/>
+               <body>
+                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
+                               <source>Information about modules</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
+                               <source>Shows this page about available modules.</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
+                               <source>About Modules</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/aboutmodules/Resources/Private/Layouts/Default.html b/typo3/sysext/aboutmodules/Resources/Private/Layouts/Default.html
new file mode 100644 (file)
index 0000000..f1cb330
--- /dev/null
@@ -0,0 +1,12 @@
+<f:be.container>
+       <div id="typo3-docheader">
+               <div id="typo3-docheader-row1">&nbsp;</div>
+               <div id="typo3-docheader-row2">&nbsp;</div>
+       </div>
+
+       <div id="typo3-docbody">
+               <div id="typo3-alt-intro-php-sub">
+                       <f:render section="Content" />
+               </div>
+       </div>
+</f:be.container>
diff --git a/typo3/sysext/aboutmodules/Resources/Private/Templates/Modules/Index.html b/typo3/sysext/aboutmodules/Resources/Private/Templates/Modules/Index.html
new file mode 100644 (file)
index 0000000..51c0c0e
--- /dev/null
@@ -0,0 +1,84 @@
+<f:layout name="Default" />
+
+<f:section name="Content">
+       <h1>TYPO3 {TYPO3Version}<br />
+               <f:translate key="LLL:EXT:lang/locallang_alt_intro.xlf:introtext" />
+       </h1>
+
+       <p>{copyRightNotice -> f:format.raw()}</p>
+
+       {warningMessages -> f:format.raw()}
+
+       <h3>
+               <f:translate key="LLL:EXT:lang/locallang_alt_intro.xlf:introtext2" />
+       </h3>
+
+       <table border="0" cellpadding="0" cellspacing="0" id="typo3-about-modules">
+               <tbody>
+                       <f:for each="{modules}" as="mainModule">
+                               <tr class="c-mainitem">
+                                       <td colspan="3">
+                                               <f:image src="{mainModule.icon}" alt="" />
+                                               &nbsp;
+                                               <f:if condition="{mainModules.subModules -> f:count()} > 0">
+                                                       <f:then>
+                                                               <strong>{mainModule.label}</strong>
+                                                       </f:then>
+                                                       <f:else>
+                                                               <a
+                                                                       href="#"
+                                                                       onclick="top.goToModule('{mainModule.name}'); return false;"
+                                                               >
+                                                                       <strong>{mainModule.label}</strong>
+                                                               </a>
+                                                       </f:else>
+                                               </f:if>
+                                       </td>
+                               </tr>
+
+                               <f:for each="{mainModule.subModules}" as="subModule" iteration="subModuleIterator">
+                                       <f:if condition="{subModuleIterator.isFirst}">
+                                               <tr class="c-first"><td colspan="3"></td></tr>
+                                       </f:if>
+
+                                       <tr class="c-subitem-row">
+                                               <td align="center">
+                                                       <f:image src="{subModule.icon}" alt="" />
+                                               </td>
+                                               <td>
+                                                       <a
+                                                               href="#"
+                                                               onclick="top.goToModule('{mainModule.name}_{subModule.name}'); return false;"
+                                                               title="{subModule.shortDescription}"
+                                                       >
+                                                               {subModule.label}
+                                                       </a>
+                                               </td>
+                                               <td class="module-description">
+                                                       <strong>
+                                                               {subModule.shortDescription}
+                                                       </strong>
+                                                       <br />
+                                                       {subModule.longDescription -> f:format.raw()}
+                                               </td>
+                                       </tr>
+                               </f:for>
+
+                               <f:if condition="{mainModule.subModules -> f:count()} > 0">
+                                       <tr class="c-endrow"><td colspan="3"></td></tr>
+                               </f:if>
+                       </f:for>
+               </tbody>
+       </table>
+
+       <br />
+
+       <p class="c-features">
+               <em>
+                       (<f:translate key="LLL:EXT:lang/locallang_alt_intro.xlf:endText" />)
+               </em>
+       </p>
+
+       <br />
+
+</f:section>
index 180f202..5864576 100755 (executable)
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => 'Shows an overview of the installed and available modules including description and links.',
        'category' => 'module',
        'shy' => 1,
-       'dependencies' => '',
+       'dependencies' => 'extbase,fluid',
        'conflicts' => '',
        'priority' => '',
        'loadOrder' => '',
@@ -33,7 +33,7 @@ $EM_CONF[$_EXTKEY] = array(
        'author_company' => 'Curby Soft Multimedia',
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
-       'version' => '1.1.0',
+       'version' => '2.0.0',
        '_md5_values_when_last_written' => 'a:8:{s:35:"class.tx_aboutmodules_functions.php";s:4:"80cb";s:16:"ext_autoload.php";s:4:"06c5";s:12:"ext_icon.gif";s:4:"6101";s:14:"ext_tables.php";s:4:"920d";s:20:"mod/aboutmodules.gif";s:4:"711d";s:12:"mod/conf.php";s:4:"9a03";s:13:"mod/index.php";s:4:"acd7";s:21:"mod/locallang_mod.xlf";s:4:"8645";}',
        'constraints' => array(
                'depends' => array(
index 499fb94..65b75a2 100755 (executable)
@@ -1,5 +1,24 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+       // Avoid that this block is loaded in frontend or within upgrade wizards
+if (TYPO3_MODE === 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
+       Tx_Extbase_Utility_Extension::registerModule(
+               $_EXTKEY,
+               'help',
+               'aboutmodules',
+               'after:about',
+               array(
+                       'Modules' => 'index',
+               ),
+               array(
+                       'access' => 'user,group',
+                       'icon' => 'EXT:aboutmodules/ext_icon.gif',
+                       'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf',
+               )
+       );
+}
 
-if (TYPO3_MODE=='BE')  t3lib_extMgm::addModule('help','aboutmodules','after:about',t3lib_extMgm::extPath($_EXTKEY).'mod/');
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/aboutmodules/mod/aboutmodules.gif b/typo3/sysext/aboutmodules/mod/aboutmodules.gif
deleted file mode 100755 (executable)
index c397df4..0000000
Binary files a/typo3/sysext/aboutmodules/mod/aboutmodules.gif and /dev/null differ
diff --git a/typo3/sysext/aboutmodules/mod/conf.php b/typo3/sysext/aboutmodules/mod/conf.php
deleted file mode 100755 (executable)
index 78b9a38..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-       // DO NOT REMOVE OR CHANGE THESE 2 LINES:
-$MCONF['name'] = 'help_aboutmodules';
-$MCONF['script'] = '_DISPATCH';
-
-$MCONF['access'] = 'user,group';
-
-$MLANG['default']['tabs_images']['tab'] = 'aboutmodules.gif';
-$MLANG['default']['ll_ref'] = 'LLL:EXT:aboutmodules/mod/locallang_mod.xml';
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/aboutmodules/mod/index.php b/typo3/sysext/aboutmodules/mod/index.php
deleted file mode 100644 (file)
index 8856e16..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (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
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * 'About modules' script - the default start-up module.
- * Will display the list of main- and sub-modules available to the user.
- * Each module will be show with description and a link to the module.
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage aboutmodules
- */
-class SC_mod_help_aboutmodules_index {
-
-       /**
-        * Default constructor
-        */
-       public function __construct() {
-               $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_alt_intro.xml');
-       }
-
-       /**
-        * Render the module
-        *
-        * @return void
-        */
-       public function render() {
-               $GLOBALS['TBE_TEMPLATE']->divClass = $GLOBALS['TBE_TEMPLATE']->bodyTagId;
-               $GLOBALS['TBE_TEMPLATE']->backPath = $GLOBALS['BACK_PATH'];
-
-               $content = array();
-               $content[] = '<div id="typo3-docheader"><div id="typo3-docheader-row1">&nbsp;</div></div>';
-               $content[] = '<div id="typo3-alt-intro-php-sub">';
-
-               $content[] = '<h1>TYPO3 ' . TYPO3_version . '<br />' . $GLOBALS['LANG']->getLL('introtext') . '</h1>';
-               $content[] = '<p>' . t3lib_BEfunc::TYPO3_copyRightNotice() . '</p>';
-
-               $content[] = t3lib_BEfunc::displayWarningMessages();
-               $content[] = '<h3>' . $GLOBALS['LANG']->getLL('introtext2') . '</h3>';
-
-                       /** @var $loadModules t3lib_loadModules */
-               $loadModules = t3lib_div::makeInstance('t3lib_loadModules');
-               $loadModules->observeWorkspaces = TRUE;
-                       // Load available backend modules to create the description overview.
-               $loadModules->load($GLOBALS['TBE_MODULES']);
-               $content[] = $this->renderModules($loadModules->modules);
-               $content[] = '<br />';
-
-                       // End text: 'Features may vary depending on your website and permissions'
-               $content[] = '<p class="c-features"><em>(' . $GLOBALS['LANG']->getLL('endText') . ')</em></p>';
-
-               $content[] = '<br />';
-               $content[] = '</div>';
-
-               echo $GLOBALS['TBE_TEMPLATE']->render(
-                       'About modules',
-                       implode(LF, $content),
-                       TRUE
-               );
-       }
-
-       /**
-        * Render an overview of modules and its sub modules
-        *
-        * @param array $modules is the output from load_modules class
-        * @return string Module list HTML
-        */
-       protected function renderModules(array $modules) {
-               $moduleHtml = array();
-
-                       // Traverse array with modules
-               foreach ($modules as $moduleName => $moduleInfo) {
-                       $moduleKey = $moduleName . '_tab';
-
-                               // Create image icon
-                       $icon = @getimagesize($GLOBALS['LANG']->moduleLabels['tabs_images'][$moduleKey]);
-                       $iconHtml = '';
-                       if ($icon) {
-                               $iconPath = '../' . substr($GLOBALS['LANG']->moduleLabels['tabs_images'][$moduleKey], strlen(PATH_site));
-                               $iconHtml = '<img src="' . $iconPath . '" ' . $icon[3] . ' alt="" />';
-                       }
-
-                       $label = htmlspecialchars($GLOBALS['LANG']->moduleLabels['tabs'][$moduleKey]);
-                               // Creating main module link, if there are no sub modules
-                       if (!is_array($moduleInfo['sub'])) {
-                               $label = '<a href="#" onclick="top.goToModule(\'' . $moduleName . '\');return false;">' . $label . '</a>';
-                       }
-                       $label = '&nbsp;<strong>' . $label . '</strong>&nbsp;';
-
-                       $moduleHtml[] = '<tr class="c-mainitem"><td colspan="3">' . $iconHtml . $label . '</td></tr>';
-
-                               // Traverse sub modules
-                       $subHtml = array();
-                       if (is_array($moduleInfo['sub'])) {
-                               $subCount = 0;
-                               foreach ($moduleInfo['sub'] as $subName => $subInfo) {
-                                       $subCount ++;
-                                       if ($subCount === 1) {
-                                               $subHtml[] = '
-                                                       <tr class="c-first">
-                                                               <td colspan="3"></td>
-                                                       </tr>
-                                               ';
-                                       }
-
-                                       $subKey = $moduleName . '_' . $subName . '_tab';
-
-                                               // Create image icon
-                                       $icon = @getimagesize($GLOBALS['LANG']->moduleLabels['tabs_images'][$subKey]);
-                                       $iconHtml = '';
-                                       if ($icon) {
-                                               $iconPath = '../' . substr($GLOBALS['LANG']->moduleLabels['tabs_images'][$subKey], strlen(PATH_site));
-                                               $iconHtml = '<img src="' . $iconPath . '" ' . $icon[3] . ' title="' . htmlspecialchars($GLOBALS['LANG']->moduleLabels['labels'][$subKey . 'label']) . '" alt="" />';
-                                       }
-
-                                               // Label for sub module
-                                       $label = $GLOBALS['LANG']->moduleLabels['tabs'][$subKey];
-                                       $labelDescription = ' title="' . htmlspecialchars($GLOBALS['LANG']->moduleLabels['labels'][$subKey . 'label']) . '"';
-                                       $onClickString = htmlspecialchars('top.goToModule(\'' . $moduleName . '_' . $subName . '\');return false;');
-                                       $linkedLabel = '<a href="#" onclick="' . $onClickString . '"' . $labelDescription . '>' . htmlspecialchars($label) . '</a>';
-
-                                       $moduleLabel = htmlspecialchars($GLOBALS['LANG']->moduleLabels['labels'][$subKey . 'label']);
-                                       $moduleLabelHtml = !empty($moduleLabel) ? '<strong>' . $moduleLabel . '</strong><br />' : '';
-                                       $moduleDescription = $GLOBALS['LANG']->moduleLabels['labels'][$subKey . 'descr'];
-
-                                       $subHtml[] = '<tr class="c-subitem-row">';
-                                       $subHtml[] = '<td align="center">' . $iconHtml . '</td>';
-                                       $subHtml[] = '<td>' . $linkedLabel . '&nbsp;&nbsp;</td>';
-
-                                       if (!empty($moduleLabel) || !empty($moduleDescription)) {
-                                               $subHtml[] = '<td class="module-description">' . $moduleLabelHtml . $moduleDescription . '</td>';
-                                       } else {
-                                               $subHtml[] = '<td>&nbsp;</td>';
-                                       }
-
-                                       $subHtml[] = '</tr>';
-                               }
-                       }
-
-                       if (count($subHtml) > 0) {
-                               $moduleHtml[] = implode(LF, $subHtml);
-                               $moduleHtml[] = '<tr class="c-endrow"><td colspan="3"></td></tr>';
-                       }
-               }
-
-               return '
-                       <table border="0" cellpadding="0" cellspacing="0" id="typo3-about-modules">
-                               ' . implode(LF, $moduleHtml) . '
-                       </table>
-               ';
-       }
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/sysext/aboutmodules/mod/index.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/sysext/aboutmodules/mod/index.php']);
-}
-
-t3lib_div::makeInstance('SC_mod_help_aboutmodules_index')->render();
-?>
\ No newline at end of file
diff --git a/typo3/sysext/aboutmodules/mod/locallang_mod.xlf b/typo3/sysext/aboutmodules/mod/locallang_mod.xlf
deleted file mode 100644 (file)
index aedead2..0000000
+++ /dev/null
@@ -1,17 +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="aboutmodules">
-               <header/>
-               <body>
-                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
-                               <source>Information about modules</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
-                               <source>Shows this page about available modules.</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
-                               <source>About Modules</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
index 5e467bf..ee5a1f3 100644 (file)
@@ -50,4 +50,7 @@ $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['addFlexformsToAcl'] = '
 
        // Version 4.5: Split tt_content image_link to newline by comma
 $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['imagelink'] = 'tx_coreupdates_imagelink';
+
+       // Version 4.7: Load fluid and extbase if extensions with new dependency to them are installed
+$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['installFluidExtbase'] = 'tx_coreupdates_installFluidExtbase';
 ?>
\ No newline at end of file
index 9c38f26..f477d7e 100644 (file)
@@ -53,6 +53,7 @@ require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_mi
 require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_flagsfromsprite.php');
 require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_addflexformstoacl.php');
 require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_imagelink.php');
+require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_installfluidextbase.php');
 
 /**
  * Install Tool module
diff --git a/typo3/sysext/install/updates/class.tx_coreupdates_installfluidextbase.php b/typo3/sysext/install/updates/class.tx_coreupdates_installfluidextbase.php
new file mode 100644 (file)
index 0000000..473cffd
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Contains the update class for installing extbase and fluid
+ * for installed extensions that depend on it now.
+ *
+ * @author Christian Kuhn <lolli@schwarzbu.ch>
+ */
+class tx_coreupdates_installFluidExtbase extends Tx_Install_Updates_Base {
+
+       /**
+        * @var string Title of this wizard
+        */
+       protected $title = 'Install fluid and extbase to satisfy dependencies of system extensions';
+
+       /**
+        * @var array Extensions keys that depend on fluid / extbase
+        */
+       protected $extensionsDependingOnFluidExtbase = array(
+               'aboutmodules',
+               'workspaces'
+       );
+
+       /**
+        * Checks if an update is needed
+        *
+        * @param string &$description: The description for the update
+        * @return boolean whether an update is needed (TRUE) or not (FALSE)
+        */
+       public function checkForUpdate(&$description) {
+               $result = FALSE;
+
+               $description = 'These loaded extensions depend on fluid and extbase:';
+               $description .= '<ul>';
+               if (!t3lib_extMgm::isLoaded('extbase') || !t3lib_extMgm::isLoaded('fluid')) {
+                       foreach($this->extensionsDependingOnFluidExtbase as $extension) {
+                               if (t3lib_extMgm::isLoaded($extension)) {
+                                       $result = TRUE;
+                                       $description .= '<li>' . $extension . '</li>';
+                               }
+                       }
+               }
+               $description .= '</ul>';
+
+               return $result;
+       }
+
+       /**
+        * Adds fluid and extbase to the extList in TYPO3_CONF_VARS
+        *
+        * @param array &$dbQueries: Queries done in this update
+        * @param mixed &$customMessages: Custom messages
+        * @return boolean Whether it worked (TRUE) or not (FALSE)
+        */
+       public function performUpdate(array &$dbQueries, &$customMessages) {
+               $this->installExtensions(array('extbase', 'fluid'));
+               return TRUE;
+       }
+}
+?>
\ No newline at end of file