Merge lp:~sebastian-meyer/goobi-presentation/bug838070 into lp:goobi-presentation/1.1

Proposed by Sebastian Meyer
Status: Merged
Merged at revision: 57
Proposed branch: lp:~sebastian-meyer/goobi-presentation/bug838070
Merge into: lp:goobi-presentation/1.1
Diff against target: 102 lines (+49/-11)
2 files modified
dlf/plugins/listview/class.tx_dlf_listview.php (+43/-7)
dlf/plugins/listview/locallang.xml (+6/-4)
To merge this branch: bzr merge lp:~sebastian-meyer/goobi-presentation/bug838070
Reviewer Review Type Date Requested Status
Sebastian Meyer Approve
Review via email: mp+81873@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sebastian Meyer (sebastian-meyer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dlf/plugins/listview/class.tx_dlf_listview.php'
2--- dlf/plugins/listview/class.tx_dlf_listview.php 2011-09-16 13:54:41 +0000
3+++ dlf/plugins/listview/class.tx_dlf_listview.php 2011-11-10 16:25:02 +0000
4@@ -82,23 +82,59 @@
5
6 }
7
8- $output = ($this->piVars['pointer'] > 0 ? $this->pi_linkTP_keepPIvars($this->pi_getLL('firstPage', '<'), array ('pointer' => $this->piVars['pointer'] - 1), TRUE) : $this->pi_getLL('firstPage', '<'));
9-
10- $output .= $this->pi_getLL('separator', ' - ');
11+ // Get separator.
12+ $separator = $this->pi_getLL('separator', ' - ');
13+
14+ // Add link to previous page.
15+ if ($this->piVars['pointer'] > 0) {
16+
17+ $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<'), array ('pointer' => $this->piVars['pointer'] - 1), TRUE).$separator;
18+
19+ } else {
20+
21+ $output = $this->pi_getLL('prevPage', '<').$separator;
22+
23+ }
24
25 $i = 0;
26
27 while ($i < $maxPages) {
28
29- $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));
30-
31- $output .= $this->pi_getLL('separator', ' - ');
32+ if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) {
33+
34+ if ($this->piVars['pointer'] != $i) {
35+
36+ $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d'), $i + 1), array ('pointer' => $i), TRUE).$separator;
37+
38+ } else {
39+
40+ $output .= sprintf($this->pi_getLL('page', '%d'), $i + 1).$separator;
41+
42+ }
43+
44+ $skip = TRUE;
45+
46+ } elseif ($skip == TRUE) {
47+
48+ $output .= $this->pi_getLL('skip', '...').$separator;
49+
50+ $skip = FALSE;
51+
52+ }
53
54 $i++;
55
56 }
57
58- $output .= ($this->piVars['pointer'] < $maxPages - 1 ? $this->pi_linkTP_keepPIvars($this->pi_getLL('lastPage', '&gt;'), array ('pointer' => $this->piVars['pointer'] + 1), TRUE) : $this->pi_getLL('lastPage', '&gt;'));
59+ if ($this->piVars['pointer'] < $maxPages - 1) {
60+
61+ $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '&gt;'), array ('pointer' => $this->piVars['pointer'] + 1), TRUE);
62+
63+ } else {
64+
65+ $output .= $this->pi_getLL('nextPage', '&gt;');
66+
67+ }
68
69 return $output;
70
71
72=== modified file 'dlf/plugins/listview/locallang.xml'
73--- dlf/plugins/listview/locallang.xml 2011-09-16 13:54:41 +0000
74+++ dlf/plugins/listview/locallang.xml 2011-11-10 16:25:02 +0000
75@@ -13,10 +13,11 @@
76 <label index="tt_content.pi_flexform.templateFile">Template file</label>
77 <label index="nohits">Nothing found.</label>
78 <label index="count">Entries %d to %d of %d.</label>
79- <label index="firstPage">&lt;</label>
80- <label index="lastPage">&gt;</label>
81+ <label index="prevPage">&lt;</label>
82+ <label index="nextPage">&gt;</label>
83 <label index="page">%d</label>
84 <label index="separator"> - </label>
85+ <label index="skip">...</label>
86 <label index="orderBy">Order by: </label>
87 <label index="noTitle">[no title]</label>
88 </languageKey>
89@@ -28,10 +29,11 @@
90 <label index="tt_content.pi_flexform.templateFile">HTML-Template</label>
91 <label index="nohits">Keine Treffer.</label>
92 <label index="count">Einträge %d bis %d von %d.</label>
93- <label index="firstPage">&lt;</label>
94- <label index="lastPage">&gt;</label>
95+ <label index="prevPage">&lt;</label>
96+ <label index="nextPage">&gt;</label>
97 <label index="page">%d</label>
98 <label index="separator"> - </label>
99+ <label index="skip">...</label>
100 <label index="orderBy">Sortieren nach: </label>
101 <label index="noTitle">[kein Titel]</label>
102 </languageKey>

Subscribers

People subscribed via source and target branches

to all changes: