Beispiel #1
0
}
$model = new PluginDatainjectionModel();
$model->checkGlobal(READ);
/* add */
if (isset($_POST["add"])) {
    $model->check(-1, UPDATE, $_POST);
    $newID = $model->add($_POST);
    //Set display to the advanced options tab
    Session::setActiveTab('PluginDatainjectionModel', 'PluginDatainjectionModel$3');
    Html::redirect(Toolbox::getItemTypeFormURL('PluginDatainjectionModel') . "?id={$newID}");
    /* delete */
} else {
    if (isset($_POST["delete"])) {
        $model->check($_POST['id'], DELETE);
        $model->delete($_POST);
        $model->redirectToList();
        /* update */
    } else {
        if (isset($_POST["update"])) {
            //Update model
            $model->check($_POST['id'], UPDATE);
            $model->update($_POST);
            $specific_model = PluginDatainjectionModel::getInstance('csv');
            $specific_model->saveFields($_POST);
            Html::back();
            /* update order */
        } elseif (isset($_POST["validate"])) {
            $model->check($_POST['id'], UPDATE);
            $model->switchReadyToUse();
            Html::back();
        } elseif (isset($_POST['upload'])) {