Fixed bug #13294: IRRE deleted combo records are still validated by TBE_EDITOR (Thank...
[Packages/TYPO3.CMS.git] / typo3 / class.db_list_extra.inc
index bb189be..91a8a65 100644 (file)
@@ -2,7 +2,7 @@
 /*************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  * Used specifically for the Web>List module (db_list.php)
  *
  * $Id$
- * Revised for TYPO3 3.6 December/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.6 December/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -83,7 +83,7 @@
 /**
  * Class for rendering of Web>List module
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -469,32 +469,18 @@ class localRecordList extends recordList {
                                // Header line is drawn
                        $theData = Array();
                        if ($this->disableSingleTableView)      {
-                               $theData[$titleCol] = '<span class="c-table">'.$GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'],1).'</span> ('.$this->totalItems.')';
+                               $theData[$titleCol] = '<span class="c-table">' . t3lib_BEfunc::wrapInHelp($table, '', $GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'], TRUE)) . '</span> ('.$this->totalItems.')';
                        } else {
                                $theData[$titleCol] = $this->linkWrapTable($table, '<span class="c-table">' . $GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'], TRUE) . '</span> (' . $this->totalItems . ') ' .
                                                ($this->table ? t3lib_iconWorks::getSpriteIcon('actions-view-table-collapse', array('title' => $GLOBALS['LANG']->getLL('contractView', TRUE))) : t3lib_iconWorks::getSpriteIcon('actions-view-table-expand', array('title' => $GLOBALS['LANG']->getLL('expandView', TRUE))))
                                        );
                        }
 
-                               // CSH:
-                       $theData[$titleCol].= t3lib_BEfunc::cshItem($table,'',$this->backPath,'',FALSE,'margin-bottom:0px; white-space: normal;');
-
                        if ($listOnlyInSingleTableMode) {
                                $out.='
                                        <tr>
-                                               <td class="t3-row-header" style="width:95%;">' . $theData[$titleCol] . '</td>
+                                               <td class="t3-row-header" style="width:95%;">' . t3lib_BEfunc::wrapInHelp($table, '', $theData[$titleCol]) . '</td>
                                        </tr>';
-
-                               if ($GLOBALS['BE_USER']->uc["edit_showFieldHelp"])      {
-                                       $GLOBALS['LANG']->loadSingleTableDescription($table);
-                                       if (isset($GLOBALS['TCA_DESCR'][$table]['columns']['']))        {
-                                               $onClick = 'vHWin=window.open(\'view_help.php?tfID='.$table.'.\',\'viewFieldHelp\',\'height=400,width=600,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
-                                               $out.='
-                                       <tr>
-                                               <td class="c-tableDescription">'.t3lib_BEfunc::helpTextIcon($table,'',$this->backPath,TRUE).$GLOBALS['TCA_DESCR'][$table]['columns']['']['description'].'</td>
-                                       </tr>';
-                                       }
-                               }
                        } else {
                                // Render collapse button if in multi table mode
                                $collapseIcon = '';
@@ -593,8 +579,7 @@ class localRecordList extends recordList {
 
                                        // Record navigation is added to the beginning and end of the table if in single table mode
                                if ($this->table) {
-                                       $pageNavigation = $this->renderListNavigation();
-                                       $iOut = $pageNavigation . $iOut . $pageNavigation;
+                                       $iOut = $this->renderListNavigation('top') . $iOut . $this->renderListNavigation('bottom');
                                } else {
                                                // show that there are more records than shown
                                        if ($this->totalItems > $this->itemsLimitPerTable) {
@@ -773,7 +758,7 @@ class localRecordList extends recordList {
         * @param       integer         Uid of current record
         * @return      void
         *
-        * @deprecated since 4.4: Use getReferenceCount instead
+        * @deprecated since 4.4, will be removed in TYPO3 4.6 - Use getReferenceCount instead
         */
        function setReferences($table, $uid) {
                t3lib_div::logDeprecatedFunction();
@@ -1002,10 +987,11 @@ class localRecordList extends recordList {
        /**
         * Creates a page browser for tables with many records
         *
+        * @param       string          Distinguish between 'top' and 'bottom' part of the navigation (above or below the records)
         * @return      string  Navigation HTML
         *
         */
-       protected function renderListNavigation() {
+       protected function renderListNavigation($renderPart = 'top') {
                $totalPages = ceil($this->totalItems / $this->iLimit);
 
                $content = '';
@@ -1061,18 +1047,17 @@ class localRecordList extends recordList {
                        }
 
                        $reload = '<a href="#" onclick="document.dblistForm.action=\''
-                               . $listURL . '&pointer=\'+calculatePointer(); document.dblistForm.submit(); return true;" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:reload', TRUE) . '">' .
+                               . $listURL . '&pointer=\'+calculatePointer(document.getElementById(\'jumpPage-' . $renderPart .'\').value); document.dblistForm.submit(); return true;" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:reload', TRUE) . '">' .
                                        t3lib_iconWorks::getSpriteIcon('actions-system-refresh') .
                                '</a>';
 
-                       // Add js to traverse a page select input to a pointer value
-                       $content = '
+                       if ($renderPart === 'top') {
+                                       // Add js to traverse a page select input to a pointer value
+                               $content = '
 <script type="text/JavaScript">
 /*<![CDATA[*/
 
-       function calculatePointer(){
-               page = document.getElementById(\'jumpPage\').value;
-
+       function calculatePointer(page) {
                if (page > ' . $totalPages . ') {
                        page = ' . $totalPages . ';
                }
@@ -1089,10 +1074,10 @@ class localRecordList extends recordList {
 /*]]>*/
 </script>
 ';
-
+                       }
                        $pageNumberInput = '<span>
                                <input type="text" value="' . $currentPage
-                               . '" size="3" id="jumpPage" name="jumpPage" onkeyup="if (event.keyCode == Event.KEY_RETURN) { document.dblistForm.action=\'' . $listURL . '&pointer=\'+calculatePointer(); document.dblistForm.submit(); } return true;" />
+                               . '" size="3" id="jumpPage-' . $renderPart . '" name="jumpPage-' . $renderPart . '" onkeyup="if (event.keyCode == Event.KEY_RETURN) { document.dblistForm.action=\'' . $listURL . '&pointer=\'+calculatePointer(this.value); document.dblistForm.submit(); } return true;" />
                                </span>';
                        $pageIndicator = '<span class="pageIndicator">'
                                . sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:pageIndicator'), $pageNumberInput, $totalPages)
@@ -1347,7 +1332,7 @@ class localRecordList extends recordList {
                /**
                 * @hook                        recStatInfoHooks: Allows to insert HTML before record icons on various places
                 * @date                        2007-09-22
-                * @request             Kasper Skaarhoj  <kasper2007@typo3.com>
+                * @request             Kasper Skårhøj  <kasper2007@typo3.com>
                 */
                if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['recStatInfoHooks']))     {
                        $stat='';
@@ -1475,7 +1460,7 @@ class localRecordList extends recordList {
         * @param       integer         UID of record
         * @return      string          HTML-table
         *
-        * @deprecated since 4.4: Use getReferenceHTML() instead
+        * @deprecated since 4.4, will be removed in TYPO3 4.6 - Use getReferenceHTML() instead
         */
        function makeRef($table,$uid)   {
                t3lib_div::logDeprecatedFunction();