Example #1
0
if (!isset($_GET["preconfig"])) {
    $_GET["preconfig"] = -1;
}
$config = new PluginMreportingConfig();
if (isset($_POST["add"])) {
    Session::checkRight("config", "w");
    $newID = $config->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        Session::checkRight("config", "w");
        $config->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["delete"])) {
            Session::checkRight("config", "w");
            $config->delete($_POST, 1);
            Html::redirect("./config.form.php");
        } else {
            Html::header(__("Setup"), '', "plugins", "mreporting", "config");
            //Link from graph
            if (isset($_GET["name"]) && isset($_GET["classname"])) {
                if ($config->getFromDBByFunctionAndClassname($_GET["name"], $_GET["classname"])) {
                    $_GET["id"] = $config->fields['id'];
                }
            }
            $config->showForm($_GET["id"]);
            Html::footer();
        }
    }
}