ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 ()
 
 manually ()
 
 getViewControlsForPanel ()
 
 viewDashboardObject ()
 
 changePDItemSortingObject ()
 
 changePDItemPresentationObject ()
 
 getItemGroups ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 removeMultipleEnabled ()
 
 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 ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Protected Member Functions

 getCardForData (BlockDTO $data)
 
 getListItemGroups ()
 Get items. More...
 
 getListItemForDataDTO (BlockDTO $data)
 
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 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

string $content
 
readonly ilRbacSystem $rbacsystem
 
string $parent
 
readonly ilFavouritesManager $favourites_manager
 
int $requested_item_ref_id
 
mixed $object_cache
 
readonly ilTree $tree
 
readonly mixed $obj_definition
 
readonly ilSetting $settings
 
readonly ilLogger $logging
 
readonly Services $http
 
readonly Factory $refinery
 
ilPDSelectedItemsBlockViewSettings $view_settings
 
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)
 
 sortManually (array $data)
 

Private Attributes

RoundTrip $manual_sort_modal = null
 
readonly SignalGenerator $signal_generator
 

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 34 of file class.ilDashboardBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilDashboardBlockGUI::__construct ( )

Reimplemented from ilBlockGUI.

Reimplemented in ilDashboardRecommendedContentGUI.

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

55 {
57 global $DIC;
58 $this->http = $DIC->http();
59 $this->refinery = $DIC->refinery();
60 $this->logging = $DIC->logger()->root();
61 $this->settings = $DIC->settings();
62 $this->object_cache = $DIC['ilObjDataCache'];
63 $this->tree = $DIC->repositoryTree();
64 $this->obj_definition = $DIC['objDefinition'];
65 $this->rbacsystem = $DIC->rbac()->system();
66 $this->favourites_manager = new ilFavouritesManager();
67 $this->parent = $this->ctrl->getCurrentClassPath()[0] ?? '';
68 $this->signal_generator = new SignalGenerator();
69 $this->init();
70 }
Manages favourites, currently the interface for other components, needs discussion.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandActions()

ilDashboardBlockGUI::addCommandActions ( )

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

364 : void
365 {
366 $sortings = $this->view_settings->getSelectableSortingModes();
367 if (count($sortings) > 1) {
368 foreach ($sortings as $sorting) {
370 global $DIC;
371 $signal = $this->signal_generator->create();
372 // $signal = $DIC['ui.signal_generator']->create();
373 $this->manual_sort_modal = $this->ui->factory()->modal()->roundtrip(
374 $this->lng->txt('dash_manual_sorting_title'),
375 [$this->manually()]
376 )->withAdditionalOnLoadCode(fn($id) => "document.getElementById('$id').addEventListener('close', () => {window.location = window.location;});");
377
378 $this->manual_sort_modal = $this->manual_sort_modal->withAdditionalOnLoadCode(fn($id) => (
379 "il.Dashboard.moveModalButtons($id)"
380 ));
381 }
382 $this->addSortOption(
383 $sorting,
384 '<span data-action="' . $sorting . '">' . $this->lng->txt(ilObjDashboardSettingsGUI::DASH_SORT_PREFIX . $sorting) . '</span>',
385 $sorting === $this->view_settings->getEffectiveSortingMode()
386 );
387 }
388 $this->setSortTarget($this->ctrl->getLinkTarget($this, 'changePDItemSorting'));
389 }
390
391 $presentations = $this->view_settings->getSelectablePresentationModes();
392 foreach ($presentations as $presentation) {
393 $this->ctrl->setParameter($this, 'presentation', $presentation);
394 $this->addPresentation(
395 $this->ui->renderer()->render($this->ui->factory()->symbol()->glyph()->{$presentation . 'View'}()),
396 $this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),
397 $presentation === $this->view_settings->getEffectivePresentationMode()
398 );
399 $this->ctrl->setParameter($this, 'presentation', null);
400 }
401
402 if ($this->removeMultipleEnabled()) {
403 $this->addBlockCommand(
404 $this->ctrl->getLinkTarget($this, 'manage'),
405 $this->lng->txt('dash_' . $this->getBlockType() . '_remove_multiple'),
406 '',
407 $this->getRemoveModal()
408 );
409 }
410 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
array $presentations
addPresentation(string $label, string $target, bool $active)
addBlockCommand(string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
addSortOption(string $option, string $label, bool $active)
setSortTarget(string $target)

References $DIC, $id, ilBlockGUI\$presentation, ilBlockGUI\$presentations, ilBlockGUI\addPresentation(), ilBlockGUI\addSortOption(), ILIAS\Repository\ctrl(), ilObjDashboardSettingsGUI\DASH_SORT_PREFIX, ILIAS\Repository\lng(), ilBlockGUI\setSortTarget(), ilPDSelectedItemsBlockConstants\SORT_MANUALLY, and ILIAS\Repository\ui().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addCustomCommandsToActionMenu()

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

Reimplemented in ilDashboardRecommendedContentGUI.

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

78 : void
79 {
80 }

Referenced by getCardForData(), and getListItemForDataDTO().

+ Here is the caller graph for this function:

◆ addToDeskObject()

ilDashboardBlockGUI::addToDeskObject ( )

Implements ilDesktopItemHandling.

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

609 : void
610 {
611 $this->favourites_manager->add($this->user->getId(), $this->requested_item_ref_id);
612 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('added_to_favourites'), true);
613 $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
614 }

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

