Beispiel #1
0
<?php

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
$articles = new articles();
if (!empty($_POST['newsave'])) {
    if ($articles->createContainer($_POST['id'], $_POST['title'])) {
        rcms_showAdminMessage(__('Section created'));
    } else {
        rcms_showAdminMessage($articles->last_error);
    }
} elseif (!empty($_POST['delete']) && is_array($_POST['delete'])) {
    $result = '';
    foreach ($_POST['delete'] as $id => $cond) {
        if (!empty($cond)) {
            if ($articles->removeContainer($id)) {
                $result .= __('Section deleted') . ' (' . $id . ')<br/>';
            } else {
                $result .= $articles->last_error . ' (' . $id . ')<br/>';
            }
        }
    }
    rcms_showAdminMessage($result);
    $_POST['edit'] = '';
} elseif (!empty($_POST['edit']) && !empty($_POST['save'])) {
    if ($articles->editContainer($_POST['edit'], $_POST['id'], $_POST['title'])) {
        rcms_showAdminMessage(__('Section updated'));
        $_POST['edit'] = $_POST['id'];