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