ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPDSelectedItemsBlockGUI Class Reference

@ilCtrl_IsCalledBy ilPDSelectedItemsBlockGUI: ilColumnGUI @ilCtrl_Calls ilPDSelectedItemsBlockGUI: ilCommonActionDispatcherGUI More...

+ Inheritance diagram for ilPDSelectedItemsBlockGUI:
+ Collaboration diagram for ilPDSelectedItemsBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getViewSettings ()
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
 getBlockType ()
 @inheritDoc More...
 
 getHTML ()
 @inheritDoc More...
 
 executeCommand ()
 
 fillDataSection ()
 @inheritDoc More...
 
 fillFooter ()
 @inheritDoc More...
 
 changePDItemPresentation ()
 
 changePDItemSorting ()
 
 manageObject ()
 
 confirmRemoveObject ()
 
 confirmedRemove ()
 
 confirmedUnsubscribe ()
 
 getNoItemFoundContent ()
 @ineritdoc More...
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 
 addToDeskObject ()
 Add desktop item @access public. More...
 
 removeFromDeskObject ()
 Remove from desktop @access public. More...
 

Static Public Member Functions

static getScreenMode ()
 @inheritDoc More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = 'pditems'
 

Protected Member Functions

 initViewSettings ()
 
 returnToContext ()
 @inheritDoc More...
 
 isRepositoryObject ()
 @inheritDoc More...
 
 getViewTitle ()
 
 getContent ()
 
 setContent (string $a_content)
 
 getGroupedCommandsForView ($manage=false)
 
 setFooterLinks ()
 
 renderGroupedItems (array $grouped_items, bool $showHeader=true)
 
 getViewBlockHtml ()
 
 initAndShow ()
 
 cancel ()
 
 getListItemGroups ()
 @inheritDoc More...
 
 getListItemForData (array $data)
 @inheritDoc More...
 
 getCardForData (array $item)
 
 getLegacyContent ()
 @inheritDoc More...
 
 renderManageList (array $grouped_items)
 
 getRepositoryTitle ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. 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...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $new_rendering = true
 
 $rbacsystem
 
 $settings
 
 $obj_definition
 
 $viewSettings
 
 $blockView
 
 $manage = false
 
 $content = ''
 
 $lng
 
 $ctrl
 
 $user
 
 $ui
 
 $http
 
 $objectService
 
 $favourites
 
 $tree
 
 $list_factory
 
 $logging
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $new_rendering = false
 

Additional Inherited Members

- 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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDSelectedItemsBlockGUI::__construct ( )

Constructor.

Parameters

Reimplemented from ilBlockGUI.

Definition at line 91 of file class.ilPDSelectedItemsBlockGUI.php.

92 {
93 global $DIC;
94
95 $this->rbacsystem = $DIC->rbac()->system();
96 $this->settings = $DIC->settings();
97 $this->obj_definition = $DIC["objDefinition"];
98 $this->access = $DIC->access();
99 $this->ui = $DIC->ui();
100 $this->http = $DIC->http();
101 $this->objectService = $DIC->object();
102 $this->favourites = new ilFavouritesManager();
103 $this->tree = $DIC->repositoryTree();
104 $this->logging = $DIC->logger()->root();
105
107
108 $this->lng = $DIC->language();
109 $this->ctrl = $DIC->ctrl();
110 $this->user = $DIC->user();
111
112 $this->lng->loadLanguageModule('pd');
113 $this->lng->loadLanguageModule('cntr'); // #14158
114 $this->lng->loadLanguageModule('rep'); // #14158
115
116 $this->setEnableNumInfo(false);
117 $this->setLimit(99999);
118 $this->allow_moving = false;
119
120 $this->initViewSettings();
121 $this->list_factory = new ilPDSelectedItemsBlockListGUIFactory($this, $this->blockView);
122
123 if ($this->viewSettings->isTilePresentation()) {
124 $this->setPresentation(self::PRES_MAIN_LEG);
125 } else {
126 $this->setPresentation(self::PRES_MAIN_LIST);
127 }
128 }
user()
Definition: user.php:4
setLimit($a_limit)
Set Limit.
setPresentation(int $type)
Set presentation.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
Manages favourites, currently the interface for other components, needs discussion.
global $DIC
Definition: goto.php:24
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), initViewSettings(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), settings(), ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToDeskObject()

