if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $command = new PluginShellcommandsShellcommand(); $command_item = new PluginShellcommandsShellcommand_Item(); if (isset($_POST["add"])) { $command->check(-1, UPDATE, $_POST); $newID = $command->add($_POST); Html::back(); } else { if (isset($_POST["update"])) { $command->check($_POST['id'], UPDATE); $command->update($_POST); Html::back(); } else { if (isset($_POST["additem"])) { if (!empty($_POST['itemtype'])) { if ($command->canCreate()) { $command_item->addItem($_POST["plugin_shellcommands_shellcommands_id"], $_POST['itemtype']); } } Html::back(); } else { if (isset($_POST["deleteitem"])) { if ($command->canCreate()) { $command_item->delete(array('id' => $_POST["id"])); } Html::back();