Project

General

Profile

Feature #17225 » list_patch.diff

Administrator Admin, 2007-04-20 11:43

View differences:

typo3-patch/typo3/stylesheet.css Wed Apr 18 18:44:14 2007
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
......
<label index="defaultLanguage">Default</label>
<label index="multipleLanguages">All languages</label>
<label index="Localize">Localize to:</label>
<label index="nav_first">First</label>
<label index="nav_last">Last</label>
<label index="nav_prev">Previous</label>
<label index="nav_next">Next</label>
<label index="nav_goto">Go to</label>
<label index="nav_showingpageof">Showing %s of %d</label>
</languageKey>
</data>
</T3locallang>
-- 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
......
$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) {
......
// 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
......
($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
......
* 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")
......
$this->HTMLcode.='
</table>';
}
/**
* Creates a forward/reverse button based on the status of ->eCounter, ->firstElementNumber, ->iLimit
*
......
}
}
/**
* Creates the button with link to either forward or reverse
*
......
}
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) ? '<a href="'.$this->listURL().'&pointer='.(($on_page-2)*$this->iLimit ). $tParam.'">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_prev').']</a>' : '<span class="typo3-dblist-inactive">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_prev').']</span>';
$next = (($on_page + 1) <= $total_pages) ? ' <a href="'.$this->listURL().'&pointer='.(($on_page)*$this->iLimit ). $tParam.'">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_next').']</a> ' : '<span class="typo3-dblist-inactive">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_next').']</span>';
$first = ($on_page > 1) ? '<a href="'.$this->listURL().'&pointer=0'.$tParam.'">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_first').']</a>' : '<span class="typo3-dblist-inactive">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_first').']</span>';
$last = $on_page <> $total_pages ? '<a href="'.$this->listURL().'&pointer='.(($total_pages-1)*$this->iLimit).$tParam.'">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_last').']</a>' : '<span class="typo3-dblist-inactive">['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_last').']</span>';
$content = '
<script language="JavaScript" type="text/JavaScript">
<!--
function jumpPagination_' . $table . '(){
page = document.getElementById(\'quickpage_' . $table . '\').value;
if (page > '.$total_pages.') page = '.$total_pages.';
if (page < 1) page = 1;
page = (page-1) * '.$this->iLimit.';
eval("self.location=\''.$this->listURL().$tParam.'&pointer="+page+"\'");
}
//-->
</script>';
$content .= '<div id="typo3-dblist-pagination">';
$content .= $prev . "&nbsp;";
foreach (range($low, $high) as $i){
if($i > 0 && $i <= $total_pages){
$href = $this->listURL().'&pointer='.( ( $i - 1 ) * $this->iLimit ).$tParam;
$from = ( $i - 1 ) * $this->iLimit;
$to = ($this->totalItems > ($from + $this->iLimit) ) ? ($from + $this->iLimit) : $this->totalItems;
$txt = '[' . ($from + 1 ). '-' . $to . ']';
$content .= ( $i == $on_page ) ? '<span class="typo3-dblist-active">'.$txt.'</span> ' : '<a href="'.htmlspecialchars($href).'">' . $txt . '</a> ';
}
}
$content .= $next . '<br/>';
$showing = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_showingpageof'), '<span class="typo3-dblist-active">'. $on_page .'</span>', $total_pages);
$content .= $first .' | '. $showing .' | '. $last .' &nbsp;&nbsp;&nbsp;'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_browse_links.xml:page').' #<input id="quickpage_' . $table . '" size="3" name="quickpage" /> <a href="javascript:jumpPagination_' . $table . '();">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:nav_goto').'</a></div>';
$theData = Array();
$titleCol=$this->fieldArray[0];
$theData[$titleCol] = $content;
$code=$this->addElement(1,'',$theData);
return $code;
}
/**
* Creates the URL to this script, including all relevant GPvars
(1-1/9)