Changeset 153 for trunk/lib/SortOrder.inc.php
- Timestamp:
- Jun 7, 2006 8:41:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/SortOrder.inc.php
r152 r153 39 39 $this->default_sort = $default_sort; 40 40 $this->default_order = $default_order; 41 42 $this->prefs = new Prefs(); 43 $this->prefs->setParam(array('persistent' => false)); 41 44 } 42 45 … … 69 72 function setDefault($default_sort = '', $default_order = '') 70 73 { 71 $prefs =& Prefs::getInstance($_SERVER['PHP_SELF']);72 $prefs->setParam(array('persistent' => false));73 74 74 // Which column to sort by? 75 75 // (1) By GET or POST specification, if available. … … 79 79 if (!empty($new_sort_by)) { 80 80 $this->sort_by = $new_sort_by; 81 $ prefs->set('sort_by', $this->sort_by);82 } else if ($ prefs->exists('sort_by')) {83 $this->sort_by = $ prefs->get('sort_by');81 $this->prefs->set('sort_by', $this->sort_by); 82 } else if ($this->prefs->exists('sort_by')) { 83 $this->sort_by = $this->prefs->get('sort_by'); 84 84 } else { 85 85 $this->sort_by = $default_sort; … … 93 93 if (!empty($new_order)) { 94 94 $this->order = $new_order; 95 $ prefs->set('sort_order', $this->order);96 } else if ($ prefs->exists('sort_order')) {97 $this->order = $ prefs->get('sort_order');95 $this->prefs->set('sort_order', $this->order); 96 } else if ($this->prefs->exists('sort_order')) { 97 $this->order = $this->prefs->get('sort_order'); 98 98 } else { 99 99 $this->order = $default_order; … … 112 112 function set($sort = null, $order = null) 113 113 { 114 $prefs =& Prefs::getInstance($_SERVER['PHP_SELF']);115 $prefs->setParam(array('persistent' => false));116 117 114 // Set new sort value. 118 115 if (isset($sort)) { 119 116 $this->sort_by = $sort; 120 $ prefs->set('sort_by', $this->sort_by);117 $this->prefs->set('sort_by', $this->sort_by); 121 118 } 122 119 … … 124 121 if (isset($order)) { 125 122 $this->order = $order; 126 $ prefs->set('sort_order', $this->order);123 $this->prefs->set('sort_order', $this->order); 127 124 } 128 125 }
Note: See TracChangeset
for help on using the changeset viewer.