ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBiblAdminFieldGUI Class Reference

Class ilBiblAdminFieldGUI. More...

+ Inheritance diagram for ilBiblAdminFieldGUI:
+ Collaboration diagram for ilBiblAdminFieldGUI:

Public Member Functions

 __construct (protected \ilBiblAdminFactoryFacadeInterface $facade)
 ilBiblAdminFieldGUI constructor. More...
 
 executeCommand ()
 
 checkPermissionAndFail (string $permission)
 
 checkPermissionBoolAndReturn (string $permission)
 

Data Fields

const SUBTAB_RIS = 'subtab_ris'
 
const SUBTAB_BIBTEX = 'subtab_bibtex'
 
const FIELD_IDENTIFIER = 'field_id'
 
const DATA_TYPE = 'data_type'
 
const CMD_STANDARD = 'index'
 
const CMD_CANCEL = 'cancel'
 
const CMD_EDIT = 'edit'
 
const CMD_UPDATE = 'update'
 
const CMD_SAVE_ORDERING = 'saveOrdering'
 
const CMD_APPLY_FILTER = 'applyFilter'
 
const CMD_RESET_FILTER = 'resetFilter'
 
const CMD_SAVE = 'save'
 

Protected Member Functions

 performCommand ()
 
 saveOrdering ()
 
 getFieldIdFromRequest ()
 
 index ()
 
 setSubTabs ()
 
 save ()
 
 applyFilter ()
 
 resetFilter ()
 

Protected Attributes

Table $table
 

Private Member Functions

 saveFieldIdsInRequest ()
 
 getFieldFromRequest ()
 

Private Attributes

Services $http
 
ilCtrl $ctrl
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
ilAccessHandler $access
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblAdminFieldGUI::__construct ( protected \ilBiblAdminFactoryFacadeInterface  $facade)

ilBiblAdminFieldGUI constructor.

Definition at line 52 of file class.ilBiblAdminFieldGUI.php.

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

