Fix Bug #838070: Refactor the page browser in list view
This commit is contained in:
parent
37e67cce38
commit
96f0743a32
|
@ -82,23 +82,59 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
|||
|
||||
}
|
||||
|
||||
$output = ($this->piVars['pointer'] > 0 ? $this->pi_linkTP_keepPIvars($this->pi_getLL('firstPage', '<'), array ('pointer' => $this->piVars['pointer'] - 1), TRUE) : $this->pi_getLL('firstPage', '<'));
|
||||
// Get separator.
|
||||
$separator = $this->pi_getLL('separator', ' - ');
|
||||
|
||||
$output .= $this->pi_getLL('separator', ' - ');
|
||||
// Add link to previous page.
|
||||
if ($this->piVars['pointer'] > 0) {
|
||||
|
||||
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<'), array ('pointer' => $this->piVars['pointer'] - 1), TRUE).$separator;
|
||||
|
||||
} else {
|
||||
|
||||
$output = $this->pi_getLL('prevPage', '<').$separator;
|
||||
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $maxPages) {
|
||||
|
||||
$output .= ($this->piVars['pointer'] != $i ? $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d'), $i + 1), array ('pointer' => $i), TRUE) : sprintf($this->pi_getLL('page', '%d'), $i + 1));
|
||||
if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) {
|
||||
|
||||
$output .= $this->pi_getLL('separator', ' - ');
|
||||
if ($this->piVars['pointer'] != $i) {
|
||||
|
||||
$output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d'), $i + 1), array ('pointer' => $i), TRUE).$separator;
|
||||
|
||||
} else {
|
||||
|
||||
$output .= sprintf($this->pi_getLL('page', '%d'), $i + 1).$separator;
|
||||
|
||||
}
|
||||
|
||||
$skip = TRUE;
|
||||
|
||||
} elseif ($skip == TRUE) {
|
||||
|
||||
$output .= $this->pi_getLL('skip', '...').$separator;
|
||||
|
||||
$skip = FALSE;
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
}
|
||||
|
||||
$output .= ($this->piVars['pointer'] < $maxPages - 1 ? $this->pi_linkTP_keepPIvars($this->pi_getLL('lastPage', '>'), array ('pointer' => $this->piVars['pointer'] + 1), TRUE) : $this->pi_getLL('lastPage', '>'));
|
||||
if ($this->piVars['pointer'] < $maxPages - 1) {
|
||||
|
||||
$output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>'), array ('pointer' => $this->piVars['pointer'] + 1), TRUE);
|
||||
|
||||
} else {
|
||||
|
||||
$output .= $this->pi_getLL('nextPage', '>');
|
||||
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
|
|
|
@ -13,10 +13,11 @@
|
|||
<label index="tt_content.pi_flexform.templateFile">Template file</label>
|
||||
<label index="nohits">Nothing found.</label>
|
||||
<label index="count">Entries %d to %d of %d.</label>
|
||||
<label index="firstPage"><</label>
|
||||
<label index="lastPage">></label>
|
||||
<label index="prevPage"><</label>
|
||||
<label index="nextPage">></label>
|
||||
<label index="page">%d</label>
|
||||
<label index="separator"> - </label>
|
||||
<label index="skip">...</label>
|
||||
<label index="orderBy">Order by: </label>
|
||||
<label index="noTitle">[no title]</label>
|
||||
</languageKey>
|
||||
|
@ -28,10 +29,11 @@
|
|||
<label index="tt_content.pi_flexform.templateFile">HTML-Template</label>
|
||||
<label index="nohits">Keine Treffer.</label>
|
||||
<label index="count">Einträge %d bis %d von %d.</label>
|
||||
<label index="firstPage"><</label>
|
||||
<label index="lastPage">></label>
|
||||
<label index="prevPage"><</label>
|
||||
<label index="nextPage">></label>
|
||||
<label index="page">%d</label>
|
||||
<label index="separator"> - </label>
|
||||
<label index="skip">...</label>
|
||||
<label index="orderBy">Sortieren nach: </label>
|
||||
<label index="noTitle">[kein Titel]</label>
|
||||
</languageKey>
|
||||
|
|
Loading…
Reference in New Issue