Dotclear

Changeset 1419:c121c24d7ced


Ignore:
Timestamp:
08/16/13 21:02:51 (11 years ago)
Author:
Denis Jean-Christian <contact@…>
Branch:
2.5
Message:

Enhance categories combo and other fix, step 6, addresses #1424

Location:
admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_posts_actions.js

    r1035 r1419  
    66          matchContains: true 
    77     }); 
     8     $('#new_cat').toggleWithLegend( 
     9          $('#new_cat').parent().children().not('#new_cat'), 
     10          {} // no cookie on new category as we don't use this every day 
     11     ); 
    812}); 
  • admin/posts_actions.php

    r1389 r1419  
    127127     elseif ($action == 'category' && isset($_POST['new_cat_id'])) 
    128128     { 
    129           try 
    130           { 
    131                $core->blog->updPostsCategory($posts_ids,$_POST['new_cat_id']); 
     129          $new_cat_id = $_POST['new_cat_id']; 
     130           
     131          try 
     132          { 
     133               if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) 
     134               { 
     135                    $cur_cat = $core->con->openCursor($core->prefix.'category'); 
     136                    $cur_cat->cat_title = $_POST['new_cat_title']; 
     137                    $cur_cat->cat_url = ''; 
     138                     
     139                    $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; 
     140                     
     141                    # --BEHAVIOR-- adminBeforeCategoryCreate 
     142                    $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 
     143                     
     144                    $new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 
     145                     
     146                    # --BEHAVIOR-- adminAfterCategoryCreate 
     147                    $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id); 
     148               } 
     149                
     150               $core->blog->updPostsCategory($posts_ids, $new_cat_id); 
    132151                
    133152               http::redirect($redir); 
     
    274293     '</label> '; 
    275294      
     295     if ($core->auth->check('categories', $core->blog->id)) { 
     296          echo  
     297          '<div>'. 
     298          '<p id="new_cat">'.__('Add a new category').'</p>'. 
     299          '<p><label for="new_cat_title">'.__('Title:').' '. 
     300          form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
     301          '<p><label for="new_cat_parent">'.__('Parent:').' '. 
     302          form::combo('new_cat_parent',$categories_combo,'','maximal'). 
     303          '</label></p>'. 
     304          '</div>'; 
     305     } 
     306      
    276307     echo 
    277308     $hidden_fields. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map