Dotclear

Changeset 1015:10227e338321 for inc


Ignore:
Timestamp:
11/17/12 14:19:52 (13 years ago)
Author:
JcDenis
Branch:
default
Message:

Fix #1171 : Add ability to delete non empty category (and move its content)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.blog.php

    r970 r1015  
    13391339      
    13401340     /** 
     1341     Updates posts category. <var>$new_cat_id</var> can be null. 
     1342      
     1343     @param    old_cat_id     <b>integer</b>      Old category ID 
     1344     @param    new_cat_id     <b>integer</b>      New category ID 
     1345     */ 
     1346     public function updPostsCategory($old_cat_id,$new_cat_id) 
     1347     { 
     1348          if (!$this->core->auth->check('contentadmin,categories',$this->id)) { 
     1349               throw new Exception(__('You are not allowed to change entries category')); 
     1350          } 
     1351           
     1352          $old_cat_id = (integer) $old_cat_id; 
     1353          $new_cat_id = (integer) $new_cat_id; 
     1354           
     1355          $cur = $this->con->openCursor($this->prefix.'post'); 
     1356           
     1357          $cur->cat_id = ($new_cat_id ? $new_cat_id : null); 
     1358          $cur->post_upddt = date('Y-m-d H:i:s'); 
     1359           
     1360          $cur->update( 
     1361               'WHERE cat_id = '.$old_cat_id.' '. 
     1362               "AND blog_id = '".$this->con->escape($this->id)."' " 
     1363          ); 
     1364          $this->triggerBlog(); 
     1365     } 
     1366      
     1367     /** 
    13411368     Deletes a post. 
    13421369      
Note: See TracChangeset for help on using the changeset viewer.

Sites map