ILIAS  release_8 Revision v8.23
ilEmployeeTalkMyStaffListGUI Class Reference

Class ilEmployeeTalkMyStaffListGUI. More...

+ Inheritance diagram for ilEmployeeTalkMyStaffListGUI:
+ Collaboration diagram for ilEmployeeTalkMyStaffListGUI:

Public Member Functions

 executeCommand ()
 

Private Member Functions

 getActions ()
 
 applyFilter ()
 
 resetFilter ()
 
 view ()
 
 loadTabs ()
 
 loadActionBar ()
 

Private Attributes

UIServices $ui
 
ilLanguage $language
 
ilTabsGUI $tabs
 
ilMyStaffAccess $access
 
ilCtrl $controlFlow
 
ilObjUser $currentUser
 
EmployeeTalkRepository $repository
 
HTTPServices $http
 
ilObjEmployeeTalkAccess $talkAccess
 
ILIAS Refinery Factory $refinery
 

Detailed Description

Member Function Documentation

◆ applyFilter()

ilEmployeeTalkMyStaffListGUI::applyFilter ( )
private

Definition at line 154 of file class.ilEmployeeTalkMyStaffListGUI.php.

References view().

Referenced by executeCommand().

154  : void
155  {
156  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::APPLY_FILTER);
157  $table->writeFilterToSession();
158  $table->resetOffset();
159  $this->view();
160  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilEmployeeTalkMyStaffListGUI::executeCommand ( )

Implements ILIAS\EmployeeTalk\UI\ControlFlowCommandHandler.

Definition at line 74 of file class.ilEmployeeTalkMyStaffListGUI.php.

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

74  : void
75  {
76  $nextClass = $this->controlFlow->getNextClass();
77  $command = $this->controlFlow->getCmd(ControlFlowCommand::DEFAULT);
78  switch ($nextClass) {
79  case strtolower(ilObjEmployeeTalkSeriesGUI::class):
80  $gui = new ilObjEmployeeTalkSeriesGUI();
81  $this->controlFlow->forwardCommand($gui);
82  break;
83  case strtolower(ilObjEmployeeTalkGUI::class):
84  $gui = new ilObjEmployeeTalkGUI();
85  if ($this->access->hasCurrentUserAccessToTalks()) {
86  $this->tabs->setBackTarget(
87  $this->language->txt('etal_talks'),
88  $this->controlFlow->getLinkTarget($this, ControlFlowCommand::INDEX)
89  );
90  }
91  $this->controlFlow->forwardCommand($gui);
92  break;
93  case strtolower(ilFormPropertyDispatchGUI::class):
94  $this->controlFlow->setReturn($this, ControlFlowCommand::INDEX);
95  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::INDEX);
96  $table->executeCommand();
97  break;
98  default:
99  switch ($command) {
100  case ControlFlowCommand::APPLY_FILTER:
101  $this->applyFilter();
102  break;
103  case ControlFlowCommand::RESET_FILTER:
104  $this->resetFilter();
105  break;
106  case ControlFlowCommand::TABLE_ACTIONS:
107  $this->getActions();
108  break;
109  default:
110  $this->view();
111  }
112 
113  }
114  }
Class ilObjEmployeeTalkGUI.
+ Here is the call graph for this function:

◆ getActions()

ilEmployeeTalkMyStaffListGUI::getActions ( )
private

Definition at line 116 of file class.ilEmployeeTalkMyStaffListGUI.php.

