Esempio n. 1
0
$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);
                    }
                }
                Html::back();
            } else {
                $reportconfig->checkGlobal("r");
                Html::header(PluginResourcesResource::getTypeName(2), '', "plugins", "resources");
                $reportconfig->showForm($_GET["id"], array('plugin_resources_resources_id' => $_GET["plugin_resources_resources_id"]));
                Html::footer();