ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 ()
 
 preloadData (array $data)
 
 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 Container Block StandardGUIRequest $request
 
ILIAS Container 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  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandActions()

ilDashboardBlockGUI::addCommandActions ( )

Definition at line 359 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().

359  : void
360  {
361  $sortings = $this->viewSettings->getSelectableSortingModes();
362  if (count($sortings) > 1) {
363  foreach ($sortings as $sorting) {
364  $this->addSortOption(
365  $sorting,
366  $this->lng->txt(ilObjDashboardSettingsGUI::DASH_SORT_PREFIX . $sorting),
367  $sorting === $this->viewSettings->getEffectiveSortingMode()
368  );
369  }
370  $this->setSortTarget($this->ctrl->getLinkTarget($this, 'changePDItemSorting'));
371  }
372 
373  $presentations = $this->viewSettings->getSelectablePresentationModes();
374  foreach ($presentations as $presentation) {
375  $this->ctrl->setParameter($this, 'presentation', $presentation);
376  $this->addPresentation(
377  $this->ui->renderer()->render($this->ui->factory()->symbol()->glyph()->{$presentation . 'View'}()),
378  $this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),
379  $presentation === $this->viewSettings->getEffectivePresentationMode()
380  );
381  $this->ctrl->setParameter($this, 'presentation', null);
382  }
383 
384  if ($this->removeMultipleEnabled()) {
385  $this->addBlockCommand(
386  $this->ctrl->getLinkTarget($this, 'manage'),
388  '',
389  $this->getRemoveModal()
390  );
391  }
392  }
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 526 of file class.ilDashboardBlockGUI.php.

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

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

◆ byType()

ilDashboardBlockGUI::byType ( string  $a_type)

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

References $location.

Referenced by getCardForData(), and getListItemForDataDTO().

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

◆ changePDItemPresentationObject()

ilDashboardBlockGUI::changePDItemPresentationObject ( )

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

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

497  : string
498  {
499  $this->viewSettings->storeActorPresentationMode(
500  ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['presentation'] ?? ''))
501  );
502  return $this->initAndShow();
503  }
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 488 of file class.ilDashboardBlockGUI.php.

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

488  : string
489  {
490  $this->viewSettings->storeActorSortingMode(
491  ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['sorting'] ?? ''))
492  );
493 
494  return $this->initAndShow();
495  }
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 547 of file class.ilDashboardBlockGUI.php.

Referenced by executeCommand().

547  : void
548  {
549  }
+ 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 455 of file class.ilDashboardBlockGUI.php.

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

455  : string
456  {
457  $next_class = $this->ctrl->getNextClass();
458  $cmd = $this->ctrl->getCmd('getHTML');
459 
460  switch ($next_class) {
461  case strtolower(ilCommonActionDispatcherGUI::class):
462  $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
463  if ($gui instanceof ilCommonActionDispatcherGUI) {
464  $this->ctrl->forwardCommand($gui);
465  }
466  break;
467 
468  default:
469  switch ($cmd) {
470  case 'confirmedRemove':
471  $form = $this->ui->factory()->input()->container()->form()->standard('', $this->getManageFields())->withRequest($this->http->request());
472  $this->confirmedRemove(array_merge(...array_filter($form->getData())));
473  // no break
474  default:
475  if (method_exists($this, $cmd . 'Object')) {
476  return $this->{$cmd . 'Object'}();
477  }
478  }
479  }
480  return '';
481  }
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 233 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().

