Added feature #11652: Modern integration of module into backend using Extbase (thanks...
authorSteffen Kamper <info@sk-typo3.de>
Mon, 10 Aug 2009 10:42:43 +0000 (10:42 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 10 Aug 2009 10:42:43 +0000 (10:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5771 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_loadmodules.php

index be68231..f007c67 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-08-10  Steffen Kamper  <info@sk-typo3.de>
 
+       * Added feature #11652: Modern integration of module into backend using Extbase (thanks to Xavier Perseguers): modified t3lib_loadmodules.php to allow modules without having conf.php. This is needed for extbase driven backend modules.
        * Added feature #11651: Allow Extbase as framework for backend modules (thanks to Xavier Perseguers): modified mod.php to dispatch extbase driven modules
 
 2009-08-09     Andreas Otto    <andreas@otto-hanika.de>
index 231c212..c00117a 100644 (file)
@@ -384,7 +384,17 @@ class t3lib_loadModules {
         * @return      mixed           See description of function
         */
        function checkMod($name, $fullpath)     {
-               $modconf=Array();
+                       // Check for own way of configuring module
+               if (is_array($GLOBALS['TBE_EXTBASE_MODULES'][$name]['configureModuleFunction'])) {
+                       $obj = $GLOBALS['TBE_EXTBASE_MODULES'][$name]['configureModuleFunction'];
+                       if (is_callable($obj)) {
+                               $MCONF = array();
+                               $MLANG = array();
+                               return call_user_func($obj, $name, $fullpath, $MCONF, $MLANG);
+                       }
+               }
+
+               $modconf = array();
                $path = preg_replace('/\/[^\/.]+\/\.\.\//', '/', $fullpath); // because 'path/../path' does not work
                if (@is_dir($path) && file_exists($path.'/conf.php'))   {
                        $MCONF = array();
@@ -433,7 +443,11 @@ class t3lib_loadModules {
 
                                        // Default script setup
                                if ($MCONF['script']==='_DISPATCH')     {
-                                       $modconf['script'] = 'mod.php?M='.rawurlencode($name);
+                                       if ($MCONF['extbase']) {
+                                               $modconf['script'] = 'mod.php?M=Tx_' . rawurlencode($name);
+                                       } else {
+                                               $modconf['script'] = 'mod.php?M=' . rawurlencode($name);        
+                                       }
                                } elseif ($MCONF['script'] && file_exists($path.'/'.$MCONF['script']))  {
                                        $modconf['script'] = $this->getRelativePath(PATH_typo3,$fullpath.'/'.$MCONF['script']);
                                } else {