+ Here is the call graph for this function:

◆ byType()

ilDashboardBlockGUI::byType ( string  $a_type)

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

636 {
637 $class = $this->obj_definition->getClassName($a_type);
638 if (!$class) {
639 throw new ilException(sprintf('Could not find a class for object type: %s', $a_type));
640 }
641
642 $location = $this->obj_definition->getLocation($a_type);
643 if (!$location) {
644 throw new ilException(sprintf('Could not find a class location for object type: %s', $a_type));
645 }
646
647 $full_class = 'ilObj' . $class . 'ListGUI';
648 $item_list_gui = new $full_class();
649
650 $item_list_gui->setContainerObject($this);
651 $item_list_gui->enableNotes(false);
652 $item_list_gui->enableComments(false);
653 $item_list_gui->enableTags(false);
654
655 $item_list_gui->enableIcon(true);
656 $item_list_gui->enableDelete(false);
657 $item_list_gui->enableCut(false);
658 $item_list_gui->enableCopy(false);
659 $item_list_gui->enableLink(false);
660 $item_list_gui->enableInfoScreen(true);
661
662 $item_list_gui->enableCommands(true, true);
663
664 return $item_list_gui;
665 }
$location
Definition: buildRTE.php:22
Base class for ILIAS Exception handling.

References $location.

Referenced by getCardForData(), and getListItemForDataDTO().

+ Here is the caller graph for this function:

◆ changePDItemPresentationObject()

ilDashboardBlockGUI::changePDItemPresentationObject ( )

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

573 : string
574 {
575 $this->view_settings->storeActorPresentationMode(
576 ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['presentation'] ?? ''))
577 );
578 return $this->initAndShow();
579 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

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

+ Here is the call graph for this function:

◆ changePDItemSortingObject()

ilDashboardBlockGUI::changePDItemSortingObject ( )

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

564 : string
565 {
566 $this->view_settings->storeActorSortingMode(
567 ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['sorting'] ?? ''))
568 );
569
570 return $this->initAndShow();
571 }

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

+ Here is the call graph for this function:

◆ confirmedRemove()

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

Reimplemented in ilMembershipBlockGUI, ilSelectedItemsBlockGUI, ilDashboardLearningSequenceGUI, and ilDashboardRecommendedContentGUI.

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

631 : void
632 {
633 }

◆ emptyHandling()

ilDashboardBlockGUI::emptyHandling ( )
abstract

◆ executeCommand()