ilPDSelectedItemsBlockGUI::addToDeskObject ( )

@inheritDoc

Implements ilDesktopItemHandling.

Definition at line 152 of file class.ilPDSelectedItemsBlockGUI.php.

153 {
154 $this->favourites->add($this->user->getId(), (int) $_GET["item_ref_id"]);
155 ilUtil::sendSuccess($this->lng->txt("rep_added_to_favourites"), true);
156 $this->returnToContext();
157 }
$_GET["client_id"]

References $_GET, returnToContext(), and user().

+ Here is the call graph for this function:

◆ cancel()

ilPDSelectedItemsBlockGUI::cancel ( )
protected

Definition at line 494 of file class.ilPDSelectedItemsBlockGUI.php.

495 {
496 $this->ctrl->returnToParent($this);
497 }

◆ changePDItemPresentation()

ilPDSelectedItemsBlockGUI::changePDItemPresentation ( )

Definition at line 419 of file class.ilPDSelectedItemsBlockGUI.php.

420 {
421 $this->viewSettings->storeActorPresentationMode(
422 ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['presentation'] ?? ''))
423 );
424 $this->initAndShow();
425 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ changePDItemSorting()

ilPDSelectedItemsBlockGUI::changePDItemSorting ( )

Definition at line 427 of file class.ilPDSelectedItemsBlockGUI.php.

428 {
429 $this->viewSettings->storeActorSortingMode(
430 ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['sorting'] ?? ''))
431 );
432
433 $this->initAndShow();
434 }

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

+ Here is the call graph for this function:

◆ confirmedRemove()

ilPDSelectedItemsBlockGUI::confirmedRemove ( )

Definition at line 542 of file class.ilPDSelectedItemsBlockGUI.php.

543 {
544 $refIds = (array) ($this->http->request()->getParsedBody()['ref_id'] ?? []);
545 if (0 === count($refIds)) {
546 $this->ctrl->redirect($this, 'manage');
547 }
548
549 foreach ($refIds as $ref_id) {
550 $this->favourites->remove($this->user->getId(), (int) $ref_id);
551 }
552
553 // #12909
554 ilUtil::sendSuccess($this->lng->txt('pd_remove_multi_confirm'), true);
555 $this->ctrl->redirect($this, 'manage');
556 }

References ILIAS\FileDelivery\http(), and user().

+ Here is the call graph for this function:

◆ confirmedUnsubscribe()

ilPDSelectedItemsBlockGUI::confirmedUnsubscribe ( )

Definition at line 558 of file class.ilPDSelectedItemsBlockGUI.php.

559 {
560 $refIds = (array) ($this->http->request()->getParsedBody()['ref_id'] ?? []);
561 if (0 === count($refIds)) {
562 $this->ctrl->redirect($this, 'manage');
563 }
564
565 foreach ($refIds as $ref_id) {
566 if ($this->access->checkAccess('leave', '', (int) $ref_id)) {
567 switch (ilObject::_lookupType($ref_id, true)) {
568 case 'crs':
569 $members = new ilCourseParticipants(ilObject::_lookupObjId((int) $ref_id));
570 $members->delete($this->user->getId());
571
572 $members->sendUnsubscribeNotificationToAdmins($this->user->getId());
573 $members->sendNotification(
574 $members->NOTIFY_UNSUBSCRIBE,
575 $this->user->getId()
576 );
577 break;
578
579 case 'grp':
580 $members = new ilGroupParticipants(ilObject::_lookupObjId((int) $ref_id));
581 $members->delete($this->user->getId());
582
583 $members->sendNotification(
585 $this->user->getId()
586 );
587 $members->sendNotification(
589 $this->user->getId()
590 );
591 break;
592
593 default:
594 continue 2;
595 }
596
597 include_once './Modules/Forum/classes/class.ilForumNotification.php';
598 ilForumNotification::checkForumsExistsDelete($ref_id, $this->user->getId());
599 }
600 }
601
602 ilUtil::sendSuccess($this->lng->txt('mmbr_unsubscribed_from_objs'), true);
603 $this->ctrl->returnToParent($this);
604 }
static checkForumsExistsDelete($ref_id, $user_id=0)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObject\_lookupObjId(), ilObject\_lookupType(), ilForumNotification\checkForumsExistsDelete(), ILIAS\FileDelivery\http(), ilGroupMembershipMailNotification\TYPE_NOTIFICATION_UNSUBSCRIBE, ilGroupMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER, and user().

