You should have received a copy of the GNU General Public License
 along with shellcommands. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
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();
 You should have received a copy of the GNU General Public License
 along with shellcommands. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
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, 'w', $_POST);
    $newID = $command->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $command->check($_POST['id'], 'w');
        $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();