5 include_once
"Modules/Exercise/classes/class.ilExcCriteriaCatalogue.php";
47 $this->ctrl = $DIC->ctrl();
48 $this->tabs = $DIC->tabs();
49 $this->lng = $DIC->language();
50 $this->toolbar = $DIC->toolbar();
51 $this->tpl = $DIC[
"tpl"];
52 $this->exc_obj = $a_exc_obj;
61 $next_class =
$ilCtrl->getNextClass($this);
64 switch ($next_class) {
65 case "ilexccriteriagui":
66 $ilTabs->clearTargets();
67 $ilTabs->setBackTarget(
$lng->txt(
"back"),
$ilCtrl->getLinkTarget($this,
""));
68 $ilCtrl->saveParameter($this,
"cat_id");
69 include_once
"Modules/Exercise/classes/class.ilExcCriteriaGUI.php";
71 $ilCtrl->forwardCommand($crit_gui);
92 $ilToolbar->addButton(
93 $lng->txt(
"exc_add_criteria_catalogue"),
94 $ilCtrl->getLinkTarget($this,
"add")
97 include_once
"Modules/Exercise/classes/class.ilExcCriteriaCatalogueTableGUI.php";
111 foreach (array_keys(
$_POST[
"pos"]) as
$id) {
112 if (array_key_exists($id, $all_cat)) {
114 $all_cat[
$id]->setPosition($pos);
115 $all_cat[
$id]->update();
119 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
120 $ilCtrl->redirect($this,
"view");
132 $ilCtrl->redirect($this,
"view");
135 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
137 $confirmation_gui->setFormAction(
$ilCtrl->getFormAction($this,
"delete"));
138 $confirmation_gui->setHeaderText(
$lng->txt(
"exc_criteria_catalogue_deletion_confirmation"));
139 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"view");
140 $confirmation_gui->setConfirm(
$lng->txt(
"delete"),
"delete");
143 if (in_array($item->getId(), $ids)) {
144 $confirmation_gui->addItem(
"id[]", $item->getId(), $item->getTitle());
148 $tpl->setContent($confirmation_gui->getHTML());
151 protected function delete()
158 $ilCtrl->redirect($this,
"view");
162 if (in_array($item->getId(), $ids)) {
167 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
168 $ilCtrl->redirect($this,
"view");
181 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
184 $is_edit = ($a_cat_obj !== null);
186 $form->setFormAction(
$ilCtrl->getFormAction($this,
"create"));
187 $form->setTitle(
$lng->txt(
"exc_criteria_catalogue_create_form"));
188 $form->addCommandButton(
"create",
$lng->txt(
"create"));
190 $form->setFormAction(
$ilCtrl->getFormAction($this,
"update"));
191 $form->setTitle(
$lng->txt(
"exc_criteria_catalogue_update_form"));
192 $form->addCommandButton(
"update",
$lng->txt(
"save"));
195 $form->addCommandButton(
"view",
$lng->txt(
"cancel"));
198 $title->setRequired(
true);
212 $tpl->setContent($a_form->getHTML());
225 $is_edit = ($a_cat_obj !== null);
228 if (
$form->checkInput()) {
231 $a_cat_obj->setParent($this->exc_obj->getId());
234 $a_cat_obj->setTitle(
$form->getInput(
"title"));
239 $a_cat_obj->update();
242 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
243 $ilCtrl->redirect($this,
"view");
246 $form->setValuesByPost();
247 $this->{$is_edit ?
"edit" :
"add"}(
$form);
259 $id = (int) $_REQUEST[
"cat_id"];
262 if ($cat_obj->getParent() == $this->exc_obj->getId()) {
268 $ilCtrl->redirect($this,
"view");
278 $a_form = $this->
initForm($cat_obj);
282 $tpl->setContent($a_form->getHTML());
Class ilExcCriteriaCatalogue.
Class ilExcCriteriaCatalogueGUI.
initForm(ilExcCriteriaCatalogue $a_cat_obj=null)
__construct(ilObjExercise $a_exc_obj)
if(!array_key_exists('StateId', $_REQUEST)) $id
add(ilPropertyFormGUI $a_form=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
exportForm(ilExcCriteriaCatalogue $a_cat_obj, ilPropertyFormGUI $a_form)
Class ilExcCriteriaCatalogueTableGUI.
This class represents a text property in a property form.
edit(ilPropertyFormGUI $a_form=null)
static getInstancesByParentId($a_parent_id)
importForm(ilExcCriteriaCatalogue $a_cat_obj=null)
Confirmation screen class.