Changeset 13037 for branches/2.3/admin/configuration.php
- Timestamp:
- Feb 6, 2012, 9:22:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/admin/configuration.php
r11978 r13037 135 135 $order_by = array(); 136 136 $order_by_inside_category = array(); 137 137 138 for ($i=0; $i<count($_POST['order_by_field']); $i++) 138 139 { 139 if ( $i>5) continue;140 if ( $_POST['order_by_field'][$i] == '')140 if ( $i >= (count($sort_fields)-1) ) break; // limit to the number of available parameters 141 if ( empty($_POST['order_by_field'][$i]) ) 141 142 { 142 143 array_push($page['errors'], l10n('No field selected')); 144 break; 143 145 } 144 146 else 145 147 { 148 // there is no rank outside categories 146 149 if ($_POST['order_by_field'][$i] != 'rank') 147 150 { … … 151 154 } 152 155 } 156 // must define a default order_by if user want to order by rank only 157 if ( count($order_by) == 0 ) 158 { 159 $order_by = array('id ASC'); 160 } 161 153 162 $_POST['order_by'] = 'ORDER BY '.implode(', ', $order_by); 154 163 $_POST['order_by_inside_category'] = 'ORDER BY '.implode(', ', $order_by_inside_category); 164 unset($_POST['order_by_field']); 155 165 } 156 166 }
Note: See TracChangeset
for help on using the changeset viewer.