Dotclear


Ignore:
Timestamp:
09/10/13 11:02:36 (12 years ago)
Author:
Dsls
Branch:
2.5
Message:

Harmonized categories combo in posts.php like other admin pages, see #1564

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/posts.php

    r1769 r1772  
    6161     } 
    6262      
     63     $categories_values = array('NULL' => true); 
    6364     $categories_combo[__('None')] = 'NULL'; 
    6465     while ($categories->fetch()) { 
    65           $label = str_repeat('  ',$categories->level-1).($categories->level-1 == 0 ? '' : '• '). 
    66                html::escapeHTML($categories->cat_title). 
    67                ' ('.$categories->nb_post.')'; 
    68           while (array_key_exists($label,$categories_combo)) { 
    69                $label .= ' '; 
    70           } 
    71           $categories_combo[$label] = $categories->cat_id; 
     66          $categories_combo[] = new formSelectOption( 
     67               str_repeat('  ',$categories->level-1).($categories->level-1 == 0 ? '' : '• '). 
     68               html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 
     69               $categories->cat_id 
     70          ); 
     71          $categories_values[$categories->cat_id] = true; 
    7272     } 
    7373 
     
    177177 
    178178# - Categories filter 
    179 if ($cat_id !== '' && in_array($cat_id,$categories_combo)) { 
     179if ($cat_id !== '' && isset($categories_values[$cat_id])) { 
    180180     $params['cat_id'] = $cat_id; 
    181181     $show_filters = true; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map