}
$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();
            } else {
                $command->checkGlobal(READ);
                Html::header(PluginShellcommandsShellcommand::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "shellcommand");
                $command->display(array('id' => $_GET["id"]));
                Html::footer();