ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBiblFieldFilterGUI Class Reference

Class ilBiblFieldFilterGUI. 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

 $facade
 

Private Member Functions

 getFieldFilterFromRequest ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblFieldFilterGUI::__construct ( ilBiblFactoryFacade  $facade)

ilBiblFieldFilterGUI constructor.

Parameters
\ilBiblFactoryFacade$facade

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

References $facade.

37  {
38  $this->facade = $facade;
39  }

Member Function Documentation

◆ add()

ilBiblFieldFilterGUI::add ( )
protected

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

110  {
111  $ilBiblSettingsFilterFormGUI = new ilBiblFieldFilterFormGUI($this, new ilBiblFieldFilter(), $this->facade);
112  $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
113  }
Class ilBiblFieldFilterFormGUI.
Class ilBiblFieldFilter.

◆ applyFilter()

ilBiblFieldFilterGUI::applyFilter ( )
protected

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

References $table.

207  {
208  $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
209  $table->writeFilterToSession();
210  $table->resetOffset();
211  $this->ctrl()->redirect($this, self::CMD_STANDARD);
212  }
Class ilBiblFieldFilterTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24

◆ cancel()

ilBiblFieldFilterGUI::cancel ( )

cancel

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

172  {
173  $this->ctrl()->redirect($this, self::CMD_STANDARD);
174  }

◆ create()

ilBiblFieldFilterGUI::create ( )
protected

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

References $form.

117  {
118  $this->tabs()->activateTab(self::CMD_STANDARD);
119  $il_bibl_field = new ilBiblFieldFilter();
120  $il_bibl_field->setObjectId($this->facade->iliasObjId());
121  $form = new ilBiblFieldFilterFormGUI($this, $il_bibl_field, $this->facade);
122  if ($form->saveObject()) {
123  ilUtil::sendSuccess($this->lng()->txt('changes_saved'), true);
124  $this->ctrl()->redirect($this, self::CMD_STANDARD);
125  }
126  $form->setValuesByPost();
127  $this->tpl()->setContent($form->getHTML());
128  }
Class ilBiblFieldFilterFormGUI.
if(isset($_POST['submit'])) $form
Class ilBiblFieldFilter.

◆ delete()

ilBiblFieldFilterGUI::delete ( )

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

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

154  {
155  global $DIC;
156  $items = $this->http()->request()->getParsedBody()['interruptive_items'];
157  if (is_array($items)) {
158  foreach ($items as $filter_id) {
159  $il_bibl_field = $this->facade->filterFactory()->findById($filter_id);
160  $il_bibl_field->delete();
161  }
162  }
163  ilUtil::sendSuccess($DIC->language()->txt('filter_deleted'), true);
164  $this->ctrl()->redirect($this, self::CMD_STANDARD);
165  }
global $DIC
Definition: saml.php:7
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ edit()

ilBiblFieldFilterGUI::edit ( )

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

References initEditForm().

132  {
133  $ilBiblSettingsFilterFormGUI = $this->initEditForm();
134  $this->tpl()->setContent($ilBiblSettingsFilterFormGUI->getHTML());
135  }
+ Here is the call graph for this function:

◆ executeCommand()

ilBiblFieldFilterGUI::executeCommand ( )

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

References performCommand(), and ilObjBibliographicGUI\TAB_SETTINGS.

62  {
63  $nextClass = $this->ctrl()->getNextClass();
64  switch ($nextClass) {
65  default:
66  $this->tabs()->activateTab(ilObjBibliographicGUI::TAB_SETTINGS);
67  $this->performCommand();
68  }
69  }
+ Here is the call graph for this function:

◆ getFieldFilterFromRequest()

ilBiblFieldFilterGUI::getFieldFilterFromRequest ( )
private
Returns
ilBiblFieldFilterInterface

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

References ILIAS\FileDelivery\http().

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

181  {
182  $field = $this->http()->request()->getQueryParams()[self::FILTER_ID];
183  $il_bibl_field = $this->facade->filterFactory()->findById($field);
184 
185  return $il_bibl_field;
186  }
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 97 of file class.ilBiblFieldFilterGUI.php.

References $table.

98  {
99  if ($this->access()->checkAccess('write', "", $this->facade->iliasRefId())) {
100  $button = $this->dic()->ui()->factory()->button()->primary($this->lng()->txt("add_filter"), $this->ctrl()->getLinkTarget($this, self::CMD_ADD));
101  $this->toolbar()->addText($this->dic()->ui()->renderer()->render([$button]));
102  }
103 
104  $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
105  $this->tpl()->setContent($table->getHTML());
106  }
Class ilBiblFieldFilterTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24

◆ initEditForm()

ilBiblFieldFilterGUI::initEditForm ( )
protected
Returns
ilBiblFieldFilterFormGUI

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

References CMD_STANDARD, and getFieldFilterFromRequest().

Referenced by edit().

