41 $this->
ctrl = $DIC->ctrl();
42 $this->
toolbar = $DIC->toolbar();
43 $this->
lng = $DIC->language();
44 $this->tpl =
$DIC[
"tpl"];
45 $this->cat_id = $a_cat_id;
46 $this->request =
$DIC->exercise()->internal()->gui()->request();
54 $cmd = $ilCtrl->getCmd(
"view");
56 switch ($next_class) {
68 protected function view(): void
75 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"add"));
79 $ilToolbar->addStickyItem($types);
82 $button->setCaption(
"exc_add_criteria");
83 $button->setCommand(
"add");
84 $ilToolbar->addStickyItem($button);
98 $req_positions = $this->request->getPositions();
99 asort($req_positions);
100 foreach (array_keys($req_positions) as
$id) {
101 if (array_key_exists(
$id, $all_cat)) {
103 $all_cat[
$id]->setPosition($pos);
104 $all_cat[
$id]->update();
108 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
109 $ilCtrl->redirect($this,
"view");
118 $ids = $this->request->getCriteriaIds();
119 if (count($ids) == 0) {
121 $ilCtrl->redirect($this,
"view");
125 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this,
"delete"));
126 $confirmation_gui->setHeaderText(
$lng->
txt(
"exc_criteria_deletion_confirmation"));
127 $confirmation_gui->setCancel(
$lng->
txt(
"cancel"),
"view");
128 $confirmation_gui->setConfirm(
$lng->
txt(
"delete"),
"delete");
131 if (in_array($item->getId(), $ids)) {
132 $confirmation_gui->addItem(
"id[]", $item->getId(), $item->getTitle());
139 protected function delete():
void
144 $ids = $this->request->getCriteriaIds();
145 if (count($ids) == 0) {
146 $ilCtrl->redirect($this,
"view");
150 if (in_array($item->getId(), $ids)) {
155 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
156 $ilCtrl->redirect($this,
"view");
171 $is_edit = (bool) $a_crit_obj->
getId();
173 $form->setFormAction($ilCtrl->getFormAction($this,
"create"));
174 $form->setTitle(
$lng->
txt(
"exc_criteria_create_form"));
175 $form->addCommandButton(
"create",
$lng->
txt(
"create"));
177 $form->setFormAction($ilCtrl->getFormAction($this,
"update"));
178 $form->setTitle(
$lng->
txt(
"exc_criteria_update_form"));
179 $form->addCommandButton(
"update",
$lng->
txt(
"save"));
182 $form->addCommandButton(
"view",
$lng->
txt(
"cancel"));
186 $form->addItem(
$type);
189 $title->setRequired(
true);
190 $form->addItem($title);
193 $form->addItem($desc);
196 $form->addItem(
$req);
208 $new_type = $this->request->getCriteriaType();
213 $ilCtrl->setParameter($this,
"type", $new_type);
217 $a_form = $this->
initForm($crit_obj);
227 $a_form->getItemByPostVar(
"title")->setValue($a_crit_obj->getTitle());
237 $ilCtrl = $this->
ctrl;
240 $is_edit = (bool) $a_crit_obj->
getId();
241 $ilCtrl->setParameter($this,
"type", $this->request->getCriteriaType());
242 $form = $this->initForm($a_crit_obj);
243 if ($form->checkInput()) {
244 $a_crit_obj->
setTitle($form->getInput(
"title"));
257 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
258 $ilCtrl->redirect($this,
"view");
261 $form->setValuesByPost();
262 $this->{$is_edit ?
"edit" :
"add"}($form);
267 $ilCtrl = $this->ctrl;
269 $new_type = $this->request->getCriteriaType();
271 $ilCtrl->redirect($this,
"view");
275 $this->importForm($crit_obj);
280 $ilCtrl = $this->ctrl;
282 $id = $this->request->getCritId();
285 if ($crit_obj->getParent() == $this->cat_id) {
286 $ilCtrl->setParameter($this,
"crit_id",
$id);
291 $ilCtrl->redirect($this,
"view");
300 $crit_obj = $this->getCurrentCritera();
303 $a_form = $this->initForm($crit_obj);
304 $this->exportForm($crit_obj, $a_form);
312 $crit_obj = $this->getCurrentCritera();
313 $this->importForm($crit_obj);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Exercise gui request wrapper.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
add(ilPropertyFormGUI $a_form=null)
initForm(ilExcCriteria $a_crit_obj)
__construct(int $a_cat_id)
ilGlobalTemplateInterface $tpl
edit(ilPropertyFormGUI $a_form=null)
importForm(ilExcCriteria $a_crit_obj)
exportForm(ilExcCriteria $a_crit_obj, ilPropertyFormGUI $a_form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initCustomForm(ilPropertyFormGUI $a_form)
exportCustomForm(ilPropertyFormGUI $a_form)
setRequired(bool $a_value)
setTitle(?string $a_value)
importCustomForm(ilPropertyFormGUI $a_form)
setDescription(?string $a_value)
static getInstancesByParentId(int $a_parent_id)
static getInstanceById(int $a_id)
static getInstanceByType(string $a_type)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
catch(\Exception $e) $req