ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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.

References $DIC, and $facade.

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

Member Function Documentation

◆ add()

ilBiblFieldFilterGUI::add ( )
protected

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

126  : void
127  {
128  $ilBiblSettingsFilterFormGUI = new ilBiblFieldFilterFormGUI($this, new ilBiblFieldFilter(), $this->facade);
129  $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
130  }
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 217 of file class.ilBiblFieldFilterGUI.php.

References ILIAS\Repository\ctrl().

217  : void
218  {
219  $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
220  $table->writeFilterToSession();
221  $table->resetOffset();
222  $this->ctrl()->redirect($this, self::CMD_STANDARD);
223  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ cancel()

ilBiblFieldFilterGUI::cancel ( )

cancel

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

References ILIAS\Repository\ctrl().

188  : void
189  {
190  $this->ctrl()->redirect($this, self::CMD_STANDARD);
191  }
+ Here is the call graph for this function:

◆ create()

ilBiblFieldFilterGUI::create ( )
protected

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

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

133  : void
134  {
135  $this->tabs()->activateTab(self::CMD_STANDARD);
136  $il_bibl_field = new ilBiblFieldFilter();
137  $il_bibl_field->setObjectId($this->facade->iliasObjId());
138  $form = new ilBiblFieldFilterFormGUI($this, $il_bibl_field, $this->facade);
139  if ($form->saveObject()) {
140  $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt('changes_saved'), true);
141  $this->ctrl()->redirect($this, self::CMD_STANDARD);
142  }
143  $form->setValuesByPost();
144  $this->tpl()->setContent($form->getHTML());
145  }
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...
+ Here is the call graph for this function:

◆ delete()

ilBiblFieldFilterGUI::delete ( )

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

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

170  : void
171  {
172  global $DIC;
173  $items = $this->http()->request()->getParsedBody()['interruptive_items'];
174  if (is_array($items)) {
175  foreach ($items as $filter_id) {
176  $il_bibl_field = $this->facade->filterFactory()->findById($filter_id);
177  $il_bibl_field->delete();
178  }
179  }
180  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('filter_deleted'), true);
181  $this->ctrl()->redirect($this, self::CMD_STANDARD);
182  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ edit()

ilBiblFieldFilterGUI::edit ( )

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

References initEditForm().

148  : void
149  {
150  $ilBiblSettingsFilterFormGUI = $this->initEditForm();
151  $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
152  }
+ Here is the call graph for this function:

◆ executeCommand()

ilBiblFieldFilterGUI::executeCommand ( )

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

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

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  }
+ Here is the call graph for this function:

◆ getFieldFilterFromRequest()

ilBiblFieldFilterGUI::getFieldFilterFromRequest ( )
private

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

References ILIAS\FileDelivery\http().

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

195  {
196  $field = $this->http()->request()->getQueryParams()[self::FILTER_ID];
197 
198  return $this->facade->filterFactory()->findById($field);
199  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
+ 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.

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

110  : void
111  {
112  if ($this->access()->checkAccess('write', "", $this->facade->iliasRefId())) {
113  // mantis 0038219: added infobox to describe the filter functionality
114  $infobox = $this->dic()->ui()->factory()->messageBox()->info($this->lng()->txt('msg_filter_info'));
115  $this->tpl()->setVariable("MESSAGE", $this->dic()->ui()->renderer()->render($infobox));
116 
117  $button = $this->dic()->ui()->factory()->button()->primary($this->lng()->txt("add_filter"), $this->ctrl()->getLinkTarget($this, self::CMD_ADD));
118  $this->toolbar()->addText($this->dic()->ui()->renderer()->render([$button]));
119  }
120 
121  $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
122  $this->tpl()->setContent($table->getHTML());
123  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ initEditForm()

ilBiblFieldFilterGUI::initEditForm ( )
protected

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

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

Referenced by edit().

203  {
204  $this->tabs()->clearTargets();
205  $this->tabs()->setBackTarget(
206  $this->lng()->txt("back"),
207  $this->ctrl()->getLinkTargetByClass(ilBiblFieldFilterGUI::class, ilBiblFieldFilterGUI::CMD_STANDARD)
208  );
209 
210  $ilBiblSettingsFilterFormGUI = new ilBiblFieldFilterFormGUI($this, $this->getFieldFilterFromRequest(), $this->facade);
211  $ilBiblSettingsFilterFormGUI->fillForm();
212 
213  return $ilBiblSettingsFilterFormGUI;
214  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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.

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

Referenced by executeCommand().

85  : void
86  {
87  $cmd = $this->ctrl()->getCmd(self::CMD_STANDARD);
88  switch ($cmd) {
89  case self::CMD_STANDARD:
90  case self::CMD_ADD:
91  case self::CMD_EDIT:
92  case self::CMD_UPDATE:
93  case self::CMD_CREATE:
94  case self::CMD_DELETE:
95  case self::CMD_CANCEL:
96  case self::CMD_APPLY_FILTER:
97  case self::CMD_RESET_FILTER:
98  case self::CMD_RENDER_INTERRUPTIVE:
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  }
+ 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.

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

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()->standard((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:29
$r
+ Here is the call graph for this function:

◆ resetFilter()

ilBiblFieldFilterGUI::resetFilter ( )
protected

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

References ILIAS\Repository\ctrl().

226  : void
227  {
228  $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
229  $table->resetFilter();
230  $table->resetOffset();
231  $this->ctrl()->redirect($this, self::CMD_STANDARD);
232  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ update()

ilBiblFieldFilterGUI::update ( )

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

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

155  : void
156  {
157  $il_bibl_field = $this->getFieldFilterFromRequest();
158  $this->tabs()->activateTab(self::CMD_STANDARD);
159 
160  $form = new ilBiblFieldFilterFormGUI($this, $il_bibl_field, $this->facade);
161  if ($form->saveObject()) {
162  $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt('changes_saved'), true);
163  $this->ctrl()->redirect($this, self::CMD_STANDARD);
164  }
165  $form->setValuesByPost();
166  $this->tpl()->setContent($form->getHTML());
167  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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.

◆ CMD_APPLY_FILTER

const ilBiblFieldFilterGUI::CMD_APPLY_FILTER = 'applyFilter'

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

◆ CMD_CANCEL

const ilBiblFieldFilterGUI::CMD_CANCEL = 'cancel'

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

Referenced by ilBiblFieldFilterFormGUI\initButtons().

◆ CMD_CREATE

const ilBiblFieldFilterGUI::CMD_CREATE = 'create'

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

Referenced by ilBiblFieldFilterFormGUI\initButtons().

◆ CMD_DELETE

const ilBiblFieldFilterGUI::CMD_DELETE = 'delete'

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

Referenced by 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.

◆ 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'

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

Referenced by ilBiblFieldFilterFormGUI\initButtons().

◆ FILTER_ID

const ilBiblFieldFilterGUI::FILTER_ID = 'filter_id'

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