Dotclear


Ignore:
Timestamp:
07/31/12 13:52:11 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

sexy step 2 : no more cats.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/posts.php

    r796 r851  
    1515dcPage::check('usage,contentadmin'); 
    1616 
    17 # Getting categories 
    18 try { 
    19      $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    20 } catch (Exception $e) { 
    21      $core->error->add($e->getMessage()); 
    22 } 
    23  
    2417# Getting authors 
    2518try { 
     
    4740{ 
    4841     # Filter form we'll put in html_block 
    49      $users_combo = $categories_combo = array(); 
    50      $users_combo['-'] = $categories_combo['-'] = ''; 
     42     $users_combo = array(); 
     43     $users_combo['-'] = ''; 
    5144     while ($users->fetch()) 
    5245     { 
     
    6154     } 
    6255      
    63      $categories_combo[__('None')] = 'NULL'; 
    64      while ($categories->fetch()) { 
    65           $categories_combo[str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; '). 
    66                html::escapeHTML($categories->cat_title). 
    67                ' ('.$categories->nb_post.')'] = $categories->cat_id; 
    68      } 
    69       
    7056     $status_combo = array( 
    7157     '-' => '' 
     
    9581     __('Date') => 'post_dt', 
    9682     __('Title') => 'post_title', 
    97      __('Category') => 'cat_title', 
    9883     __('Author') => 'user_id', 
    9984     __('Status') => 'post_status', 
     
    122107     __('Mark as unselected') => 'unselected' 
    123108); 
    124 $combo_action[__('Change')] = array(__('Change category') => 'category'); 
     109$combo_action[__('Change')] = array(); 
    125110if ($core->auth->check('admin',$core->blog->id)) 
    126111{ 
     
    139124-------------------------------------------------------- */ 
    140125$user_id = !empty($_GET['user_id']) ?   $_GET['user_id'] : ''; 
    141 $cat_id = !empty($_GET['cat_id']) ?     $_GET['cat_id'] : ''; 
    142126$status = isset($_GET['status']) ? $_GET['status'] : ''; 
    143127$selected = isset($_GET['selected']) ?  $_GET['selected'] : ''; 
     
    168152} else { 
    169153     $user_id=''; 
    170 } 
    171  
    172 # - Categories filter 
    173 if ($cat_id !== '' && in_array($cat_id,$categories_combo)) { 
    174      $params['cat_id'] = $cat_id; 
    175      $show_filters = true; 
    176 } else { 
    177      $cat_id=''; 
    178154} 
    179155 
     
    263239     '<label for="user_id">'.__('Author:'). 
    264240     form::combo('user_id',$users_combo,$user_id).'</label> '. 
    265      '<label for="cat_id">'.__('Category:'). 
    266      form::combo('cat_id',$categories_combo,$cat_id).'</label> '. 
    267241     '<label for="status">'.__('Status:'). 
    268242     form::combo('status',$status_combo,$status).'</label> '. 
     
    305279     '<input type="submit" value="'.__('ok').'" /></p>'. 
    306280     form::hidden(array('user_id'),$user_id). 
    307      form::hidden(array('cat_id'),$cat_id). 
    308281     form::hidden(array('status'),$status). 
    309282     form::hidden(array('selected'),$selected). 
Note: See TracChangeset for help on using the changeset viewer.

Sites map