Index: typo3/sysext/lang/locallang_common.xml =================================================================== --- typo3/sysext/lang/locallang_common.xml (revision 5069) +++ typo3/sysext/lang/locallang_common.xml (working copy) @@ -23,11 +23,13 @@ + + Index: typo3/sysext/lang/locallang_mod_web_list.xml =================================================================== --- typo3/sysext/lang/locallang_mod_web_list.xml (revision 5069) +++ typo3/sysext/lang/locallang_mod_web_list.xml (working copy) @@ -51,6 +51,7 @@ + \ No newline at end of file Index: typo3/class.db_list_extra.inc =================================================================== --- typo3/class.db_list_extra.inc (revision 5069) +++ typo3/class.db_list_extra.inc (working copy) @@ -514,13 +514,8 @@ $iOut = ''; $cc = 0; foreach($accRows as $row) { - - // Forward/Backwards navigation links: - list($flag,$code) = $this->fwd_rwd_nav($table); - $iOut.=$code; - - // If render item, increment counter and call function - if ($flag) { + // Render item row if counter < limit + if ($cc < $this->iLimit) { $cc++; $iOut.= $this->renderListRow($table,$row,$cc,$titleCol,$thumbsCol); @@ -557,6 +552,11 @@ $this->eCounter++; } + // Record navigation is added to the end of the table if in single table mode + if ($this->table) { + $iOut .= $this->renderListNavigation(); + } + // The header row for the table is now created: $out.=$this->renderListHeader($table,$currentIdList); } @@ -885,10 +885,135 @@ return $this->addelement(1, $icon, $theData, ' class="c-headLine"', ''); } + /** + * Creates a page browser for tables with many records + * + * @return string Navigation HTML + * + * @author Dmitry Pikhno + * @author Christian Kuhn + */ + protected function renderListNavigation() { + $totalPages = ceil($this->totalItems / $this->iLimit); + + $content = ''; + + // Show page selector if not all records fit into one page + if ($totalPages > 1) { + $first = $previous = $next = $last = $reload = ''; + $listURL = $this->listURL('', $this->table); + + // 1 = first page + $currentPage = floor(($this->firstElementNumber + 1) / $this->iLimit) + 1; + + // Compile first, previous, next, last and refresh buttons + if ($currentPage > 1) { + $labelFirst = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:first'); + + $first = ' + backPath, 'gfx/control_start_blue.png') + . 'alt="' . $labelFirst . '" title="' . $labelFirst . '" /> + '; + } else { + $first = 'backPath, 'gfx/control_start.png') . 'alt="" title="" />'; + } + + if (($currentPage - 1) > 0) { + $labelPrevious = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:previous'); + + $previous = ' + backPath, 'gfx/control_rewind_blue.png') + . 'alt="' . $labelPrevious . '" title="' . $labelPrevious . '" /> + '; + } else { + $previous = 'backPath, 'gfx/control_rewind.png') . 'alt="" title="" />'; + } + + if (($currentPage + 1) <= $totalPages) { + $labelNext = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:next'); + $next = ' + backPath, 'gfx/control_fastforward_blue.png') + . 'alt="' . $labelNext . '" title="' . $labelNext . '" /> + '; + } else { + $next = 'backPath, 'gfx/control_fastforward.png') . 'alt="" title="" />'; + } + if ($currentPage != $totalPages) { + $labelLast = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:last'); + $last = ' + backPath, 'gfx/control_end_blue.png') + . 'alt="' . $labelLast . '" title="' . $labelLast . '" /> + '; + } else { + $last = 'backPath, 'gfx/control_end.png') . 'alt="" title="" />'; + } + $reload = ' + backPath, 'gfx/refresh_n.gif') + . 'alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:reload') + . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:reload') + . '" />'; + + + + + // Add js to traverse a page select input to a pointer value + $content = ' + +'; + + $pageNumberInput = ' + + '; + $pageIndicator = '' + . sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:pageIndicator'), $pageNumberInput, $totalPages) + . ''; + + $content .= '
' + . $first . $previous + . '' + . $pageIndicator . '' + . $next . $last . '' + . $reload + . '
'; + } // end of if pages > 1 + + $data = Array(); + $titleColumn = $this->fieldArray[0]; + $data[$titleColumn] = $content; + + return ($this->addElement(1, '', $data)); + } + + + + + /********************************* * Index: typo3/stylesheet.css =================================================================== --- typo3/stylesheet.css (revision 5069) +++ typo3/stylesheet.css (working copy) @@ -1918,6 +1918,21 @@ width: 93%; } +div#typo3-dblist-pagination { + padding: 5px 0; +} +div#typo3-dblist-pagination img, div#typo3-dblist-pagination span.pageIndicator { + margin-right: 6px; +} +div#typo3-dblist-pagination img { + vertical-align: bottom; +} +div#typo3-dblist-pagination span.bar { + border-left: 1px solid #5485c3; + margin-right: 6px; +} + + /* - - - - - - - - - - - - - - - - - - - - - Index: typo3/class.db_list.inc =================================================================== --- typo3/class.db_list.inc (revision 5069) +++ typo3/class.db_list.inc (working copy) @@ -642,6 +642,7 @@ * Creates the URL to this script, including all relevant GPvars * Fixed GPvars are id, table, imagemode, returlUrl, search_field, search_levels and showLimit * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $exclList variable. + * This method overrides listURL() from base class t3lib_recordlist * * @param string Alternative id value. Enter blank string for the current id ($this->id) * @param string Tablename to display. Enter "-1" for the current table.