Dotclear

Changeset 851:0993f64c4809 for admin


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

sexy step 2 : no more cats.

Location:
admin
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • admin/index.php

    r848 r851  
    294294     if ($core->auth->check('usage,contentadmin',$core->blog->id)) 
    295295     { 
    296           $categories_combo = array('&nbsp;' => ''); 
    297           try { 
    298                $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    299                while ($categories->fetch()) { 
    300                     $categories_combo[] = new formSelectOption( 
    301                          str_repeat('&nbsp;&nbsp;',$categories->level-1). 
    302                          ($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
    303                          $categories->cat_id 
    304                     ); 
    305                } 
    306           } catch (Exception $e) { } 
    307       
    308296          echo 
    309297          '<div id="quick">'. 
     
    318306          form::textarea('post_content',50,7). 
    319307          '</p>'. 
    320           '<p><label for="cat_id" class="classic">'.__('Category:').' '. 
    321           form::combo('cat_id',$categories_combo).'</label></p>'. 
    322308          '<p><input type="submit" value="'.__('Save').'" name="save" /> '. 
    323309          ($core->auth->check('publish',$core->blog->id) 
  • admin/post.php

    r848 r851  
    1616 
    1717$post_id = ''; 
    18 $cat_id = ''; 
    1918$post_dt = ''; 
    2019$post_format = $core->auth->getOption('post_format'); 
     
    4847} 
    4948 
    50 # Getting categories 
    51 $categories_combo = array('&nbsp;' => ''); 
    52 try { 
    53      $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    54      while ($categories->fetch()) { 
    55           $categories_combo[] = new formSelectOption( 
    56                str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
    57                $categories->cat_id 
    58           ); 
    59      } 
    60 } catch (Exception $e) { } 
    61  
    6249# Status combo 
    6350foreach ($core->blog->getAllPostStatus() as $k => $v) { 
     
    10188     { 
    10289          $post_id = $post->post_id; 
    103           $cat_id = $post->cat_id; 
    10490          $post_dt = date('Y-m-d H:i',strtotime($post->post_dt)); 
    10591          $post_format = $post->post_format; 
     
    153139     $post_title = $_POST['post_title']; 
    154140      
    155      $cat_id = (integer) $_POST['cat_id']; 
    156       
    157141     if (isset($_POST['post_status'])) { 
    158142          $post_status = (integer) $_POST['post_status']; 
     
    188172      
    189173     $cur->post_title = $post_title; 
    190      $cur->cat_id = ($cat_id ? $cat_id : null); 
    191174     $cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : ''; 
    192175     $cur->post_format = $post_format; 
     
    389372      
    390373     echo 
    391      '<p><label for="cat_id">'.__('Category:'). 
    392      form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 
    393      '</label></p>'. 
    394       
    395374     '<p><label for="post_status">'.__('Entry status:'). 
    396375     form::combo('post_status',$status_combo,$post_status,'','',!$can_publish). 
  • 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). 
  • admin/posts_actions.php

    r500 r851  
    3232          $redir = 
    3333          'posts.php?user_id='.$_POST['user_id']. 
    34           '&cat_id='.$_POST['cat_id']. 
    3534          '&status='.$_POST['status']. 
    3635          '&selected='.$_POST['selected']. 
     
    117116           
    118117     } 
    119      elseif ($action == 'category' && isset($_POST['new_cat_id'])) 
    120      { 
    121           try 
    122           { 
    123                while ($posts->fetch()) 
    124                { 
    125                     $new_cat_id = (integer) $_POST['new_cat_id']; 
    126                     $core->blog->updPostCategory($posts->post_id,$new_cat_id); 
    127                } 
    128                http::redirect($redir); 
    129           } 
    130           catch (Exception $e) 
    131           { 
    132                $core->error->add($e->getMessage()); 
    133           } 
    134      } 
    135118     elseif ($action == 'author' && isset($_POST['new_auth_id']) 
    136119     && $core->auth->check('admin',$core->blog->id)) 
     
    187170     $hidden_fields .= 
    188171     form::hidden(array('user_id'),$_POST['user_id']). 
    189      form::hidden(array('cat_id'),$_POST['cat_id']). 
    190172     form::hidden(array('status'),$_POST['status']). 
    191173     form::hidden(array('selected'),$_POST['selected']). 
     
    205187$core->callBehavior('adminPostsActionsContent',$core,$action,$hidden_fields); 
    206188 
    207 if ($action == 'category') 
    208 { 
    209      echo '<h2 class="page-title">'.__('Change category for entries').'</h2>'; 
    210       
    211      # categories list 
    212      # Getting categories 
    213      $categories_combo = array('&nbsp;' => ''); 
    214      try { 
    215           $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    216           while ($categories->fetch()) { 
    217                $categories_combo[] = new formSelectOption( 
    218                     str_repeat('&nbsp;&nbsp;',$categories->level-1). 
    219                     ($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
    220                     $categories->cat_id 
    221                ); 
    222           } 
    223      } catch (Exception $e) { } 
    224       
    225      echo 
    226      '<form action="posts_actions.php" method="post">'. 
    227      '<p><label for="new_cat_id" class="classic">'.__('Category:').' '. 
    228      form::combo('new_cat_id',$categories_combo,''). 
    229      '</label> '; 
    230       
    231      echo 
    232      $hidden_fields. 
    233      $core->formNonce(). 
    234      form::hidden(array('action'),'category'). 
    235      '<input type="submit" value="'.__('Save').'" /></p>'. 
    236      '</form>'; 
    237 } 
    238 elseif ($action == 'author' && $core->auth->check('admin',$core->blog->id)) 
     189if ($action == 'author' && $core->auth->check('admin',$core->blog->id)) 
    239190{ 
    240191     echo '<h2 class="page-title">'.__('Change author for entries').'</h2>'; 
  • admin/search.php

    r848 r851  
    8181               $combo_action[__('mark as pending')] = 'pending'; 
    8282          } 
    83           $combo_action[__('change category')] = 'category'; 
    84           if ($core->auth->check('admin',$core->blog->id)) { 
    85                $combo_action[__('change author')] = 'author'; 
    86           } 
    8783          if ($core->auth->check('delete,contentadmin',$core->blog->id)) 
    8884          { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map