ILIAS  release_8 Revision v8.24
ilBiblFieldFilterGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilBiblFieldFilterGUI:

Public Member Functions

 __construct (ilBiblFactoryFacade $facade)
 ilBiblFieldFilterGUI constructor. More...
 
 renderInterruptiveModal ()
 
 executeCommand ()
 
 index ()
 
 edit ()
 
 update ()
 
 delete ()
 
 cancel ()
 cancel More...
 

Data Fields

const FILTER_ID = 'filter_id'
 
const CMD_STANDARD = 'index'
 
const CMD_ADD = 'add'
 
const CMD_CREATE = 'create'
 
const CMD_CANCEL = 'cancel'
 
const CMD_EDIT = 'edit'
 
const CMD_UPDATE = 'update'
 
const CMD_DELETE = 'delete'
 
const CMD_RENDER_INTERRUPTIVE = 'renderInterruptiveModal'
 
const CMD_APPLY_FILTER = 'applyFilter'
 
const CMD_RESET_FILTER = 'resetFilter'
 
const CMD_TRANSLATE = 'translate'
 

Protected Member Functions

 performCommand ()
 
 add ()
 
 create ()
 
 initEditForm ()
 
 applyFilter ()
 
 resetFilter ()
 

Protected Attributes

ilBiblFactoryFacade $facade
 

Private Member Functions

 getFieldFilterFromRequest ()
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilBiblFieldFilterGUI

Author
Benjamin Seglias bs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 25 of file class.ilBiblFieldFilterGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilBiblFieldFilterGUI::__construct ( ilBiblFactoryFacade  $facade)

ilBiblFieldFilterGUI constructor.

Definition at line 47 of file class.ilBiblFieldFilterGUI.php.

48 {
49 global $DIC;
50 $this->main_tpl = $DIC->ui()->mainTemplate();
51 $this->facade = $facade;
52 }
global $DIC
Definition: feed.php:28

References $DIC, and $facade.

Member Function Documentation

◆ add()

ilBiblFieldFilterGUI::add ( )
protected

Definition at line 122 of file class.ilBiblFieldFilterGUI.php.

122 : void
123 {
124 $ilBiblSettingsFilterFormGUI = new ilBiblFieldFilterFormGUI($this, new ilBiblFieldFilter(), $this->facade);
125 $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
126 }
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...

◆ applyFilter()

ilBiblFieldFilterGUI::applyFilter ( )
protected

Definition at line 213 of file class.ilBiblFieldFilterGUI.php.

213 : void
214 {
215 $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
216 $table->writeFilterToSession();
217 $table->resetOffset();
218 $this->ctrl()->redirect($this, self::CMD_STANDARD);
219 }
Class ilBiblFieldFilterTableGUI.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancel()

ilBiblFieldFilterGUI::cancel ( )

cancel

Definition at line 184 of file class.ilBiblFieldFilterGUI.php.

184 : void
185 {
186 $this->ctrl()->redirect($this, self::CMD_STANDARD);
187 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ create()

ilBiblFieldFilterGUI::create ( )
protected

Definition at line 129 of file class.ilBiblFieldFilterGUI.php.

129 : void
130 {
131 $this->tabs()->activateTab(self::CMD_STANDARD);
132 $il_bibl_field = new ilBiblFieldFilter();
133 $il_bibl_field->setObjectId($this->facade->iliasObjId());
134 $form = new ilBiblFieldFilterFormGUI($this, $il_bibl_field, $this->facade);
135 if ($form->saveObject()) {
136 $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt('changes_saved'), true);
137 $this->ctrl()->redirect($this, self::CMD_STANDARD);
138 }
139 $form->setValuesByPost();
140 $this->tpl()->setContent($form->getHTML());
141 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ delete()

ilBiblFieldFilterGUI::delete ( )

Definition at line 166 of file class.ilBiblFieldFilterGUI.php.

166 : void
167 {
168 global $DIC;
169 $items = $this->http()->request()->getParsedBody()['interruptive_items'];
170 if (is_array($items)) {
171 foreach ($items as $filter_id) {
172 $il_bibl_field = $this->facade->filterFactory()->findById($filter_id);
173 $il_bibl_field->delete();
174 }
175 }
176 $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('filter_deleted'), true);
177 $this->ctrl()->redirect($this, self::CMD_STANDARD);
178 }
static http()
Fetches the global http state from ILIAS.

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ edit()

