45 $this->ctrl = $DIC->ctrl();
46 $this->tabs = $DIC->tabs();
47 $this->lng = $DIC->language();
48 $this->toolbar = $DIC->toolbar();
49 $this->tpl = $DIC[
"tpl"];
50 $this->exc_obj = $a_exc_obj;
59 $next_class =
$ilCtrl->getNextClass($this);
62 switch ($next_class) {
63 case "ilexccriteriagui":
64 $ilTabs->clearTargets();
65 $ilTabs->setBackTarget(
$lng->txt(
"back"),
$ilCtrl->getLinkTarget($this,
""));
66 $ilCtrl->saveParameter($this,
"cat_id");
68 $ilCtrl->forwardCommand($crit_gui);
89 $ilToolbar->addButton(
90 $lng->txt(
"exc_add_criteria_catalogue"),
91 $ilCtrl->getLinkTarget($this,
"add")
95 $tpl->setContent($tbl->getHTML());
107 foreach (array_keys(
$_POST[
"pos"]) as $id) {
108 if (array_key_exists($id, $all_cat)) {
110 $all_cat[$id]->setPosition($pos);
111 $all_cat[$id]->update();
115 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
116 $ilCtrl->redirect($this,
"view");
128 $ilCtrl->redirect($this,
"view");
132 $confirmation_gui->setFormAction(
$ilCtrl->getFormAction($this,
"delete"));
133 $confirmation_gui->setHeaderText(
$lng->txt(
"exc_criteria_catalogue_deletion_confirmation"));
134 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"view");
135 $confirmation_gui->setConfirm(
$lng->txt(
"delete"),
"delete");
138 if (in_array($item->getId(), $ids)) {
139 $confirmation_gui->addItem(
"id[]", $item->getId(), $item->getTitle());
143 $tpl->setContent($confirmation_gui->getHTML());
146 protected function delete()
153 $ilCtrl->redirect($this,
"view");
157 if (in_array($item->getId(), $ids)) {
162 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
163 $ilCtrl->redirect($this,
"view");
178 $is_edit = ($a_cat_obj !== null);
180 $form->setFormAction(
$ilCtrl->getFormAction($this,
"create"));
181 $form->setTitle(
$lng->txt(
"exc_criteria_catalogue_create_form"));
182 $form->addCommandButton(
"create",
$lng->txt(
"create"));
184 $form->setFormAction(
$ilCtrl->getFormAction($this,
"update"));
185 $form->setTitle(
$lng->txt(
"exc_criteria_catalogue_update_form"));
186 $form->addCommandButton(
"update",
$lng->txt(
"save"));
189 $form->addCommandButton(
"view",
$lng->txt(
"cancel"));
192 $title->setRequired(
true);
193 $form->addItem($title);
206 $tpl->setContent($a_form->getHTML());
219 $is_edit = ($a_cat_obj !== null);
221 $form = $this->
initForm($a_cat_obj);
222 if ($form->checkInput()) {
225 $a_cat_obj->setParent($this->exc_obj->getId());
228 $a_cat_obj->setTitle($form->getInput(
"title"));
233 $a_cat_obj->update();
236 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
237 $ilCtrl->redirect($this,
"view");
240 $form->setValuesByPost();
241 $this->{$is_edit ?
"edit" :
"add"}($form);
253 $id = (int) $_REQUEST[
"cat_id"];
256 if ($cat_obj->getParent() == $this->exc_obj->getId()) {
257 $ilCtrl->setParameter($this,
"cat_id", $id);
262 $ilCtrl->redirect($this,
"view");
272 $a_form = $this->
initForm($cat_obj);
276 $tpl->setContent($a_form->getHTML());
Class ilExcCriteriaCatalogue.
Class ilExcCriteriaCatalogueGUI.
initForm(ilExcCriteriaCatalogue $a_cat_obj=null)
__construct(ilObjExercise $a_exc_obj)
add(ilPropertyFormGUI $a_form=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
exportForm(ilExcCriteriaCatalogue $a_cat_obj, ilPropertyFormGUI $a_form)
Class ilExcCriteriaCatalogueTableGUI.
edit(ilPropertyFormGUI $a_form=null)
static getInstancesByParentId($a_parent_id)
importForm(ilExcCriteriaCatalogue $a_cat_obj=null)
Confirmation screen class.