ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
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 ()
 @global $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 CMD_DELETE = 'delete'
 
const CMD_EDIT = 'edit'
 
const CMD_INDEX = 'index'
 
const CMD_ADD = 'add'
 

Protected Member Functions

 initTable ()
 

Protected Attributes

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

Private Member Functions

 getInstanceFromRequest ()
 

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 40 of file class.ilBiblLibraryGUI.php.

41 {
42 global $DIC;
43 $this->main_tpl = $DIC->ui()->mainTemplate();
44 $this->facade = $facade;
45 $this->wrapper = $DIC->http()->wrapper();
46 $this->refinery = $DIC->refinery();
47 }
ilBiblAdminLibraryFacadeInterface $facade
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilBiblLibraryGUI::add ( )

add library

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

111 : void
112 {
113 $this->checkPermissionAndFail('write');
114 $form = new ilBiblLibraryFormGUI($this->facade->libraryFactory()->getEmptyInstance());
115 $this->tpl()->setContent($form->getHTML());
116 }
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 134 of file class.ilBiblLibraryGUI.php.

134 : void
135 {
136 $this->ctrl()->redirect($this, self::CMD_INDEX);
137 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ create()

ilBiblLibraryGUI::create ( )

create library

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

160 : void
161 {
162 $this->checkPermissionAndFail('write');
163 $form = new ilBiblLibraryFormGUI($this->facade->libraryFactory()->getEmptyInstance());
164 $form->setValuesByPost();
165 if ($form->saveObject()) {
166 $this->main_tpl->setOnScreenMessage('success', $this->lng()->txt("settings_saved"), true);
167 $this->ctrl()->redirect($this, self::CMD_INDEX);
168 }
169 $this->tpl()->setContent($form->getHTML());
170 }

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

+ Here is the call graph for this function:

◆ delete()

ilBiblLibraryGUI::delete ( )

delete library

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

122 : void
123 {
124 $this->checkPermissionAndFail('write');
125 $ilBibliographicSetting = $this->getInstanceFromRequest();
126 $ilBibliographicSetting->delete();
127 $this->ctrl()->redirect($this, self::CMD_INDEX);
128 }

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

+ Here is the call graph for this function:

◆ edit()

ilBiblLibraryGUI::edit ( )

edit library

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

176 : void
177 {
178 $this->checkPermissionAndFail('write');
179 $this->ctrl()->saveParameter($this, self::F_LIB_ID);
180 $ilBibliographicSetting = $this->getInstanceFromRequest();
181 $form = new ilBiblLibraryFormGUI($ilBibliographicSetting);
182 $this->tpl()->setContent($form->getHTML());
183 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilBiblLibraryGUI::executeCommand ( )

Execute command.

@access public

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

56 : void
57 {
58 switch ($this->ctrl()->getNextClass()) {
59 case null:
60 $cmd = $this->ctrl()->getCmd(self::CMD_INDEX);
61 $this->{$cmd}();
62 break;
63 }
64 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getInstanceFromRequest()

ilBiblLibraryGUI::getInstanceFromRequest ( )
private

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

186 {
187 // check Query
188 if ($this->wrapper->query()->has(self::F_LIB_ID)) {
189 return $this->facade->libraryFactory()
190 ->findById(
191 $this->wrapper->query()->retrieve(
192 self::F_LIB_ID,
193 $this->refinery->kindlyTo()->int()
194 )
195 );
196 }
197 // check post
198 if ($this->wrapper->post()->has(self::F_LIB_ID)) {
199 return $this->facade->libraryFactory()
200 ->findById(
201 $this->wrapper->post()->retrieve(
202 self::F_LIB_ID,
203 $this->refinery->kindlyTo()->int()
204 )
205 );
206 }
207 throw new ilException('library not found');
208 }
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...

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

+ Here is the caller graph for this function:

◆ index()

ilBiblLibraryGUI::index ( )

@global $ilToolbar ilToolbarGUI;

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

71 : bool
72 {
73 if ($this->checkPermissionBoolAndReturn('write')) {
75 $b->setCaption(self::CMD_ADD);
76 $b->setUrl($this->ctrl()->getLinkTarget($this, self::CMD_ADD));
77 $b->setPrimary(true);
78
79 $this->toolbar()->addButtonInstance($b);
80 }
81
82 $a_table = $this->initTable();
83 $this->tpl()->setContent($a_table->getHTML());
84
85 return true;
86 }

References Vendor\Package\$b, ILIAS\Repository\ctrl(), ilLinkButton\getInstance(), initTable(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ initTable()

ilBiblLibraryGUI::initTable ( )
protected

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

90 {
91 $table = new ilBiblLibraryTableGUI($this, $this->checkPermissionBoolAndReturn('write'));
92 $settings = $this->facade->libraryFactory()->getAll();
93 $result = array();
94 foreach ($settings as $set) {
95 $result[] = array(
96 "id" => $set->getId(),
97 "name" => $set->getName(),
98 "url" => $set->getUrl(),
99 "img" => $set->getImg(),
100 );
101 }
102 $table->setData($result);
103
104 return $table;
105 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References ILIAS\LTI\ToolProvider\$settings.

Referenced by index().

+ Here is the caller graph for this function:

◆ update()

ilBiblLibraryGUI::update ( )

save changes in library

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

143 : void
144 {
145 $this->checkPermissionAndFail('write');
146 $ilBibliographicSetting = $this->getInstanceFromRequest();
147 $form = new ilBiblLibraryFormGUI($ilBibliographicSetting);
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 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $facade

ilBiblAdminLibraryFacadeInterface ilBiblLibraryGUI::$facade
protected

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

Referenced by __construct().

◆ $main_tpl

ilGlobalTemplateInterface ilBiblLibraryGUI::$main_tpl
private

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

◆ $refinery

ILIAS Refinery Factory ilBiblLibraryGUI::$refinery
protected

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

◆ $wrapper

ILIAS HTTP Wrapper WrapperFactory ilBiblLibraryGUI::$wrapper
protected

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

◆ CMD_ADD

const ilBiblLibraryGUI::CMD_ADD = 'add'

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

◆ CMD_DELETE

const ilBiblLibraryGUI::CMD_DELETE = 'delete'

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

Referenced by ilBiblLibraryTableGUI\fillRow().

◆ CMD_EDIT

const ilBiblLibraryGUI::CMD_EDIT = 'edit'

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

Referenced by ilBiblLibraryTableGUI\fillRow().

◆ CMD_INDEX

const ilBiblLibraryGUI::CMD_INDEX = 'index'

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

◆ F_LIB_ID

const ilBiblLibraryGUI::F_LIB_ID = 'lib_id'

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