+ Here is the call graph for this function:

◆ confirmRemoveObject()

ilPDSelectedItemsBlockGUI::confirmRemoveObject ( )

Definition at line 499 of file class.ilPDSelectedItemsBlockGUI.php.

500 {
501 $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
502
503 $refIds = (array) ($this->http->request()->getParsedBody()['id'] ?? []);
504 if (0 === count($refIds)) {
505 ilUtil::sendFailure($this->lng->txt('select_one'), true);
506 $this->ctrl->redirect($this, 'manage');
507 }
508
509 if ($this->viewSettings->isSelectedItemsViewActive()) {
510 $question = $this->lng->txt('dash_info_sure_remove_from_favs');
511 $cmd = 'confirmedRemove';
512 } else {
513 $question = $this->lng->txt('mmbr_info_delete_sure_unsubscribe');
514 $cmd = 'confirmedUnsubscribe';
515 }
516
517 include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
518 $cgui = new ilConfirmationGUI();
519 $cgui->setHeaderText($question);
520
521 $cgui->setFormAction($this->ctrl->getFormAction($this));
522 $cgui->setCancel($this->lng->txt('cancel'), 'manage');
523 $cgui->setConfirm($this->lng->txt('confirm'), $cmd);
524
525 foreach ($refIds as $ref_id) {
526 $obj_id = ilObject::_lookupObjectId((int) $ref_id);
528 $type = ilObject::_lookupType($obj_id);
529
530 $cgui->addItem(
531 'ref_id[]',
532 $ref_id,
533 $title,
534 ilObject::_getIcon($obj_id, 'small', $type),
535 $this->lng->txt('icon') . ' ' . $this->lng->txt('obj_' . $type)
536 );
537 }
538
539 return $cgui->getHTML();
540 }
Confirmation screen class.
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$type

