Esempio n. 1
0
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
if (!isset($_GET["plugin_resources_resources_id"])) {
    $_GET["plugin_resources_resources_id"] = "";
}
$reportconfig = new PluginResourcesReportConfig();
if (isset($_POST["add"])) {
    if ($reportconfig->canCreate()) {
        $reportconfig->add($_POST);
    }
    Html::back();
} else {
    if (isset($_POST["update"])) {
        if ($reportconfig->canCreate()) {
            $reportconfig->update($_POST);
        }
        Html::back();
    } else {
        if (isset($_POST["delete"])) {
            if ($reportconfig->canCreate()) {
                $reportconfig->delete($_POST, 1);
            }
            Html::redirect(Toolbox::getItemTypeFormURL('PluginResourcesResource') . "?id=" . $_POST["plugin_resources_resources_id"]);
        } else {
            if (isset($_POST["delete_report"])) {
                if ($reportconfig->canCreate()) {
                    foreach ($_POST["check"] as $ID => $value) {
                        $reportconfig->delete(array("id" => $ID), 1);
                    }
                }