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

Class ilBiblLibraryGUI. 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 CMD_DELETE = 'delete'
 
const CMD_EDIT = 'edit'
 
const CMD_INDEX = 'index'
 
const CMD_ADD = 'add'
 

Protected Member Functions

 initTable ()
 

Protected Attributes

 $facade
 

Private Member Functions

 getInstanceFromRequest ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblLibraryGUI::__construct ( ilBiblAdminLibraryFacadeInterface  $facade)

ilBiblLibraryGUI constructor.

Parameters
\ilBiblAdminLibraryFacadeInterface$facade

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

References $facade.

28  {
29  $this->facade = $facade;
30  }

Member Function Documentation

◆ add()

ilBiblLibraryGUI::add ( )

add library

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

References $form.

99  {
100  $this->checkPermissionAndFail('write');
101  $form = new ilBiblLibraryFormGUI($this->facade->libraryFactory()->getEmptyInstance());
102  $this->tpl()->setContent($form->getHTML());
103  }
Bibliographic Libraries Form.
if(isset($_POST['submit'])) $form

◆ cancel()

ilBiblLibraryGUI::cancel ( )

cancel

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

122  {
123  $this->ctrl()->redirect($this, self::CMD_INDEX);
124  }

◆ create()

ilBiblLibraryGUI::create ( )

create library

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

References $form.

148  {
149  $this->checkPermissionAndFail('write');
150  $form = new ilBiblLibraryFormGUI($this->facade->libraryFactory()->getEmptyInstance());
151  $form->setValuesByPost();
152  if ($form->saveObject()) {
153  ilUtil::sendSuccess($this->lng()->txt("settings_saved"), true);
154  $this->ctrl()->redirect($this, self::CMD_INDEX);
155  }
156  $this->tpl()->setContent($form->getHTML());
157  }
Bibliographic Libraries Form.
if(isset($_POST['submit'])) $form

◆ delete()

ilBiblLibraryGUI::delete ( )

delete library

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

References getInstanceFromRequest().

110  {
111  $this->checkPermissionAndFail('write');
112  $ilBibliographicSetting = $this->getInstanceFromRequest();
113  $ilBibliographicSetting->delete();
114  $this->ctrl()->redirect($this, self::CMD_INDEX);
115  }
+ Here is the call graph for this function:

◆ edit()

ilBiblLibraryGUI::edit ( )

edit library

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

References $form, and getInstanceFromRequest().

164  {
165  $this->checkPermissionAndFail('write');
166  $this->ctrl()->saveParameter($this, self::F_LIB_ID);
167  $ilBibliographicSetting = $this->getInstanceFromRequest();
168  $form = new ilBiblLibraryFormGUI($ilBibliographicSetting);
169  $this->tpl()->setContent($form->getHTML());
170  }
Bibliographic Libraries Form.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

◆ executeCommand()

ilBiblLibraryGUI::executeCommand ( )

Execute command.

public

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

40  {
41  switch ($this->ctrl()->getNextClass()) {
42  case null:
43  $cmd = $this->ctrl()->getCmd(self::CMD_INDEX);
44  $this->{$cmd}();
45  break;
46  }
47  }

◆ getInstanceFromRequest()

ilBiblLibraryGUI::getInstanceFromRequest ( )
private
Returns

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

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

177  {
178  $ilBibliographicSetting = $this->facade->libraryFactory()
179  ->findById($_REQUEST[self::F_LIB_ID]);
180 
181  return $ilBibliographicSetting;
182  }
+ Here is the caller graph for this function:

◆ index()

ilBiblLibraryGUI::index ( )

$ilToolbar ilToolbarGUI;

Returns
bool

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

References ilLinkButton\getInstance(), and initTable().

56  {
57  if ($this->checkPermissionBoolAndReturn('write')) {
59  $b->setCaption(self::CMD_ADD);
60  $b->setUrl($this->ctrl()->getLinkTarget($this, self::CMD_ADD));
61  $b->setPrimary(true);
62 
63  $this->toolbar()->addButtonInstance($b);
64  }
65 
66  $a_table = $this->initTable();
67  $this->tpl()->setContent($a_table->getHTML());
68 
69  return true;
70  }
+ Here is the call graph for this function:

◆ initTable()

ilBiblLibraryGUI::initTable ( )
protected
Returns

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

References $result, and $table.

Referenced by index().

77  {
78  $table = new ilBiblLibraryTableGUI($this, $this->checkPermissionBoolAndReturn('write'));
79  $settings = $this->facade->libraryFactory()->getAll();
80  $result = array();
81  foreach ($settings as $set) {
82  $result[] = array(
83  "id" => $set->getId(),
84  "name" => $set->getName(),
85  "url" => $set->getUrl(),
86  "img" => $set->getImg(),
87  );
88  }
89  $table->setData($result);
90 
91  return $table;
92  }
$result
Bibliographic ilBiblLibraryTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the caller graph for this function:

◆ update()

ilBiblLibraryGUI::update ( )

save changes in library

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

References $form, and getInstanceFromRequest().

131  {
132  $this->checkPermissionAndFail('write');
133  $ilBibliographicSetting = $this->getInstanceFromRequest();
134  $form = new ilBiblLibraryFormGUI($ilBibliographicSetting);
135  $form->setValuesByPost();
136  if ($form->saveObject()) {
137  ilUtil::sendSuccess($this->lng()->txt("settings_saved"), true);
138  $this->ctrl()->redirect($this, self::CMD_INDEX);
139  }
140  $this->tpl()->setContent($form->getHTML());
141  }
Bibliographic Libraries Form.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

Field Documentation

◆ $facade

ilBiblLibraryGUI::$facade
protected

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

Referenced by __construct().

◆ CMD_ADD

const ilBiblLibraryGUI::CMD_ADD = 'add'

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

◆ CMD_DELETE

const ilBiblLibraryGUI::CMD_DELETE = 'delete'

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

Referenced by ilBiblLibraryTableGUI\fillRow().

◆ CMD_EDIT

const ilBiblLibraryGUI::CMD_EDIT = 'edit'

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

Referenced by ilBiblLibraryTableGUI\fillRow().

◆ CMD_INDEX

const ilBiblLibraryGUI::CMD_INDEX = 'index'

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

Referenced by ilObjBibliographicAdminGUI\view().

◆ F_LIB_ID

const ilBiblLibraryGUI::F_LIB_ID = 'lib_id'

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