ilBiblFieldFilterGUI::edit ( )

Definition at line 144 of file class.ilBiblFieldFilterGUI.php.

144 : void
145 {
146 $ilBiblSettingsFilterFormGUI = $this->initEditForm();
147 $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
148 }

References initEditForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilBiblFieldFilterGUI::executeCommand ( )

Definition at line 74 of file class.ilBiblFieldFilterGUI.php.

74 : void
75 {
76 $nextClass = $this->ctrl()->getNextClass();
77 switch ($nextClass) {
78 default:
79 $this->tabs()->activateTab(ilObjBibliographicGUI::TAB_SETTINGS);
80 $this->performCommand();
81 }
82 }

References ILIAS\Repository\ctrl(), performCommand(), ilObjBibliographicGUI\TAB_SETTINGS, and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ getFieldFilterFromRequest()

ilBiblFieldFilterGUI::getFieldFilterFromRequest ( )
private

Definition at line 190 of file class.ilBiblFieldFilterGUI.php.

191 {
192 $field = $this->http()->request()->getQueryParams()[self::FILTER_ID];
193
194 return $this->facade->filterFactory()->findById($field);
195 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References FILTER_ID, and ILIAS\FileDelivery\http().

Referenced by initEditForm(), renderInterruptiveModal(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index()

ilBiblFieldFilterGUI::index ( )

Definition at line 110 of file class.ilBiblFieldFilterGUI.php.

110 : void
111 {
112 if ($this->access()->checkAccess('write', "", $this->facade->iliasRefId())) {
113 $button = $this->dic()->ui()->factory()->button()->primary($this->lng()->txt("add_filter"), $this->ctrl()->getLinkTarget($this, self::CMD_ADD));
114 $this->toolbar()->addText($this->dic()->ui()->renderer()->render([$button]));
115 }
116
117 $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
118 $this->tpl()->setContent($table->getHTML());
119 }

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\toolbar(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ initEditForm()

ilBiblFieldFilterGUI::initEditForm ( )
protected

Definition at line 198 of file class.ilBiblFieldFilterGUI.php.

199 {
200 $this->tabs()->clearTargets();
201 $this->tabs()->setBackTarget(
202 $this->lng()->txt("back"),
203 $this->ctrl()->getLinkTargetByClass(ilBiblFieldFilterGUI::class, ilBiblFieldFilterGUI::CMD_STANDARD)
204 );
205
206 $ilBiblSettingsFilterFormGUI = new ilBiblFieldFilterFormGUI($this, $this->getFieldFilterFromRequest(), $this->facade);
207 $ilBiblSettingsFilterFormGUI->fillForm();
208
209 return $ilBiblSettingsFilterFormGUI;
210 }

References CMD_STANDARD, ILIAS\Repository\ctrl(), getFieldFilterFromRequest(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by edit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performCommand()

ilBiblFieldFilterGUI::performCommand ( )
protected

Definition at line 85 of file class.ilBiblFieldFilterGUI.php.

85 : void
86 {
87 $cmd = $this->ctrl()->getCmd(self::CMD_STANDARD);
88 switch ($cmd) {
90 case self::CMD_ADD:
91 case self::CMD_EDIT:
99 if ($this->access()->checkAccess('write', "", $this->facade->iliasRefId())) {
100 $this->{$cmd}();
101 break;
102 } else {
103 $this->main_tpl->setOnScreenMessage('failure', $this->lng()->txt("no_permission"), true);
104 break;
105 }
106 }
107 }

References ILIAS\Repository\access(), CMD_ADD, CMD_APPLY_FILTER, CMD_CANCEL, CMD_CREATE, CMD_DELETE, CMD_EDIT, CMD_RENDER_INTERRUPTIVE, CMD_RESET_FILTER, CMD_STANDARD, CMD_UPDATE, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderInterruptiveModal()

ilBiblFieldFilterGUI::renderInterruptiveModal ( )

Definition at line 55 of file class.ilBiblFieldFilterGUI.php.

55 : void
56 {
57 $f = $this->dic()->ui()->factory();
58 $r = $this->dic()->ui()->renderer();
59 $ilBiblFieldFilter = $this->getFieldFilterFromRequest();
60 $form_action = $this->ctrl()->getFormActionByClass(ilBiblFieldFilterGUI::class, ilBiblFieldFilterGUI::CMD_DELETE);
61 $delete_modal = $f->modal()->interruptive(
62 $this->lng()->txt("delete"),
63 $this->lng()->txt('msg_confirm_delete_filter'),
64 $form_action
65 )->withAffectedItems(
66 [$f->modal()->interruptiveItem((string) $ilBiblFieldFilter->getId(), $this->facade->translationFactory()->translate($this->facade->fieldFactory()->findById($ilBiblFieldFilter->getFieldId())))]
67 );
68
69 echo $r->render([$delete_modal]);
70 exit;
71 }
exit
Definition: login.php:28

References Vendor\Package\$f, CMD_DELETE, ILIAS\Repository\ctrl(), exit, getFieldFilterFromRequest(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ resetFilter()

ilBiblFieldFilterGUI::resetFilter ( )
protected

Definition at line 222 of file class.ilBiblFieldFilterGUI.php.

222 : void
223 {
224 $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
225 $table->resetFilter();
226 $table->resetOffset();
227 $this->ctrl()->redirect($this, self::CMD_STANDARD);
228 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ update()

ilBiblFieldFilterGUI::update ( )

Definition at line 151 of file class.ilBiblFieldFilterGUI.php.

151 : void
152 {
153 $il_bibl_field = $this->getFieldFilterFromRequest();
154 $this->tabs()->activateTab(self::CMD_STANDARD);
155
156 $form = new ilBiblFieldFilterFormGUI($this, $il_bibl_field, $this->facade);
157 if ($form->saveObject()) {
158 $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt('changes_saved'), true);
159 $this->ctrl()->redirect($this, self::CMD_STANDARD);
160 }
161 $form->setValuesByPost();
162 $this->tpl()->setContent($form->getHTML());
163 }

References ILIAS\Repository\ctrl(), getFieldFilterFromRequest(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

Field Documentation

◆ $facade

ilBiblFactoryFacade ilBiblFieldFilterGUI::$facade
protected

Definition at line 40 of file class.ilBiblFieldFilterGUI.php.

Referenced by __construct().

◆ $main_tpl

ilGlobalTemplateInterface ilBiblFieldFilterGUI::$main_tpl
private

Definition at line 41 of file class.ilBiblFieldFilterGUI.php.

◆ CMD_ADD

const ilBiblFieldFilterGUI::CMD_ADD = 'add'

Definition at line 30 of file class.ilBiblFieldFilterGUI.php.

Referenced by performCommand().

◆ CMD_APPLY_FILTER

const ilBiblFieldFilterGUI::CMD_APPLY_FILTER = 'applyFilter'

Definition at line 37 of file class.ilBiblFieldFilterGUI.php.

Referenced by performCommand().

◆ CMD_CANCEL

const ilBiblFieldFilterGUI::CMD_CANCEL = 'cancel'

◆ CMD_CREATE

const ilBiblFieldFilterGUI::CMD_CREATE = 'create'

◆ CMD_DELETE

const ilBiblFieldFilterGUI::CMD_DELETE = 'delete'

Definition at line 35 of file class.ilBiblFieldFilterGUI.php.

Referenced by performCommand(), and renderInterruptiveModal().

◆ CMD_EDIT

const ilBiblFieldFilterGUI::CMD_EDIT = 'edit'

◆ CMD_RENDER_INTERRUPTIVE

const ilBiblFieldFilterGUI::CMD_RENDER_INTERRUPTIVE = 'renderInterruptiveModal'

◆ CMD_RESET_FILTER

const ilBiblFieldFilterGUI::CMD_RESET_FILTER = 'resetFilter'

Definition at line 38 of file class.ilBiblFieldFilterGUI.php.

Referenced by performCommand().

◆ CMD_STANDARD

const ilBiblFieldFilterGUI::CMD_STANDARD = 'index'

◆ CMD_TRANSLATE

const ilBiblFieldFilterGUI::CMD_TRANSLATE = 'translate'

Definition at line 39 of file class.ilBiblFieldFilterGUI.php.

◆ CMD_UPDATE

const ilBiblFieldFilterGUI::CMD_UPDATE = 'update'

◆ FILTER_ID

const ilBiblFieldFilterGUI::FILTER_ID = 'filter_id'

The documentation for this class was generated from the following file: