示例#1
0
     $article->get_from_form();
     $article->save();
     break;
 case "delete_section":
     $section = new cms_section($id);
     $res = $section->delete();
     if ($res !== true) {
         $result = array("status" => "ko", "error_message" => $charset != "uft-8" ? utf8_encode($res) : $res);
     } else {
         $result = array('status' => "ok");
     }
     print json_encode($result);
     break;
 case "delete_article":
     $article = new cms_article($id);
     $res = $article->delete();
     if ($res !== true) {
         $result = array("status" => "ko", "error_message" => $charset != "uft-8" ? utf8_encode($res) : $res);
     } else {
         $result = array('status' => "ok");
     }
     print json_encode($result);
     break;
 case "duplicate_section":
     $section = new cms_section($id);
     $section->duplicate($recursive);
     break;
 case "duplicate_article":
     $article = new cms_article($id);
     $article->duplicate();
     break;
<?php

// +-------------------------------------------------+
// © 2002-2011 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: cms_article_delete.inc.php,v 1.1 2015-03-10 17:12:25 arenou Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/cms/cms_article.class.php";
require_once $class_path . "/cms/cms_editorial_tree.class.php";
if (!$cms_editorial_form_obj_id) {
    return false;
} else {
    $section = new cms_article($cms_editorial_form_obj_id);
    $section->delete();
}
print cms_editorial_tree::get_listing();