40 $this->ctrl = $DIC->ctrl();
41 $this->toolbar = $DIC->toolbar();
42 $this->lng = $DIC->language();
43 $this->tpl = $DIC[
"tpl"];
44 $this->cat_id = $a_cat_id;
51 $next_class = $ilCtrl->getNextClass($this);
52 $cmd = $ilCtrl->getCmd(
"view");
54 switch ($next_class) {
73 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"add"));
77 $ilToolbar->addStickyItem($types);
80 $button->setCaption(
"exc_add_criteria");
81 $button->setCommand(
"add");
82 $ilToolbar->addStickyItem($button);
85 $tpl->setContent($tbl->getHTML());
97 foreach (array_keys(
$_POST[
"pos"]) as $id) {
98 if (array_key_exists($id, $all_cat)) {
100 $all_cat[$id]->setPosition($pos);
101 $all_cat[$id]->update();
105 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
106 $ilCtrl->redirect($this,
"view");
118 $ilCtrl->redirect($this,
"view");
122 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this,
"delete"));
123 $confirmation_gui->setHeaderText(
$lng->txt(
"exc_criteria_deletion_confirmation"));
124 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"view");
125 $confirmation_gui->setConfirm(
$lng->txt(
"delete"),
"delete");
128 if (in_array($item->getId(), $ids)) {
129 $confirmation_gui->addItem(
"id[]", $item->getId(), $item->getTitle());
133 $tpl->setContent($confirmation_gui->getHTML());
136 protected function delete()
143 $ilCtrl->redirect($this,
"view");
147 if (in_array($item->getId(), $ids)) {
152 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
153 $ilCtrl->redirect($this,
"view");
168 $is_edit = (bool) $a_crit_obj->
getId();
170 $form->setFormAction($ilCtrl->getFormAction($this,
"create"));
171 $form->setTitle(
$lng->txt(
"exc_criteria_create_form"));
172 $form->addCommandButton(
"create",
$lng->txt(
"create"));
174 $form->setFormAction($ilCtrl->getFormAction($this,
"update"));
175 $form->setTitle(
$lng->txt(
"exc_criteria_update_form"));
176 $form->addCommandButton(
"update",
$lng->txt(
"save"));
179 $form->addCommandButton(
"view",
$lng->txt(
"cancel"));
183 $form->addItem(
$type);
186 $title->setRequired(
true);
187 $form->addItem($title);
190 $form->addItem($desc);
193 $form->addItem(
$req);
205 $new_type = trim($_REQUEST[
"type"]);
207 $ilCtrl->redirect($this,
"view");
210 $ilCtrl->setParameter($this,
"type", $new_type);
214 $a_form = $this->
initForm($crit_obj);
217 $tpl->setContent($a_form->getHTML());
234 $is_edit = (bool) $a_crit_obj->
getId();
236 $form = $this->
initForm($a_crit_obj);
237 if ($form->checkInput()) {
238 $a_crit_obj->
setTitle($form->getInput(
"title"));
251 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
252 $ilCtrl->redirect($this,
"view");
255 $form->setValuesByPost();
256 $this->{$is_edit ?
"edit" :
"add"}($form);
263 $new_type = trim($_REQUEST[
"type"]);
265 $ilCtrl->redirect($this,
"view");
276 $id = (int) $_REQUEST[
"crit_id"];
280 $ilCtrl->setParameter($this,
"crit_id", $id);
285 $ilCtrl->redirect($this,
"view");
295 $a_form = $this->
initForm($crit_obj);
299 $tpl->setContent($a_form->getHTML());
static getInstanceByType($a_type)
importCustomForm(ilPropertyFormGUI $a_form)
static getInstanceById($a_id)
exportCustomForm(ilPropertyFormGUI $a_form)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
add(ilPropertyFormGUI $a_form=null)
static getInstancesByParentId($a_parent_id)
edit(ilPropertyFormGUI $a_form=null)
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
exportForm(ilExcCriteria $a_crit_obj, ilPropertyFormGUI $a_form)
initCustomForm(ilPropertyFormGUI $a_form)
initForm(ilExcCriteria $a_crit_obj)
Class ilExcCriteriaTableGUI.
importForm(ilExcCriteria $a_crit_obj)
Confirmation screen class.