ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilBiblLibraryGUI 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 ilBiblLibraryGUI:

Public Member Functions

 __construct (ilBiblAdminLibraryFacadeInterface $facade)
 ilBiblLibraryGUI constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 index ()
 $ilToolbar ilToolbarGUI; More...
 
 add ()
 add library More...
 
 delete ()
 delete library More...
 
 cancel ()
 cancel More...
 
 update ()
 save changes in library More...
 
 create ()
 create library More...
 
 edit ()
 edit library More...
 

Data Fields

const F_LIB_ID = 'lib_id'
 
const F_LIB_IDS = 'lib_ids'
 
const CMD_DELETE = 'delete'
 
const CMD_EDIT = 'edit'
 
const CMD_INDEX = 'index'
 
const CMD_ADD = 'add'
 

Protected Attributes

ilBiblAdminLibraryFacadeInterface $facade
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper WrapperFactory $wrapper
 

Private Member Functions

 getInstancesFromRequest ()
 return ilBiblLibraryInterface[] More...
 

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 ilBiblLibraryGUI

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

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

Constructor & Destructor Documentation

◆ __construct()

ilBiblLibraryGUI::__construct ( ilBiblAdminLibraryFacadeInterface  $facade)

ilBiblLibraryGUI constructor.

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

References $DIC, $facade, and ILIAS\Repository\refinery().

42  {
43  global $DIC;
44  $this->main_tpl = $DIC->ui()->mainTemplate();
45  $this->facade = $facade;
46  $this->wrapper = $DIC->http()->wrapper();
47  $this->refinery = $DIC->refinery();
48  }
global $DIC
Definition: shib_login.php:25
ilBiblAdminLibraryFacadeInterface $facade
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilBiblLibraryGUI::add ( )

add library

Definition at line 93 of file class.ilBiblLibraryGUI.php.

93  : void
94  {
95  $this->checkPermissionAndFail('write');
96  $form = new ilBiblLibraryFormGUI($this->facade->libraryFactory()->getEmptyInstance());
97  $this->tpl()->setContent($form->getHTML());
98  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ cancel()

ilBiblLibraryGUI::cancel ( )

cancel

Definition at line 118 of file class.ilBiblLibraryGUI.php.

References ILIAS\Repository\ctrl().

118  : void
119  {
120  $this->ctrl()->redirect($this, self::CMD_INDEX);
121  }
+ Here is the call graph for this function:

◆ create()

ilBiblLibraryGUI::create ( )

create library

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

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

144  : void
145  {
146  $this->checkPermissionAndFail('write');
147  $form = new ilBiblLibraryFormGUI($this->facade->libraryFactory()->getEmptyInstance());
148  $form->setValuesByPost();
149  if ($form->saveObject()) {
150  $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt("settings_saved"), true);
151  $this->ctrl()->redirect($this, self::CMD_INDEX);
152  }
153  $this->tpl()->setContent($form->getHTML());
154  }
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()

ilBiblLibraryGUI::delete ( )

delete library

Definition at line 104 of file class.ilBiblLibraryGUI.php.

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

104  : void
105  {
106  $this->checkPermissionAndFail('write');
107  $ilBibliographicSettings = $this->getInstancesFromRequest();
108  foreach ($ilBibliographicSettings as $ilBibliographicSetting) {
109  $ilBibliographicSetting->delete();
110  }
111  $this->ctrl()->redirect($this, self::CMD_INDEX);
112  }
getInstancesFromRequest()
return ilBiblLibraryInterface[]
+ Here is the call graph for this function:

◆ edit()

ilBiblLibraryGUI::edit ( )

edit library

Definition at line 160 of file class.ilBiblLibraryGUI.php.

References getInstancesFromRequest().