ilDashboardBlockGUI::executeCommand ( )

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

467 : string
468 {
469 $next_class = $this->ctrl->getNextClass();
470 $cmd = $this->ctrl->getCmd('getHTML');
471
472 switch ($next_class) {
473 case strtolower(ilCommonActionDispatcherGUI::class):
474 $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
475 if ($gui instanceof ilCommonActionDispatcherGUI) {
476 $this->ctrl->forwardCommand($gui);
477 }
478 break;
479
480 default:
481 switch ($cmd) {
482 case 'confirmedRemove':
483 $form = $this->ui->factory()->input()->container()->form()->standard('', $this->getManageFields())->withRequest($this->http->request());
484 $this->confirmedRemove(array_merge(...array_filter($form->getData())));
485 // no break
486 default:
487 if (method_exists($this, $cmd . 'Object')) {
488 return $this->{$cmd . 'Object'}();
489 }
490 }
491 }
492 return '';
493 }
Class ilCommonActionDispatcherGUI.

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

+ Here is the call graph for this function:

◆ getCardForData()

ilDashboardBlockGUI::getCardForData ( BlockDTO  $data)
protected

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

83 {
84 $itemListGui = $this->byType($data->getType());
85 $this->addCustomCommandsToActionMenu($itemListGui, $data->getRefId());
86 $card = $itemListGui->getAsCard(
87 $data->getRefId(),
88 $data->getObjId(),
89 $data->getType(),
90 $data->getTitle(),
91 $data->getDescription()
92 );
93
94 return $card;
95 }
addCustomCommandsToActionMenu(ilObjectListGUI $itemListGui, int $ref_id)

References $data, addCustomCommandsToActionMenu(), byType(), and ILIAS\components\Dashboard\Block\BlockDTO\getType().

Referenced by getLegacyContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getData()

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

Reimplemented from ilBlockGUI.

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

239 : array
240 {
241 return parent::getData();
242 }

◆ getHTML()

ilDashboardBlockGUI::getHTML ( )

Reimplemented from ilBlockGUI.

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

206 : string
207 {
208 $this->setTitle(
209 $this->lng->txt('dash_' . $this->view_settings->getViewName($this->view_settings->getView()))
210 );
211
212 if (!$this->data) {
213 return $this->emptyHandling();
214 }
215
216 $this->addCommandActions();
217 $this->setData($this->getItemGroups());
218
219 $modal = $this->manual_sort_modal ? $this->ui->renderer()->render($this->manual_sort_modal) : '';
220 return parent::getHTML() . $modal;
221 }
setTitle(string $a_title)

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

Referenced by initAndShow().

+ 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 584 of file class.ilDashboardBlockGUI.php.

584 : array
585 {
586 switch ($this->view_settings->getEffectiveSortingMode()) {
588 $data = $this->getData();
589 $data = array_merge(...array_values($data));
590 $data = $this->sortByTitle($data);
591 return ['' => $data];
593 return $this->groupItemsByStartDate();
595 return ['' => $this->sortManually($this->getData())];
597 $groups = $this->groupItemsByType();
598 ksort($groups, SORT_NATURAL);
599 return $groups;
601 default:
602 $groups = $this->groupItemsByLocation();
603 ksort($groups, SORT_NATURAL);
604 return $groups;
605 }
606 }

References $data, ilPDSelectedItemsBlockConstants\SORT_BY_ALPHABET, ilPDSelectedItemsBlockConstants\SORT_BY_LOCATION, ilPDSelectedItemsBlockConstants\SORT_BY_START_DATE, ilPDSelectedItemsBlockConstants\SORT_BY_TYPE, and ilPDSelectedItemsBlockConstants\SORT_MANUALLY.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getLegacyContent()

ilDashboardBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

