Changeset 15950
- Timestamp:
- Jun 22, 2012, 11:41:07 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r14649 r15950 146 146 { 147 147 if ( !empty($_POST['order_by']) ) 148 { 149 // limit to the number of available parameters 150 $order_by = $order_by_inside_category = array_slice($_POST['order_by'], 0, ceil(count($sort_fields)/2)); 151 152 // there is no rank outside categories 153 unset($order_by[ array_search('rank ASC', $order_by) ]); 154 155 // must define a default order_by if user want to order by rank only 156 if ( count($order_by) == 0 ) 148 { 149 foreach ($_POST['order_by'] as $i => $val) 157 150 { 158 $order_by = array('id ASC');151 if (empty($val)) unset($_POST['order_by'][$i]); 159 152 } 160 161 $_POST['order_by'] = 'ORDER BY '.implode(', ', $order_by); 162 $_POST['order_by_inside_category'] = 'ORDER BY '.implode(', ', $order_by_inside_category); 153 if ( !count($_POST['order_by']) ) 154 { 155 array_push($page['errors'], l10n('No order field selected')); 156 } 157 else 158 { 159 // limit to the number of available parameters 160 $order_by = $order_by_inside_category = array_slice($_POST['order_by'], 0, ceil(count($sort_fields)/2)); 161 162 // there is no rank outside categories 163 if ( ($i = array_search('rank ASC', $order_by)) !== false) 164 { 165 unset($order_by[$i]); 166 } 167 168 // must define a default order_by if user want to order by rank only 169 if ( count($order_by) == 0 ) 170 { 171 $order_by = array('id ASC'); 172 } 173 174 $_POST['order_by'] = 'ORDER BY '.implode(', ', $order_by); 175 $_POST['order_by_inside_category'] = 'ORDER BY '.implode(', ', $order_by_inside_category); 176 } 163 177 } 164 178 else 165 179 { 166 array_push($page['errors'], l10n('No field selected'));180 array_push($page['errors'], l10n('No order field selected')); 167 181 } 168 182 } -
trunk/language/en_UK/admin.lang.php
r15659 r15950 463 463 $lang['No user to send notifications by mail.'] = "No user to be notified by mail."; 464 464 $lang['no write access'] = "no write access"; 465 $lang['No order field selected'] = 'No order field selected'; 465 466 $lang['none'] = "none"; 466 467 $lang['None'] = 'None'; -
trunk/language/fr_FR/admin.lang.php
r15659 r15950 923 923 $lang['Edit photo'] = 'Éditer la photo'; 924 924 $lang['create a new site'] = 'créer un nouveau site'; 925 $lang['No order field selected'] = 'Aucun critère de tri sélectionné'; 925 926 ?>
Note: See TracChangeset
for help on using the changeset viewer.