53  {
54  global $DIC;
55  $this->main_tpl = $DIC->ui()->mainTemplate();
56  $this->table = new Table(
57  $this,
58  $this->facade
59  );
60  $this->http = $DIC['http'];
61  $this->ctrl = $DIC['ilCtrl'];
62  $this->tabs = $DIC['ilTabs'];
63  $this->lng = $DIC['lng'];
64  $this->access = $DIC['ilAccess'];
65  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilBiblAdminFieldGUI::applyFilter ( )
protected

Definition at line 197 of file class.ilBiblAdminFieldGUI.php.

References ILIAS\Repository\ctrl().

197  : void
198  {
199  $ilBiblAdminFieldTableGUI = new ilBiblAdminFieldTableGUI($this, $this->facade);
200  $ilBiblAdminFieldTableGUI->writeFilterToSession();
201  $this->ctrl->redirect($this, self::CMD_STANDARD);
202  }
+ Here is the call graph for this function:

◆ checkPermissionAndFail()

ilBiblAdminFieldGUI::checkPermissionAndFail ( string  $permission)

Definition at line 212 of file class.ilBiblAdminFieldGUI.php.

References checkPermissionBoolAndReturn(), and ILIAS\Repository\lng().

212  : void
213  {
214  if (!$this->checkPermissionBoolAndReturn($permission)) {
215  throw new \ilObjectException($this->lng->txt("permission_denied"));
216  }
217  }
checkPermissionBoolAndReturn(string $permission)
+ Here is the call graph for this function:

◆ checkPermissionBoolAndReturn()

ilBiblAdminFieldGUI::checkPermissionBoolAndReturn ( string  $permission)

Definition at line 219 of file class.ilBiblAdminFieldGUI.php.

References ILIAS\Repository\access(), and ILIAS\FileDelivery\http().

Referenced by checkPermissionAndFail(), and performCommand().

219  : bool
220  {
221  return (bool) $this->access->checkAccess($permission, '', $this->http->request()->getQueryParams()['ref_id']);
222  }
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:

◆ executeCommand()

ilBiblAdminFieldGUI::executeCommand ( )

Definition at line 67 of file class.ilBiblAdminFieldGUI.php.

References ILIAS\Repository\ctrl(), getFieldFromRequest(), ILIAS\Repository\lng(), null, performCommand(), saveFieldIdsInRequest(), ilObjBibliographicAdminGUI\TAB_FIELDS, and ILIAS\Repository\tabs().

67  : void
68  {
69  $this->saveFieldIdsInRequest();
70  $next_class = $this->ctrl->getNextClass();
71  $this->tabs->activateTab(ilObjBibliographicAdminGUI::TAB_FIELDS);
72  switch ($next_class) {
73  case strtolower(ilBiblTranslationGUI::class):
74  $this->tabs->clearTargets();
75  $target = $this->ctrl->getLinkTarget($this);
76  $this->tabs->setBackTarget($this->lng->txt('back'), $target);
77 
78  $field = $this->getFieldFromRequest();
79  if ($field === null) {
80  throw new ilException("Field not found");
81  }
82  $gui = new ilBiblTranslationGUI($this->facade, $field);
83  $this->ctrl->forwardCommand($gui);
84  break;
85 
86  default:
87  $this->performCommand();
88  }
89  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getFieldFromRequest()

ilBiblAdminFieldGUI::getFieldFromRequest ( )
private

Definition at line 140 of file class.ilBiblAdminFieldGUI.php.

References getFieldIdFromRequest().

Referenced by executeCommand().

141  {
142  $field_id = $this->getFieldIdFromRequest();
143 
144  return $this->facade->fieldFactory()->findById($field_id); // get field from id from the factory
145  }
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:

◆ getFieldIdFromRequest()

ilBiblAdminFieldGUI::getFieldIdFromRequest ( )
protected

Definition at line 125 of file class.ilBiblAdminFieldGUI.php.

References ILIAS\FileDelivery\http().

Referenced by getFieldFromRequest(), and saveFieldIdsInRequest().

125  : int
126  {
127  $query_params = $this->http->request()->getQueryParams(); // aka $_GET
128  $name = $this->table->getIdToken()->getName(); // name of the query parameter from the table
129  $field_ids = $query_params[$name] ?? []; // array of field ids
130  return (int) (is_array($field_ids) ? end($field_ids) : $field_ids); // return the last field id
131  }
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()

ilBiblAdminFieldGUI::index ( )
protected

Definition at line 147 of file class.ilBiblAdminFieldGUI.php.

References setSubTabs().

147  : void
148  {
149  $this->setSubTabs();
150  //$table = new ilBiblAdminFieldTableGUI($this, $this->facade);
151  //$this->tpl()->setContent($table->getHTML());
152  $this->main_tpl->setContent($this->table->getHTML());
153  }
+ Here is the call graph for this function:

◆ performCommand()

ilBiblAdminFieldGUI::performCommand ( )
protected

Definition at line 91 of file class.ilBiblAdminFieldGUI.php.

References checkPermissionBoolAndReturn(), and ILIAS\Repository\ctrl().

Referenced by executeCommand().

91  : void
92  {
93  $cmd = $this->ctrl->getCmd(self::CMD_STANDARD);
94  switch ($cmd) {
95  case self::CMD_STANDARD:
96  if ($this->checkPermissionBoolAndReturn('read')) {
97  $this->{$cmd}();
98  }
99  break;
100  case self::CMD_EDIT:
101  case self::CMD_UPDATE:
102  case self::CMD_SAVE:
103  case self::CMD_SAVE_ORDERING:
104  case self::CMD_APPLY_FILTER:
105  case self::CMD_RESET_FILTER:
106  if ($this->checkPermissionBoolAndReturn('write')) {
107  $this->{$cmd}();
108  }
109  break;
110  }
111  }
checkPermissionBoolAndReturn(string $permission)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilBiblAdminFieldGUI::resetFilter ( )
protected

Definition at line 204 of file class.ilBiblAdminFieldGUI.php.

References ILIAS\Repository\ctrl().

204  : void
205  {
206  $ilBiblAdminFieldTableGUI = new ilBiblAdminFieldTableGUI($this, $this->facade);
207  $ilBiblAdminFieldTableGUI->resetFilter();
208  $ilBiblAdminFieldTableGUI->resetOffset();
209  $this->ctrl->redirect($this, self::CMD_STANDARD);
210  }
+ Here is the call graph for this function:

◆ save()

ilBiblAdminFieldGUI::save ( )
protected

Definition at line 191 of file class.ilBiblAdminFieldGUI.php.

References saveOrdering().

191  : void
192  {
193  $this->saveOrdering();
194  ;
195  }
+ Here is the call graph for this function:

◆ saveFieldIdsInRequest()

ilBiblAdminFieldGUI::saveFieldIdsInRequest ( )
private

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

References ILIAS\Repository\ctrl(), and getFieldIdFromRequest().

Referenced by executeCommand().

133  : void
134  {
135  $field_id = $this->getFieldIdFromRequest();
136 
137  $this->ctrl->setParameter($this, $this->table->getIdToken()->getName(), $field_id);
138  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOrdering()

ilBiblAdminFieldGUI::saveOrdering ( )
protected

Definition at line 113 of file class.ilBiblAdminFieldGUI.php.

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

Referenced by save().

113  : void
114  {
115  foreach ($this->table->getOrdering() as $position => $field_id) {
116  $field = $this->facade->fieldFactory()->findById($field_id);
117  $field->setPosition($position);
118  $field->store();
119  }
120 
121  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('changes_successfully_saved'));
122  $this->ctrl->redirect($this, self::CMD_STANDARD);
123  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabs()

ilBiblAdminFieldGUI::setSubTabs ( )
protected

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

References CMD_STANDARD, ILIAS\Repository\ctrl(), ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, ilBiblTypeFactoryInterface\DATA_TYPE_RIS, ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by index().

155  : void
156  {
157  $this->tabs->addSubTab(
158  self::SUBTAB_RIS,
159  $this->lng->txt('ris'),
160  $this->ctrl->getLinkTargetByClass(
161  [
162  ilObjBibliographicAdminGUI::class,
163  ilBiblAdminRisFieldGUI::class,
164  ],
166  )
167  );
168  $this->tabs->activateSubTab(self::SUBTAB_RIS);
169 
170  $this->tabs->addSubTab(
171  self::SUBTAB_BIBTEX,
172  $this->lng->txt('bibtex'),
173  $this->ctrl->getLinkTargetByClass(
174  [
175  ilObjBibliographicAdminGUI::class,
176  ilBiblAdminBibtexFieldGUI::class,
177  ],
179  )
180  );
181  switch ($this->facade->type()->getId()) {
183  $this->tabs->activateSubTab(self::SUBTAB_BIBTEX);
184  break;
186  $this->tabs->activateSubTab(self::SUBTAB_RIS);
187  break;
188  }
189  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilBiblAdminFieldGUI::$access
private

Definition at line 45 of file class.ilBiblAdminFieldGUI.php.

◆ $ctrl

ilCtrl ilBiblAdminFieldGUI::$ctrl
private

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

◆ $http

Services ilBiblAdminFieldGUI::$http
private

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

◆ $lng

ilLanguage ilBiblAdminFieldGUI::$lng
private

Definition at line 44 of file class.ilBiblAdminFieldGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilBiblAdminFieldGUI::$main_tpl
private

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

◆ $table

Table ilBiblAdminFieldGUI::$table
protected

Definition at line 46 of file class.ilBiblAdminFieldGUI.php.

◆ $tabs

ilTabsGUI ilBiblAdminFieldGUI::$tabs
private

Definition at line 43 of file class.ilBiblAdminFieldGUI.php.

◆ CMD_APPLY_FILTER

const ilBiblAdminFieldGUI::CMD_APPLY_FILTER = 'applyFilter'

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

◆ CMD_CANCEL

const ilBiblAdminFieldGUI::CMD_CANCEL = 'cancel'

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

◆ CMD_EDIT

const ilBiblAdminFieldGUI::CMD_EDIT = 'edit'

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

◆ CMD_RESET_FILTER

const ilBiblAdminFieldGUI::CMD_RESET_FILTER = 'resetFilter'

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

◆ CMD_SAVE

const ilBiblAdminFieldGUI::CMD_SAVE = 'save'

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

◆ CMD_SAVE_ORDERING

const ilBiblAdminFieldGUI::CMD_SAVE_ORDERING = 'saveOrdering'

◆ CMD_STANDARD

const ilBiblAdminFieldGUI::CMD_STANDARD = 'index'

◆ CMD_UPDATE

const ilBiblAdminFieldGUI::CMD_UPDATE = 'update'

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

◆ DATA_TYPE

const ilBiblAdminFieldGUI::DATA_TYPE = 'data_type'

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

◆ FIELD_IDENTIFIER

const ilBiblAdminFieldGUI::FIELD_IDENTIFIER = 'field_id'

◆ SUBTAB_BIBTEX

const ilBiblAdminFieldGUI::SUBTAB_BIBTEX = 'subtab_bibtex'

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

◆ SUBTAB_RIS

const ilBiblAdminFieldGUI::SUBTAB_RIS = 'subtab_ris'

Definition at line 29 of file class.ilBiblAdminFieldGUI.php.


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