136 : string
137 {
138 $groupedCards = [];
139 foreach ($this->loadData() as $title => $group) {
140 $cards = array_filter(array_map($this->getCardForData(...), $group));
141 if ($cards) {
142 $groupedCards[] = $this->ui->factory()->panel()->sub(
143 (string) $title,
144 $this->factory->deck($cards)->withNormalCardsSize()
145 );
146 }
147 }
148
149 if ($groupedCards) {
150 return $this->renderer->render($groupedCards);
151 }
152
153 return $this->getNoItemFoundContent();
154 }
renderer()
factory()
loadData()
Load data for current page.

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

+ Here is the call graph for this function:

◆ getListItemForDataDTO()

ilDashboardBlockGUI::getListItemForDataDTO ( BlockDTO  $data)
protected

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

114 : ?Item
115 {
116 $itemListGui = $this->byType($data->getType());
117 $this->addCustomCommandsToActionMenu($itemListGui, $data->getRefId());
118 $list_item = $itemListGui->getAsListItem(
119 $data->getRefId(),
120 $data->getObjId(),
121 $data->getType(),
122 $data->getTitle(),
123 $data->getDescription()
124 );
125
126 $list_item = $list_item->withProperties($list_item->getProperties() + $data->getAdditionalData());
127
128 return $list_item;
129 }
Common interface to all items.
Definition: Item.php:32

References $data, addCustomCommandsToActionMenu(), byType(), and ILIAS\components\Dashboard\Block\BlockDTO\getType().

Referenced by getListItemGroups().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListItemGroups()

ilDashboardBlockGUI::getListItemGroups ( )
protected

Get items.

Returns
\ILIAS\UI\Component\Item\Group[]

Reimplemented from ilBlockGUI.

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

97 : array
98 {
99 $groupedCards = [];
100 foreach ($this->loadData() as $title => $group) {
101 $items = [];
102 foreach ($group as $datum) {
103 $item = $this->getListItemForDataDTO($datum);
104 if ($item !== null) {
105 $items[] = $item;
106 }
107 }
108 $groupedCards[] = $this->factory->item()->group((string) $title, $items);
109 }
110
111 return $groupedCards;
112 }

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

+ Here is the call graph for this function:

◆ getManageFields()

ilDashboardBlockGUI::getManageFields ( )
protected

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

437 : array
438 {
439 $inputs = [];
440 foreach ($this->getItemGroups() as $key => $item_group) {
441 $options = [];
442 foreach ($item_group as $item) {
443 $icon = $this->ui->renderer()->render($this->ui->factory()->symbol()->icon()->custom(ilObject::_getIcon($item->getObjId()), ''));
444 if ($this instanceof ilMembershipBlockGUI) {
445 if ($this->rbacsystem->checkAccess('leave', $item->getRefId())) {
446 if ($item->getType() === 'crs' || $item->getType() === 'grp') {
447 $members_obj = ilParticipants::getInstance($item->getRefId());
448 if (!$members_obj->checkLastAdmin([$this->user->getId()])) {
449 continue;
450 }
451 }
452 $options[$item->getRefId()] = $icon . $item->getTitle();
453 }
454 } else {
455 $options[$item->getRefId()] = $icon . $item->getTitle();
456 }
457 }
458 if ($options !== []) {
459 $inputs[] = $this->ui->factory()->input()->field()->multiSelect((string) $key, $options)
460 ->withAdditionalTransformation($this->refinery->to()->listOf($this->refinery->kindlyTo()->int()));
461 }
462 }
463
464 return $inputs;
465 }
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)

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

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilDashboardBlockGUI::getNoItemFoundContent ( )

Reimplemented from ilBlockGUI.

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

168 : string
169 {
170 return $this->emptyHandling();
171 }

References emptyHandling().

Referenced by getLegacyContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveModal()

ilDashboardBlockGUI::getRemoveModal ( )

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