233  : array
234  {
235  return parent::getData();
236  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilDashboardBlockGUI::getHTML ( )

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

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

Referenced by initAndShow().

201  : string
202  {
203  $this->setTitle(
204  $this->lng->txt('dash_' . $this->viewSettings->getViewName($this->viewSettings->getCurrentView()))
205  );
206 
207  if (!$this->data) {
208  return $this->emptyHandling();
209  }
210 
211  $this->addCommandActions();
212  $this->setData($this->getItemGroups());
213 
214  return parent::getHTML();
215  }
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 508 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().

508  : array
509  {
510  switch ($this->viewSettings->getEffectiveSortingMode()) {
512  $data = $this->getData();
513  $data = array_merge(...array_values($data));
514  $data = $this->sortByTitle($data);
515  return ['' => $data];
517  return $this->groupItemsByStartDate();
519  return $this->groupItemsByType();
521  default:
522  return $this->groupItemsByLocation();
523  }
524  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLegacyContent()

ilDashboardBlockGUI::getLegacyContent ( )
protected

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

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

131  : string
132  {
133  $groupedCards = [];
134  foreach ($this->loadData() as $title => $group) {
135  $cards = array_filter(array_map($this->getCardForData(...), $group));
136  if ($cards) {
137  $groupedCards[] = $this->ui->factory()->panel()->sub(
138  (string) $title,
139  $this->factory->deck($cards)->withNormalCardsSize()
140  );
141  }
142  }
143 
144  if ($groupedCards) {
145  return $this->renderer->render($groupedCards);
146  }
147 
148  return $this->getNoItemFoundContent();
149  }
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 109 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().

109  : ?Item
110  {
111  $itemListGui = $this->byType($data->getType());
112  $this->addCustomCommandsToActionMenu($itemListGui, $data->getRefId());
113  $list_item = $itemListGui->getAsListItem(
114  $data->getRefId(),
115  $data->getObjId(),
116  $data->getType(),
117  $data->getTitle(),
118  $data->getDescription()
119  );
120 
121  $list_item = $list_item->withProperties($list_item->getProperties() + $data->getAdditionalData());
122 
123  return $list_item;
124  }
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(), and null.

92  : array
93  {
94  $groupedCards = [];
95  foreach ($this->loadData() as $title => $group) {
96  $items = [];
97  foreach ($group as $datum) {
98  $item = $this->getListItemForDataDTO($datum);
99  if ($item !== null) {
100  $items[] = $item;
101  }
102  }
103  $groupedCards[] = $this->factory->item()->group((string) $title, $items);
104  }
105 
106  return $groupedCards;
107  }
factory()
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 425 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().

425  : array
426  {
427  $inputs = [];
428  foreach ($this->getItemGroups() as $key => $item_group) {
429  $options = [];
430  foreach ($item_group as $item) {
431  $icon = $this->ui->renderer()->render($this->ui->factory()->symbol()->icon()->custom(ilObject::_getIcon($item->getObjId()), ''));
432  if ($this instanceof ilMembershipBlockGUI) {
433  if ($this->rbacsystem->checkAccess('leave', $item->getRefId())) {
434  if ($item->getType() === 'crs' || $item->getType() === 'grp') {
435  $members_obj = ilParticipants::getInstance($item->getRefId());
436  if (!$members_obj->checkLastAdmin([$this->user->getId()])) {
437  continue;
438  }
439  }
440  $options[$item->getRefId()] = $icon . $item->getTitle();
441  }
442  } else {
443  $options[$item->getRefId()] = $icon . $item->getTitle();
444  }
445  }
446  if ($options !== []) {
447  $inputs[] = $this->ui->factory()->input()->field()->multiSelect((string) $key, $options)
448  ->withAdditionalTransformation($this->refinery->to()->listOf($this->refinery->kindlyTo()->int()));
449  }
450  }
451 
452  return $inputs;
453  }
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 163 of file class.ilDashboardBlockGUI.php.

References emptyHandling().

Referenced by getLegacyContent().

163  : string
164  {
165  return $this->emptyHandling();
166  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveModal()

ilDashboardBlockGUI::getRemoveModal ( )

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

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

Referenced by addCommandActions().

394  : RoundTrip
395  {
396  $items = $this->getManageFields();
397  if ($items !== []) {
398  if ($this->viewSettings->isSelectedItemsViewActive()) {
399  $question = $this->lng->txt('dash_info_sure_remove_from_favs');
400  } else {
401  $this->lng->loadLanguageModule('mmbr');
402  $question = $this->lng->txt('mmbr_info_delete_sure_unsubscribe');
403  }
404  $modal = $this->ui->factory()->modal()->roundtrip(
406  [
407  $this->ui->factory()->messageBox()->confirmation($question),
408  $this->ui->factory()->messageBox()->info($this->lng->txt('select_one')),
409  ],
410  $items,
411  $this->ctrl->getLinkTargetByClass([ilDashboardGUI::class, $this::class], 'confirmedRemove')
412  )->withSubmitLabel($this->getRemoveMultipleActionText());
413 
414  $modal = $modal->withOnLoadCode(static fn($id) => "il.Dashboard.confirmModal($id)");
415  } else {
416  $modal = $this->ui->factory()->modal()->roundtrip(
418  $this->ui->factory()->messageBox()->info($this->lng->txt('pd_no_items_to_manage'))
419  );
420  }
421 
422  return $modal;
423  }
$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 347 of file class.ilDashboardBlockGUI.php.

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

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

347  : string
348  {
349  $nd = $this->tree->getNodeData($this->tree->getRootId());
350  $title = $nd['title'];
351 
352  if ($title === 'ILIAS') {
353  $title = $this->lng->txt('repository');
354  }
355 
356  return $title;
357  }
$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 168 of file class.ilDashboardBlockGUI.php.

References $viewSettings.

169  {
170  return $this->viewSettings;
171  }
ilPDSelectedItemsBlockViewSettings $viewSettings

◆ init()

ilDashboardBlockGUI::init ( )

Definition at line 173 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().

173  : void
174  {
175  $this->lng->loadLanguageModule('dash');
176  $this->lng->loadLanguageModule('rep');
177  $this->lng->loadLanguageModule('pd');
178  $this->initViewSettings();
179  $this->viewSettings->parse();
180  $this->requested_item_ref_id = (int) ($this->http->request()->getQueryParams()['item_ref_id'] ?? 0);
181  $this->initData();
182 
183  $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
184  if ($this->viewSettings->isTilePresentation()) {
185  $this->setPresentation(self::PRES_MAIN_LEG);
186  } else {
187  $this->setPresentation(self::PRES_SEC_LIST);
188  }
189  }
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 191 of file class.ilDashboardBlockGUI.php.

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

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

191  : string
192  {
193  $this->init();
194  if ($this->parent === ilDashboardGUI::class) {
195  $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
196  }
197 
198  return $this->getHTML();
199  }
+ 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 126 of file class.ilDashboardBlockGUI.php.

126  : bool
127  {
128  return false;
129  }

◆ isRootNode()

ilDashboardBlockGUI::isRootNode ( int  $refId)
protected

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

References $refId.

Referenced by getData().

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

◆ preloadData()

ilDashboardBlockGUI::preloadData ( array  $data)
protected

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

References ilLPStatus\preloadListGUIData().

151  : void
152  {
153  $obj_ids = [];
154  foreach ($data as $group) {
155  foreach ($group as $datum) {
156  $obj_ids[] = $datum->getObjId();
157  }
158  }
160  parent::preloadData($data);
161  }
static preloadListGUIData(array $a_obj_ids)
+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilDashboardBlockGUI::removeFromDeskObject ( )

Implements ilDesktopItemHandling.

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

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

533  : void
534  {
535  $this->favourites_manager->remove($this->user->getId(), $this->requested_item_ref_id);
536  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('rep_removed_from_favourites'), true);
537  $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
538  }
+ 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 220 of file class.ilDashboardBlockGUI.php.

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

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

◆ sortByDate()

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

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

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

Referenced by getData().

586  : array
587  {
588  usort(
589  $data,
590  static fn(BlockDTO $left, BlockDTO $right): int =>
591  ($asc ? -1 : 1) *
592  (($right->getStartDate()?->get(IL_CAL_UNIX) ?? 0) - ($left->getStartDate()?->get(IL_CAL_UNIX) ?? 0))
593  );
594  return $data;
595  }
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 600 of file class.ilDashboardBlockGUI.php.

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

Referenced by getData(), and getItemGroups().

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

◆ viewDashboardObject()

ilDashboardBlockGUI::viewDashboardObject ( )

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

References initAndShow().

483  : void
484  {
485  $this->initAndShow();
486  }
+ 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: