Exemple #1
0
require_once ABS_PATH . '/modules/actualities/src/class/class-actualities.php';
$database = Mysql::getConnection();
$template = AdmTemplate::getInstance();
$pageId = $database->handler->real_escape_string($_GET["id"]);
if (isset($_POST["edit_new"])) {
    $type = $database->handler->real_escape_string($_POST["type"]);
    $newTitle = $database->handler->real_escape_string($_POST["title"]);
    $newContent = $database->handler->real_escape_string($_POST["actualNewContent"]);
    if ($type == "edit") {
        $actId = $database->handler->real_escape_string($_POST["id"]);
        $act = new Actualities($actId);
        $act->title = $newTitle;
        $act->content = $newContent;
        $act->save();
    } else {
        if ($type == "new") {
            $act = new Actualities();
            $act->title = $newTitle;
            $act->content = $newContent;
            $act->save();
        } else {
        }
    }
}
$page = new Page();
$page->GetInfo($pageId);
$actuality = new Actualities();
$data = $actuality->getPageActualities($pageId);
$template->template->assign("actData", $data);
$template->template->assign("pageData", array("pageTitle" => $page->pageTitle));
require_once "./modules/text_master/src/includes/tinymce/tiny_mce.php";