* Created a new DEFAULT backend module called "manual". It shows a TOC of CSH items...
authorKasper Skårhøj <kasper@typo3.org>
Sat, 29 May 2004 11:28:09 +0000 (11:28 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Sat, 29 May 2004 11:28:09 +0000 (11:28 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@331 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/stddb/tables.php
typo3/alt_intro.php
typo3/mod/help/cshmanual/conf.php [new file with mode: 0755]
typo3/mod/help/cshmanual/ext_icon.gif [new file with mode: 0755]
typo3/stylesheet.css
typo3/sysext/lang/locallang_mod_help_cshmanual.php [new file with mode: 0644]
typo3/sysext/lang/locallang_view_help.php
typo3/view_help.php

index 739d025..ffa8d21 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-29  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * Created a new DEFAULT backend module called "manual". It shows a TOC of CSH items from the system. This will provide a "user sensitive" manual inside of TYPO3 with localized content to the extend that translators has translated CSH labels in the system. The vision is that the Documentation Team will develop CSH content so far that this will become a really good inline reference for users of TYPO3. Also, extension authors are encouraged to implement CSH for their tables and backend modules and let that be the user manual for their products!
+
 2004-05-28  Kasper Skårhøj,,,  <kasper@typo3.com>
 
        * Added new CSH entries at various places using a new method in t3lib_BEfunc. The CSH entries are still empty and needs to be completed.
index 00d467c..869e63d 100755 (executable)
@@ -2707,6 +2707,29 @@ class t3lib_BEfunc       {
        }
 
        /**
+        * Prints TYPO3 Copyright notice for About Modules etc. modules.
+        *
+        * @return      void
+        */
+       function TYPO3_copyRightNotice()        {
+               global $TYPO3_CONF_VARS;
+
+                       // COPYRIGHT NOTICE:
+               $loginCopyrightWarrantyProvider = strip_tags(trim($TYPO3_CONF_VARS['SYS']['loginCopyrightWarrantyProvider']));
+               $loginCopyrightWarrantyURL = strip_tags(trim($TYPO3_CONF_VARS['SYS']['loginCopyrightWarrantyURL']));
+
+               if (strlen($loginCopyrightWarrantyProvider)>=2 && strlen($loginCopyrightWarrantyURL)>=10)       {
+                       $warrantyNote='Warranty is supplied by '.htmlspecialchars($loginCopyrightWarrantyProvider).'; <a href="'.htmlspecialchars($loginCopyrightWarrantyURL).'" target="_blank">click for details.</a>';
+               } else {
+                       $warrantyNote='TYPO3 comes with ABSOLUTELY NO WARRANTY; <a href="http://typo3.com/1316.0.html" target="_blank">click for details.</a>';
+               }
+               $cNotice = '<a href="http://typo3.com/" target="_blank"><img src="gfx/loginlogo_transp.gif" width="75" vspace="2" height="19" alt="TYPO3 logo" align="left" />TYPO3 CMS ver. '.htmlspecialchars($GLOBALS['TYPO_VERSION']).'</a>. Copyright &copy; 1998-2004 Kasper Sk&aring;rh&oslash;j. Extensions are copyright of their respective owners. Go to <a href="http://typo3.com/" target="_blank">http://typo3.com/</a> for details.
+               '.strip_tags($warrantyNote,'<a>').' This is free software, and you are welcome to redistribute it under certain conditions; <a href="http://typo3.com/1316.0.html" target="_blank">click for details</a>. Obstructing the appearance of this notice is prohibited by law.';
+
+               return $cNotice;
+       }
+
+       /**
         * Returns "web" if the $path (absolute) is within the DOCUMENT ROOT - and thereby qualifies as a "web" folder.
         * Usage: 4
         *
index 238bab1..a5938cb 100755 (executable)
@@ -345,7 +345,7 @@ $TBE_MODULES = Array (
        'doc' => '',    // This should always be empty!
        'user' => '',
        'tools' => 'em',
-       'help' => 'about'
+       'help' => 'about,cshmanual'
 );
 
 
index 9d9ce27..ba15044 100755 (executable)
@@ -100,25 +100,9 @@ class SC_alt_intro {
 
                $alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
 
-               $TBE_TEMPLATE->docType='xhtml_trans';
-               $TBE_TEMPLATE->divClass=$TBE_TEMPLATE->bodyTagId;
-               $this->content.=$TBE_TEMPLATE->startPage('About modules');
-
-
-                       // COPYRIGHT NOTICE:
-               $loginCopyrightWarrantyProvider = strip_tags(trim($TYPO3_CONF_VARS['SYS']['loginCopyrightWarrantyProvider']));
-               $loginCopyrightWarrantyURL = strip_tags(trim($TYPO3_CONF_VARS['SYS']['loginCopyrightWarrantyURL']));
-
-               if (strlen($loginCopyrightWarrantyProvider)>=2 && strlen($loginCopyrightWarrantyURL)>=10)       {
-                       $warrantyNote='Warranty is supplied by '.htmlspecialchars($loginCopyrightWarrantyProvider).'; <a href="'.htmlspecialchars($loginCopyrightWarrantyURL).'" target="_blank">click for details.</a>';
-               } else {
-                       $warrantyNote='TYPO3 comes with ABSOLUTELY NO WARRANTY; <a href="http://typo3.com/1316.0.html" target="_blank">click for details.</a>';
-               }
-               $cNotice='<a href="http://typo3.com/" target="_blank"><img src="gfx/loginlogo_transp.gif" width="75" vspace="2" height="19" alt="TYPO3 logo" align="left" />TYPO3 CMS ver. '.htmlspecialchars($GLOBALS['TYPO_VERSION']).'</a>. Copyright &copy; 1998-2004 Kasper Sk&aring;rh&oslash;j. Extensions are copyright of their respective owners. Go to <a href="http://typo3.com/" target="_blank">http://typo3.com/</a> for details.
-               '.strip_tags($warrantyNote,'<a>').' This is free software, and you are welcome to redistribute it under certain conditions; <a href="http://typo3.com/1316.0.html" target="_blank">click for details</a>. Obstructing the appearance of this notice is prohibited by law.';
-
-
-
+               $TBE_TEMPLATE->docType = 'xhtml_trans';
+               $TBE_TEMPLATE->divClass = $TBE_TEMPLATE->bodyTagId;
+               $this->content.= $TBE_TEMPLATE->startPage('About modules');
 
                $this->content.= sprintf('
                        <h1>%s<br />%s</h1>
@@ -128,7 +112,7 @@ class SC_alt_intro {
                        <p>%s</p>',
                        'TYPO3 '.$TYPO_VERSION,
                        $LANG->getLL('introtext'),
-                       $cNotice,
+                       t3lib_BEfunc::TYPO3_copyRightNotice(),
                        $LANG->getLL('introtext2')
                        );
 
diff --git a/typo3/mod/help/cshmanual/conf.php b/typo3/mod/help/cshmanual/conf.php
new file mode 100755 (executable)
index 0000000..3f03834
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+define('TYPO3_MOD_PATH', 'mod/help/cshmanual/');
+$BACK_PATH = '../../../';
+
+$MLANG['default']['tabs_images']['tab'] = 'ext_icon.gif';
+$MLANG['default']['ll_ref'] = 'LLL:EXT:lang/locallang_mod_help_cshmanual.php';
+
+$MCONF['script'] = $BACK_PATH.'view_help.php';
+$MCONF['name'] = 'help_cshmanual';
+?>
\ No newline at end of file
diff --git a/typo3/mod/help/cshmanual/ext_icon.gif b/typo3/mod/help/cshmanual/ext_icon.gif
new file mode 100755 (executable)
index 0000000..aec5e60
Binary files /dev/null and b/typo3/mod/help/cshmanual/ext_icon.gif differ
index ec51561..a95fbd7 100755 (executable)
@@ -253,8 +253,14 @@ TABLE#typo3-TCEforms-palette TR TD.c-close { padding-top: 3px; }
 
 /* Context Sensitive Help window (view_help.php) */
 DIV.typo3-view-help { margin-top: 6px; margin-left: 3px; width:95%; }
+DIV.typo3-view-help H2 { font-size: 14px; text-align: left; margin: 20px 0px 10px 0px; }
 DIV.typo3-view-help H3 { background-color: #ABBBB4; margin-top: 0px;}
 DIV.typo3-view-help H4 { margin-top: 15px; border-bottom: 1px black solid; }
+DIV.typo3-view-help DIV.c-toc { border: 1px solid black; background-color: #D9D5C9; }
+DIV.typo3-view-help DIV.c-toc UL LI { font-size: 11px; font-weight: bold; margin-top: 10px;}
+DIV.typo3-view-help DIV.c-toc UL LI UL LI { font-size: 12px; font-weight: normal; margin-top: 0px;}
+DIV.typo3-view-help P.c-nav { padding: 6px 0px 0px 0px; }
+DIV.typo3-view-help P.c-nav A { background-color: #E7DBA8; font-weight: bold;padding: 2px 2px 2px 2px; }
 
 /* Shortcut frame (alt_shortcut.php) */
 BODY#typo3-alt-shortcut-php { border-top: #9BA1A8 1px solid; margin: 0px 0px 0px 0px; padding: 2px 0px 0px 5px;}
diff --git a/typo3/sysext/lang/locallang_mod_help_cshmanual.php b/typo3/sysext/lang/locallang_mod_help_cshmanual.php
new file mode 100644 (file)
index 0000000..50d00eb
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+# TYPO3 CVS ID: $Id$
+
+$LOCAL_LANG = Array (
+       'default' => Array (
+               'mlang_labels_tablabel' => 'TYPO3 Inline Manual',
+               'mlang_labels_tabdescr' => 'Inline Manual based on the information sources for Context Sensitive Help in the system',
+               'mlang_tabs_tab' => 'Manual',
+       ),
+);
+?>
\ No newline at end of file
index 6f79734..d99127a 100755 (executable)
@@ -8,8 +8,21 @@ $LOCAL_LANG = Array (
                'seeAlso' => 'See also',
                'goBack' => 'Go back',
                'fullDescription' => 'See full description of table',
+               'fullDescription_module' => 'See full description of module',
+               'goToToc' => 'Go to TOC',
+               'to_top' => 'To top',
+               'TOC' => 'Table Of Contents',
+               'TOC_core' => 'TYPO3 Core Features',
+               'TOC_modules' => 'Backend Modules',
+               'TOC_tables' => 'Database Tables',
+               'TOC_other' => 'Other',
                'close' => 'Close',
-               'title' => 'TYPO3 Online Help',
+               'title' => 'TYPO3 Inline Help',
+               'manual_title' => 'TYPO3 Inline User Manual',
+               'introduction' => 'Introduction',
+               'description' => 'The TYPO3 Inline User Manual is dynamically composed from the available help sources in this TYPO3 Installation (Context Sensitive Help). Here you will find a general description of the TYPO3 Core modules, descriptions of installation specific Backend Modules and Database Tables that are available based on your login credentials.',
+               'full_manual' => 'Full Manual (in one page)',
+               'full_manual_chapters' => 'Manual Chapters',
        ),
        'dk' => Array (
                'details' => 'Detaljer',
@@ -18,7 +31,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Gå tilbage',
                'fullDescription' => 'Se hele tabelbeskrivelsen',
                'close' => 'Luk',
-               'title' => 'TYPO3 Online hjælp',
+               'title' => 'TYPO3 Inline hjælp',
        ),
        'de' => Array (
                'details' => 'Details',
@@ -27,7 +40,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Zurück',
                'fullDescription' => 'Komplette Beschreibung der Tabelle ansehen',
                'close' => 'Schliessen',
-               'title' => 'TYPO3 Online Hilfe',
+               'title' => 'TYPO3 Inline Hilfe',
        ),
        'no' => Array (
                'details' => 'Detaljer',
@@ -36,7 +49,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Gå tilbake',
                'fullDescription' => 'Se hele tabellbeskrivelsen',
                'close' => 'Lukk',
-               'title' => 'TYPO3 Online Hjelp',
+               'title' => 'TYPO3 Inline Hjelp',
        ),
        'it' => Array (
                'details' => 'Dettagli',
@@ -45,7 +58,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Indietro',
                'fullDescription' => 'Vedi descrizione completa',
                'close' => 'Chiudi',
-               'title' => 'Typo3 Help Online',
+               'title' => 'Typo3 Help Inline',
        ),
        'fr' => Array (
                'details' => 'Détails',
@@ -70,7 +83,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Ga terug',
                'fullDescription' => 'Bekijk volledige omschrijving van deze tabel.',
                'close' => 'Sluiten',
-               'title' => 'TYPO3 Online Help',
+               'title' => 'TYPO3 Inline Help',
        ),
        'cz' => Array (
                'details' => 'Detaily',
@@ -79,7 +92,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Jít zpìt',
                'fullDescription' => 'Zobrazit úplný popis tabulky',
                'close' => 'Zavøít',
-               'title' => 'Online nápovìda TYPO3',
+               'title' => 'Inline nápovìda TYPO3',
        ),
        'pl' => Array (
                'details' => 'Szczegó³y',
@@ -88,7 +101,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Powrót',
                'fullDescription' => 'Zobacz pe³ny opis tablicy',
                'close' => 'Zamknij',
-               'title' => 'Pomoc online TYPO3',
+               'title' => 'Pomoc Inline TYPO3',
        ),
        'si' => Array (
                'details' => 'Podrobnosti',
@@ -105,7 +118,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Takaisin',
                'fullDescription' => 'Katso koko taulun kuvausta',
                'close' => 'Sulje',
-               'title' => 'Typo3 online ohjeet',
+               'title' => 'Typo3 Inline ohjeet',
        ),
        'tr' => Array (
                'details' => 'Ayrntýlar',
@@ -114,7 +127,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Geri git',
                'fullDescription' => 'Tablonun tüm tanýtýmýný gör',
                'close' => 'Kapat',
-               'title' => 'TYPO3 online yardým',
+               'title' => 'TYPO3 Inline yardým',
        ),
        'se' => Array (
                'details' => 'Detaljer',
@@ -123,7 +136,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Gå tillbaka',
                'fullDescription' => 'Se full förklaring över tabellen',
                'close' => 'Stäng',
-               'title' => 'Typo3 Online-hjälp',
+               'title' => 'Typo3 Inline-hjälp',
        ),
        'pt' => Array (
                'details' => 'Detalhes',
@@ -165,7 +178,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Choï naspä\9d',
                'fullDescription' => 'Pozri celý popis tabu¾ky',
                'close' => 'Zavrie\9d',
-               'title' => 'TYPO3 Online Pomoc',
+               'title' => 'TYPO3 Inline Pomoc',
        ),
        'lt' => Array (
                'details' => 'Detalës',
@@ -190,7 +203,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Natrag',
                'fullDescription' => 'Pogledaj pun opis tablice',
                'close' => 'Zatvori',
-               'title' => 'TYPO3 online pomoæ',
+               'title' => 'TYPO3 Inline pomoæ',
        ),
        'hu' => Array (
                'details' => 'Részletek',
@@ -199,7 +212,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Menj vissza',
                'fullDescription' => 'A tábla teljes leírásának megtekintése',
                'close' => 'Bezár',
-               'title' => 'TYPO3 Online Súgó',
+               'title' => 'TYPO3 Inline Súgó',
        ),
        'gl' => Array (
        ),
@@ -240,7 +253,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Voltar',
                'fullDescription' => 'Ver descrição completa da tabela',
                'close' => 'Fechar',
-               'title' => 'Ajuda Online TYPO3',
+               'title' => 'Ajuda Inline TYPO3',
        ),
        'et' => Array (
                'details' => 'Detailid',
@@ -249,7 +262,7 @@ $LOCAL_LANG = Array (
                'goBack' => 'Tagasi',
                'fullDescription' => 'Tabeli täiskirjeldus',
                'close' => 'Sulge',
-               'title' => 'TYPO3 Online Abi',
+               'title' => 'TYPO3 Inline Abi',
        ),
        'ar' => Array (
                'details' => 'ÊáÇÕêä',
index b3bdb0f..9f4f0ce 100755 (executable)
@@ -29,7 +29,7 @@
  * See Inside TYPO3 for details.
  *
  * $Id$
- * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.7 5/2004 by Kasper Skaarhoj
  * XHTML-trans compliant
  *
  * @author     Kasper Skaarhoj <kasper@typo3.com>
  *
  *
  *
- *   78: class SC_view_help
- *   97:     function init()
- *  119:     function main()
- *  173:     function printContent()
- *  184:     function make_seeAlso($value,$anchorTable='')
- *  222:     function printImage($image,$descr)
- *  244:     function headerLine($str,$type=0)
- *  265:     function prepareContent($str)
- *  280:     function printItem($table,$field,$anchors=0)
- *  316:     function getTableFieldNames($table,$field)
+ *   87: class SC_view_help
+ *  110:     function init()
+ *  130:     function main()
+ *  158:     function printContent()
  *
- * TOTAL FUNCTIONS: 9
+ *              SECTION: Rendering main modes
+ *  181:     function render_TOC()
+ *  280:     function render_TOC_el($table, $tocCat, &$outputSections, &$tocArray, &$CSHkeys)
+ *  311:     function render_TOC_makeTocList($tocArray)
+ *  346:     function render_Table($table)
+ *  391:     function render_Single($table,$field)
+ *
+ *              SECTION: Rendering CSH items
+ *  433:     function make_seeAlso($value,$anchorTable='')
+ *  471:     function printImage($image,$descr)
+ *  493:     function headerLine($str,$type=0)
+ *  514:     function prepareContent($str)
+ *  529:     function printItem($table,$field,$anchors=0)
+ *  565:     function getTableFieldNames($table,$field)
+ *
+ * TOTAL FUNCTIONS: 14
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
 
-require ('init.php');
-require ('template.php');
-include ('sysext/lang/locallang_view_help.php');
-
+require('init.php');
+require('template.php');
+include('sysext/lang/locallang_view_help.php');
+require_once(PATH_t3lib.'class.t3lib_loadmodules.php');
 
 
 
@@ -78,8 +87,6 @@ include ('sysext/lang/locallang_view_help.php');
 class SC_view_help {
        var $allowedHTML = '<strong><em><b><i>';
 
-       var $content;   // Content accumulation.
-
                // For these vars, see init()
        var $limitAccess;       // If set access to fields and tables is checked. Should be done for true database tables.
        var $table;                     // The "table" key
@@ -88,6 +95,12 @@ class SC_view_help {
                // Internal, static: GPvar:
        var $tfID;                      // Table/FIeld id.
        var $back;                      // Back (previous tfID)
+       var $renderALL;         // If set, then in TOC mode the FULL manual will be printed as well!
+
+               // Internal, dynamic:
+       var $content;   // Content accumulation.
+
+
 
        /**
         * Initialize the class for various input etc.
@@ -95,20 +108,18 @@ class SC_view_help {
         * @return      void
         */
        function init() {
-               global $LANG;
+               global $LANG, $TCA;
 
                        // Setting GPvars:
                $this->tfID = t3lib_div::_GP('tfID');
                $this->back = t3lib_div::_GP('back');
+               $this->renderALL = t3lib_div::_GP('renderALL');
 
                        // Set internal table/field to the parts of "tfID" incoming var.
-               list($this->table,$this->field)=explode('.',$this->tfID);
-
-                       // Load descriptions for table $this->table
-               $LANG->loadSingleTableDescription($this->table);
+               list($this->table,$this->field) = explode('.',$this->tfID);
 
                        // limitAccess is checked if the $this->table really IS a table.
-               $this->limitAccess = !isset($TCA[$this->table]) ? 0 : 1;
+               $this->limitAccess = isset($TCA[$this->table]) ? TRUE : FALSE;
        }
 
        /**
@@ -120,51 +131,24 @@ class SC_view_help {
                global $BE_USER,$LANG,$TCA_DESCR,$TCA,$TBE_TEMPLATE;
 
                        // Start HTML output accumulation:
-               $TBE_TEMPLATE->docType='xhtml_trans';
-               $TBE_TEMPLATE->divClass='typo3-view-help';
-               $this->content.=$TBE_TEMPLATE->startPage($LANG->getLL('title'));
-
-                       // If ALL fields is supposed to be shown:
-               if ($this->field=='*')  {
-                               // Load table TCA
-                       t3lib_div::loadTCA($this->table);
-
-                       if (is_array($TCA_DESCR[$this->table]['columns']) && (!$this->limitAccess || $BE_USER->check('tables_select',$this->table)))    {
-                                       // Traverse table columns as listed in TCA_DESCR
-                               $parts=array();
-                               $parts[0]='';   // Reserved for header of table
-                               reset($TCA_DESCR[$this->table]['columns']);
-                               while(list($this->field)=each($TCA_DESCR[$this->table]['columns']))     {
-                                       $fieldValue = isset($TCA[$this->table]) && strcmp($this->field,"") ? $TCA[$this->table]['columns'][$this->field] : array();
-
-                                       if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue['exclude'] || $BE_USER->check('non_exclude_fields',$this->table.':'.$this->field)))   {
-                                               if (!$this->field)      {
-                                                       $parts[0]=$this->printItem($this->table,'',1);
-                                               } else {
-                                                       $parts[]=$this->printItem($this->table,$this->field,1);
-                                               }
-                                       }
-                               }
-
-                               if (!strcmp($parts,"")) unset($parts[0]);
-                               $this->content.= implode('<br />',$parts);
-                       }
-               } else {
-                               // ... otherwise show only single field:
-                       $this->content.=$this->printItem($this->table,$this->field);
-
-                               // Link to Full table description:
-               #       $onClick = 'vHWin=window.open(\'view_help.php?tfID='.rawurlencode($this->table.'.*').'&ONLY='.$LANG->lang.'\',\'fullHelpWindow\',\'width=600,scrollbars=1,status=1,menubar=1,location=1,resizable=1,toolbar=1\');vHWin.focus();return false;';
-                       $onClick = 'document.location = \'view_help.php?tfID='.rawurlencode($this->table.'.*').'&ONLY='.$LANG->lang.'\';return false;';
-                       $this->content.='<br /><p><a href="#" onclick="'.htmlspecialchars($onClick).'">'.htmlspecialchars($LANG->getLL('fullDescription')).'</a></p>';
+               $TBE_TEMPLATE->docType = 'xhtml_trans';
+               $TBE_TEMPLATE->divClass = 'typo3-view-help';
+               $this->content.= $TBE_TEMPLATE->startPage($LANG->getLL('title'));
+
+               if ($this->field=='*')  { // If ALL fields is supposed to be shown:
+                       $this->content.= $this->render_Table($this->table);
+               } elseif ($this->tfID) { // ... otherwise show only single field:
+                       $this->content.= $this->render_Single($this->table,$this->field);
+               } else {        // Render Table Of Contents if nothing else:
+                       $this->content.= $this->render_TOC();
                }
 
                        // Print close-button:
-               $this->content.='<br /><form action=""><input type="submit" value="'.htmlspecialchars($LANG->getLL('close')).'" onclick="self.close(); return false;" /></form>
-                       <br/>';
+#              $this->content.='<br /><form action=""><input type="submit" value="'.htmlspecialchars($LANG->getLL('close')).'" onclick="self.close(); return false;" /></form><br/>';
 
                        // End page:
-               $this->content.=$TBE_TEMPLATE->endPage();
+               $this->content.= '<br/>';
+               $this->content.= $TBE_TEMPLATE->endPage();
        }
 
        /**
@@ -176,6 +160,290 @@ class SC_view_help {
                echo $this->content;
        }
 
+
+
+
+
+
+
+
+
+       /************************************
+        *
+        * Rendering main modes
+        *
+        ************************************/
+
+       /**
+        * Creates Table Of Contents and possibly "Full Manual" mode if selected.
+        *
+        * @return      string          HTML content
+        */
+       function render_TOC()   {
+               global $TCA_DESCR,$TCA,$LANG,$BE_USER,$TBE_MODULES;
+
+                       // Initialize:
+               $CSHkeys = array_flip(array_keys($TCA_DESCR));
+               $TCAkeys = array_keys($TCA);
+
+               $outputSections = array();
+               $tocArray = array();
+
+
+                       // TYPO3 Core Features:
+               $LANG->loadSingleTableDescription('xMOD_csh_corebe');
+               $this->render_TOC_el('xMOD_csh_corebe', 'core', $outputSections, $tocArray, $CSHkeys);
+
+                       // Backend Modules:
+               $loadModules = t3lib_div::makeInstance('t3lib_loadModules');
+               $loadModules->load($TBE_MODULES);
+               foreach($loadModules->modules as $mainMod => $info)     {
+                       $cshKey = '_MOD_'.$mainMod;
+                       if ($CSHkeys[$cshKey])  {
+                               $LANG->loadSingleTableDescription($cshKey);
+                               $this->render_TOC_el($cshKey, 'modules', $outputSections, $tocArray, $CSHkeys);
+                       }
+
+                       if (is_array($info['sub']))     {
+                               foreach($info['sub'] as $subMod => $subInfo)    {
+                                       $cshKey = '_MOD_'.$mainMod.'_'.$subMod;
+                                       if ($CSHkeys[$cshKey])  {
+                                               $LANG->loadSingleTableDescription($cshKey);
+                                               $this->render_TOC_el($cshKey, 'modules', $outputSections, $tocArray, $CSHkeys);
+                                       }
+                               }
+                       }
+               }
+
+                       // Database Tables:
+               foreach($TCAkeys as $table)     {
+                               // Load descriptions for table $table
+                       $LANG->loadSingleTableDescription($table);
+                       if (is_array($TCA_DESCR[$table]['columns']) && $BE_USER->check('tables_select',$table)) {
+                               $this->render_TOC_el($table, 'tables', $outputSections, $tocArray, $CSHkeys);
+                       }
+               }
+
+                       // Other:
+               foreach($CSHkeys as $cshKey => $value)  {
+                       if (!t3lib_div::isFirstPartOfStr($cshKey, '_MOD_') && !isset($TCA[$cshKey]))    {
+                               $LANG->loadSingleTableDescription($cshKey);
+                               $this->render_TOC_el($cshKey, 'other', $outputSections, $tocArray, $CSHkeys);
+                       }
+               }
+
+
+                       // COMPILE output:
+               $output = '';
+               $output.= '
+
+                       <h1>'.$LANG->getLL('manual_title',1).'</h1>
+                       <p>'.t3lib_BEfunc::TYPO3_copyRightNotice().'</p>';
+
+               $output.= '
+
+                       <h1>'.$LANG->getLL('introduction',1).'</h1>
+                       <p>'.$LANG->getLL('description',1).'</p>';
+
+               $output.= '
+
+                       <h1>'.$LANG->getLL('TOC',1).'</h1>'.
+                       $this->render_TOC_makeTocList($tocArray);
+
+               if (!$this->renderALL)  {
+               $output.= '
+                               <br/>
+                               <p class="c-nav"><a href="view_help.php?renderALL=1">'.$LANG->getLL('full_manual',1).'</a></p>';
+               }
+
+               if ($this->renderALL)   {
+                       $output.= '
+
+                               <h1>'.$LANG->getLL('full_manual_chapters',1).'</h1>'.
+                               implode('
+
+
+                               <!-- NEW SECTION: -->
+                               ',$outputSections);
+               }
+
+               return $output;
+       }
+
+       /**
+        * Creates a TOC list element and renders corresponding HELP content if "renderALL" mode is set.
+        *
+        * @param       string          CSH key / Table name
+        * @param       string          TOC category keyword: "core", "modules", "tables", "other"
+        * @param       array           Array for accumulation of rendered HELP Content (in "renderALL" mode). Passed by reference!
+        * @param       array           TOC array; Here TOC index elements are created. Passed by reference!
+        * @param       array           CSH keys array. Every item rendered will be unset in this array so finally we can see what CSH keys are not processed yet. Passed by reference!
+        * @return      void
+        */
+       function render_TOC_el($table, $tocCat, &$outputSections, &$tocArray, &$CSHkeys)        {
+               global $LANG;
+
+               if ($this->renderALL)   {       // Render full manual right here!
+                       $outputSections[$table] = $this->render_Table($table);
+
+                       if ($outputSections[$table])    {
+                               $outputSections[$table] = '
+
+               <!-- New CSHkey/Table: '.$table.' -->
+               <p class="c-nav"><a name="ANCHOR_'.$table.'" href="#">'.$LANG->getLL('to_top',1).'</a></p>
+               <h2>'.$this->getTableFieldLabel($table).'</h2>
+
+               '.$outputSections[$table];
+                               $tocArray[$tocCat][$table] = '<a href="#ANCHOR_'.$table.'">'.$this->getTableFieldLabel($table).'</a>';
+                       } else {
+                               unset($outputSections[$table]);
+                       }
+               } else {        // Only TOC:
+                       $tocArray[$tocCat][$table] = '<p><a href="view_help.php?tfID='.rawurlencode($table.'.*').'">'.$this->getTableFieldLabel($table).'</a></p>';
+               }
+
+                       // Unset CSH key:
+               unset($CSHkeys[$table]);
+       }
+
+       /**
+        * Renders the TOC index as a HTML bullet list from TOC array
+        *
+        * @param       array           ToC Array.
+        * @return      string          HTML bullet list for index.
+        */
+       function render_TOC_makeTocList($tocArray)      {
+               global $LANG;
+
+                       // The Various manual sections:
+               $keys = explode(',', 'core,modules,tables,other');
+
+                       // Create TOC bullet list:
+               $output = '';
+               foreach($keys as $tocKey)       {
+                       if (is_array($tocArray[$tocKey]))       {
+                               $output.='
+                                       <li>'.$LANG->getLL('TOC_'.$tocKey,1).'
+                                               <ul>
+                                                       <li>'.implode('</li>
+                                                       <li>',$tocArray[$tocKey]).'</li>
+                                               </ul>
+                                       </li>';
+                       }
+               }
+
+                       // Compile TOC:
+               $output = '
+
+                       <!-- TOC: -->
+                       <div class="c-toc">
+                               <ul>
+                               '.$output.'
+                               </ul>
+                       </div>';
+
+               return $output;
+       }
+
+       /**
+        * Render CSH for a full cshKey/table
+        *
+        * @param       string          CSH key / table name
+        * @return      string          HTML output
+        */
+       function render_Table($table)   {
+               global $BE_USER,$TCA_DESCR,$TCA,$LANG;
+
+               $output = '';
+
+                       // Load table TCA
+               t3lib_div::loadTCA($table);
+
+                       // Load descriptions for table $table
+               $LANG->loadSingleTableDescription($table);
+
+               if (is_array($TCA_DESCR[$table]['columns']) && (!$this->limitAccess || $BE_USER->check('tables_select',$table)))        {
+                               // Initialize variables:
+                       $parts = array();
+                       $parts[0] = ''; // Reserved for header of table
+
+                               // Traverse table columns as listed in TCA_DESCR
+                       reset($TCA_DESCR[$table]['columns']);
+                       while(list($field) = each($TCA_DESCR[$table]['columns']))       {
+
+                               $fieldValue = isset($TCA[$table]) && strcmp($field,'') ? $TCA[$table]['columns'][$field] : array();
+
+                               if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue['exclude'] || $BE_USER->check('non_exclude_fields',$table.':'.$field)))       {
+                                       if (!$field)    {
+                                               $parts[0] = $this->printItem($table,'',1);      // Header
+                                       } else {
+                                               $parts[] = $this->printItem($table,$field,1);   // Field
+                                       }
+                               }
+                       }
+
+                       if (!strcmp($parts,'')) unset($parts[0]);
+                       $output.= implode('<br />',$parts);
+               }
+
+                       // TOC link:
+               if (!$this->renderALL)  {
+                       $tocLink = '<p class="c-nav"><a href="view_help.php">'.$LANG->getLL('goToToc',1).'</a></p>';
+
+                       $output =
+                               $tocLink.'
+                               <br/>'.
+                               $output.'
+                               <br />'.
+                               $tocLink;
+               }
+
+               return $output;
+       }
+
+       /**
+        * Renders CSH for a single field.
+        *
+        * @param       string          CSH key / table name
+        * @param       string          Sub key / field name
+        * @return      string          HTML output
+        */
+       function render_Single($table,$field)   {
+               global $LANG, $TCA;
+
+               $output = '';
+
+                       // Load descriptions for table $table
+               $LANG->loadSingleTableDescription($table);
+
+                       // Render single item:
+               $output.= $this->printItem($table,$field);
+
+                       // Link to Full table description and TOC:
+               $getLLKey = $this->limitAccess ? 'fullDescription' : 'fullDescription_module';
+               $output.= '<br />
+                       <p class="c-nav"><a href="view_help.php?tfID='.rawurlencode($table.'.*').'">'.$LANG->getLL($getLLKey,1).'</a></p>
+                       <p class="c-nav"><a href="view_help.php">'.$LANG->getLL('goToToc',1).'</a></p>';
+
+               return $output;
+       }
+
+
+
+
+
+
+
+
+
+
+
+       /************************************
+        *
+        * Rendering CSH items
+        *
+        ************************************/
+
        /**
         * Make seeAlso links from $value
         *
@@ -187,26 +455,25 @@ class SC_view_help {
                global $TCA,$BE_USER;
                        // Split references by comma, vert.line or linebreak
                $items = split(',|'.chr(10),$value);
-               reset($items);
-               $lines=array();
-               while(list(,$val)=each($items)) {
+               $lines = array();
+
+               foreach($items as $val) {
                        $val = trim($val);
                        if ($val)       {
                                $iP = explode(':',$val);
                                $iPUrl = t3lib_div::trimExplode('|',$val);
                                        // URL reference:
                                if (substr($iPUrl[1],0,4)=='http')      {
-                                       $lines[]='<a href="'.htmlspecialchars($iPUrl[1]).'" target="_blank"><em>'.htmlspecialchars($iPUrl[0]).'</em></a>';
+                                       $lines[] = '<a href="'.htmlspecialchars($iPUrl[1]).'" target="_blank"><em>'.htmlspecialchars($iPUrl[0]).'</em></a>';
                                } else {
                                        // "table" reference
                                        t3lib_div::loadTCA($iP[0]);
                                        if (!isset($TCA[$iP[0]]) || (is_array($TCA[$iP[0]]['columns'][$iP[1]]) && (!$this->limitAccess || ($BE_USER->check('tables_select',$iP[0]) && (!$TCA[$iP[0]]['columns'][$iP[1]]['exclude'] || $BE_USER->check('non_exclude_fields',$iP[0].':'.$iP[1]))))))      {       // Checking read access:
-                                               list($tableName,$fieldName) = $this->getTableFieldNames($iP[0],$iP[1]);
 
                                                        // Make see-also link:
-                                               $href = ($anchorTable&&$iP[0]==$anchorTable ? '#'.implode('.',$iP) : 'view_help.php?tfID='.rawurlencode(implode('.',$iP)).'&back='.$this->tfID);
-                                               $label = $GLOBALS['LANG']->sL($tableName).($iP[1]?' / '.ereg_replace(':$','',$GLOBALS['LANG']->sL($fieldName)):'');
-                                               $lines[]='<a href="'.htmlspecialchars($href).'">'.htmlspecialchars($label).'</a>';
+                                               $href = ($this->renderALL || ($anchorTable && $iP[0]==$anchorTable) ? '#'.implode('.',$iP) : 'view_help.php?tfID='.rawurlencode(implode('.',$iP)).'&back='.$this->tfID);
+                                               $label = $this->getTableFieldLabel($iP[0],$iP[1],' / ');
+                                               $lines[] = '<a href="'.htmlspecialchars($href).'">'.htmlspecialchars($label).'</a>';
                                        }
                                }
                        }
@@ -225,7 +492,7 @@ class SC_view_help {
                $absImagePath = t3lib_div::getFileAbsFileName($image,1,1);
                if ($absImagePath && @is_file($absImagePath))   {
                        $imgFile = substr($absImagePath,strlen(PATH_site));
-                       $imgInfo=@getimagesize($absImagePath);
+                       $imgInfo = @getimagesize($absImagePath);
                        if (is_array($imgInfo)) {
                                $code = '<br /><img src="../'.$imgFile.'" '.$imgInfo[3].' alt="" /><br />
                                ';
@@ -289,13 +556,10 @@ class SC_view_help {
                                // Make seeAlso references.
                        $seeAlsoRes = $this->make_seeAlso($TCA_DESCR[$table]['columns'][$field]['seeAlso'],$anchors?$table:'');
 
-                               // Get Human Readable table and field labels
-                       list($tableName,$fieldName) = $this->getTableFieldNames($table,$field);
-
                                // Making item:
                        $out= '<a name="'.$table.'.'.$field.'"></a>
                                        '.
-                                       $this->headerLine($LANG->sL($tableName).': '.($field?ereg_replace(':$','',trim($LANG->sL($fieldName))):''),1).
+                                       $this->headerLine($this->getTableFieldLabel($table,$field),1).
                                        $this->prepareContent($TCA_DESCR[$table]['columns'][$field]['description']).
                                        ($TCA_DESCR[$table]['columns'][$field]['details'] ? $this->headerLine($LANG->getLL('details').':').$this->prepareContent($TCA_DESCR[$table]['columns'][$field]['details']) : '').
                                        ($TCA_DESCR[$table]['columns'][$field]['syntax'] ? $this->headerLine($LANG->getLL('syntax').':').$this->prepareContent($TCA_DESCR[$table]['columns'][$field]['syntax']) : '').
@@ -325,6 +589,28 @@ class SC_view_help {
                                                        (isset($TCA[$table])&&isset($TCA[$table]['columns'][$field]) ? $TCA[$table]['columns'][$field]['label'] : $field);
                return array($tableName,$fieldName);
        }
+
+       /**
+        * Returns composite label for table/field
+        *
+        * @param       string          Table name
+        * @param       string          Field name
+        * @param       string          Token to merge the two strings with.
+        * @return      array           Table and field labels in a numeric array
+        * @see getTableFieldNames()
+        */
+       function getTableFieldLabel($table,$field='',$mergeToken=': ')  {
+               global $LANG;
+
+                       // Get table / field parts:
+               list($tableName,$fieldName) = $this->getTableFieldNames($table,$field);
+
+                       // Create label:
+               $labelStr = $LANG->sL($tableName).
+                                       ($field ? $mergeToken.ereg_replace(':$','', trim($LANG->sL($fieldName))):'');
+
+               return $labelStr;
+       }
 }