412 : RoundTrip
413 {
414 $items = $this->getManageFields();
415 if ($items !== []) {
416 $modal = $this->ui->factory()->modal()->roundtrip(
417 $this->lng->txt('dash_' . $this->getBlockType() . '_remove_multiple'),
418 [
419 $this->ui->factory()->messageBox()->confirmation($this->lng->txt('dash_' . $this->getBlockType() . '_remove_info')),
420 $this->ui->factory()->messageBox()->info($this->lng->txt('select_one')),
421 ],
422 $items,
423 $this->ctrl->getLinkTargetByClass([ilDashboardGUI::class, $this::class], 'confirmedRemove')
424 )->withSubmitLabel($this->lng->txt('dash_' . $this->getBlockType() . '_remove'));
425
426 $modal = $modal->withOnLoadCode(static fn($id) => "il.Dashboard.confirmModal($id)");
427 } else {
428 $modal = $this->ui->factory()->modal()->roundtrip(
429 $this->lng->txt('dash_' . $this->getBlockType() . '_remove_multiple'),
430 $this->ui->factory()->messageBox()->info($this->lng->txt('dash_no_items_to_manage'))
431 );
432 }
433
434 return $modal;
435 }

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

+ Here is the call graph for this function:

◆ getRepositoryTitle()

ilDashboardBlockGUI::getRepositoryTitle ( )
protected

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

352 : string
353 {
354 $nd = $this->tree->getNodeData($this->tree->getRootId());
355 $title = $nd['title'];
356
357 if ($title === 'ILIAS') {
358 $title = $this->lng->txt('repository');
359 }
360
361 return $title;
362 }

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

+ Here is the call graph for this function:

◆ getViewControlsForPanel()

ilDashboardBlockGUI::getViewControlsForPanel ( )
Returns
ViewControl\Sortation[]|ViewControl\Pagination[]

Reimplemented from ilBlockGUI.

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

540 : array
541 {
542 global $DIC;
543 if (!$this->manual_sort_modal) {
544 return parent::getViewControlsForPanel();
545 }
546 $show = $this->manual_sort_modal->getShowSignal();
547 $modal_signals = json_encode(['manually' => (string) $show]);
548 $url = json_encode($this->ctrl->getLinkTarget($this, 'changePDItemSorting'));
549 $signal = $this->signal_generator->create();
550 $code = fn($id) => "il.Dashboard.showModalOnSort($id, $url, '$signal', $modal_signals)";
551 $compontents = array_map(
552 fn($x) => $x instanceof Sortation ? $x->withOnSort($signal)->withAdditionalOnLoadCode($code) : $x,
553 parent::getViewControlsForPanel()
554 );
555
556 return $compontents;
557 }
This describes a Sortation Control.
Definition: Sortation.php:32
withOnSort(Signal $signal)
Get a component like this, triggering a signal of another component.
$url
Definition: shib_logout.php:70

References $DIC, $id, $url, ILIAS\Repository\ctrl(), and ILIAS\UI\Component\ViewControl\Sortation\withOnSort().

+ Here is the call graph for this function:

◆ getViewSettings()

ilDashboardBlockGUI::getViewSettings ( )

◆ init()

ilDashboardBlockGUI::init ( )

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

178 : void
179 {
180 $this->lng->loadLanguageModule('dash');
181 $this->lng->loadLanguageModule('pd');
182 $this->setLimit(PHP_INT_MAX);
183 $this->initViewSettings();
184 $this->view_settings->parse();
185 $this->requested_item_ref_id = (int) ($this->http->request()->getQueryParams()['item_ref_id'] ?? 0);
186 $this->initData();
187
188 $this->ctrl->setParameter($this, 'view', $this->view_settings->getView());
189 if ($this->view_settings->isTilePresentation()) {
190 $this->setPresentation(self::PRES_MAIN_LEG);
191 } else {
192 $this->setPresentation(self::PRES_SEC_LIST);
193 }
194 }
setPresentation(int $type)
setLimit(int $a_limit)

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

Referenced by __construct(), and initAndShow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAndShow()

ilDashboardBlockGUI::initAndShow ( )
protected

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

