Changeset 1775:fd4b24fb574d
- Timestamp:
- 09/10/13 11:29:38 (12 years ago)
- Branch:
- default
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/posts.php
r1719 r1775 53 53 54 54 $categories_combo = array_merge( 55 array('-' => ''), 56 dcAdminCombos::getCategoriesCombo($categories) 57 ); 58 $categories_combo[__('(No cat)')] = 'NULL'; 55 array( 56 new formSelectOption('-',''), 57 new formSelectOption(__('(No cat)'),'NULL')), 58 dcAdminCombos::getCategoriesCombo($categories,false) 59 ); 60 $categories_values = array(); 61 foreach ($categories_combo as $cat) { 62 if (isset($cat->value)) { 63 $categories_values[$cat->value]=true; 64 } 65 } 59 66 60 67 $status_combo = array_merge( … … 161 168 162 169 # - Categories filter 163 if ($cat_id !== '' && i n_array($cat_id,$categories_combo)) {170 if ($cat_id !== '' && isset($categories_values[$cat_id])) { 164 171 $params['cat_id'] = $cat_id; 165 172 $show_filters = true; -
inc/admin/lib.admincombos.php
r1774 r1775 30 30 @return <b>array</b> the combo box (form::combo -compatible format) 31 31 */ 32 public static function getCategoriesCombo($categories) { 33 $categories_combo[__('(No cat)')] = ''; 32 public static function getCategoriesCombo($categories,$include_empty = true) { 33 $categories_combo = array(); 34 if ($include_empty) { 35 $categories_combo = array(new formSelectOption(__('(no cat)'),'')); 36 } 34 37 while ($categories->fetch()) { 35 38 $categories_combo[] = new formSelectOption (
Note: See TracChangeset
for help on using the changeset viewer.