ILIAS  release_8 Revision v8.24
ilPDSelectedItemsBlockGUI Class Reference

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

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

Public Member Functions

 getViewSettings ()
 
 addToDeskObject ()
 Add desktop item @access public. More...
 
 removeFromDeskObject ()
 Remove from desktop @access public. More...
 
 getBlockType ()
 
 getHTML ()
 
 executeCommand ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 changePDItemPresentation ()
 
 changePDItemSorting ()
 
 manageObject ()
 
 confirmRemoveObject ()
 
 confirmedRemove ()
 
 confirmedUnsubscribe ()
 
 getNoItemFoundContent ()
 
- 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 ()
 
 correctOffset ()
 
 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="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $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 (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 
 addToDeskObject ()
 Add desktop item @access public. More...
 
 removeFromDeskObject ()
 Remove from desktop @access public. More...
 

Static Public Attributes

static string $block_type = 'pditems'
 

Protected Member Functions

 initViewSettings ()
 
 returnToContext ()
 
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getViewTitle ()
 
 getContent ()
 
 setContent (string $a_content)
 
 getGroupedCommandsForView (bool $manage=false)
 
 initAndShow ()
 
 cancel ()
 
 getListItemGroups ()
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 getCardForData (array $item)
 
 getLegacyContent ()
 Get legacy content. More...
 
 renderManageList (array $grouped_items)
 
 getRepositoryTitle ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $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...
 
 send (string $output)
 Send. More...
 

Protected Attributes

bool $new_rendering = true
 
ilRbacSystem $rbacsystem
 
ilSetting $settings
 
ilObjectDefinition $obj_definition
 
ilPDSelectedItemsBlockViewSettings $viewSettings
 
ilPDSelectedItemsBlockViewGUI $blockView
 
bool $manage = false
 
string $content = ''
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjUser $user
 
Services $http
 
Factory $refinery
 
ilObjectService $objectService
 
ilFavouritesManager $favourites
 
ilTree $tree
 
ilPDSelectedItemsBlockListGUIFactory $list_factory
 
ilLogger $logging
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Private Attributes

int $requested_item_ref_id
 

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

Member Function Documentation

◆ addToDeskObject()

ilPDSelectedItemsBlockGUI::addToDeskObject ( )

Add desktop item @access public.

Implements ilDesktopItemHandling.

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

118 : void
119 {
120 $this->favourites->add($this->user->getId(), $this->requested_item_ref_id);
121 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("rep_added_to_favourites"), true);
122 $this->returnToContext();
123 }

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

+ Here is the call graph for this function:

◆ cancel()

ilPDSelectedItemsBlockGUI::cancel ( )
protected

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

342 : void
343 {
344 $this->ctrl->returnToParent($this);
345 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ changePDItemPresentation()

ilPDSelectedItemsBlockGUI::changePDItemPresentation ( )

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

271 : void
272 {
273 $this->viewSettings->storeActorPresentationMode(
274 ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['presentation'] ?? ''))
275 );
276 $this->initAndShow();
277 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.

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

+ Here is the call graph for this function:

◆ changePDItemSorting()

ilPDSelectedItemsBlockGUI::changePDItemSorting ( )

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

279 : void
280 {
281 $this->viewSettings->storeActorSortingMode(
282 ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['sorting'] ?? ''))
283 );
284
285 $this->initAndShow();
286 }

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

+ Here is the call graph for this function:

◆ confirmedRemove()

ilPDSelectedItemsBlockGUI::confirmedRemove ( )

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

389 : void
390 {
391 $refIds = (array) ($this->http->request()->getParsedBody()['ref_id'] ?? []);
392 if (0 === count($refIds)) {
393 $this->ctrl->redirect($this, 'manage');
394 }
395
396 foreach ($refIds as $ref_id) {
397 $this->favourites->remove($this->user->getId(), (int) $ref_id);
398 }
399
400 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('pd_remove_multi_confirm'), true);
401 $this->ctrl->redirect($this, 'manage');
402 }
$ref_id
Definition: ltiauth.php:67

References $ref_id, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ confirmedUnsubscribe()

ilPDSelectedItemsBlockGUI::confirmedUnsubscribe ( )

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

404 : void
405 {
406 $refIds = $this->http->wrapper()->post()->retrieve(
407 'ref_id',
408 $this->refinery->to()->listOf($this->refinery->kindlyTo()->int())
409 );
410 if (0 === count($refIds)) {
411 $this->ctrl->redirect($this, 'manage');
412 }
413
414 foreach ($refIds as $ref_id) {
415 if ($this->access->checkAccess('leave', '', (int) $ref_id)) {
416 switch (ilObject::_lookupType($ref_id, true)) {
417 case 'crs':
419 $members->delete($this->user->getId());
420
421 $members->sendUnsubscribeNotificationToAdmins($this->user->getId());
422 $members->sendNotification(
424 $this->user->getId()
425 );
426 break;
427
428 case 'grp':
430 $members->delete($this->user->getId());
431
432 $members->sendNotification(
434 $this->user->getId()
435 );
436 $members->sendNotification(
438 $this->user->getId()
439 );
440 break;
441
442 default:
443 continue 2;
444 }
445
446 ilForumNotification::checkForumsExistsDelete($ref_id, $this->user->getId());
447 }
448 }
449
450 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('mmbr_unsubscribed_from_objs'), true);
451 $this->ctrl->returnToParent($this);
452 }
static checkForumsExistsDelete(int $ref_id, int $user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)

