ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBiblLibraryGUI Class Reference

Class ilBiblLibraryGUI. More...

+ Collaboration diagram for ilBiblLibraryGUI:

Public Member Functions

 __construct (protected \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

Factory $refinery
 
WrapperFactory $wrapper
 

Private Member Functions

 getInstancesFromRequest ()
 return ilBiblLibraryInterface[] More...
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblLibraryGUI::__construct ( protected \ilBiblAdminLibraryFacadeInterface  $facade)

ilBiblLibraryGUI constructor.

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

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

45  {
46  global $DIC;
47  $this->main_tpl = $DIC->ui()->mainTemplate();
48  $this->wrapper = $DIC->http()->wrapper();
49  $this->refinery = $DIC->refinery();
50  }
global $DIC
Definition: shib_login.php:22
+ 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  }
Bibliographic Libraries Form.

◆ 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  }
Bibliographic Libraries Form.
+ 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  }
Bibliographic Libraries Form.
getInstancesFromRequest()
return ilBiblLibraryInterface[]
+ Here is the call graph for this function:

◆ executeCommand()

ilBiblLibraryGUI::executeCommand ( )

Execute command.

public

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

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

59  : void
60  {
61  if ($this->ctrl()->getNextClass() === null) {
62  $cmd = $this->ctrl()->getCmd(self::CMD_INDEX);
63  $this->{$cmd}();
64  }
65  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getInstancesFromRequest()

ilBiblLibraryGUI::getInstancesFromRequest ( )
private

return ilBiblLibraryInterface[]

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

References null, and 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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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  }
+ 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  }
Bibliographic Libraries Form.
getInstancesFromRequest()
return ilBiblLibraryInterface[]
+ Here is the call graph for this function:

Field Documentation

◆ $main_tpl

ilGlobalTemplateInterface ilBiblLibraryGUI::$main_tpl
private

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

◆ $refinery

Factory ilBiblLibraryGUI::$refinery
protected

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

◆ $wrapper

WrapperFactory ilBiblLibraryGUI::$wrapper
protected

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

◆ CMD_ADD

const ilBiblLibraryGUI::CMD_ADD = 'add'

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

◆ CMD_DELETE

const ilBiblLibraryGUI::CMD_DELETE = 'delete'

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

Referenced by ilBiblLibraryTableGUI\getColumns().

◆ CMD_EDIT

const ilBiblLibraryGUI::CMD_EDIT = 'edit'

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

Referenced by ilBiblLibraryTableGUI\getColumns().

◆ CMD_INDEX

const ilBiblLibraryGUI::CMD_INDEX = 'index'

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

Referenced by ilObjBibliographicAdminGUI\view().

◆ F_LIB_ID

const ilBiblLibraryGUI::F_LIB_ID = 'lib_id'

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

Referenced by ilBiblLibraryFormGUI\__construct().

◆ F_LIB_IDS

const ilBiblLibraryGUI::F_LIB_IDS = 'lib_ids'

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


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