References $refId, exit, ILIAS\FileDelivery\http(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\refinery().

Referenced by executeCommand().

116  : void
117  {
118  $listGUI = new ilAdvancedSelectionListGUI();
119 
120  $class = strtolower(ilObjEmployeeTalkGUI::class);
121  $classPath = [
122  strtolower(ilDashboardGUI::class),
123  strtolower(ilMyStaffGUI::class),
124  strtolower(ilEmployeeTalkMyStaffListGUI::class),
125  $class
126  ];
127 
128  $queryParams = $this->http->request()->getQueryParams();
129  if (!key_exists('ref_id', $queryParams)) {
130  echo $listGUI->getHTML(true);
131  exit;
132  }
133 
134  $refId = $this->http
135  ->wrapper()
136  ->query()
137  ->retrieve('ref_id', $this->refinery->kindlyTo()->int());
138  $this->controlFlow->setParameterByClass($class, "ref_id", $refId);
139  if ($this->talkAccess->canEdit($refId)) {
140  $listGUI->addItem($this->language->txt('edit'), '', $this->controlFlow->getLinkTargetByClass($classPath, ControlFlowCommand::UPDATE));
141  } else {
142  $listGUI->addItem($this->language->txt('view'), '', $this->controlFlow->getLinkTargetByClass($classPath, ControlFlowCommand::INDEX));
143  }
144 
145  if ($this->talkAccess->canDelete($refId)) {
146  $this->controlFlow->setParameterByClass($class, "item_ref_id", $refId);
147  $listGUI->addItem($this->language->txt('delete'), '', $this->controlFlow->getLinkTargetByClass($classPath, ControlFlowCommand::DELETE_INDEX));
148  }
149 
150  echo $listGUI->getHTML(true);
151  exit;
152  }
exit
Definition: login.php:28
$refId
Definition: xapitoken.php:58
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadActionBar()

ilEmployeeTalkMyStaffListGUI::loadActionBar ( )
private

Definition at line 188 of file class.ilEmployeeTalkMyStaffListGUI.php.

References $objId, $path, $refId, $type, $url, ilObject\_getAllReferences(), ilObject\_getIcon(), ilObject\_getObjectsByType(), ilObject\_hasUntrashedReference(), ilObjEmployeeTalkAccess\canCreate(), ilHelp\getObjCreationTooltipText(), ilObjTalkTemplateAdministration\getRootRefId(), ilOrgUnitPermissionQueries\getTemplateSetForContextName(), ilUtil\img(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\UI\examples\Deck\repository(), ilAdvancedSelectionListGUI\STYLE_EMPH, ilObjEmployeeTalkSeries\TYPE, ilObjEmployeeTalk\TYPE, and ILIAS\Repository\ui().

Referenced by view().

188  : void
189  {
191  if (!$talkAccess->canCreate()) {
192  return;
193  }
194 
195  $gl = new ilGroupedListGUI();
196  $gl->setAsDropDown(true, false);
197 
198  $templates = new CallbackFilterIterator(
200  function (array $item) {
201  return
202  (
203  $item['offline'] === "0" ||
204  $item['offline'] === null
205  ) && ilObjTalkTemplate::_hasUntrashedReference(intval($item['obj_id']));
206  }
207  );
208 
209  foreach ($templates as $item) {
210  $type = $item["type"];
211 
212  $objId = intval($item['obj_id']);
213  $path = ilObject::_getIcon($objId, 'tiny', $type);
214  $icon = ($path != "")
215  ? ilUtil::img($path, "") . " "
216  : "";
217 
218  $url = $this->controlFlow->getLinkTargetByClass(strtolower(ilObjEmployeeTalkSeriesGUI::class), ControlFlowCommand::CREATE);
220 
221  // Templates only have one ref id
222  $url .= "&new_type=" . ilObjEmployeeTalkSeries::TYPE;
223  $url .= "&template=" . array_pop($refId);
225 
226  $ttip = ilHelp::getObjCreationTooltipText("tals");
227 
228  $gl->addEntry(
229  $icon . $item["title"],
230  $url,
231  "_top",
232  "",
233  "",
234  $type,
235  $ttip,
236  "bottom center",
237  "top center",
238  false
239  );
240  }
241 
242  $adv = new ilAdvancedSelectionListGUI();
243  $adv->setListTitle($this->language->txt("etal_add_new_item"));
244  //$gl->getHTML();
245  $adv->setGroupedList($gl);
247  //$this->toolbar->addDropDown($this->language->txt("cntr_add_new_item"), $adv->getHTML());
248  $this->ui->mainTemplate()->setVariable("SELECT_OBJTYPE_REPOS", $adv->getHTML());
249  }
static getObjCreationTooltipText(string $a_type)
Get object_creation tooltip tab text.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
$type
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
static _getObjectsByType(string $obj_type="", int $owner=null)
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
$path
Definition: ltiservices.php:32
canCreate(?ilObjUser $talkParticipant=null)
Checks if the user is allowed to create a new talks series.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadTabs()

ilEmployeeTalkMyStaffListGUI::loadTabs ( )
private

Definition at line 180 of file class.ilEmployeeTalkMyStaffListGUI.php.

References ILIAS\Repository\tabs().

Referenced by view().

180  : void
181  {
182  $this->tabs->addTab("view_content", "Content", "#");
183  $this->tabs->activateTab("view_content");
184  //$this->tabs->addTab("placeholder", "", "#");
185  $this->tabs->setForcePresentationOfSingleTab(true);
186  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilEmployeeTalkMyStaffListGUI::resetFilter ( )
private

Definition at line 162 of file class.ilEmployeeTalkMyStaffListGUI.php.

References view().

Referenced by executeCommand().

162  : void
163  {
164  $table = new ilEmployeeTalkTableGUI($this, ControlFlowCommand::RESET_FILTER);
165  $table->resetOffset();
166  $table->resetFilter();
167  $this->view();
168  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilEmployeeTalkMyStaffListGUI::view ( )
private

Definition at line 170 of file class.ilEmployeeTalkMyStaffListGUI.php.

References ilUtil\getImagePath(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), loadActionBar(), loadTabs(), and ILIAS\Repository\ui().

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

170  : bool
171  {
172  $this->loadActionBar();
173  $this->loadTabs();
174  $this->ui->mainTemplate()->setTitle($this->language->txt('mm_org_etal'));
175  $this->ui->mainTemplate()->setTitleIcon(ilUtil::getImagePath('icon_etal.svg'));
176  $this->ui->mainTemplate()->setContent($this->loadTable()->getHTML());
177  return true;
178  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilEmployeeTalkMyStaffListGUI::$access
private

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

◆ $controlFlow

ilCtrl ilEmployeeTalkMyStaffListGUI::$controlFlow
private

Definition at line 45 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $currentUser

ilObjUser ilEmployeeTalkMyStaffListGUI::$currentUser
private

Definition at line 46 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $http

HTTPServices ilEmployeeTalkMyStaffListGUI::$http
private

Definition at line 48 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $language

ilLanguage ilEmployeeTalkMyStaffListGUI::$language
private

Definition at line 42 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $refinery

ILIAS Refinery Factory ilEmployeeTalkMyStaffListGUI::$refinery
private

Definition at line 50 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $repository

EmployeeTalkRepository ilEmployeeTalkMyStaffListGUI::$repository
private

Definition at line 47 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $tabs

ilTabsGUI ilEmployeeTalkMyStaffListGUI::$tabs
private

Definition at line 43 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $talkAccess

ilObjEmployeeTalkAccess ilEmployeeTalkMyStaffListGUI::$talkAccess
private

Definition at line 49 of file class.ilEmployeeTalkMyStaffListGUI.php.

◆ $ui

UIServices ilEmployeeTalkMyStaffListGUI::$ui
private

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


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