References ilBlockGUI\$title, $type, ilObject\_getIcon(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\FileDelivery\http(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ executeCommand()

ilPDSelectedItemsBlockGUI::executeCommand ( )

Definition at line 241 of file class.ilPDSelectedItemsBlockGUI.php.

242 {
243 $next_class = $this->ctrl->getNextClass();
244 $cmd = $this->ctrl->getCmd('getHTML');
245
246 switch ($next_class) {
247 case 'ilcommonactiondispatchergui':
248 include_once('Services/Object/classes/class.ilCommonActionDispatcherGUI.php');
250 $this->ctrl->forwardCommand($gui);
251 break;
252
253 default:
254 if (method_exists($this, $cmd)) {
255 return $this->$cmd();
256 } else {
257 return $this->{$cmd . 'Object'}();
258 }
259 }
260 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call

References ilCommonActionDispatcherGUI\getInstanceFromAjaxCall().

+ Here is the call graph for this function:

◆ fillDataSection()

ilPDSelectedItemsBlockGUI::fillDataSection ( )

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 275 of file class.ilPDSelectedItemsBlockGUI.php.

276 {
277 if ($this->getContent() === '') {
278 $this->setDataSection($this->blockView->getIntroductionHtml());
279 } else {
280 $this->tpl->setVariable('BLOCK_ROW', $this->getContent());
281 }
282 }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.

References getContent(), and ilBlockGUI\setDataSection().

+ Here is the call graph for this function:

◆ fillFooter()

ilPDSelectedItemsBlockGUI::fillFooter ( )

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 288 of file class.ilPDSelectedItemsBlockGUI.php.

288 : void
289 {
290 }

◆ getBlockType()

ilPDSelectedItemsBlockGUI::getBlockType ( )

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 182 of file class.ilPDSelectedItemsBlockGUI.php.

182 : string
183 {
184 return static::$block_type;
185 }

◆ getCardForData()

ilPDSelectedItemsBlockGUI::getCardForData ( array  $item)
protected

Definition at line 664 of file class.ilPDSelectedItemsBlockGUI.php.

664 : Card
665 {
666 $itemListGui = $this->list_factory->byType($item['type']);
668
669 $card = $itemListGui->getAsCard(
670 (int) $item['ref_id'],
671 (int) $item['obj_id'],
672 (string) $item['type'],
673 (string) $item['title'],
674 (string) $item['description']
675 );
676
677 return $card;
678 }
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.

References ilObjectActivation\addListGUIActivationProperty().

Referenced by getLegacyContent().

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

◆ getContent()

ilPDSelectedItemsBlockGUI::getContent ( )
protected

Definition at line 262 of file class.ilPDSelectedItemsBlockGUI.php.

262 : string
263 {
264 return $this->content;
265 }

References $content.

Referenced by fillDataSection(), and setFooterLinks().

+ Here is the caller graph for this function:

◆ getGroupedCommandsForView()

ilPDSelectedItemsBlockGUI::getGroupedCommandsForView (   $manage = false)
protected

Definition at line 292 of file class.ilPDSelectedItemsBlockGUI.php.

292 : array
293 {
294 $commandGroups = [];
295
296 $sortingCommands = [];
297 $sortings = $this->viewSettings->getSelectableSortingModes();
298 $effectiveSorting = $this->viewSettings->getEffectiveSortingMode();
299 foreach ($sortings as $sorting) {
300 $this->ctrl->setParameter($this, 'sorting', $sorting);
301 $sortingCommands[] = [
302 'txt' => $this->lng->txt('dash_sort_by_' . $sorting),
303 'url' => $this->ctrl->getLinkTarget($this, 'changePDItemSorting'),
304 'xxxasyncUrl' => $this->ctrl->getLinkTarget($this, 'changePDItemSorting', '', true),
305 'active' => $sorting === $effectiveSorting,
306 ];
307 $this->ctrl->setParameter($this, 'sorting', null);
308 }
309
310 if (count($sortingCommands) > 1) {
311 $commandGroups[] = $sortingCommands;
312 }
313
314 if ($manage) {
315 return $commandGroups;
316 }
317
318 $presentationCommands = [];
319 $presentations = $this->viewSettings->getSelectablePresentationModes();
320 $effectivePresentation = $this->viewSettings->getEffectivePresentationMode();
321 foreach ($presentations as $presentation) {
322 $this->ctrl->setParameter($this, 'presentation', $presentation);
323 $presentationCommands[] = [
324 'txt' => $this->lng->txt('pd_presentation_mode_' . $presentation),
325 'url' => $this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),
326 'xxxasyncUrl' => $this->ctrl->getLinkTarget($this, 'changePDItemPresentation', '', true),
327 'active' => $presentation === $effectivePresentation,
328 ];
329 $this->ctrl->setParameter($this, 'presentation', null);
330 }
331
332 if (count($presentationCommands) > 1) {
333 $commandGroups[] = $presentationCommands;
334 }
335
336 $commandGroups[] = [
337 [
338 'txt' => $this->viewSettings->isSelectedItemsViewActive() ?
339 $this->lng->txt('pd_remove_multiple') :
340 $this->lng->txt('pd_unsubscribe_multiple_memberships'),
341 'url' => $this->ctrl->getLinkTarget($this, 'manage'),
342 'asyncUrl' => null,
343 'active' => false,
344 ]
345 ];
346
347 return $commandGroups;
348 }

References $manage, and ilBlockGUI\$presentation.

Referenced by getLegacyContent(), getListItemGroups(), renderManageList(), and setFooterLinks().

+ Here is the caller graph for this function:

◆ getHTML()

ilPDSelectedItemsBlockGUI::getHTML ( )

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 227 of file class.ilPDSelectedItemsBlockGUI.php.

228 {
229 global $DIC;
230
231 $this->setTitle($this->getViewTitle());
232 $DIC->database()->useSlave(true);
233 $this->setData([['dummy']]);
234 $DIC['ilHelp']->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, $this->blockView->getScreenId());
235 $this->ctrl->clearParameters($this);
236 $DIC->database()->useSlave(false);
237
238 return parent::getHTML();
239 }
setData($a_data)
Set Data.
setTitle($a_title)
Set Title.
const ID_PART_SCREEN

References $DIC, getViewTitle(), ilHelpGUI\ID_PART_SCREEN, ilBlockGUI\setData(), and ilBlockGUI\setTitle().

Referenced by initAndShow().

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

◆ getLegacyContent()

ilPDSelectedItemsBlockGUI::getLegacyContent ( )
protected

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 683 of file class.ilPDSelectedItemsBlockGUI.php.

683 : string
684 {
685 $groupedCommands = $this->getGroupedCommandsForView();
686 foreach ($groupedCommands as $group) {
687 foreach ($group as $command) {
688 $this->addBlockCommand(
689 (string) $command['url'],
690 (string) $command['txt'],
691 (string) $command['asyncUrl']
692 );
693 }
694 }
695
696 $groupedItems = $this->blockView->getItemGroups();
697
698 $subs = [];
699 foreach ($groupedItems as $group) {
700 $cards = [];
701
702 foreach ($group->getItems() as $item) {
703 try {
704 $cards[] = $this->getCardForData($item);
705 } catch (ilException $e) {
706 $this->logging->warning('Listing failed for item with ID ' . $item['obj_id'] . ': ' . $e->getMessage());
707 continue;
708 }
709 }
710 if (count($cards) > 0) {
711 $subs[] = $this->ui->factory()->panel()->sub(
712 $group->getLabel(),
713 $this->ui->factory()->deck($cards)->withNormalCardsSize()
714 );
715 }
716 }
717
718 if (count($subs) > 0) {
719 return $this->ui->renderer()->render($subs);
720 }
721
722 return $this->getNoItemFoundContent();
723 }
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References Vendor\Package\$e, ilBlockGUI\addBlockCommand(), getCardForData(), getGroupedCommandsForView(), getNoItemFoundContent(), and ui().

+ Here is the call graph for this function:

◆ getListItemForData()

ilPDSelectedItemsBlockGUI::getListItemForData ( array  $data)
protected

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 648 of file class.ilPDSelectedItemsBlockGUI.php.

648 : Item
649 {
650 $itemListGui = $this->list_factory->byType($data['type']);
652
653 $list_item = $itemListGui->getAsListItem(
654 (int) $data['ref_id'],
655 (int) $data['obj_id'],
656 (string) $data['type'],
657 (string) $data['title'],
658 (string) $data['description']
659 );
660
661 return $list_item;
662 }
Common interface to all items.
Definition: Item.php:11

References ilBlockGUI\$data, and ilObjectActivation\addListGUIActivationProperty().

Referenced by getListItemGroups().

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

◆ getListItemGroups()

ilPDSelectedItemsBlockGUI::getListItemGroups ( )
protected

@inheritDoc

Reimplemented from ilBlockGUI.

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

609 : array
610 {
611 $groupedItems = $this->blockView->getItemGroups();
612 $groupedCommands = $this->getGroupedCommandsForView();
613 foreach ($groupedCommands as $group) {
614 foreach ($group as $command) {
615 $this->addBlockCommand(
616 (string) $command['url'],
617 (string) $command['txt'],
618 (string) $command['asyncUrl']
619 );
620 }
621 }
622
623 $item_groups = [];
624 $list_items = [];
625
626 foreach ($groupedItems as $group) {
627 $list_items = [];
628
629 foreach ($group->getItems() as $item) {
630 try {
631 $list_items[] = $this->getListItemForData($item);
632 } catch (ilException $e) {
633 $this->logging->warning('Listing failed for item with ID ' . $item['obj_id'] . ': ' . $e->getMessage());
634 continue;
635 }
636 }
637 if (count($list_items) > 0) {
638 $item_groups[] = $this->ui->factory()->item()->group((string) $group->getLabel(), $list_items);
639 }
640 }
641
642 return $item_groups;
643 }

References Vendor\Package\$e, ilBlockGUI\addBlockCommand(), getGroupedCommandsForView(), getListItemForData(), and ui().

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDSelectedItemsBlockGUI::getNoItemFoundContent ( )

@ineritdoc

Reimplemented from ilBlockGUI.

Reimplemented in ilPDMembershipBlockGUI.

Definition at line 757 of file class.ilPDSelectedItemsBlockGUI.php.

757 : string
758 {
759 $txt = $this->lng->txt("rep_fav_intro1") . "<br>";
760 $txt .= sprintf(
761 $this->lng->txt('rep_fav_intro2'),
762 $this->getRepositoryTitle()
763 ) . "<br>";
764 $txt .= $this->lng->txt("rep_fav_intro3");
765 $mbox = $this->ui->factory()->messageBox()->info($txt);
766 $mbox = $mbox->withLinks([$this->ui->factory()->link()->standard($this->getRepositoryTitle(), ilLink::_getStaticLink(1, 'root', true))]);
767 return $this->ui->renderer()->render($mbox);
768 }
$txt
Definition: error.php:13

References $txt, ilLink\_getStaticLink(), and ui().

Referenced by getLegacyContent().

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

◆ getRepositoryTitle()

ilPDSelectedItemsBlockGUI::getRepositoryTitle ( )
protected

Definition at line 770 of file class.ilPDSelectedItemsBlockGUI.php.

771 {
772 $nd = $this->tree->getNodeData($this->tree->getRootId());
773 $title = $nd['title'];
774
775 if ($title === 'ILIAS') {
776 $title = $this->lng->txt('repository');
777 }
778
779 return $title;
780 }
$nd
Definition: error.php:12

References $nd, and ilBlockGUI\$title.

◆ getScreenMode()

static ilPDSelectedItemsBlockGUI::getScreenMode ( )
static

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 190 of file class.ilPDSelectedItemsBlockGUI.php.

191 {
192 $cmd = $_GET['cmd'];
193 if ($cmd === 'post') {
194 global $DIC;
195 $cmd = key($DIC->http()->request()->getParsedBody()['cmd']);
196 }
197
198 switch ($cmd) {
199 case 'confirmRemove':
200 case 'manage':
201 return IL_SCREEN_FULL;
202
203 default:
204 return IL_SCREEN_SIDE;
205 }
206 }
const IL_SCREEN_SIDE
const IL_SCREEN_FULL

References $_GET, $DIC, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

◆ getViewBlockHtml()

ilPDSelectedItemsBlockGUI::getViewBlockHtml ( )
protected

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

412 : string
413 {
414 return $this->renderGroupedItems(
415 $this->blockView->getItemGroups()
416 );
417 }
renderGroupedItems(array $grouped_items, bool $showHeader=true)

References renderGroupedItems().

+ Here is the call graph for this function:

◆ getViewSettings()

ilPDSelectedItemsBlockGUI::getViewSettings ( )

◆ getViewTitle()

ilPDSelectedItemsBlockGUI::getViewTitle ( )
protected
Returns
string

Reimplemented in ilPDMembershipBlockGUI.

Definition at line 219 of file class.ilPDSelectedItemsBlockGUI.php.

220 {
221 return $this->blockView->getTitle();
222 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ initAndShow()

ilPDSelectedItemsBlockGUI::initAndShow ( )
protected

Definition at line 436 of file class.ilPDSelectedItemsBlockGUI.php.

437 {
438 $this->initViewSettings();
439
440 if ($this->ctrl->isAsynch()) {
441 echo $this->getHTML();
442 exit;
443 }
444
445 if ($_GET["manage"]) {
446 $this->ctrl->redirect($this, 'manage');
447 }
448
449 $this->returnToContext();
450 }
exit
Definition: login.php:29

References $_GET, exit, getHTML(), initViewSettings(), and returnToContext().

Referenced by changePDItemPresentation(), and changePDItemSorting().

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

◆ initViewSettings()

ilPDSelectedItemsBlockGUI::initViewSettings ( )
protected

Reimplemented in ilPDMembershipBlockGUI.

Definition at line 130 of file class.ilPDSelectedItemsBlockGUI.php.

131 {
132 $this->viewSettings = new ilPDSelectedItemsBlockViewSettings(
133 $this->user,
135 );
136
137 $this->viewSettings->parse();
138
139 $this->blockView = ilPDSelectedItemsBlockViewGUI::bySettings($this->viewSettings);
140
141 $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
142 }
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)

References ilPDSelectedItemsBlockViewGUI\bySettings(), user(), and ilPDSelectedItemsBlockConstants\VIEW_SELECTED_ITEMS.

Referenced by __construct(), and initAndShow().

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

◆ isRepositoryObject()

ilPDSelectedItemsBlockGUI::isRepositoryObject ( )
protected

@inheritDoc

Reimplemented from ilBlockGUI.

Definition at line 211 of file class.ilPDSelectedItemsBlockGUI.php.

211 : bool
212 {
213 return false;
214 }

◆ manageObject()

ilPDSelectedItemsBlockGUI::manageObject ( )

Definition at line 452 of file class.ilPDSelectedItemsBlockGUI.php.

453 {
454 $this->blockView->setIsInManageMode(true);
455
456 $top_tb = new ilToolbarGUI();
457 $top_tb->setFormAction($this->ctrl->getFormAction($this));
458 $top_tb->setLeadingImage(ilUtil::getImagePath('arrow_upright.svg'), $this->lng->txt('actions'));
459
460 $button = ilSubmitButton::getInstance();
461 $grouped_items = $this->blockView->getItemGroups();
462 if ($this->viewSettings->isSelectedItemsViewActive()) {
463 $button->setCaption('remove');
464 } else {
465 $button->setCaption('pd_unsubscribe_memberships');
466 foreach ($grouped_items as $group) {
467 $items = $group->getItems();
468 $group->setItems([]);
469 foreach ($items as $item) {
470 if ($this->rbacsystem->checkAccess('leave', $item['ref_id'])) {
471 if (
472 $item['type'] !== 'crs' ||
473 ilParticipants::getInstance($item['ref_id'])->checkLastAdmin([$this->user->getId()])
474 ) {
475 $group->pushItem($item);
476 }
477 }
478 }
479 }
480 }
481 $button->setCommand('confirmRemove');
482 $top_tb->addStickyItem($button);
483
484 $top_tb->setCloseFormTag(false);
485
486 $bot_tb = new ilToolbarGUI();
487 $bot_tb->setLeadingImage(ilUtil::getImagePath('arrow_downright.svg'), $this->lng->txt('actions'));
488 $bot_tb->addStickyItem($button);
489 $bot_tb->setOpenFormTag(false);
490
491 return $top_tb->getHTML() . $this->renderManageList($grouped_items) . $bot_tb->getHTML();
492 }
static getInstance($a_ref_id)
Get instance by ref_id.
static getInstance()
Factory.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath(), ilParticipants\getInstance(), ilSubmitButton\getInstance(), renderManageList(), and user().

+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilPDSelectedItemsBlockGUI::removeFromDeskObject ( )

@inheritDoc

Implements ilDesktopItemHandling.

Definition at line 171 of file class.ilPDSelectedItemsBlockGUI.php.

172 {
173 $this->lng->loadLanguageModule("rep");
174 $this->favourites->remove($this->user->getId(), (int) $_GET["item_ref_id"]);
175 ilUtil::sendSuccess($this->lng->txt("rep_removed_from_favourites"), true);
176 $this->returnToContext();
177 }

References $_GET, returnToContext(), and user().

+ Here is the call graph for this function:

◆ renderGroupedItems()

ilPDSelectedItemsBlockGUI::renderGroupedItems ( array  $grouped_items,
bool  $showHeader = true 
)
protected
Parameters
ilPDSelectedItemsBlockGroup[]$grouped_items

Definition at line 377 of file class.ilPDSelectedItemsBlockGUI.php.

377 : string
378 {
379 if (0 === count($grouped_items)) {
380 return '';
381 }
382
383 if ($this->viewSettings->isTilePresentation()) {
384 $renderer = new ilPDObjectsTileRenderer(
385 $this->blockView,
386 $this->ui->factory(),
387 $this->ui->renderer(),
388 $this->list_factory,
389 $this->user,
390 $this->lng,
391 $this->objectService,
392 $this->ctrl
393 );
394
395 return $renderer->render($grouped_items, $showHeader);
396 }
397
398 $renderer = new ilPDObjectsListRenderer(
399 $this->blockView,
400 $this->ui->factory(),
401 $this->ui->renderer(),
402 $this->list_factory,
403 $this->user,
404 $this->lng,
405 $this->objectService,
406 $this->ctrl
407 );
408
409 return $renderer->render($grouped_items, $showHeader);
410 }
Class ilPDSelectedItemsListRenderer.
Class ilPDObjectsTileRenderer.

References ui().

Referenced by getViewBlockHtml().

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

◆ renderManageList()

ilPDSelectedItemsBlockGUI::renderManageList ( array  $grouped_items)
protected

Definition at line 725 of file class.ilPDSelectedItemsBlockGUI.php.

725 : string
726 {
727 $ui = $this->ui;
728
729 $this->ctrl->setParameter($this, "manage", "1");
730 $groupedCommands = $this->getGroupedCommandsForView(true);
731 foreach ($groupedCommands as $group) {
732 foreach ($group as $command) {
733 $this->addBlockCommand(
734 (string) $command['url'],
735 (string) $command['txt'],
736 (string) $command['asyncUrl']
737 );
738 }
739 }
740
741 if (is_array($groupedCommands[0])) {
742 $actions = array_map(static function ($item) use ($ui) {
743 return $ui->factory()->link()->standard($item["txt"], $item["url"]);
744 }, $groupedCommands[0]);
745 if (count($actions) > 0) {
746 $dd = $this->ui->factory()->dropdown()->standard($actions);
747 $this->main_tpl->setHeaderActionMenu($ui->renderer()->render($dd));
748 }
749 }
750
751 return (new ilDashObjectsTableRenderer($this))->render($grouped_items);
752 }
Dashboard objects table renderer.
standard()
This is an example, of how the Notification Slate is generated by assigning Notification Items to it.
Definition: standard.php:11

References $ui, ilBlockGUI\addBlockCommand(), getGroupedCommandsForView(), standard(), and ui().

Referenced by manageObject().

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

◆ returnToContext()

ilPDSelectedItemsBlockGUI::returnToContext ( )
protected

@inheritDoc

Reimplemented in ilPDMembershipBlockGUI.

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

163 {
164 $this->ctrl->setParameterByClass('ildashboardgui', 'view', $this->viewSettings->getCurrentView());
165 $this->ctrl->redirectByClass('ildashboardgui', 'show');
166 }

Referenced by addToDeskObject(), initAndShow(), and removeFromDeskObject().

+ Here is the caller graph for this function:

◆ setContent()

ilPDSelectedItemsBlockGUI::setContent ( string  $a_content)
protected

Definition at line 267 of file class.ilPDSelectedItemsBlockGUI.php.

268 {
269 $this->content = $a_content;
270 }

◆ setFooterLinks()

ilPDSelectedItemsBlockGUI::setFooterLinks ( )
protected

Definition at line 350 of file class.ilPDSelectedItemsBlockGUI.php.

351 {
352 if ('' === $this->getContent()) {
353 $this->setEnableNumInfo(false);
354 return;
355 }
356
357 if ($this->blockView->isInManageMode()) {
358 return;
359 }
360
361 // @todo: handle $command['active']
362 $groupedCommands = $this->getGroupedCommandsForView();
363 foreach ($groupedCommands as $group) {
364 foreach ($group as $command) {
365 $this->addBlockCommand(
366 $command['url'],
367 $command['txt'],
368 $command['asyncUrl']
369 );
370 }
371 }
372 }

References ilBlockGUI\addBlockCommand(), getContent(), getGroupedCommandsForView(), and ilBlockGUI\setEnableNumInfo().

+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDSelectedItemsBlockGUI::$block_type = 'pditems'
static

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

◆ $blockView

ilPDSelectedItemsBlockGUI::$blockView
protected

Definition at line 53 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $content

ilPDSelectedItemsBlockGUI::$content = ''
protected

Definition at line 59 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by getContent().

◆ $ctrl

ilPDSelectedItemsBlockGUI::$ctrl
protected

Definition at line 65 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $favourites

ilPDSelectedItemsBlockGUI::$favourites
protected

Definition at line 80 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $http

ilPDSelectedItemsBlockGUI::$http
protected

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

◆ $list_factory

ilPDSelectedItemsBlockGUI::$list_factory
protected

Definition at line 86 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $lng

ilPDSelectedItemsBlockGUI::$lng
protected

Definition at line 62 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $logging

ilPDSelectedItemsBlockGUI::$logging
protected

Definition at line 89 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $manage

ilPDSelectedItemsBlockGUI::$manage = false
protected

Definition at line 56 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by getGroupedCommandsForView().

◆ $new_rendering

ilPDSelectedItemsBlockGUI::$new_rendering = true
protected

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

◆ $obj_definition

ilPDSelectedItemsBlockGUI::$obj_definition
protected

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

◆ $objectService

ilPDSelectedItemsBlockGUI::$objectService
protected

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

◆ $rbacsystem

ilPDSelectedItemsBlockGUI::$rbacsystem
protected

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

◆ $settings

ilPDSelectedItemsBlockGUI::$settings
protected

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

◆ $tree

ilPDSelectedItemsBlockGUI::$tree
protected

Definition at line 83 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $ui

ilPDSelectedItemsBlockGUI::$ui
protected

Definition at line 71 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by renderManageList().

◆ $user

ilPDSelectedItemsBlockGUI::$user
protected

Definition at line 68 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $viewSettings

ilPDSelectedItemsBlockGUI::$viewSettings
protected

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

Referenced by getViewSettings().


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