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

Public Member Functions

 __construct ()
 
 initViewSettings ()
 
 initData ()
 
 emptyHandling ()
 
 addCustomCommandsToActionMenu (ilObjectListGUI $itemListGui, int $ref_id)
 
 getNoItemFoundContent ()
 
 getViewSettings ()
 
 init ()
 
 getHTML ()
 
 setData (array $a_data)
 
 getData ()
 
 addCommandActions ()
 
 getRemoveModal ()
 
 executeCommand ()
 
 viewDashboardObject ()
 
 changePDItemSortingObject ()
 
 changePDItemPresentationObject ()
 
 getItemGroups ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 removeMultipleEnabled ()
 
 getRemoveMultipleActionText ()
 
 confirmedRemove (array $ids)
 
 byType (string $a_type)
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 checkOffset (int $offset)
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 getNoItemFoundContent ()
 

Protected Member Functions

 getCardForData (BlockDTO $data)
 
 getListItemGroups ()
 
 getListItemForDataDTO (BlockDTO $data)
 
 isRepositoryObject ()
 
 getLegacyContent ()
 
 initAndShow ()
 
 isRootNode (int $refId)
 
 getRepositoryTitle ()
 
 getManageFields ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Protected Attributes

ilFavouritesManager $favourites_manager
 
int $requested_item_ref_id
 
ilSetting $settings
 
ilLogger $logging
 
Services $http
 
ilPDSelectedItemsBlockViewSettings $viewSettings
 
array $data
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 

Private Member Functions

 sortByDate (array $data, bool $asc=true)
 
 sortByTitle (array $data)
 

Private Attributes

string $content
 
ilRbacSystem $rbacsystem
 
string $parent
 
mixed $object_cache
 
ilTree $tree
 
mixed $objDefinition
 
Factory $refinery
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilDashboardBlockGUI::__construct ( )

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), emptyHandling(), ILIAS\FileDelivery\http(), init(), initData(), initViewSettings(), ILIAS\Repository\refinery(), and ILIAS\Repository\settings().

51  {
53  global $DIC;
54  $this->http = $DIC->http();
55  $this->refinery = $DIC->refinery();
56  $this->logging = $DIC->logger()->root();
57  $this->settings = $DIC->settings();
58  $this->object_cache = $DIC['ilObjDataCache'];
59  $this->tree = $DIC->repositoryTree();
60  $this->objDefinition = $DIC['objDefinition'];
61  $this->rbacsystem = $DIC->rbac()->system();
62  $this->favourites_manager = new ilFavouritesManager();
63  $this->parent = $this->ctrl->getCurrentClassPath()[0] ?? '';
64  $this->init();
65  }
Manages favourites, currently the interface for other components, needs discussion.
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandActions()

ilDashboardBlockGUI::addCommandActions ( )

Definition at line 356 of file class.ilDashboardBlockGUI.php.

References ilBlockGUI\$presentation, ilBlockGUI\$presentations, ilBlockGUI\addBlockCommand(), ilBlockGUI\addPresentation(), ilBlockGUI\addSortOption(), ILIAS\Repository\ctrl(), ilObjDashboardSettingsGUI\DASH_SORT_PREFIX, getRemoveModal(), getRemoveMultipleActionText(), ILIAS\Repository\lng(), null, removeMultipleEnabled(), ilBlockGUI\setSortTarget(), and ILIAS\Repository\ui().

Referenced by getHTML().

356  : void
357  {
358  $sortings = $this->viewSettings->getSelectableSortingModes();
359  if (count($sortings) > 1) {
360  foreach ($sortings as $sorting) {
361  $this->addSortOption(
362  $sorting,
363  $this->lng->txt(ilObjDashboardSettingsGUI::DASH_SORT_PREFIX . $sorting),
364  $sorting === $this->viewSettings->getEffectiveSortingMode()
365  );
366  }
367  $this->setSortTarget($this->ctrl->getLinkTarget($this, 'changePDItemSorting'));
368  }
369 
370  $presentations = $this->viewSettings->getSelectablePresentationModes();
371  foreach ($presentations as $presentation) {
372  $this->ctrl->setParameter($this, 'presentation', $presentation);
373  $this->addPresentation(
374  $this->ui->renderer()->render($this->ui->factory()->symbol()->glyph()->{$presentation . 'View'}()),
375  $this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),
376  $presentation === $this->viewSettings->getEffectivePresentationMode()
377  );
378  $this->ctrl->setParameter($this, 'presentation', null);
379  }
380 
381  if ($this->removeMultipleEnabled()) {
382  $this->addBlockCommand(
383  $this->ctrl->getLinkTarget($this, 'manage'),
385  '',
386  $this->getRemoveModal()
387  );
388  }
389  }
addPresentation(string $label, string $target, bool $active)
array $presentations
setSortTarget(string $target)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addBlockCommand(string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
addSortOption(string $option, string $label, bool $active)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addCustomCommandsToActionMenu()

ilDashboardBlockGUI::addCustomCommandsToActionMenu ( ilObjectListGUI  $itemListGui,
int  $ref_id 
)

Definition at line 73 of file class.ilDashboardBlockGUI.php.

Referenced by getCardForData(), and getListItemForDataDTO().

73  : void
74  {
75  }
+ Here is the caller graph for this function:

◆ addToDeskObject()

ilDashboardBlockGUI::addToDeskObject ( )

Implements ilDesktopItemHandling.

Definition at line 522 of file class.ilDashboardBlockGUI.php.

References $requested_item_ref_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

522  : void
523  {
524  $this->favourites_manager->add($this->user->getId(), $this->requested_item_ref_id);
525  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('rep_added_to_favourites'), true);
526  $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
527  }
+ Here is the call graph for this function:

◆ byType()

ilDashboardBlockGUI::byType ( string  $a_type)

Definition at line 547 of file class.ilDashboardBlockGUI.php.

References $location.

Referenced by getCardForData(), and getListItemForDataDTO().

548  {
549  $class = $this->objDefinition->getClassName($a_type);
550  if (!$class) {
551  throw new ilException(sprintf('Could not find a class for object type: %s', $a_type));
552  }
553 
554  $location = $this->objDefinition->getLocation($a_type);
555  if (!$location) {
556  throw new ilException(sprintf('Could not find a class location for object type: %s', $a_type));
557  }
558 
559  $full_class = 'ilObj' . $class . 'ListGUI';
560  $item_list_gui = new $full_class();
561 
562  $item_list_gui->setContainerObject($this);
563  $item_list_gui->enableNotes(false);
564  $item_list_gui->enableComments(false);
565  $item_list_gui->enableTags(false);
566 
567  $item_list_gui->enableIcon(true);
568  $item_list_gui->enableDelete(false);
569  $item_list_gui->enableCut(false);
570  $item_list_gui->enableCopy(false);
571  $item_list_gui->enableLink(false);
572  $item_list_gui->enableInfoScreen(true);
573 
574  $item_list_gui->enableCommands(true, true);
575 
576  return $item_list_gui;
577  }
$location
Definition: buildRTE.php:22
+ Here is the caller graph for this function:

◆ changePDItemPresentationObject()

ilDashboardBlockGUI::changePDItemPresentationObject ( )

Definition at line 493 of file class.ilDashboardBlockGUI.php.

References ILIAS\FileDelivery\http(), initAndShow(), and ilUtil\stripSlashes().

493  : string
494  {
495  $this->viewSettings->storeActorPresentationMode(
496  ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['presentation'] ?? ''))
497  );
498  return $this->initAndShow();
499  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ changePDItemSortingObject()

ilDashboardBlockGUI::changePDItemSortingObject ( )

Definition at line 484 of file class.ilDashboardBlockGUI.php.

References ILIAS\FileDelivery\http(), initAndShow(), and ilUtil\stripSlashes().

