--- typo3-trunk/typo3/stylesheet.css Thu Apr 19 14:39:13 2007 +++ typo3-patch/typo3/stylesheet.css Wed Apr 18 18:44:14 2007 @@ -444,6 +444,10 @@ INPUT.smallCheckboxes { vertical-align: middle; margin: 0px; padding: 0px; width: 12px; height: 12px; } DIV#typo3-listOptions { margin: 10px 0px 10px 0px; } +DIV#typo3-dblist-pagination { padding: 5px 0;} +SPAN.typo3-dblist-inactive { color: #666; } +SPAN.typo3-dblist-active { font-weight: bold; } + /* File > List */ TABLE#typo3-filelist IMG { vertical-align: middle; } TABLE#typo3-filelist TR TD { padding-left: 1px; padding-right: 6px; } --- typo3-trunk/typo3/sysext/lang/locallang_mod_web_list.xml Thu Apr 19 14:41:12 2007 +++ typo3-patch/typo3/sysext/lang/locallang_mod_web_list.xml Wed Apr 18 14:27:26 2007 @@ -49,6 +49,12 @@ + + + + + + --- typo3-trunk/typo3/class.db_list_extra.inc Thu Apr 19 14:39:26 2007 +++ typo3-patch/typo3/class.db_list_extra.inc Fri Apr 20 11:29:40 2007 @@ -481,9 +481,11 @@ $cc = 0; foreach($accRows as $row) { - // Forward/Backwards navigation links: + // Forward/Backwards navigation links: list($flag,$code) = $this->fwd_rwd_nav($table); - $iOut.=$code; + if(!$GLOBALS['SOBE']->modTSconfig['properties']['pagination']){ + $iOut.=$code; + } // If render item, increment counter and call function if ($flag) { @@ -526,6 +528,11 @@ // The list of records is added after the header: $out.=$iOut; + + // Pagination is added to the end of table + if($GLOBALS['SOBE']->modTSconfig['properties']['pagination']){ + $out.=$this->pagination_HTML($this->firstElementNumber, $this->eCounter, $table); + } // ... and it is all wrapped in a table: $out=' --- typo3-trunk/typo3/class.db_list.inc Mon Feb 12 10:11:17 2007 +++ typo3-patch/typo3/class.db_list.inc Fri Apr 20 11:38:58 2007 @@ -651,7 +651,8 @@ ($this->searchLevels?'&search_levels='.rawurlencode($this->searchLevels):''). ($this->showLimit?'&showLimit='.rawurlencode($this->showLimit):''). ((!$exclList || !t3lib_div::inList($exclList,'sortField')) && $this->sortField?'&sortField='.rawurlencode($this->sortField):''). - ((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):'') + ((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):''). + ($this->firstElementNumber?'&pointer='.rawurlencode($this->firstElementNumber):'') ; } --- typo3-trunk/t3lib/class.t3lib_recordlist.php Thu Apr 19 14:39:05 2007 +++ typo3-patch/t3lib/class.t3lib_recordlist.php Fri Apr 20 11:41:29 2007 @@ -44,10 +44,11 @@ * 206: function writeBottom() * 225: function fwd_rwd_nav($table='') * 258: function fwd_rwd_HTML($type,$pointer,$table='') - * 284: function listURL($altId='') - * 294: function CBfunctions() - * 344: function initializeLanguages() - * 411: function languageFlag($sys_language_uid) + * 287: function pagination_HTML($pointer,$table='') + * 371: function listURL($altId='') + * 381: function CBfunctions() + * 431: function initializeLanguages() + * 457: function languageFlag($sys_language_uid) * * TOTAL FUNCTIONS: 9 * (This index is automatically created/updated by the extension "extdeveval") @@ -215,7 +216,7 @@ $this->HTMLcode.=' '; } - + /** * Creates a forward/reverse button based on the status of ->eCounter, ->firstElementNumber, ->iLimit * @@ -245,7 +246,7 @@ } } - + /** * Creates the button with link to either forward or reverse * @@ -274,6 +275,93 @@ } return $content; } + + /** + * Creates the pagination + * + * @param integer Pointer + * @param integer Last record number + * @param string Table name + * @return string + * @access private + */ + function pagination_HTML( $pointer, $last, $table = '') { + if ($pointer && $this->iLimit > $pointer) { + $this->iLimit = $pointer; + } + $pointer = $pointer + $this->iLimit - 1; + $total_pages = ceil($this->totalItems/$this->iLimit); + $show = $GLOBALS['SOBE']->modTSconfig['properties']['pagination.']['linksBetween']; + $show = $show ? $show : 5; + + $tParam = $table ? '&table='.rawurlencode($table) : ''; + //if ($type == 'rwd') $pointer = $pointer - $this->iLimit; + if ( $total_pages <= 1){ + return ''; + } + $on_page = floor($pointer/$this->iLimit) + 1; + + $disp = floor($show / 2); + if ( $on_page <= $disp) { + $low = ( ($disp - $on_page) > 0 ) ? ($disp - $on_page) : 1; + $high = ($low + $show) - 1; + } + elseif ( ($on_page + $disp) > $total_pages) { + $high = $total_pages; + $low = ($total_pages - $show) + 1; + } + else { + $low = ($on_page - $disp); + $high = ($on_page + $disp); + } + + $prev = (($on_page - 1) > 0) ? '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_prev').']' : '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_prev').']'; + + $next = (($on_page + 1) <= $total_pages) ? ' ['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_next').'] ' : '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_next').']'; + + $first = ($on_page > 1) ? '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_first').']' : '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_first').']'; + + $last = $on_page <> $total_pages ? '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_last').']' : '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_last').']'; + + + $content = ' + '; + + $content .= '