References $ref_id, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\access(), ilForumNotification\checkForumsExistsDelete(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilGroupMembershipMailNotification\TYPE_NOTIFICATION_UNSUBSCRIBE, ilCourseMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER, ilGroupMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ confirmRemoveObject()

ilPDSelectedItemsBlockGUI::confirmRemoveObject ( )

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

347 : string
348 {
349 $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
350
351 $refIds = (array) ($this->http->request()->getParsedBody()['id'] ?? []);
352 if (0 === count($refIds)) {
353 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
354 $this->ctrl->redirect($this, 'manage');
355 }
356
357 if ($this->viewSettings->isSelectedItemsViewActive()) {
358 $question = $this->lng->txt('dash_info_sure_remove_from_favs');
359 $cmd = 'confirmedRemove';
360 } else {
361 $question = $this->lng->txt('mmbr_info_delete_sure_unsubscribe');
362 $cmd = 'confirmedUnsubscribe';
363 }
364
365 $cgui = new ilConfirmationGUI();
366 $cgui->setHeaderText($question);
367
368 $cgui->setFormAction($this->ctrl->getFormAction($this));
369 $cgui->setCancel($this->lng->txt('cancel'), 'manage');
370 $cgui->setConfirm($this->lng->txt('confirm'), $cmd);
371
372 foreach ($refIds as $ref_id) {
373 $obj_id = ilObject::_lookupObjectId((int) $ref_id);
375 $type = ilObject::_lookupType($obj_id);
376
377 $cgui->addItem(
378 'ref_id[]',
379 $ref_id,
380 $title,
381 ilObject::_getIcon($obj_id, 'small', $type),
382 $this->lng->txt('icon') . ' ' . $this->lng->txt('obj_' . $type)
383 );
384 }
385
386 return $cgui->getHTML();
387 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupTitle(int $obj_id)
$type

References $ref_id, $type, ilObject\_getIcon(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilPDSelectedItemsBlockGUI::executeCommand ( )

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

173 : string
174 {
175 $next_class = $this->ctrl->getNextClass();
176 $cmd = $this->ctrl->getCmd('getHTML');
177
178 switch ($next_class) {
179 case 'ilcommonactiondispatchergui':
181 $this->ctrl->forwardCommand($gui);
182 break;
183
184 default:
185 if (method_exists($this, $cmd)) {
186 return $this->$cmd();
187 }
188 return $this->{$cmd . 'Object'}();
189 }
190 return "";
191 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call

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

+ Here is the call graph for this function:

◆ fillDataSection()

ilPDSelectedItemsBlockGUI::fillDataSection ( )

Standard implementation for row based data.

Overwrite this and call setContent for other data.

Reimplemented from ilBlockGUI.

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

203 : void
204 {
205 if ($this->getContent() === '') {
206 $this->setDataSection($this->blockView->getIntroductionHtml());
207 } else {
208 $this->tpl->setVariable('BLOCK_ROW', $this->getContent());
209 }
210 }
setDataSection(string $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:

◆ getBlockType()

ilPDSelectedItemsBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

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

139 : string
140 {
141 return static::$block_type;
142 }

◆ getCardForData()

ilPDSelectedItemsBlockGUI::getCardForData ( array  $item)
protected

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

514 {
515 $itemListGui = $this->list_factory->byType($item['type']);
517
518 $card = $itemListGui->getAsCard(
519 (int) $item['ref_id'],
520 (int) $item['obj_id'],
521 (string) $item['type'],
522 (string) $item['title'],
523 (string) $item['description']
524 );
525
526 return $card;
527 }
static addListGUIActivationProperty(ilObjectListGUI $list_gui, array &$item)
Get timing details for list gui.

References ilObjectActivation\addListGUIActivationProperty().

+ Here is the call graph for this function:

◆ getContent()

ilPDSelectedItemsBlockGUI::getContent ( )
protected

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

193 : string
194 {
195 return $this->content;
196 }

References $content.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getGroupedCommandsForView()

ilPDSelectedItemsBlockGUI::getGroupedCommandsForView ( bool  $manage = false)
protected

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

214 : array {
215 $commandGroups = [];
216
217 $sortingCommands = [];
218 $sortings = $this->viewSettings->getSelectableSortingModes();
219 $effectiveSorting = $this->viewSettings->getEffectiveSortingMode();
220 foreach ($sortings as $sorting) {
221 $this->ctrl->setParameter($this, 'sorting', $sorting);
222 $sortingCommands[] = [
223 'txt' => $this->lng->txt('dash_sort_by_' . $sorting),
224 'url' => $this->ctrl->getLinkTarget($this, 'changePDItemSorting'),
225 'xxxasyncUrl' => $this->ctrl->getLinkTarget($this, 'changePDItemSorting', '', true),
226 'active' => $sorting === $effectiveSorting,
227 ];
228 $this->ctrl->setParameter($this, 'sorting', null);
229 }
230
231 if (count($sortingCommands) > 1) {
232 $commandGroups[] = $sortingCommands;
233 }
234
235 if ($manage) {
236 return $commandGroups;
237 }
238
239 $presentationCommands = [];
240 $presentations = $this->viewSettings->getSelectablePresentationModes();
241 $effectivePresentation = $this->viewSettings->getEffectivePresentationMode();
242 foreach ($presentations as $presentation) {
243 $this->ctrl->setParameter($this, 'presentation', $presentation);
244 $presentationCommands[] = [
245 'txt' => $this->lng->txt('pd_presentation_mode_' . $presentation),
246 'url' => $this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),
247 'xxxasyncUrl' => $this->ctrl->getLinkTarget($this, 'changePDItemPresentation', '', true),
248 'active' => $presentation === $effectivePresentation,
249 ];
250 $this->ctrl->setParameter($this, 'presentation', null);
251 }
252
253 if (count($presentationCommands) > 1) {
254 $commandGroups[] = $presentationCommands;
255 }
256
257 $commandGroups[] = [
258 [
259 'txt' => $this->viewSettings->isSelectedItemsViewActive() ?
260 $this->lng->txt('pd_remove_multiple') :
261 $this->lng->txt('pd_unsubscribe_multiple_memberships'),
262 'url' => $this->ctrl->getLinkTarget($this, 'manage'),
263 'asyncUrl' => null,
264 'active' => false,
265 ]
266 ];
267
268 return $commandGroups;
269 }

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

+ Here is the call graph for this function:

◆ getHTML()

ilPDSelectedItemsBlockGUI::getHTML ( )

Reimplemented from ilBlockGUI.

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

154 : string
155 {
156 global $DIC;
157
158 $this->setTitle($this->getViewTitle());
159
160 $DIC->database()->useSlave(true);
161
162 $this->setData([['dummy']]);
163
164 $DIC['ilHelp']->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, $this->blockView->getScreenId());
165
166 $this->ctrl->clearParameters($this);
167
168 $DIC->database()->useSlave(false);
169
170 return parent::getHTML();
171 }
setData(array $a_data)
setTitle(string $a_title)
const ID_PART_SCREEN
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

◆ getLegacyContent()

ilPDSelectedItemsBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

529 : string
530 {
531 $groupedCommands = $this->getGroupedCommandsForView();
532 foreach ($groupedCommands as $group) {
533 foreach ($group as $command) {
534 $asynch_url = $command['asyncUrl'] ?? "";
535 $this->addBlockCommand(
536 (string) $command['url'],
537 (string) $command['txt'],
538 (string) $asynch_url
539 );
540 }
541 }
542
543 $groupedItems = $this->blockView->getItemGroups();
544
545 $subs = [];
546 foreach ($groupedItems as $group) {
547 $cards = [];
548
549 foreach ($group->getItems() as $item) {
550 try {
551 $cards[] = $this->getCardForData($item);
552 } catch (ilException $e) {
553 $this->logging->warning('Listing failed for item with ID ' . $item['obj_id'] . ': ' . $e->getMessage());
554 continue;
555 }
556 }
557 if (count($cards) > 0) {
558 $subs[] = $this->ui->factory()->panel()->sub(
559 $group->getLabel(),
560 $this->ui->factory()->deck($cards)->withNormalCardsSize()
561 );
562 }
563 }
564
565 if (count($subs) > 0) {
566 return $this->ui->renderer()->render($subs);
567 }
568
569 return $this->getNoItemFoundContent();
570 }
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References Vendor\Package\$e, and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getListItemForData()

ilPDSelectedItemsBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Reimplemented from ilBlockGUI.

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

497 : ?Item
498 {
499 $itemListGui = $this->list_factory->byType($data['type']);
501
502 $list_item = $itemListGui->getAsListItem(
503 (int) $data['ref_id'],
504 (int) $data['obj_id'],
505 (string) $data['type'],
506 (string) $data['title'],
507 (string) $data['description']
508 );
509
510 return $list_item;
511 }
Common interface to all items.
Definition: Item.php:32

References $data, and ilObjectActivation\addListGUIActivationProperty().

+ Here is the call graph for this function:

◆ getListItemGroups()

ilPDSelectedItemsBlockGUI::getListItemGroups ( )
protected
Returns
Group[]

Reimplemented from ilBlockGUI.

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

457 : array
458 {
459 $groupedItems = $this->blockView->getItemGroups();
460 $groupedCommands = $this->getGroupedCommandsForView();
461 foreach ($groupedCommands as $group) {
462 foreach ($group as $command) {
463 $asynch_url = $command['asyncUrl'] ?? "";
464 $this->addBlockCommand(
465 (string) $command['url'],
466 (string) $command['txt'],
467 (string) $asynch_url
468 );
469 }
470 }
471
472 $item_groups = [];
473 $list_items = [];
474
475 foreach ($groupedItems as $group) {
476 $list_items = [];
477
478 foreach ($group->getItems() as $item) {
479 try {
480 $itemListGUI = $this->list_factory->byType($item['type']);
482
483 $list_items[] = $this->getListItemForData($item);
484 } catch (ilException $e) {
485 $this->logging->warning('Listing failed for item with ID ' . $item['obj_id'] . ': ' . $e->getMessage());
486 continue;
487 }
488 }
489 if (count($list_items) > 0) {
490 $item_groups[] = $this->ui->factory()->item()->group($group->getLabel(), $list_items);
491 }
492 }
493
494 return $item_groups;
495 }
getListItemForData(array $data)
Get list item for data array.

References Vendor\Package\$e, ilObjectActivation\addListGUIActivationProperty(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDSelectedItemsBlockGUI::getNoItemFoundContent ( )

Reimplemented from ilBlockGUI.

Reimplemented in ilPDMembershipBlockGUI.

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

601 : string
602 {
603 $txt = $this->lng->txt("rep_fav_intro1") . "<br>";
604 $txt .= sprintf(
605 $this->lng->txt('rep_fav_intro2'),
606 $this->getRepositoryTitle()
607 ) . "<br>";
608 $txt .= $this->lng->txt("rep_fav_intro3");
609 $mbox = $this->ui->factory()->messageBox()->info($txt);
610 $mbox = $mbox->withLinks([$this->ui->factory()->link()->standard($this->getRepositoryTitle(), ilLink::_getStaticLink(1, 'root', true))]);
611 return $this->ui->renderer()->render($mbox);
612 }
$txt
Definition: error.php:13

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

+ Here is the call graph for this function:

◆ getRepositoryTitle()

ilPDSelectedItemsBlockGUI::getRepositoryTitle ( )
protected

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

614 : string
615 {
616 $nd = $this->tree->getNodeData($this->tree->getRootId());
617 $title = $nd['title'];
618
619 if ($title === 'ILIAS') {
620 $title = $this->lng->txt('repository');
621 }
622
623 return $title;
624 }
$nd
Definition: error.php:12

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

+ Here is the call graph for this function:

◆ getViewSettings()

ilPDSelectedItemsBlockGUI::getViewSettings ( )

◆ getViewTitle()

ilPDSelectedItemsBlockGUI::getViewTitle ( )
protected

Reimplemented in ilPDMembershipBlockGUI.

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

149 : string
150 {
151 return $this->blockView->getTitle();
152 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ initAndShow()

ilPDSelectedItemsBlockGUI::initAndShow ( )
protected

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

288 : void
289 {
290 $this->initViewSettings();
291
292 if ($this->ctrl->isAsynch()) {
293 echo $this->getHTML();
294 exit;
295 }
296
297 $this->returnToContext();
298 }
exit
Definition: login.php:28

References ILIAS\Repository\ctrl(), and exit.

+ Here is the call graph for this function:

◆ initViewSettings()

ilPDSelectedItemsBlockGUI::initViewSettings ( )
protected

Reimplemented in ilPDMembershipBlockGUI.

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

99 : void
100 {
101 $this->viewSettings = new ilPDSelectedItemsBlockViewSettings(
102 $this->user,
104 );
105
106 $this->viewSettings->parse();
107
108 $this->blockView = ilPDSelectedItemsBlockViewGUI::bySettings($this->viewSettings);
109
110 $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
111 }
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)

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

+ Here is the call graph for this function:

◆ isRepositoryObject()

ilPDSelectedItemsBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

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

144 : bool
145 {
146 return false;
147 }

◆ manageObject()

ilPDSelectedItemsBlockGUI::manageObject ( )

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

300 : string
301 {
302 $this->blockView->setIsInManageMode(true);
303
304 $top_tb = new ilToolbarGUI();
305 $top_tb->setFormAction($this->ctrl->getFormAction($this));
306 $top_tb->setLeadingImage(ilUtil::getImagePath('arrow_upright.svg'), $this->lng->txt('actions'));
307
308 $button = ilSubmitButton::getInstance();
309 $grouped_items = $this->blockView->getItemGroups();
310 if ($this->viewSettings->isSelectedItemsViewActive()) {
311 $button->setCaption('remove');
312 } else {
313 $button->setCaption('pd_unsubscribe_memberships');
314 foreach ($grouped_items as $group) {
315 $items = $group->getItems();
316 $group->setItems([]);
317 foreach ($items as $item) {
318 if ($this->rbacsystem->checkAccess('leave', $item['ref_id'])) {
319 if (
320 $item['type'] !== 'crs' ||
321 ilParticipants::getInstance($item['ref_id'])->checkLastAdmin([$this->user->getId()])
322 ) {
323 $group->pushItem($item);
324 }
325 }
326 }
327 }
328 }
329 $button->setCommand('confirmRemove');
330 $top_tb->addStickyItem($button);
331
332 $top_tb->setCloseFormTag(false);
333
334 $bot_tb = new ilToolbarGUI();
335 $bot_tb->setLeadingImage(ilUtil::getImagePath('arrow_downright.svg'), $this->lng->txt('actions'));
336 $bot_tb->addStickyItem($button);
337 $bot_tb->setOpenFormTag(false);
338
339 return $top_tb->getHTML() . $this->renderManageList($grouped_items) . $bot_tb->getHTML();
340 }
static getInstance(int $a_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilSubmitButton\getInstance(), ilParticipants\getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilPDSelectedItemsBlockGUI::removeFromDeskObject ( )

Remove from desktop @access public.

Implements ilDesktopItemHandling.

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

131 : void
132 {
133 $this->lng->loadLanguageModule("rep");
134 $this->favourites->remove($this->user->getId(), $this->requested_item_ref_id);
135 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("rep_removed_from_favourites"), true);
136 $this->returnToContext();
137 }

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

+ Here is the call graph for this function:

◆ renderManageList()

ilPDSelectedItemsBlockGUI::renderManageList ( array  $grouped_items)
protected

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

572 : string
573 {
574 $ui = $this->ui;
575
576 $this->ctrl->setParameter($this, "manage", "1");
577 $groupedCommands = $this->getGroupedCommandsForView(true);
578 foreach ($groupedCommands as $group) {
579 foreach ($group as $command) {
580 $this->addBlockCommand(
581 (string) $command['url'],
582 (string) $command['txt'],
583 (string) ($command['asyncUrl'] ?? "")
584 );
585 }
586 }
587
588 if (is_array($groupedCommands[0])) {
589 $actions = array_map(static function ($item) use ($ui) {
590 return $ui->factory()->link()->standard($item["txt"], $item["url"]);
591 }, $groupedCommands[0]);
592 if (count($actions) > 0) {
593 $dd = $this->ui->factory()->dropdown()->standard($actions);
594 $this->main_tpl->setHeaderActionMenu($ui->renderer()->render($dd));
595 }
596 }
597
598 return (new ilDashObjectsTableRenderer($this))->render($grouped_items);
599 }
ILIAS DI UIServices $ui
standard()
This is an example, of how the Notification Slate is generated by assigning Notification Items to it.
Definition: standard.php:16

References ILIAS\Repository\ctrl(), ILIAS\UI\examples\MainControls\Slate\Notification\standard(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ returnToContext()

ilPDSelectedItemsBlockGUI::returnToContext ( )
protected

Reimplemented in ilPDMembershipBlockGUI.

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

125 : void
126 {
127 $this->ctrl->setParameterByClass('ildashboardgui', 'view', $this->viewSettings->getCurrentView());
128 $this->ctrl->redirectByClass('ildashboardgui', 'show');
129 }

References ILIAS\Repository\ctrl().

Referenced by addToDeskObject(), and removeFromDeskObject().

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

◆ setContent()

ilPDSelectedItemsBlockGUI::setContent ( string  $a_content)
protected

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

198 : void
199 {
200 $this->content = $a_content;
201 }

Field Documentation

◆ $block_type

string ilPDSelectedItemsBlockGUI::$block_type = 'pditems'
static

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

◆ $blockView

ilPDSelectedItemsBlockViewGUI ilPDSelectedItemsBlockGUI::$blockView
protected

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

◆ $content

string ilPDSelectedItemsBlockGUI::$content = ''
protected

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

Referenced by getContent().

◆ $ctrl

ilCtrl ilPDSelectedItemsBlockGUI::$ctrl
protected

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

◆ $favourites

ilFavouritesManager ilPDSelectedItemsBlockGUI::$favourites
protected

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

◆ $http

Services ilPDSelectedItemsBlockGUI::$http
protected

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

◆ $list_factory

ilPDSelectedItemsBlockListGUIFactory ilPDSelectedItemsBlockGUI::$list_factory
protected

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

◆ $lng

ilLanguage ilPDSelectedItemsBlockGUI::$lng
protected

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

◆ $logging

ilLogger ilPDSelectedItemsBlockGUI::$logging
protected

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

◆ $manage

bool ilPDSelectedItemsBlockGUI::$manage = false
protected

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

◆ $new_rendering

bool ilPDSelectedItemsBlockGUI::$new_rendering = true
protected

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

◆ $obj_definition

ilObjectDefinition ilPDSelectedItemsBlockGUI::$obj_definition
protected

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

◆ $objectService

ilObjectService ilPDSelectedItemsBlockGUI::$objectService
protected

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

◆ $rbacsystem

ilRbacSystem ilPDSelectedItemsBlockGUI::$rbacsystem
protected

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

◆ $refinery

Factory ilPDSelectedItemsBlockGUI::$refinery
protected

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

◆ $requested_item_ref_id

int ilPDSelectedItemsBlockGUI::$requested_item_ref_id
private

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

◆ $settings

ilSetting ilPDSelectedItemsBlockGUI::$settings
protected

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

◆ $tree

ilTree ilPDSelectedItemsBlockGUI::$tree
protected

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

◆ $user

ilObjUser ilPDSelectedItemsBlockGUI::$user
protected

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

◆ $viewSettings

ilPDSelectedItemsBlockViewSettings ilPDSelectedItemsBlockGUI::$viewSettings
protected

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

Referenced by getViewSettings().


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