196 : string
197 {
198 $this->init();
199 if ($this->parent === ilDashboardGUI::class) {
200 $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
201 }
202
203 return $this->getHTML();
204 }

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

+ Here is the call graph for this function:

◆ initData()

ilDashboardBlockGUI::initData ( )
abstract

Reimplemented in ilMembershipBlockGUI, ilSelectedItemsBlockGUI, ilDashboardRecommendedContentGUI, and ilStudyProgrammeDashboardViewGUI.

Referenced by init().

+ Here is the caller graph for this function:

◆ initViewSettings()

ilDashboardBlockGUI::initViewSettings ( )
abstract

◆ isRepositoryObject()

ilDashboardBlockGUI::isRepositoryObject ( )
finalprotected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

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

131 : bool
132 {
133 return false;
134 }

◆ isRootNode()

ilDashboardBlockGUI::isRootNode ( int  $refId)
finalprotected

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

347 : bool
348 {
349 return $this->tree->getRootId() === $refId;
350 }
$refId
Definition: xapitoken.php:56

References $refId.

◆ manually()

ilDashboardBlockGUI::manually ( )

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

495 : Ordering
496 {
497 $request = $this->http->request();
498 $columns = [
499 'title' => $this->factory->table()->column()->text('Title')
500 ];
501
502 $records = null;
503 $proc = function ($b) use (&$records) {
504 return yield from array_map(fn($x) => $b->buildOrderingRow((string) $x['id'], $x), $records);
505 };
506
507 $uri = new URI((string) $request->getUri());
508 parse_str($uri->getQuery(), $query);
509 $uri = $uri->withQuery(http_build_query(array_merge(
510 $query,
511 ['view' => $this->view_settings->getView()]
512 )));
513 $table = $this->factory->table()
514 ->ordering(new \ILIAS\Dashboard\TableData($proc), $uri, '', $columns)
515 ->withRequest($request);
516
517 $int = $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(null)]);
518
519 if ($request->getMethod() === 'POST' && $this->view_settings->getView() === $this->http->wrapper()->query()->retrieve('view', $int)) {
520 $data = $table->getData();
521 if ($data) {
522 $this->view_settings->storeActorSortingMode('manually');
523 $this->view_settings->storeActorSortingData(array_flip($data));
524 $this->ctrl->redirectByClass(ilDashboardGUI::class);
525 }
526 }
527
528 $icon_for = fn(int $obj_id) => $this->renderer->render(
529 $this->ui->factory()->symbol()->icon()->custom(ilObject::_getIcon($obj_id), '')
530 );
531
532 $records = array_map(fn($x) => [
533 'id' => $x->getRefId(),
534 'title' => $icon_for($x->getObjId()) . $x->getTitle(),
535 ], array_values($this->sortManually($this->getItemGroups())));
536
537 return $table;
538 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
ILIAS Container Block StandardGUIRequest $request
This describes a Table to specify the order of its data (rows).
Definition: Ordering.php:29
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References Vendor\Package\$b, $data, ilObject\_getIcon(), ILIAS\Repository\ctrl(), factory(), ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), renderer(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ preloadData()

ilDashboardBlockGUI::preloadData ( array  $data)
protected

Can be overwritten in subclasses.

Only the visible part of the complete data was passed so a preload of the visible data is possible.

Parameters
array$data

Reimplemented from ilBlockGUI.

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

156 : void
157 {
158 $obj_ids = [];
159 foreach ($data as $group) {
160 foreach ($group as $datum) {
161 $obj_ids[] = $datum->getObjId();
162 }
163 }
165 parent::preloadData($data);
166 }
static preloadListGUIData(array $a_obj_ids)

References $data, and ilLPStatus\preloadListGUIData().

+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilDashboardBlockGUI::removeFromDeskObject ( )

Implements ilDesktopItemHandling.

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

616 : void
617 {
618 $this->favourites_manager->remove($this->user->getId(), $this->requested_item_ref_id);
619 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('removed_from_favourites'), true);
620 $this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
621 }

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