484  : string
485  {
486  $this->viewSettings->storeActorSortingMode(
487  ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['sorting'] ?? ''))
488  );
489 
490  return $this->initAndShow();
491  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ confirmedRemove()

ilDashboardBlockGUI::confirmedRemove ( array  $ids)
Parameters
int[]$ids

Definition at line 543 of file class.ilDashboardBlockGUI.php.

Referenced by executeCommand().

543  : void
544  {
545  }
+ Here is the caller graph for this function:

◆ emptyHandling()

ilDashboardBlockGUI::emptyHandling ( )
abstract

Referenced by __construct(), getHTML(), and getNoItemFoundContent().

+ Here is the caller graph for this function:

◆ executeCommand()

ilDashboardBlockGUI::executeCommand ( )

Definition at line 451 of file class.ilDashboardBlockGUI.php.

References confirmedRemove(), ILIAS\Repository\ctrl(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getManageFields(), ILIAS\FileDelivery\http(), and ILIAS\Repository\ui().

451  : string
452  {
453  $next_class = $this->ctrl->getNextClass();
454  $cmd = $this->ctrl->getCmd('getHTML');
455 
456  switch ($next_class) {
457  case strtolower(ilCommonActionDispatcherGUI::class):
458  $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
459  if ($gui instanceof ilCommonActionDispatcherGUI) {
460  $this->ctrl->forwardCommand($gui);
461  }
462  break;
463 
464  default:
465  switch ($cmd) {
466  case 'confirmedRemove':
467  $form = $this->ui->factory()->input()->container()->form()->standard('', $this->getManageFields())->withRequest($this->http->request());
468  $this->confirmedRemove(array_merge(...array_filter($form->getData())));
469  // no break
470  default:
471  if (method_exists($this, $cmd . 'Object')) {
472  return $this->{$cmd . 'Object'}();
473  }
474  }
475  }
476  return '';
477  }
static http()
Fetches the global http state from ILIAS.
Class ilCommonActionDispatcherGUI.
+ Here is the call graph for this function:

◆ getCardForData()

ilDashboardBlockGUI::getCardForData ( BlockDTO  $data)
protected

Definition at line 77 of file class.ilDashboardBlockGUI.php.

References addCustomCommandsToActionMenu(), byType(), ILIAS\components\Dashboard\Block\BlockDTO\getDescription(), ILIAS\components\Dashboard\Block\BlockDTO\getObjId(), ILIAS\components\Dashboard\Block\BlockDTO\getRefId(), ILIAS\components\Dashboard\Block\BlockDTO\getTitle(), and ILIAS\components\Dashboard\Block\BlockDTO\getType().

Referenced by getLegacyContent().

78  {
79  $itemListGui = $this->byType($data->getType());
80  $this->addCustomCommandsToActionMenu($itemListGui, $data->getRefId());
81  $card = $itemListGui->getAsCard(
82  $data->getRefId(),
83  $data->getObjId(),
84  $data->getType(),
85  $data->getTitle(),
86  $data->getDescription()
87  );
88 
89  return $card;
90  }
addCustomCommandsToActionMenu(ilObjectListGUI $itemListGui, int $ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getData()

ilDashboardBlockGUI::getData ( )
Returns
array<BlockDTO[]>

Definition at line 230 of file class.ilDashboardBlockGUI.php.

References ilBlockGUI\$title, ilObjectPlugin\getPluginObjectByType(), ILIAS\components\Dashboard\Block\BlockDTO\getRefId(), getRepositoryTitle(), isRootNode(), ILIAS\Repository\lng(), sortByDate(), and sortByTitle().

Referenced by getItemGroups().

230  : array
231  {
232  return parent::getData();
233  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilDashboardBlockGUI::getHTML ( )

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

References addCommandActions(), emptyHandling(), getItemGroups(), ILIAS\Repository\lng(), setData(), and ilBlockGUI\setTitle().

Referenced by initAndShow().

198  : string
199  {
200  $this->setTitle(
201  $this->lng->txt('dash_' . $this->viewSettings->getViewName($this->viewSettings->getCurrentView()))
202  );
203 
204  if (!$this->data) {
205  return $this->emptyHandling();
206  }
207 
208  $this->addCommandActions();
209  $this->setData($this->getItemGroups());
210 
211  return parent::getHTML();
212  }
setTitle(string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemGroups()

ilDashboardBlockGUI::getItemGroups ( )
Returns
array<BlockDTO[]>

Definition at line 504 of file class.ilDashboardBlockGUI.php.

References $data, getData(), ilPDSelectedItemsBlockConstants\SORT_BY_ALPHABET, ilPDSelectedItemsBlockConstants\SORT_BY_LOCATION, ilPDSelectedItemsBlockConstants\SORT_BY_START_DATE, ilPDSelectedItemsBlockConstants\SORT_BY_TYPE, and sortByTitle().

Referenced by getHTML(), and getManageFields().

504  : array
505  {
506  switch ($this->viewSettings->getEffectiveSortingMode()) {
508  $data = $this->getData();
509  $data = array_merge(...array_values($data));
510  $data = $this->sortByTitle($data);
511  return ['' => $data];
513  return $this->groupItemsByStartDate();
515  return $this->groupItemsByType();
517  default:
518  return $this->groupItemsByLocation();
519  }
520  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLegacyContent()

ilDashboardBlockGUI::getLegacyContent ( )
protected

Definition at line 140 of file class.ilDashboardBlockGUI.php.

References ilBlockGUI\$title, factory(), getCardForData(), getNoItemFoundContent(), ilBlockGUI\loadData(), renderer(), and ILIAS\Repository\ui().

140  : string
141  {
142  $groupedCards = [];
143  foreach ($this->loadData() as $title => $group) {
144  $cards = array_filter(array_map($this->getCardForData(...), $group));
145  if ($cards) {
146  $groupedCards[] = $this->ui->factory()->panel()->sub(
147  (string) $title,
148  $this->factory->deck($cards)->withNormalCardsSize()
149  );
150  }
151  }
152 
153  if ($groupedCards) {
154  return $this->renderer->render($groupedCards);
155  }
156 
157  return $this->getNoItemFoundContent();
158  }
factory()
renderer()
loadData()
Load data for current page.
+ Here is the call graph for this function:

◆ getListItemForDataDTO()

ilDashboardBlockGUI::getListItemForDataDTO ( BlockDTO  $data)
protected

Definition at line 118 of file class.ilDashboardBlockGUI.php.

References addCustomCommandsToActionMenu(), byType(), ILIAS\components\Dashboard\Block\BlockDTO\getAdditionalData(), ILIAS\components\Dashboard\Block\BlockDTO\getDescription(), ILIAS\components\Dashboard\Block\BlockDTO\getObjId(), ILIAS\components\Dashboard\Block\BlockDTO\getRefId(), ILIAS\components\Dashboard\Block\BlockDTO\getTitle(), and ILIAS\components\Dashboard\Block\BlockDTO\getType().

Referenced by getListItemGroups().

118  : ?Item
119  {
120  $itemListGui = $this->byType($data->getType());
121  $this->addCustomCommandsToActionMenu($itemListGui, $data->getRefId());
122  $list_item = $itemListGui->getAsListItem(
123  $data->getRefId(),
124  $data->getObjId(),
125  $data->getType(),
126  $data->getTitle(),
127  $data->getDescription()
128  );
129 
130  $list_item = $list_item->withProperties($list_item->getProperties() + $data->getAdditionalData());
131 
132  return $list_item;
133  }
addCustomCommandsToActionMenu(ilObjectListGUI $itemListGui, int $ref_id)
Common interface to all items.
Definition: Item.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListItemGroups()

ilDashboardBlockGUI::getListItemGroups ( )
protected

Definition at line 92 of file class.ilDashboardBlockGUI.php.

References ilBlockGUI\$title, factory(), getListItemForDataDTO(), ilBlockGUI\loadData(), null, and ilLPStatus\preloadListGUIData().

92  : array
93  {
94  $data = $this->loadData();
95  $groupedCards = [];
96  $obj_ids = [];
97  foreach ($data as $group) {
98  foreach ($group as $datum) {
99  $obj_ids[] = $datum->getObjId();
100  }
101  }
103 
104  foreach ($data as $title => $group) {
105  $items = [];
106  foreach ($group as $datum) {
107  $item = $this->getListItemForDataDTO($datum);
108  if ($item !== null) {
109  $items[] = $item;
110  }
111  }
112  $groupedCards[] = $this->factory->item()->group((string) $title, $items);
113  }
114 
115  return $groupedCards;
116  }
factory()
static preloadListGUIData(array $a_obj_ids)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
loadData()
Load data for current page.
+ Here is the call graph for this function:

◆ getManageFields()

ilDashboardBlockGUI::getManageFields ( )
protected

Definition at line 421 of file class.ilDashboardBlockGUI.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ilObject\_getIcon(), ilParticipants\getInstance(), getItemGroups(), ILIAS\Repository\refinery(), and ILIAS\Repository\ui().

Referenced by executeCommand(), and getRemoveModal().

421  : array
422  {
423  $inputs = [];
424  foreach ($this->getItemGroups() as $key => $item_group) {
425  $options = [];
426  foreach ($item_group as $item) {
427  $icon = $this->ui->renderer()->render($this->ui->factory()->symbol()->icon()->custom(ilObject::_getIcon($item->getObjId()), ''));
428  if ($this instanceof ilMembershipBlockGUI) {
429  if ($this->rbacsystem->checkAccess('leave', $item->getRefId())) {
430  if ($item->getType() === 'crs' || $item->getType() === 'grp') {
431  $members_obj = ilParticipants::getInstance($item->getRefId());
432  if (!$members_obj->checkLastAdmin([$this->user->getId()])) {
433  continue;
434  }
435  }
436  $options[$item->getRefId()] = $icon . $item->getTitle();
437  }
438  } else {
439  $options[$item->getRefId()] = $icon . $item->getTitle();
440  }
441  }
442  if ($options !== []) {
443  $inputs[] = $this->ui->factory()->input()->field()->multiSelect((string) $key, $options)
444  ->withAdditionalTransformation($this->refinery->to()->listOf($this->refinery->kindlyTo()->int()));
445  }
446  }
447 
448  return $inputs;
449  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static getInstance(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNoItemFoundContent()

ilDashboardBlockGUI::getNoItemFoundContent ( )

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

References emptyHandling().

Referenced by getLegacyContent().

160  : string
161  {
162  return $this->emptyHandling();
163  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveModal()

ilDashboardBlockGUI::getRemoveModal ( )

Definition at line 391 of file class.ilDashboardBlockGUI.php.

References $id, ILIAS\Repository\ctrl(), getManageFields(), getRemoveMultipleActionText(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by addCommandActions().

391  : RoundTrip
392  {
393  $items = $this->getManageFields();
394  if ($items !== []) {
395  if ($this->viewSettings->isSelectedItemsViewActive()) {
396  $question = $this->lng->txt('dash_info_sure_remove_from_favs');
397  } else {
398  $question = $this->lng->txt('mmbr_info_delete_sure_unsubscribe');
399  }
400  $modal = $this->ui->factory()->modal()->roundtrip(
402  [
403  $this->ui->factory()->messageBox()->confirmation($question),
404  $this->ui->factory()->messageBox()->info($this->lng->txt('select_one')),
405  ],
406  $items,
407  $this->ctrl->getLinkTargetByClass([ilDashboardGUI::class, $this::class], 'confirmedRemove')
408  )->withSubmitLabel($this->getRemoveMultipleActionText());
409 
410  $modal = $modal->withOnLoadCode(static fn($id) => "il.Dashboard.confirmModal($id)");
411  } else {
412  $modal = $this->ui->factory()->modal()->roundtrip(
414  $this->ui->factory()->messageBox()->info($this->lng->txt('pd_no_items_to_manage'))
415  );
416  }
417 
418  return $modal;
419  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveMultipleActionText()

ilDashboardBlockGUI::getRemoveMultipleActionText ( )
abstract

Referenced by addCommandActions(), getRemoveModal(), and removeFromDeskObject().

+ Here is the caller graph for this function:

◆ getRepositoryTitle()

ilDashboardBlockGUI::getRepositoryTitle ( )
protected

Definition at line 344 of file class.ilDashboardBlockGUI.php.

References $nd, ilBlockGUI\$title, and ILIAS\Repository\lng().

Referenced by ilSelectedItemsBlockGUI\emptyHandling(), and getData().

344  : string
345  {
346  $nd = $this->tree->getNodeData($this->tree->getRootId());
347  $title = $nd['title'];
348 
349  if ($title === 'ILIAS') {
350  $title = $this->lng->txt('repository');
351  }
352 
353  return $title;
354  }
$nd
Definition: error.php:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewSettings()

ilDashboardBlockGUI::getViewSettings ( )

Definition at line 165 of file class.ilDashboardBlockGUI.php.

References $viewSettings.

166  {
167  return $this->viewSettings;
168  }
ilPDSelectedItemsBlockViewSettings $viewSettings

◆ init()

ilDashboardBlockGUI::init ( )

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

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), initData(), initViewSettings(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilBlockGUI\setPresentation().

Referenced by __construct(), and initAndShow().

170  : void
171  {
172  $this->lng->loadLanguageModule('dash');
173  $this->lng->loadLanguageModule('rep');
174  $this->lng->loadLanguageModule('pd');
175  $this->initViewSettings();
176  $this->viewSettings->parse();
177  $this->requested_item_ref_id = (int) ($this->http->request()->getQueryParams()['item_ref_id'] ?? 0);
178  $this->initData();
179 
180  $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
181  if ($this->viewSettings->isTilePresentation()) {
182  $this->setPresentation(self::PRES_MAIN_LEG);
183  } else {
184  $this->setPresentation(self::PRES_SEC_LIST);
185  }
186  }
static http()
Fetches the global http state from ILIAS.
setPresentation(int $type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAndShow()

ilDashboardBlockGUI::initAndShow ( )
protected

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

References ILIAS\Repository\ctrl(), getHTML(), and init().

Referenced by changePDItemPresentationObject(), changePDItemSortingObject(), and viewDashboardObject().

188  : string
189  {
190  $this->init();
191  if ($this->parent === ilDashboardGUI::class) {
192  $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
193  }
194 
195  return $this->getHTML();
196  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initData()

ilDashboardBlockGUI::initData ( )
abstract

Referenced by __construct(), init(), and ilDashboardLearningSequenceGUI\initViewSettings().

+ Here is the caller graph for this function:

◆ initViewSettings()

ilDashboardBlockGUI::initViewSettings ( )
abstract

Referenced by __construct(), and init().

+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilDashboardBlockGUI::isRepositoryObject ( )
protected

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

135  : bool
136  {
137  return false;
138  }

◆ isRootNode()

ilDashboardBlockGUI::isRootNode ( int  $refId)
protected

Definition at line 339 of file class.ilDashboardBlockGUI.php.

References $refId.

Referenced by getData().

339  : bool
340  {
341  return $this->tree->getRootId() === $refId;
342  }
$refId
Definition: xapitoken.php:58
+ Here is the caller graph for this function:

◆ removeFromDeskObject()

ilDashboardBlockGUI::removeFromDeskObject ( )

Implements ilDesktopItemHandling.

Definition at line 529 of file class.ilDashboardBlockGUI.php.

References $requested_item_ref_id, ILIAS\Repository\ctrl(), getRemoveMultipleActionText(), ILIAS\Repository\lng(), removeMultipleEnabled(), and ILIAS\Repository\user().

529  : void
530  {
531  $this->favourites_manager->remove($this->user->getId(), $this->requested_item_ref_id);
532  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('rep_removed_from_favourites'), true);
533  $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
534  }
+ Here is the call graph for this function:

◆ removeMultipleEnabled()

ilDashboardBlockGUI::removeMultipleEnabled ( )
abstract

Referenced by addCommandActions(), and removeFromDeskObject().

+ Here is the caller graph for this function:

◆ setData()

ilDashboardBlockGUI::setData ( array  $a_data)
Parameters
array<BlockDTO[]>$a_data

Definition at line 217 of file class.ilDashboardBlockGUI.php.

Referenced by getHTML(), ilStudyProgrammeDashboardViewGUI\initData(), ilMembershipBlockGUI\initData(), ilDashboardRecommendedContentGUI\initData(), ilSelectedItemsBlockGUI\initData(), and ilDashboardLearningSequenceGUI\initViewSettings().

217  : void
218  {
219  $this->data = array_filter(
220  array_map(
221  static fn($group) => array_filter($group, static fn($item) => $item instanceof BlockDTO),
222  $a_data
223  )
224  );
225  }
+ Here is the caller graph for this function:

◆ sortByDate()

ilDashboardBlockGUI::sortByDate ( array  $data,
bool  $asc = true 
)
private
Parameters
BlockDTO[]$data

Definition at line 582 of file class.ilDashboardBlockGUI.php.

References $data, ILIAS\components\Dashboard\Block\BlockDTO\getStartDate(), and IL_CAL_UNIX.

Referenced by getData().

582  : array
583  {
584  usort(
585  $data,
586  static fn(BlockDTO $left, BlockDTO $right): int =>
587  ($asc ? -1 : 1) *
588  (($right->getStartDate()?->get(IL_CAL_UNIX) ?? 0) - ($left->getStartDate()?->get(IL_CAL_UNIX) ?? 0))
589  );
590  return $data;
591  }
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sortByTitle()

ilDashboardBlockGUI::sortByTitle ( array  $data)
private
Parameters
BlockDTO[]$data

Definition at line 596 of file class.ilDashboardBlockGUI.php.

References $data, and ILIAS\components\Dashboard\Block\BlockDTO\getTitle().

Referenced by getData(), and getItemGroups().

596  : array
597  {
598  usort(
599  $data,
600  static fn(BlockDTO $left, BlockDTO $right): int => strcmp($left->getTitle(), $right->getTitle())
601  );
602  return $data;
603  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewDashboardObject()

ilDashboardBlockGUI::viewDashboardObject ( )

Definition at line 479 of file class.ilDashboardBlockGUI.php.

References initAndShow().

479  : void
480  {
481  $this->initAndShow();
482  }
+ Here is the call graph for this function:

Field Documentation

◆ $content

string ilDashboardBlockGUI::$content
private

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

◆ $data

◆ $favourites_manager

ilFavouritesManager ilDashboardBlockGUI::$favourites_manager
protected

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

◆ $http

Services ilDashboardBlockGUI::$http
protected

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

◆ $logging

ilLogger ilDashboardBlockGUI::$logging
protected

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

◆ $objDefinition

mixed ilDashboardBlockGUI::$objDefinition
private

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

◆ $object_cache

mixed ilDashboardBlockGUI::$object_cache
private

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

◆ $parent

string ilDashboardBlockGUI::$parent
private

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

◆ $rbacsystem

ilRbacSystem ilDashboardBlockGUI::$rbacsystem
private

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

◆ $refinery

Factory ilDashboardBlockGUI::$refinery
private

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

◆ $requested_item_ref_id

int ilDashboardBlockGUI::$requested_item_ref_id
protected

◆ $settings

ilSetting ilDashboardBlockGUI::$settings
protected

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

Referenced by ilFavouritesListGUI\__construct().

◆ $tree

ilTree ilDashboardBlockGUI::$tree
private

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

◆ $viewSettings

ilPDSelectedItemsBlockViewSettings ilDashboardBlockGUI::$viewSettings
protected

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

Referenced by getViewSettings().


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