ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilEmployeeTalkMyStaffBaseGUI Class Reference
+ Inheritance diagram for ilEmployeeTalkMyStaffBaseGUI:
+ Collaboration diagram for ilEmployeeTalkMyStaffBaseGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 getClassPath ()
 

Protected Member Functions

 hasCurrentUserAccess ()
 
 loadHeader ()
 
 loadTabs ()
 
 loadTalkData ()
 

Protected Attributes

UIServices $ui
 
ilLanguage $language
 
ilTabsGUI $tabs
 
ilMyStaffAccess $access
 
ilCtrl $ctrl
 
ilObjUser $current_user
 
EmployeeTalkRepository $repository
 
ilObjEmployeeTalkAccess $talk_access
 

Private Member Functions

 checkAccessOrFail ()
 
 applyFilter ()
 
 resetFilter ()
 
 view ()
 
 loadActionBar ()
 
 loadTable ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilEmployeeTalkMyStaffBaseGUI::__construct ( )

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

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\UI\examples\Deck\repository(), ILIAS\Repository\tabs(), and ILIAS\Repository\ui().

41  {
42  global $DIC;
43 
44  $DIC->language()->loadLanguageModule('etal');
45  $DIC->language()->loadLanguageModule('orgu');
46  $this->language = $DIC->language();
47  $this->talk_access = new ilObjEmployeeTalkAccess();
48  $this->access = ilMyStaffAccess::getInstance();
49 
50  $this->tabs = $DIC->tabs();
51  $this->ui = $DIC->ui();
52  $this->ctrl = $DIC->ctrl();
53  $this->current_user = $DIC->user();
54  $this->repository = new IliasDBEmployeeTalkRepository($DIC->database());
55  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
global $DIC
Definition: shib_login.php:22
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilEmployeeTalkMyStaffBaseGUI::applyFilter ( )
private

Definition at line 119 of file class.ilEmployeeTalkMyStaffBaseGUI.php.

References view().

Referenced by executeCommand().

119  : void
120  {
121  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::APPLY_FILTER);
122  $table->writeFilterToSession();
123  $table->resetOffset();
124  $this->view();
125  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkAccessOrFail()

ilEmployeeTalkMyStaffBaseGUI::checkAccessOrFail ( )
private

Definition at line 102 of file class.ilEmployeeTalkMyStaffBaseGUI.php.

References ILIAS\Repository\ctrl(), getClassPath(), hasCurrentUserAccess(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\ui().

102  : void
103  {
104  if (!$this->hasCurrentUserAccess()) {
105  $this->ui->mainTemplate()->setOnScreenMessage(
106  'failure',
107  $this->language->txt("permission_denied"),
108  true
109  );
110  $this->ctrl->redirectByClass(ilDashboardGUI::class, "");
111  }
112  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ executeCommand()

ilEmployeeTalkMyStaffBaseGUI::executeCommand ( )
final

Implements ILIAS\EmployeeTalk\UI\ControlFlowCommandHandler.

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

References ILIAS\Repository\access(), applyFilter(), ILIAS\Repository\ctrl(), getClassPath(), hasCurrentUserAccess(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), resetFilter(), ILIAS\Repository\tabs(), and view().

57  : void
58  {
59  $next_class = $this->ctrl->getNextClass();
60  $command = $this->ctrl->getCmd(ControlFlowCommand::DEFAULT);
61  $link_to_this = $this->ctrl->getLinkTargetByClass($this->getClassPath());
62 
63  switch ($next_class) {
64  case strtolower(ilObjEmployeeTalkSeriesGUI::class):
65  $gui = new ilObjEmployeeTalkSeriesGUI();
66  $gui->setLinkToParentGUI($link_to_this);
67  $this->ctrl->forwardCommand($gui);
68  break;
69  case strtolower(ilObjEmployeeTalkGUI::class):
70  $gui = new ilObjEmployeeTalkGUI();
71  if ($this->access->hasCurrentUserAccessToTalks()) {
72  $this->tabs->setBackTarget(
73  $this->language->txt('etal_talks'),
74  $this->ctrl->getLinkTarget($this, ControlFlowCommand::INDEX)
75  );
76  }
77  $gui->setLinkToParentGUI($link_to_this);
78  $this->ctrl->forwardCommand($gui);
79  break;
80  case strtolower(ilFormPropertyDispatchGUI::class):
81  $this->ctrl->setReturn($this, ControlFlowCommand::INDEX);
82  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::INDEX);
83  $table->executeCommand();
84  break;
85  default:
86  switch ($command) {
87  case ControlFlowCommand::APPLY_FILTER:
88  $this->applyFilter();
89  break;
90  case ControlFlowCommand::RESET_FILTER:
91  $this->resetFilter();
92  break;
93  case ControlFlowCommand::INDEX:
94  default:
95  $this->view();
96  }
97  }
98  }
Class ilObjEmployeeTalkGUI.
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ getClassPath()

ilEmployeeTalkMyStaffBaseGUI::getClassPath ( )
abstract
Returns
string[]

Referenced by checkAccessOrFail(), and executeCommand().

+ Here is the caller graph for this function:

◆ hasCurrentUserAccess()

ilEmployeeTalkMyStaffBaseGUI::hasCurrentUserAccess ( )
abstractprotected

Referenced by checkAccessOrFail(), and executeCommand().

+ Here is the caller graph for this function:

◆ loadActionBar()

ilEmployeeTalkMyStaffBaseGUI::loadActionBar ( )
private

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

References $objId, $refId, $url, ilObject\_getAllReferences(), ilObject\_getObjectsByType(), ilObject\_hasUntrashedReference(), ILIAS\Repository\ctrl(), ilObjTalkTemplateAdministration\getRootRefId(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), loadTalkData(), null, ilObjEmployeeTalkSeries\TYPE, and ILIAS\Repository\ui().

Referenced by view().

147  : void
148  {
149  if (!$this->talk_access->canCreate()) {
150  return;
151  }
152 
153  $templates = new CallbackFilterIterator(
155  function (array $item) {
156  return
157  (
158  $item['offline'] === "0" ||
159  $item['offline'] === 0 ||
160  $item['offline'] === null
161  ) && ilObjTalkTemplate::_hasUntrashedReference(intval($item['obj_id']));
162  }
163  );
164 
165  $buttons = [];
166  $talk_class = strtolower(ilObjEmployeeTalkSeriesGUI::class);
167  foreach ($templates as $item) {
168  $objId = intval($item['obj_id']);
170 
171  // Templates only have one ref id
172  $this->ctrl->setParameterByClass($talk_class, 'new_type', ilObjEmployeeTalkSeries::TYPE);
173  $this->ctrl->setParameterByClass($talk_class, 'template', array_pop($refId));
174  $this->ctrl->setParameterByClass($talk_class, 'ref_id', ilObjTalkTemplateAdministration::getRootRefId());
175  $url = $this->ctrl->getLinkTargetByClass($talk_class, ControlFlowCommand::CREATE);
176  $this->ctrl->clearParametersByClass($talk_class);
177 
178  $buttons[] = $this->ui->factory()->link()->standard(
179  (string) $item["title"],
180  $url
181  );
182  }
183 
184  $dropdown = $this->ui->factory()->dropdown()->standard($buttons)->withLabel(
185  $this->language->txt('etal_add_new_item')
186  );
187  $this->ui->mainTemplate()->setVariable(
188  'SELECT_OBJTYPE_REPOS',
189  $this->ui->renderer()->render($dropdown)
190  );
191  }
static _getObjectsByType(string $obj_type="", ?int $owner=null)
static _getAllReferences(int $id)
get all reference ids for object ID
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
$objId
Definition: xapitoken.php:57
$refId
Definition: xapitoken.php:58
$url
Definition: shib_logout.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadHeader()

ilEmployeeTalkMyStaffBaseGUI::loadHeader ( )
abstractprotected

Referenced by view().

+ Here is the caller graph for this function:

◆ loadTable()

ilEmployeeTalkMyStaffBaseGUI::loadTable ( )
private

Definition at line 198 of file class.ilEmployeeTalkMyStaffBaseGUI.php.

References loadTalkData().

Referenced by view().

199  {
200  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::DEFAULT);
201  $table->setTalkData($this->loadTalkData());
202 
203  return $table;
204  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadTabs()

ilEmployeeTalkMyStaffBaseGUI::loadTabs ( )
abstractprotected

Referenced by view().

+ Here is the caller graph for this function:

◆ loadTalkData()

ilEmployeeTalkMyStaffBaseGUI::loadTalkData ( )
abstractprotected
Returns
EmployeeTalk[]

Referenced by loadActionBar(), loadTable(), and ilEmployeeTalkMyStaffListGUI\loadTabs().

+ Here is the caller graph for this function:

◆ resetFilter()

ilEmployeeTalkMyStaffBaseGUI::resetFilter ( )
private

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

References view().

Referenced by executeCommand().

127  : void
128  {
129  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::RESET_FILTER);
130  $table->resetOffset();
131  $table->resetFilter();
132  $this->view();
133  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilEmployeeTalkMyStaffBaseGUI::view ( )
private

Definition at line 135 of file class.ilEmployeeTalkMyStaffBaseGUI.php.

References loadActionBar(), loadHeader(), loadTable(), loadTabs(), and ILIAS\Repository\ui().

Referenced by applyFilter(), executeCommand(), and resetFilter().

135  : void
136  {
137  $this->loadActionBar();
138  $this->loadTabs();
139  $this->loadHeader();
140  $this->ui->mainTemplate()->setContent($this->loadTable()->getHTML());
141  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilEmployeeTalkMyStaffBaseGUI::$access
protected

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

◆ $ctrl

ilCtrl ilEmployeeTalkMyStaffBaseGUI::$ctrl
protected

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

◆ $current_user

ilObjUser ilEmployeeTalkMyStaffBaseGUI::$current_user
protected

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

◆ $language

ilLanguage ilEmployeeTalkMyStaffBaseGUI::$language
protected

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

◆ $repository

EmployeeTalkRepository ilEmployeeTalkMyStaffBaseGUI::$repository
protected

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

◆ $tabs

ilTabsGUI ilEmployeeTalkMyStaffBaseGUI::$tabs
protected

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

◆ $talk_access

ilObjEmployeeTalkAccess ilEmployeeTalkMyStaffBaseGUI::$talk_access
protected

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

◆ $ui

UIServices ilEmployeeTalkMyStaffBaseGUI::$ui
protected

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


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