+ Here is the call graph for this function:

◆ removeMultipleEnabled()

ilDashboardBlockGUI::removeMultipleEnabled ( )

Reimplemented in ilMembershipBlockGUI, ilSelectedItemsBlockGUI, ilDashboardLearningSequenceGUI, and ilDashboardRecommendedContentGUI.

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

623 : bool
624 {
625 return false;
626 }

◆ setData()

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

Reimplemented from ilBlockGUI.

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

226 : void
227 {
228 $this->data = array_filter(
229 array_map(
230 static fn($group) => array_filter($group, static fn($item) => $item instanceof BlockDTO),
231 $a_data
232 )
233 );
234 }

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

+ Here is the caller graph for this function:

◆ sortByDate()

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

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

670 : array
671 {
672 usort(
673 $data,
674 static fn(BlockDTO $left, BlockDTO $right): int =>
675 ($asc ? -1 : 1) *
676 (($right->getStartDate()?->get(IL_CAL_UNIX) ?? 0) - ($left->getStartDate()?->get(IL_CAL_UNIX) ?? 0))
677 );
678 return $data;
679 }
const IL_CAL_UNIX

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

+ Here is the call graph for this function:

◆ sortByTitle()

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

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

684 : array
685 {
686 usort(
687 $data,
688 static fn(BlockDTO $left, BlockDTO $right): int => strcasecmp($left->getTitle(), $right->getTitle())
689 );
690 return $data;
691 }

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

+ Here is the call graph for this function:

◆ sortManually()

ilDashboardBlockGUI::sortManually ( array  $data)
private

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

693 : array
694 {
695 $data = array_merge(...array_values($data));
696 $new_at_botton = 'bot' === ($this->view_settings->getEffectiveSortingOptions()['new_items'] ?? 'bot');
697 $default = $new_at_botton ? INF : -INF;
698 $manual_sorting = $this->view_settings->getEffectiveSortingData();
699 usort($data, fn(BlockDTO $l, BlockDTO $r) => (
700 ($manual_sorting[$l->getRefId()] ?? $default) <=> ($manual_sorting[$r->getRefId()] ?? $default)
701 ));
702
703 return $data;
704 }

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

+ Here is the call graph for this function:

◆ viewDashboardObject()

ilDashboardBlockGUI::viewDashboardObject ( )

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

559 : void
560 {
561 $this->initAndShow();
562 }

Field Documentation

◆ $content

◆ $data

array ilDashboardBlockGUI::$data
protected

◆ $favourites_manager

readonly ilFavouritesManager ilDashboardBlockGUI::$favourites_manager
protected

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

◆ $http

readonly Services ilDashboardBlockGUI::$http
protected

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

◆ $logging

readonly ilLogger ilDashboardBlockGUI::$logging
protected

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

◆ $manual_sort_modal

RoundTrip ilDashboardBlockGUI::$manual_sort_modal = null
private

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

◆ $obj_definition

readonly mixed ilDashboardBlockGUI::$obj_definition
protected

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

◆ $object_cache

mixed ilDashboardBlockGUI::$object_cache
protected

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

◆ $parent

string ilDashboardBlockGUI::$parent
protected

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

◆ $rbacsystem

readonly ilRbacSystem ilDashboardBlockGUI::$rbacsystem
protected

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

◆ $refinery

readonly Factory ilDashboardBlockGUI::$refinery
protected

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

◆ $requested_item_ref_id

int ilDashboardBlockGUI::$requested_item_ref_id
protected

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

◆ $settings

readonly ilSetting ilDashboardBlockGUI::$settings
protected

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

Referenced by ilFavouritesListGUI\__construct().

◆ $signal_generator

◆ $tree

readonly ilTree ilDashboardBlockGUI::$tree
protected

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

◆ $view_settings

ilPDSelectedItemsBlockViewSettings ilDashboardBlockGUI::$view_settings
protected

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

Referenced by getViewSettings().


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