ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 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.

References ILIAS\Repository\ctrl().

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

◆ cancel()

ilBiblFieldFilterGUI::cancel ( )

cancel

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

References ILIAS\Repository\ctrl().

184  : void
185  {
186  $this->ctrl()->redirect($this, self::CMD_STANDARD);
187  }
+ Here is the call graph for this function:

◆ create()

ilBiblFieldFilterGUI::create ( )
protected

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

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

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  }
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 166 of file class.ilBiblFieldFilterGUI.php.

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

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  }
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 144 of file class.ilBiblFieldFilterGUI.php.

References initEditForm().

144  : void
145  {
146  $ilBiblSettingsFilterFormGUI = $this->initEditForm();
147  $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
148  }
+ 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 190 of file class.ilBiblFieldFilterGUI.php.

References ILIAS\FileDelivery\http().

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

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

◆ initEditForm()

ilBiblFieldFilterGUI::initEditForm ( )
protected

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

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

Referenced by edit().

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

◆ resetFilter()

ilBiblFieldFilterGUI::resetFilter ( )
protected

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

References ILIAS\Repository\ctrl().

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

◆ update()

ilBiblFieldFilterGUI::update ( )

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

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

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  }
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: