Various
authorKasper Skårhøj <kasper@typo3.org>
Fri, 4 Jun 2004 23:14:25 +0000 (23:14 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Fri, 4 Jun 2004 23:14:25 +0000 (23:14 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@338 709f56b5-9817-0410-a4d7-c38de5d9e867

TODO.txt
t3lib/class.t3lib_extobjbase.php
t3lib/class.t3lib_loadmodules.php
t3lib/class.t3lib_scbase.php
typo3/class.alt_menu_functions.inc
typo3/class.db_list_extra.inc
typo3/db_list.php
typo3/sysext/lang/locallang_csh_corebe.php

index f7ff99e..dc227d5 100755 (executable)
--- a/TODO.txt
+++ b/TODO.txt
@@ -9,7 +9,7 @@ General:
 - Feature: "admin" can click a button which wipes out all record-lockings. (Message-Id: <200301281752.23246.mundaun@gmx.ch>)
 - Feature: Controlling access to function menu modules as well (thus we could have a user-module inside ?Template? which could edit the constants field)
 - Feature: Web >plugins -> to be a main module where people can place modules for their extension.
-
+- Substitute "->include_once[] = ...." with "require_once()" directly in classes - BUT the problem might be that class files accesses $TYPO3_CONF_VARS (for XCLASS inclusion) and if that is not accessible from the function including the script THEN all XCLASSes of that class will break!!!
 
 TCEmain:
 - Commenting of the class.
index c2ca406..9e2c97d 100755 (executable)
  * Notice that the first part is as usual: Include classes and call $SOBE->checkExtObj() to initialize any level-1 sub-modules
  * But then again ->include_once is traversed IF the initialization of the level-1 modules might have added more files!!
  * And after that $SOBE->checkSubExtObj() is called to initialize the second level.
- * In this way even a third level could be supported - but most likely that is a too layered module to be practical.
+ * In this way even a third level could be supported - but most likely that is a too layered model to be practical.
  *
  * Anyways, the final interesting thing is to see what the framework "func_wizard" actually does:
  *
@@ -176,7 +176,7 @@ class t3lib_extobjbase {
         *
         * @see handleExternalFunctionValue(), tx_funcwizards_webfunc
         */
-       var $function_key='';
+       var $function_key = '';
 
 
 
@@ -224,7 +224,7 @@ class t3lib_extobjbase {
                if ($this->function_key)        {
                        $this->extClassConf = $this->pObj->getExternalItemConfig($this->pObj->MCONF['name'],$this->function_key,$this->pObj->MOD_SETTINGS[$this->function_key]);
                        if (is_array($this->extClassConf) && $this->extClassConf['path'])       {
-                               $this->pObj->include_once[]=$this->extClassConf['path'];
+                               $this->pObj->include_once[] = $this->extClassConf['path'];
                        }
                }
        }
@@ -237,7 +237,7 @@ class t3lib_extobjbase {
        function incLocalLang() {
                if ($this->localLangFile && @is_file($this->thisPath.'/'.$this->localLangFile)) {
                        include($this->thisPath.'/'.$this->localLangFile);
-                       $GLOBALS['LOCAL_LANG']=t3lib_div::array_merge_recursive_overrule($GLOBALS['LOCAL_LANG'],$LOCAL_LANG);
+                       $GLOBALS['LOCAL_LANG'] = t3lib_div::array_merge_recursive_overrule($GLOBALS['LOCAL_LANG'],$LOCAL_LANG);
                }
        }
 
index 2a6862a..7be1567 100644 (file)
  */
 class t3lib_loadModules {
        var $modules = Array();         // After the init() function this array will contain the structure of available modules for the backend user.
-       var $absPathArray=array();      // Array with paths pointing to the location of modules from extensions
+       var $absPathArray = array();    // Array with paths pointing to the location of modules from extensions
 
-       var $modListGroup= Array();             // this array will hold the elements that should go into the select-list of modules for groups...
-       var $modListUser= Array();              // this array will hold the elements that should go into the select-list of modules for users...
+       var $modListGroup = Array();            // this array will hold the elements that should go into the select-list of modules for groups...
+       var $modListUser = Array();             // this array will hold the elements that should go into the select-list of modules for users...
 
-       var $BE_USER='';        // The backend user for use internally
+       var $BE_USER = '';      // The backend user for use internally
 
 
        /**
@@ -97,7 +97,7 @@ class t3lib_loadModules {
        function load($modulesArray,$BE_USER='')        {
                        // Setting the backend user for use internally
                if (is_object($BE_USER))        {
-                       $this->BE_USER=$BE_USER;
+                       $this->BE_USER = $BE_USER;
                } else {
                        $this->BE_USER = $GLOBALS['BE_USER'];
                }
@@ -171,12 +171,12 @@ class t3lib_loadModules {
                                Today almost all modules reside in extensions and they are found by the _PATHS array of the incoming $TBE_MODULES array
                        */
                        // Setting paths for 1) core modules (old concept from mod/) and 2) user-defined modules (from ../typo3conf)
-               $paths=array();
+               $paths = array();
                $paths['defMods'] = PATH_typo3.'mod/';  // Path of static modules
                $paths['userMods'] = PATH_typo3.'../typo3conf/';  // local modules (maybe frontend specific)
 
                        // Traverses the module setup and creates the internal array $this->modules
-               while(list($mods,$subMod)=each($theMods))       {
+               foreach($theMods as $mods => $subMod)   {
                        unset ($path);
 
                        $extModRelPath = $this->checkExtensionModule($mods);
@@ -201,26 +201,26 @@ class t3lib_loadModules {
 
                                // if $theMainMod is not set (false) there is no access to the module !(?)
                        if ($theMainMod && isset($path))        {
-                               $this->modules[$mods]=$theMainMod;
+                               $this->modules[$mods] = $theMainMod;
 
                                        // SUBMODULES - if any - are loaded (The 'doc' module cannot have submodules...)
                                if ($mods!='doc' && is_array($subMod))  {
-                                       while(list(,$valsub)=each($subMod))     {
+                                       foreach($subMod as $valsub)     {
                                                $extModRelPath = $this->checkExtensionModule($mods.'_'.$valsub);
                                                if ($extModRelPath)     {       // EXTENSION submodule:
-                                                       $theTempSubMod=$this->checkMod($mods.'_'.$valsub,PATH_site.$extModRelPath);
+                                                       $theTempSubMod = $this->checkMod($mods.'_'.$valsub,PATH_site.$extModRelPath);
                                                        if (is_array($theTempSubMod))   {       // default sub-module in either main-module-path, be it the default or the userdefined.
-                                                               $this->modules[$mods]['sub'][$valsub]=$theTempSubMod;
+                                                               $this->modules[$mods]['sub'][$valsub] = $theTempSubMod;
                                                        }
                                                } else {        // 'CLASSIC' submodule
                                                                // Checking for typo3/mod/xxx/ module existence...
-                                                       $theTempSubMod=$this->checkMod($mods.'_'.$valsub,$path.$mods.'/'.$valsub);
+                                                       $theTempSubMod = $this->checkMod($mods.'_'.$valsub,$path.$mods.'/'.$valsub);
                                                        if (is_array($theTempSubMod))   {       // default sub-module in either main-module-path, be it the default or the userdefined.
-                                                               $this->modules[$mods]['sub'][$valsub]=$theTempSubMod;
+                                                               $this->modules[$mods]['sub'][$valsub] = $theTempSubMod;
                                                        } elseif ($path == $paths['defMods'])   {               // If the submodule did not exist in the default module path, then check if there is a submodule in the submodule path!
-                                                               $theTempSubMod=$this->checkMod($mods.'_'.$valsub,$paths['userMods'].$mods.'/'.$valsub);
+                                                               $theTempSubMod = $this->checkMod($mods.'_'.$valsub,$paths['userMods'].$mods.'/'.$valsub);
                                                                if (is_array($theTempSubMod))   {
-                                                                       $this->modules[$mods]['sub'][$valsub]=$theTempSubMod;
+                                                                       $this->modules[$mods]['sub'][$valsub] = $theTempSubMod;
                                                                }
                                                        }
                                                }
@@ -228,7 +228,7 @@ class t3lib_loadModules {
                                }
                        } else {        // This must be done in order to fill out the select-lists for modules correctly!!
                                if ($mods!='doc' && is_array($subMod))  {
-                                       while(list(,$valsub)=each($subMod))     {
+                                       foreach($subMod as $valsub)     {
                                                $this->checkMod($mods.'_'.$valsub,$path.$mods.'/'.$valsub);
                                        }
                                }
@@ -372,10 +372,10 @@ class t3lib_loadModules {
        }
 
        /**
-        * Here we check for the module. If not a conf-file is set then it's regarded to be a spacer
+        * Here we check for the module.
         * Return values:
-        *      'notFound':     If the module was not found in the path
-        *      false:          If no access to the module
+        *      'notFound':     If the module was not found in the path (no "conf.php" file)
+        *      false:          If no access to the module (access check failed)
         *      array():        Configuration array, in case a valid module where access IS granted exists.
         *
         * @param       string          Module name
@@ -430,29 +430,28 @@ class t3lib_loadModules {
 
                                        // Default script setup
                                if ($MCONF['script'] && @file_exists($path.'/'.$MCONF['script']))       {
-                                       $modconf['script']= $this->getRelativePath(PATH_typo3,$fullpath.'/'.$MCONF['script']);
+                                       $modconf['script'] = $this->getRelativePath(PATH_typo3,$fullpath.'/'.$MCONF['script']);
                                } else {
-                                       $modconf['script']='dummy.php';
+                                       $modconf['script'] = 'dummy.php';
                                }
                                        // Default tab setting
                                if ($MCONF['defaultMod'])       {
-                                       $modconf['defaultMod']=$MCONF['defaultMod'];
+                                       $modconf['defaultMod'] = $MCONF['defaultMod'];
                                }
                                        // Navigation Frame Script (GET params could be added)
                                if ($MCONF['navFrameScript']) {
                                        $navFrameScript = explode('?', $MCONF['navFrameScript']);
                                        $navFrameScript = $navFrameScript[0];
                                        if (@file_exists($path.'/'.$navFrameScript))    {
-                                               $modconf['navFrameScript']= $this->getRelativePath(PATH_typo3,$fullpath.'/'.$MCONF['navFrameScript']);
+                                               $modconf['navFrameScript'] = $this->getRelativePath(PATH_typo3,$fullpath.'/'.$MCONF['navFrameScript']);
                                        }
                                }
                                        // additional params for Navigation Frame Script: "&anyParam=value&moreParam=1"
                                if ($MCONF['navFrameScriptParam']) {
-                                       $modconf['navFrameScriptParam']=$MCONF['navFrameScriptParam'];
+                                       $modconf['navFrameScriptParam'] = $MCONF['navFrameScriptParam'];
                                }
                        } else return false;
-               } else $modconf='notFound';
-
+               } else $modconf = 'notFound';
                return $modconf;
        }
 
@@ -486,23 +485,22 @@ class t3lib_loadModules {
         * @param       array           moduleArray ($TBE_MODULES)
         * @return      array           Output structure with available modules
         */
-       function parseModulesArray ($arr)       {
+       function parseModulesArray($arr)        {
                $theMods = Array();
                if (is_array($arr))     {
-                       reset($arr);
-                       while(list($mod,$subs)=each($arr))      {
-                               $mod=$this->cleanName($mod);            // clean module name to alphanum
+                       foreach($arr as $mod => $subs)  {
+                               $mod = $this->cleanName($mod);          // clean module name to alphanum
                                if ($mod)       {
                                        if ($subs)      {
-                                               $temp=explode(',',$subs);
-                                               while(list(,$subMod)=each($temp))       {
-                                                       $subMod=$this->cleanName($subMod);
+                                               $subsArr = t3lib_div::trimExplode(',', $subs);
+                                               foreach($subsArr as $subMod)    {
+                                                       $subMod = $this->cleanName($subMod);
                                                        if ($subMod)    {
-                                                               $theMods[$mod][]=$subMod;
+                                                               $theMods[$mod][] = $subMod;
                                                        }
                                                }
                                        } else {
-                                               $theMods[$mod]=1;
+                                               $theMods[$mod] = 1;
                                        }
                                }
                        }
index 8b90554..a1e7278 100644 (file)
@@ -136,10 +136,10 @@ class t3lib_SCbase {
         * Loaded with the global array $MCONF which holds some module configuration from the conf.php file of backend modules.
         * @see init()
         */
-       var $MCONF=array();
+       var $MCONF = array();
 
        /**
-        * The integer value of the GET/POST var, 'id'. Used for submodules to the 'Web' module.
+        * The integer value of the GET/POST var, 'id'. Used for submodules to the 'Web' module (page id)
         * @see init()
         */
        var $id;
@@ -162,7 +162,7 @@ class t3lib_SCbase {
         * The module menu items array. Each key represents a key for which values can range between the items in the array of that key.
         * @see init()
         */
-       var $MOD_MENU= Array (
+       var $MOD_MENU = Array (
                        'function' => array()
                );
 
@@ -170,7 +170,7 @@ class t3lib_SCbase {
         * Current settings for the keys of the MOD_MENU array
         * @see $MOD_MENU
         */
-       var $MOD_SETTINGS=array();
+       var $MOD_SETTINGS = array();
 
        /**
         * Module TSconfig based on PAGE TSconfig / USER TSconfig
@@ -214,12 +214,12 @@ class t3lib_SCbase {
         *
         * @see handleExternalFunctionValue()
         */
-       var $include_once=array();
+       var $include_once = array();
 
        /**
         * Generally used for accumulating the output content of backend modules
         */
-       var $content='';
+       var $content = '';
 
        /**
         * Generally used to hold an instance of the 'template' class from typo3/template.php
index 878f8b5..a1d0609 100755 (executable)
@@ -133,17 +133,17 @@ class alt_menu_functions {
                        if (is_array($moduleInfo['sub']))       {
                                        // Finding the default module to display
                                if ($moduleInfo['defaultMod'])  {
-                                       $link=$moduleInfo['sub'][$moduleInfo['defaultMod']]['script'];
+                                       $link = $moduleInfo['sub'][$moduleInfo['defaultMod']]['script'];
                                } else {
                                        reset($moduleInfo['sub']);
                                        $subTemp = current($moduleInfo['sub']);
-                                       $link=$subTemp['script'];
+                                       $link = $subTemp['script'];
                                }
-                               $link_sub=1;    // Tells that the main modules links to a submodule
-                               $link='';       // Does not link to submodules...
+                               $link_sub = 1;  // Tells that the main modules links to a submodule
+                               $link = '';     // Does not link to submodules...
                        } else {
-                               $link=$moduleInfo['script'];
-                               $link_sub=0;
+                               $link = $moduleInfo['script'];
+                               $link_sub = 0;
                        }
 
                        $moduleKey = $moduleName.'_tab';
index 8aab5c6..39f104f 100755 (executable)
@@ -389,7 +389,7 @@ class localRecordList extends recordList {
                        }
 
                                // CSH:
-                       $theData[$titleCol].= t3lib_BEfunc::cshItem($table,'',$this->backPath);
+                       $theData[$titleCol].= t3lib_BEfunc::cshItem($table,'',$this->backPath,'',FALSE,'margin-bottom:0px; white-space: normal;');
 
                        if ($LOISmode)  {
                                $out.='
index 2b9eb0f..88d8455 100755 (executable)
@@ -341,12 +341,21 @@ class SC_db_list {
                $this->content.=$this->doc->startPage('DB list');
                $this->content.= '<form action="'.htmlspecialchars($dblist->listURL()).'" method="post" name="dblistForm">';
 
+                       // List Module CSH:
+               if (!strlen($this->id)) {
+                       $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH'],'<br/>|');
+               } elseif (!$this->id)   {       // zero...:
+                       $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH'],'<br/>|');
+               }
+
                        // Add listing HTML code:
                $this->content.= $dblist->HTMLcode;
                $this->content.= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
 
                        // List Module CSH:
-               $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'],'<br/>|');
+               if ($this->id)  {
+                       $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'],'<br/>|');
+               }
 
 
                        // If a listing was produced, create the page footer with search form etc:
index 917a14e..ceed6a6 100644 (file)
@@ -20,6 +20,8 @@ $LOCAL_LANG = Array (
                'list_searchbox.description' => "[FILL IN] list searchbox",
                'list_options.description' => "[FILL IN] list options",
                'list_module.description' => "[FILL IN] list_module",
+               'list_module_noId.description' => "[FILL IN] list_module_noId",
+               'list_module_root.description' => "[FILL IN] list_module_root",
                'info_module.description' => "[FILL IN] info_module",
                'func_module.description' => "[FILL IN] func_module",
                'perm_module_setting.description' => "[FILL IN] perm_module_setting",
@@ -55,8 +57,6 @@ $LOCAL_LANG = Array (
                '.description' => "[FILL IN] ",
                '.description' => "[FILL IN] ",
                '.description' => "[FILL IN] ",
-               '.description' => "[FILL IN] ",
-               '.description' => "[FILL IN] ",
        )
 );
 ?>
\ No newline at end of file