193  {
194  $this->tabs()->clearTargets();
195  $this->tabs()->setBackTarget(
196  $this->lng()->txt("back"),
197  $this->ctrl()->getLinkTargetByClass(ilBiblFieldFilterGUI::class, ilBiblFieldFilterGUI::CMD_STANDARD)
198  );
199 
200  $ilBiblSettingsFilterFormGUI = new ilBiblFieldFilterFormGUI($this, $this->getFieldFilterFromRequest(), $this->facade);
201  $ilBiblSettingsFilterFormGUI->fillForm();
202 
203  return $ilBiblSettingsFilterFormGUI;
204  }
Class ilBiblFieldFilterFormGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performCommand()

ilBiblFieldFilterGUI::performCommand ( )
protected

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

References ilUtil\sendFailure().

Referenced by executeCommand().

73  {
74  $cmd = $this->ctrl()->getCmd(self::CMD_STANDARD);
75  switch ($cmd) {
76  case self::CMD_STANDARD:
77  case self::CMD_ADD:
78  case self::CMD_EDIT:
79  case self::CMD_UPDATE:
80  case self::CMD_CREATE:
81  case self::CMD_DELETE:
82  case self::CMD_CANCEL:
83  case self::CMD_APPLY_FILTER:
84  case self::CMD_RESET_FILTER:
85  case self::CMD_RENDER_INTERRUPTIVE:
86  if ($this->access()->checkAccess('write', "", $this->facade->iliasRefId())) {
87  $this->{$cmd}();
88  break;
89  } else {
90  ilUtil::sendFailure($this->lng()->txt("no_permission"), true);
91  break;
92  }
93  }
94  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderInterruptiveModal()

ilBiblFieldFilterGUI::renderInterruptiveModal ( )

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

References $f, $r, CMD_DELETE, exit, and getFieldFilterFromRequest().

43  {
44  $f = $this->dic()->ui()->factory();
45  $r = $this->dic()->ui()->renderer();
46  $ilBiblFieldFilter = $this->getFieldFilterFromRequest();
47  $form_action = $this->ctrl()->getFormActionByClass(ilBiblFieldFilterGUI::class, ilBiblFieldFilterGUI::CMD_DELETE);
48  $delete_modal = $f->modal()->interruptive(
49  $this->lng()->txt("delete"),
50  $this->lng()->txt('msg_confirm_delete_filter'),
51  $form_action
52  )->withAffectedItems(
53  [$f->modal()->interruptiveItem($ilBiblFieldFilter->getId(), $this->facade->translationFactory()->translate($this->facade->fieldFactory()->findById($ilBiblFieldFilter->getFieldId())))]
54  );
55 
56  echo $r->render([$delete_modal]);
57  exit;
58  }
$r
Definition: example_031.php:79
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ resetFilter()

ilBiblFieldFilterGUI::resetFilter ( )
protected

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

References $table.

216  {
217  $table = new ilBiblFieldFilterTableGUI($this, $this->facade);
218  $table->resetFilter();
219  $table->resetOffset();
220  $this->ctrl()->redirect($this, self::CMD_STANDARD);
221  }
Class ilBiblFieldFilterTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24

◆ update()

ilBiblFieldFilterGUI::update ( )

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

References $form, and getFieldFilterFromRequest().

139  {
140  $il_bibl_field = $this->getFieldFilterFromRequest();
141  $this->tabs()->activateTab(self::CMD_STANDARD);
142 
143  $form = new ilBiblFieldFilterFormGUI($this, $il_bibl_field, $this->facade);
144  if ($form->saveObject()) {
145  ilUtil::sendSuccess($this->lng()->txt('changes_saved'), true);
146  $this->ctrl()->redirect($this, self::CMD_STANDARD);
147  }
148  $form->setValuesByPost();
149  $this->tpl()->setContent($form->getHTML());
150  }
Class ilBiblFieldFilterFormGUI.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

Field Documentation

◆ $facade

ilBiblFieldFilterGUI::$facade
protected

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

Referenced by __construct().

◆ CMD_ADD

const ilBiblFieldFilterGUI::CMD_ADD = 'add'

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

◆ CMD_APPLY_FILTER

const ilBiblFieldFilterGUI::CMD_APPLY_FILTER = 'applyFilter'

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

◆ CMD_CANCEL

const ilBiblFieldFilterGUI::CMD_CANCEL = 'cancel'

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

Referenced by ilBiblFieldFilterFormGUI\initButtons().

◆ CMD_CREATE

const ilBiblFieldFilterGUI::CMD_CREATE = 'create'

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

Referenced by ilBiblFieldFilterFormGUI\initButtons().

◆ CMD_DELETE

const ilBiblFieldFilterGUI::CMD_DELETE = 'delete'

Definition at line 20 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 23 of file class.ilBiblFieldFilterGUI.php.

◆ CMD_STANDARD

const ilBiblFieldFilterGUI::CMD_STANDARD = 'index'

◆ CMD_TRANSLATE

const ilBiblFieldFilterGUI::CMD_TRANSLATE = 'translate'

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

◆ CMD_UPDATE

const ilBiblFieldFilterGUI::CMD_UPDATE = 'update'

Definition at line 19 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: