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/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). 
Note: See TracChangeset for help on using the changeset viewer.

Sites map