160  : void
161  {
162  $this->checkPermissionAndFail('write');
163  $ilBibliographicSetting = $this->getInstancesFromRequest()[0];
164  $form = new ilBiblLibraryFormGUI($ilBibliographicSetting);
165  $this->tpl()->setContent($form->getHTML());
166  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInstancesFromRequest()
return ilBiblLibraryInterface[]
+ Here is the call graph for this function:

◆ executeCommand()

ilBiblLibraryGUI::executeCommand ( )

Execute command.

public

Definition at line 57 of file class.ilBiblLibraryGUI.php.

References ILIAS\Repository\ctrl().

57  : void
58  {
59  switch ($this->ctrl()->getNextClass()) {
60  case null:
61  $cmd = $this->ctrl()->getCmd(self::CMD_INDEX);
62  $this->{$cmd}();
63  break;
64  }
65  }
+ Here is the call graph for this function:

◆ getInstancesFromRequest()

ilBiblLibraryGUI::getInstancesFromRequest ( )
private

return ilBiblLibraryInterface[]

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

References ILIAS\Repository\refinery().

Referenced by delete(), edit(), and update().

171  : array
172  {
173  $lib_ids = null;
174  $to_int = $this->refinery->kindlyTo()->int();
175  $to_int_array = $this->refinery->kindlyTo()->listOf($to_int);
176  if ($this->wrapper->query()->has(self::F_LIB_IDS)) {
177  $lib_ids = $this->wrapper->query()->retrieve(self::F_LIB_IDS, $to_int_array);
178  } elseif ($this->wrapper->query()->has(self::F_LIB_ID)) {
179  $lib_ids[] = $this->wrapper->query()->retrieve(self::F_LIB_ID, $to_int);
180  } elseif ($this->wrapper->post()->has(self::F_LIB_IDS)) {
181  $lib_ids = $this->wrapper->post()->retrieve(self::F_LIB_IDS, $to_int_array);
182  } elseif ($this->wrapper->post()->has(self::F_LIB_ID)) {
183  $lib_ids[] = $this->wrapper->post()->retrieve(self::F_LIB_ID, $to_int);
184  }
185 
186  if ($lib_ids === null) {
187  throw new ilException('library not found');
188  }
189 
190  $instances = [];
191  foreach ($lib_ids as $lib_id) {
192  $instances[] = $this->facade->libraryFactory()->findById($lib_id);
193  }
194  return $instances;
195  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index()

ilBiblLibraryGUI::index ( )

$ilToolbar ilToolbarGUI;

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

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

72  : bool
73  {
74  if ($this->checkPermissionBoolAndReturn('write')) {
75  $btn_add = $this->ui()->factory()->button()->primary(
76  $this->lng()->txt(self::CMD_ADD),
77  $this->ctrl()->getLinkTarget($this, self::CMD_ADD)
78  );
79  $this->toolbar()->addComponent($btn_add);
80 
81  }
82 
83  $table_gui = new ilBiblLibraryTableGUI($this->facade);
84  $this->tpl()->setContent($table_gui->getRenderedTable());
85 
86  return true;
87  }
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()

ilBiblLibraryGUI::update ( )

save changes in library

Definition at line 127 of file class.ilBiblLibraryGUI.php.

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

127  : void
128  {
129  $this->checkPermissionAndFail('write');
130  $ilBibliographicSetting = $this->getInstancesFromRequest()[0];
131  $form = new ilBiblLibraryFormGUI($ilBibliographicSetting);
132  $form->setValuesByPost();
133  if ($form->saveObject()) {
134  $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt("settings_saved"), true);
135  $this->ctrl()->redirect($this, self::CMD_INDEX);
136  }
137  $this->tpl()->setContent($form->getHTML());
138  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInstancesFromRequest()
return ilBiblLibraryInterface[]
+ Here is the call graph for this function:

Field Documentation

◆ $facade

ilBiblAdminLibraryFacadeInterface ilBiblLibraryGUI::$facade
protected

Definition at line 33 of file class.ilBiblLibraryGUI.php.

Referenced by __construct().

◆ $main_tpl

ilGlobalTemplateInterface ilBiblLibraryGUI::$main_tpl
private

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

◆ $refinery

ILIAS Refinery Factory ilBiblLibraryGUI::$refinery
protected

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

◆ $wrapper

ILIAS HTTP Wrapper WrapperFactory ilBiblLibraryGUI::$wrapper
protected

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

◆ CMD_ADD

const ilBiblLibraryGUI::CMD_ADD = 'add'

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

◆ CMD_DELETE

const ilBiblLibraryGUI::CMD_DELETE = 'delete'

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

Referenced by ilBiblLibraryTableGUI\getColumns().

◆ CMD_EDIT

const ilBiblLibraryGUI::CMD_EDIT = 'edit'

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

Referenced by ilBiblLibraryTableGUI\getColumns().

◆ CMD_INDEX

const ilBiblLibraryGUI::CMD_INDEX = 'index'

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

Referenced by ilObjBibliographicAdminGUI\view().

◆ F_LIB_ID

const ilBiblLibraryGUI::F_LIB_ID = 'lib_id'

Definition at line 27 of file class.ilBiblLibraryGUI.php.

Referenced by ilBiblLibraryFormGUI\__construct().

◆ F_LIB_IDS

const ilBiblLibraryGUI::F_LIB_IDS = 'lib_ids'

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


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