Merge lp:~henrik-lochmann/goobi-presentation/bug-1049565 into lp:~slub.team/goobi-presentation/old-bzr-trunk

Proposed by Henrik Lochmann
Status: Merged
Approved by: Sebastian Meyer
Approved revision: 115
Merged at revision: 115
Proposed branch: lp:~henrik-lochmann/goobi-presentation/bug-1049565
Merge into: lp:~slub.team/goobi-presentation/old-bzr-trunk
Diff against target: 66 lines (+22/-2)
2 files modified
dlf/plugins/listview/class.tx_dlf_listview.php (+16/-2)
dlf/plugins/listview/locallang.xml (+6/-0)
To merge this branch: bzr merge lp:~henrik-lochmann/goobi-presentation/bug-1049565
Reviewer Review Type Date Requested Status
Sebastian Meyer Approve
Review via email: mp+123941@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 2012-08-22 19:22:29 +0000
3+++ dlf/plugins/listview/class.tx_dlf_listview.php 2012-09-12 12:24:27 +0000
4@@ -293,6 +293,17 @@
5
6 }
7
8+ $sorting .= '</select>';
9+
10+ // sort direction
11+ $uniqId = uniqid($prefix.'-');
12+
13+ $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('direction', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[direction]" onchange="javascript:this.form.submit();">';
14+
15+ $sorting .= '<option value="asc" '.(($this->list->metadata['options']['order_direction'] === 'asc') ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.asc', '', TRUE).'</option>';
16+
17+ $sorting .= '<option value="desc" '.(($this->list->metadata['options']['order_direction'] === 'desc') ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.desc', '', TRUE).'</option>';
18+
19 $sorting .= '</select></div></form>';
20
21 return $sorting;
22@@ -457,15 +468,18 @@
23 $this->list = t3lib_div::makeInstance('tx_dlf_list');
24
25 // Sort the list if applicable.
26- if (!empty($this->piVars['order']) && $this->piVars['order'] != $this->list->metadata['options']['order']) {
27+ if ((!empty($this->piVars['order']) && $this->piVars['order'] != $this->list->metadata['options']['order'])
28+ || (!empty($this->piVars['direction']) && $this->piVars['direction'] != $this->list->metadata['options']['order_direction'])) {
29
30 // Order list by given field.
31- $this->list->sort($this->piVars['order'], TRUE);
32+ $this->list->sort($this->piVars['order'], $this->piVars['direction'] === 'asc' ? TRUE : FALSE);
33
34 // Update list's metadata.
35 $listMetadata = $this->list->metadata;
36
37 $listMetadata['options']['order'] = $this->piVars['order'];
38+
39+ $listMetadata['options']['order_direction'] = $this->piVars['direction'];
40
41 $this->list->metadata = $listMetadata;
42
43
44=== modified file 'dlf/plugins/listview/locallang.xml'
45--- dlf/plugins/listview/locallang.xml 2012-08-14 15:39:30 +0000
46+++ dlf/plugins/listview/locallang.xml 2012-09-12 12:24:27 +0000
47@@ -20,6 +20,9 @@
48 <label index="skip">...</label>
49 <label index="orderBy">Order by: </label>
50 <label index="relevance">relevance</label>
51+ <label index="direction">Direction:</label>
52+ <label index="direction.asc">ascending</label>
53+ <label index="direction.desc">descending</label>
54 <label index="noTitle">[no title]</label>
55 </languageKey>
56 <languageKey index="de" type="array">
57@@ -37,6 +40,9 @@
58 <label index="skip">...</label>
59 <label index="orderBy">Sortieren nach: </label>
60 <label index="relevance">Relevanz</label>
61+ <label index="direction">Richtung:</label>
62+ <label index="direction.asc">aufsteigend</label>
63+ <label index="direction.desc">absteigend</label>
64 <label index="noTitle">[kein Titel]</label>
65 </languageKey>
66 </data>

Subscribers

People subscribed via source and target branches