Changeset 1158:9d7267aec27b for inc/admin/class.dc.list.php
- Timestamp:
- 06/12/13 11:38:49 (12 years ago)
- Branch:
- twig
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/class.dc.list.php
r1156 r1158 23 23 protected $nb_pages; 24 24 protected $page; 25 protected $sortby; 26 protected $order; 25 27 26 28 … … 71 73 $columns_combo[$c->getID()] = $c->getName(); 72 74 } 73 $this-> filterset->addFilter(new dcFilterCombo(75 $this->sortby = new dcFilterCombo( 74 76 'sortby', 75 77 __('Sort By'), 76 __('Sort by'), 'sortby', $columns_combo,array('singleval'=> true,'static' => true))); 78 __('Sort by'), 'sortby', $columns_combo,array('singleval'=> true,'static' => true)); 79 $this->filterset->addFilter($this->sortby); 77 80 $order_combo = array('asc' => __('Ascending'),'desc' => __('Descending')); 78 $this-> filterset->addFilter(new dcFilterCombo(81 $this->order = new dcFilterCombo( 79 82 'order', 80 83 __('Order'), 81 __('Order'), 'orderby', $order_combo,array('singleval'=> true, 'static' => true)) );84 __('Order'), 'orderby', $order_combo,array('singleval'=> true, 'static' => true)); 82 85 $limit = new dcFilterText( 83 86 'limit', 84 87 __('Limit'), __('Limit'), 'limit',array('singleval'=> true,'static' =>true)); 88 $this->filterset->addFilter($this->order); 85 89 $this->filterset->addFilter($limit); 86 90 $this->filterset->setup(); … … 107 111 } 108 112 $offset = $this->nb_items_per_page*($this->page-1); 113 $params['order'] = $this->getOrder(); 109 114 $entries = $this->fetcher->getEntries($params,$offset,$this->nb_items_per_page); 110 115 $this->setEntries($entries); … … 152 157 153 158 public function addColumn($c) { 154 $this->columns[ ] = $c;159 $this->columns[$c->getID()] = $c; 155 160 $c->setForm($this); 156 161 return $this; 162 } 163 164 public function getOrder() { 165 $id = $this->sortby->getFields()->getValue(); 166 167 return $this->columns[$id]->getColID().' '.$this->order->getFields()->getValue(); 157 168 } 158 169
Note: See TracChangeset
for help on using the changeset viewer.