Fixed bug #15801: Deprecate t3lib_div::rm_endcomma
[Packages/TYPO3.CMS.git] / typo3 / sysext / lowlevel / dbint / index.php
index 9b34118..b53dbf4 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -29,7 +29,7 @@
  *
  * This module lets you check if all pages and the records relate properly to each other
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @coauthor   Jo Hasenau <info@cybercraft.de>
  */
 /**
@@ -76,7 +76,7 @@ $BE_USER->modAccess($MCONF,1);
 /**
  * Script class for the DB int module
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tx_lowlevel
  */
@@ -155,7 +155,6 @@ class SC_mod_tools_dbint_index {
                        'function' => array(
                                0 => $GLOBALS['LANG']->getLL('menu', true),
                                'records' => $GLOBALS['LANG']->getLL('recordStatistics', true),
-                               'tree' => $GLOBALS['LANG']->getLL('totalPageTree', true),
                                'relations' => $GLOBALS['LANG']->getLL('databaseRelations', true),
                                'search' => $GLOBALS['LANG']->getLL('fullSearch', true),
                                'filesearch' => $GLOBALS['LANG']->getLL('findFilename', true),
@@ -243,9 +242,6 @@ class SC_mod_tools_dbint_index {
                        case 'search':
                                $this->func_search();
                        break;
-                       case 'tree':
-                               $this->func_tree();
-                       break;
                        case 'records':
                                $this->func_records();
                        break;
@@ -326,15 +322,23 @@ class SC_mod_tools_dbint_index {
         * @return      void
         */
        function func_default() {
-               global $LANG;
+               $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
+
+               $content = '<dl class="t3-overview-list">';
+
+               $availableModFuncs = array('records', 'relations', 'search', 'filesearch', 'refindex');
+               foreach ($availableModFuncs as $modFunc) {
+                       $link = 'index.php?SET[function]=' . $modFunc;
+                       $title = $GLOBALS['LANG']->getLL($modFunc);
+                       $description = $GLOBALS['LANG']->getLL($modFunc . '_description');
+                       $content .= '
+                               <dt><a href="' . $link . '">' . $title . '</a></dt>
+                               <dd>' . $description . '</dd>
+                       ';
+               }
 
-               $this->content.=$this->doc->header($GLOBALS['LANG']->getLL('title'));
-               $this->content.=$this->doc->section('<a href="index.php?SET[function]=records">' . $GLOBALS['LANG']->getLL('records') . '</a>',$GLOBALS['LANG']->getLL('records_description'),1,1,0,1);
-               $this->content.=$this->doc->section('<a href="index.php?SET[function]=tree">' . $GLOBALS['LANG']->getLL('tree') . '</a>',$GLOBALS['LANG']->getLL('tree_description'),1,1,0,1);
-               $this->content.=$this->doc->section('<a href="index.php?SET[function]=relations">' . $GLOBALS['LANG']->getLL('relations') . '</a>',$GLOBALS['LANG']->getLL('relations_description'),1,1,0,1);
-               $this->content.=$this->doc->section('<a href="index.php?SET[function]=search">' . $GLOBALS['LANG']->getLL('search') . '</a>',$GLOBALS['LANG']->getLL('search_description'),1,1,0,1);
-               $this->content.=$this->doc->section('<a href="index.php?SET[function]=filesearch">' . $GLOBALS['LANG']->getLL('filesearch') . '</a>',$GLOBALS['LANG']->getLL('filesearch_description'),1,1,0,1);
-               $this->content.=$this->doc->section('<a href="index.php?SET[function]=refindex">' . $GLOBALS['LANG']->getLL('refindex') . '</a>',$GLOBALS['LANG']->getLL('refindex_description'),1,1,0,1);
+               $content .= '</dl>';
+               $this->content .= $content;
        }
 
 
@@ -426,27 +430,6 @@ class SC_mod_tools_dbint_index {
                }
        }
 
-       /**
-        * Display page tree
-        *
-        * @return      void
-        */
-       function func_tree()    {
-               global $LANG,$BACK_PATH;
-
-               $startID = 0;
-               $admin = t3lib_div::makeInstance('t3lib_admin');
-               $admin->genTree_makeHTML=1;
-               $admin->backPath = $BACK_PATH;
-               $admin->genTree(intval($startID),'<img src="' . $BACK_PATH . 'clear.gif" width="1" height="1" align="top" alt="" />');
-
-               $this->content.= $this->doc->header($GLOBALS['LANG']->getLL('tree'));
-               $this->content.= $this->doc->spacer(5);
-               $this->content.= $this->doc->sectionEnd();
-
-               $this->content.= $admin->genTree_HTML;
-               $this->content.= $admin->lostRecords($admin->genTree_idlist.'0');
-       }
 
        /**
         * Records overview
@@ -500,16 +483,16 @@ class SC_mod_tools_dbint_index {
                }
 
                        // Tables and lost records
-               $id_list = '-1,0,'.implode(array_keys($admin->page_idArray),',');
-               $id_list = t3lib_div::rm_endcomma($id_list);
+               $id_list = '-1,0,' . implode(',', array_keys($admin->page_idArray));
+               $id_list = rtrim($id_list, ',');
                $admin->lostRecords($id_list);
 
-               if ($admin->fixLostRecord(t3lib_div::_GET('fixLostRecords_table'),t3lib_div::_GET('fixLostRecords_uid')))       {
+               if ($admin->fixLostRecord(t3lib_div::_GET('fixLostRecords_table'), t3lib_div::_GET('fixLostRecords_uid'))) {
                        $admin = t3lib_div::makeInstance('t3lib_admin');
                        $admin->backPath = $BACK_PATH;
                        $admin->genTree(0,'');
-                       $id_list = '-1,0,'.implode(array_keys($admin->page_idArray),',');
-                       $id_list = t3lib_div::rm_endcomma($id_list);
+                       $id_list = '-1,0,' . implode(',', array_keys($admin->page_idArray));
+                       $id_list = rtrim($id_list, ',');
                        $admin->lostRecords($id_list);
                }
 
@@ -530,7 +513,7 @@ class SC_mod_tools_dbint_index {
                                if ($TCA[$t]['ctrl']['hideTable']) {
                                        continue;
                                }
-                               $codeArr[$t][]=t3lib_iconWorks::getIconImage($t,array(),$BACK_PATH,'hspace="4" align="top"');
+                               $codeArr[$t][]=t3lib_iconWorks::getSpriteIconForRecord($t, array());
                                $codeArr[$t][]=$LANG->sL($TCA[$t]['ctrl']['title']);
                                $codeArr[$t][]=$t;
 
@@ -704,4 +687,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
+?>
\ No newline at end of file