ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPDSelectedItemsBlockGUI Class Reference

BlockGUI class for Selected Items on Personal Desktop. More...

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

Public Member Functions

 __construct ()
 ilPDSelectedItemsBlockGUI constructor. More...
 
 getViewSettings ()
 
 addToDeskObject ()
 Add desktop item public. More...
 
 removeFromDeskObject ()
 Remove from desktop public. More...
 
 getBlockType ()
 
 getHTML ()
 
 executeCommand ()
 
 fillDataSection ()
 
 fillFooter ()
 
 changePDItemPresentation ()
 Called if the user interacted with the provided sorting options. More...
 
 changePDItemSorting ()
 Called if the user interacted with the provided presentation options. More...
 
 manageObject ()
 
 confirmRemoveObject ()
 
 confirmedRemove ()
 
 confirmedUnsubscribe ()
 
 getNoItemFoundContent ()
 No item entry. 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...
 

Static Public Member Functions

static getScreenMode ()
 
- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = 'pditems'
 

Protected Member Functions

 initViewSettings ()
 Evaluates the view settings of this block. More...
 
 returnToContext ()
 Return to context. More...
 
 isRepositoryObject ()
 
 getViewTitle ()
 Get view title. More...
 
 getContent ()
 
 setContent (string $a_content)
 
 getGroupedCommandsForView ($manage=false)
 
 setFooterLinks ()
 
 renderGroupedItems (array $grouped_items, $showHeader=true)
 
 getViewBlockHtml ()
 
 initAndShow ()
 
 cancel ()
 Cancel. More...
 
 getListItemGroups ()
 Get items. More...
 
 getLegacyContent ()
 
 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

 $rbacsystem
 
 $settings
 
 $obj_definition
 
 $viewSettings
 
 $blockView
 
 $manage = false
 
 $content = ''
 
 $lng
 
 $ctrl
 
 $user
 
 $ui
 
 $http
 
 $objectService
 
 $favourites
 
 $tree
 
 $new_rendering = true
 
- 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

BlockGUI class for Selected Items on Personal Desktop.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilPDSelectedItemsBlockGUI: ilColumnGUI ilPDSelectedItemsBlockGUI: ilCommonActionDispatcherGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDSelectedItemsBlockGUI::__construct ( )

ilPDSelectedItemsBlockGUI constructor.

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

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

88  {
89  global $DIC;
90 
91  $this->rbacsystem = $DIC->rbac()->system();
92  $this->settings = $DIC->settings();
93  $this->obj_definition = $DIC["objDefinition"];
94  $this->access = $DIC->access();
95  $this->ui = $DIC->ui();
96  $this->http = $DIC->http();
97  $this->objectService = $DIC->object();
98  $this->favourites = new ilFavouritesManager();
99  $this->tree = $DIC->repositoryTree();
100 
102 
103  $this->lng = $DIC->language();
104  $this->ctrl = $DIC->ctrl();
105  $this->user = $DIC->user();
106 
107  $this->lng->loadLanguageModule('pd');
108  $this->lng->loadLanguageModule('cntr'); // #14158
109  $this->lng->loadLanguageModule('rep'); // #14158
110 
111  $this->setEnableNumInfo(false);
112  $this->setLimit(99999);
113  $this->allow_moving = false;
114 
115  $this->initViewSettings();
116 
117  if ($this->viewSettings->isTilePresentation()) {
118  $this->setPresentation(self::PRES_MAIN_LEG);
119  } else {
120  $this->setPresentation(self::PRES_MAIN_LIST);
121  }
122  $this->main_content = true;
123  }
settings()
Definition: settings.php:2
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
Manages favourites, currently the interface for other components, needs discussion.
user()
Definition: user.php:4
static http()
Fetches the global http state from ILIAS.
ui()
Definition: ui.php:5
setLimit($a_limit)
Set Limit.
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
setPresentation(int $type)
Set presentation.
initViewSettings()
Evaluates the view settings of this block.
+ Here is the call graph for this function:

Member Function Documentation

◆ addToDeskObject()

ilPDSelectedItemsBlockGUI::addToDeskObject ( )

Add desktop item public.

Add desktop item public.

Implements ilDesktopItemHandling.

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

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

163  {
164  $this->favourites->add($this->user->getId(), (int) $_GET["item_ref_id"]);
165  ilUtil::sendSuccess($this->lng->txt("rep_added_to_favourites"), true);
166  $this->returnToContext();
167  }
$_GET["client_id"]
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ cancel()

ilPDSelectedItemsBlockGUI::cancel ( )
protected

Cancel.

Parameters

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

573  {
574  $this->ctrl->returnToParent($this);
575  }

◆ changePDItemPresentation()

ilPDSelectedItemsBlockGUI::changePDItemPresentation ( )

Called if the user interacted with the provided sorting options.

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

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

486  {
487  $this->viewSettings->storeActorPresentationMode(
488  \ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['presentation'] ?? ''))
489  );
490  $this->initAndShow();
491  }
static http()
Fetches the global http state from ILIAS.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ changePDItemSorting()

ilPDSelectedItemsBlockGUI::changePDItemSorting ( )

Called if the user interacted with the provided presentation options.

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

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

497  {
498  $this->viewSettings->storeActorSortingMode(
499  \ilUtil::stripSlashes((string) ($this->http->request()->getQueryParams()['sorting'] ?? ''))
500  );
501 
502  $this->initAndShow();
503  }
static http()
Fetches the global http state from ILIAS.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ confirmedRemove()

ilPDSelectedItemsBlockGUI::confirmedRemove ( )

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

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

622  {
623  $refIds = (array) ($this->http->request()->getParsedBody()['ref_id'] ?? []);
624  if (0 === count($refIds)) {
625  $this->ctrl->redirect($this, 'manage');
626  }
627 
628  foreach ($refIds as $ref_id) {
629  $this->favourites->remove($this->user->getId(), $ref_id);
630  }
631 
632  // #12909
633  ilUtil::sendSuccess($this->lng->txt('pd_remove_multi_confirm'), true);
634  $this->ctrl->redirect($this, 'manage');
635  }
user()
Definition: user.php:4
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ confirmedUnsubscribe()

ilPDSelectedItemsBlockGUI::confirmedUnsubscribe ( )

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

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

638  {
639  $refIds = (array) ($this->http->request()->getParsedBody()['ref_id'] ?? []);
640  if (0 === count($refIds)) {
641  $this->ctrl->redirect($this, 'manage');
642  }
643 
644  foreach ($refIds as $ref_id) {
645  if ($this->access->checkAccess('leave', '', (int) $ref_id)) {
646  switch (ilObject::_lookupType($ref_id, true)) {
647  case 'crs':
648  // see ilObjCourseGUI:performUnsubscribeObject()
649  $members = new ilCourseParticipants(ilObject::_lookupObjId((int) $ref_id));
650  $members->delete($this->user->getId());
651 
652  $members->sendUnsubscribeNotificationToAdmins($this->user->getId());
653  $members->sendNotification(
654  $members->NOTIFY_UNSUBSCRIBE,
655  $this->user->getId()
656  );
657  break;
658 
659  case 'grp':
660  // see ilObjGroupGUI:performUnsubscribeObject()
661  $members = new ilGroupParticipants(ilObject::_lookupObjId((int) $ref_id));
662  $members->delete($this->user->getId());
663 
664  $members->sendNotification(
666  $this->user->getId()
667  );
668  $members->sendNotification(
670  $this->user->getId()
671  );
672  break;
673 
674  default:
675  // do nothing
676  continue 2;
677  }
678 
679  include_once './Modules/Forum/classes/class.ilForumNotification.php';
680  ilForumNotification::checkForumsExistsDelete($ref_id, $this->user->getId());
681  }
682  }
683 
684  ilUtil::sendSuccess($this->lng->txt('mmbr_unsubscribed_from_objs'), true);
685  $this->ctrl->returnToParent($this);
686  }
user()
Definition: user.php:4
static http()
Fetches the global http state from ILIAS.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static checkForumsExistsDelete($ref_id, $user_id=0)
+ Here is the call graph for this function:

◆ confirmRemoveObject()

ilPDSelectedItemsBlockGUI::confirmRemoveObject ( )

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

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

579  {
580  $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
581 
582  $refIds = (array) ($this->http->request()->getParsedBody()['id'] ?? []);
583  if (0 === count($refIds)) {
584  ilUtil::sendFailure($this->lng->txt('select_one'), true);
585  $this->ctrl->redirect($this, 'manage');
586  }
587 
588  if ($this->viewSettings->isSelectedItemsViewActive()) {
589  $question = $this->lng->txt('dash_info_sure_remove_from_favs');
590  $cmd = 'confirmedRemove';
591  } else {
592  $question = $this->lng->txt('mmbr_info_delete_sure_unsubscribe');
593  $cmd = 'confirmedUnsubscribe';
594  }
595 
596  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
597  $cgui = new ilConfirmationGUI();
598  $cgui->setHeaderText($question);
599 
600  $cgui->setFormAction($this->ctrl->getFormAction($this));
601  $cgui->setCancel($this->lng->txt('cancel'), 'manage');
602  $cgui->setConfirm($this->lng->txt('confirm'), $cmd);
603 
604  foreach ($refIds as $ref_id) {
605  $obj_id = ilObject::_lookupObjectId((int) $ref_id);
606  $title = ilObject::_lookupTitle($obj_id);
607  $type = ilObject::_lookupType($obj_id);
608 
609  $cgui->addItem(
610  'ref_id[]',
611  $ref_id,
612  $title,
613  ilObject::_getIcon($obj_id, 'small', $type),
614  $this->lng->txt('icon') . ' ' . $this->lng->txt('obj_' . $type)
615  );
616  }
617 
618  return $cgui->getHTML();
619  }
$type
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static http()
Fetches the global http state from ILIAS.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ executeCommand()

ilPDSelectedItemsBlockGUI::executeCommand ( )

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

References ilCommonActionDispatcherGUI\getInstanceFromAjaxCall().

276  {
277  $next_class = $this->ctrl->getNextClass();
278  $cmd = $this->ctrl->getCmd('getHTML');
279 
280  switch ($next_class) {
281  case 'ilcommonactiondispatchergui':
282  include_once('Services/Object/classes/class.ilCommonActionDispatcherGUI.php');
284  $this->ctrl->forwardCommand($gui);
285  break;
286 
287  default:
288  if (method_exists($this, $cmd)) {
289  return $this->$cmd();
290  } else {
291  return $this->{$cmd . 'Object'}();
292  }
293  }
294  }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ fillDataSection()

ilPDSelectedItemsBlockGUI::fillDataSection ( )

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

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

316  {
317  if ($this->getContent() == '') {
318  $this->setDataSection($this->blockView->getIntroductionHtml());
319  } else {
320  $this->tpl->setVariable('BLOCK_ROW', $this->getContent());
321  }
322  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
+ Here is the call graph for this function:

◆ fillFooter()

ilPDSelectedItemsBlockGUI::fillFooter ( )

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

329  {
330  /*
331  $this->tpl->setVariable('FCOLSPAN', $this->getColSpan());
332  if ($this->tpl->blockExists('block_footer')) {
333  $this->tpl->setCurrentBlock('block_footer');
334  $this->tpl->parseCurrentBlock();
335  }
336  */
337  }

◆ getBlockType()

ilPDSelectedItemsBlockGUI::getBlockType ( )

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

194  : string
195  {
196  return static::$block_type;
197  }

◆ getContent()

ilPDSelectedItemsBlockGUI::getContent ( )
protected
Returns
string

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

References $content.

Referenced by fillDataSection(), and setFooterLinks().

299  : string
300  {
301  return $this->content;
302  }
+ Here is the caller graph for this function:

◆ getGroupedCommandsForView()

ilPDSelectedItemsBlockGUI::getGroupedCommandsForView (   $manage = false)
protected
Returns
array

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

References $manage, and ilBlockGUI\$presentation.

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

342  : array
343  {
344  $commandGroups = [];
345 
346  $sortingCommands = [];
347  $sortings = $this->viewSettings->getSelectableSortingModes();
348  $effectiveSorting = $this->viewSettings->getEffectiveSortingMode();
349  // @todo: set checked on $sorting === $effectiveSorting
350  foreach ($sortings as $sorting) {
351  $this->ctrl->setParameter($this, 'sorting', $sorting);
352  $sortingCommands[] = [
353  'txt' => $this->lng->txt('dash_sort_by_' . $sorting),
354  'url' => $this->ctrl->getLinkTarget($this, 'changePDItemSorting'),
355  'xxxasyncUrl' => $this->ctrl->getLinkTarget($this, 'changePDItemSorting', '', true),
356  'active' => $sorting === $effectiveSorting,
357  ];
358  $this->ctrl->setParameter($this, 'sorting', null);
359  }
360 
361  if (count($sortingCommands) > 1) {
362  $commandGroups[] = $sortingCommands;
363  }
364 
365  if ($manage) {
366  return $commandGroups;
367  }
368 
369  $presentationCommands = [];
370  $presentations = $this->viewSettings->getSelectablePresentationModes();
371  $effectivePresentation = $this->viewSettings->getEffectivePresentationMode();
372  // @todo: set checked on $presentation === $effectivePresentation
373  foreach ($presentations as $presentation) {
374  $this->ctrl->setParameter($this, 'presentation', $presentation);
375  $presentationCommands[] = [
376  'txt' => $this->lng->txt('pd_presentation_mode_' . $presentation),
377  'url' => $this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),
378  'xxxasyncUrl' => $this->ctrl->getLinkTarget($this, 'changePDItemPresentation', '', true),
379  'active' => $presentation === $effectivePresentation,
380  ];
381  $this->ctrl->setParameter($this, 'presentation', null);
382  }
383 
384  if (count($presentationCommands) > 1) {
385  $commandGroups[] = $presentationCommands;
386  }
387 
388  $commandGroups[] = [
389  [
390  'txt' => $this->viewSettings->isSelectedItemsViewActive() ?
391  $this->lng->txt('pd_remove_multiple') :
392  $this->lng->txt('pd_unsubscribe_multiple_memberships'),
393  'url' => $this->ctrl->getLinkTarget($this, 'manage'),
394  'asyncUrl' => null,
395  'active' => false,
396  ]
397  ];
398 
399  return $commandGroups;
400  }
+ Here is the caller graph for this function:

◆ getHTML()

ilPDSelectedItemsBlockGUI::getHTML ( )

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

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

Referenced by initAndShow().

241  {
242  global $DIC;
243 
244  $this->setTitle($this->getViewTitle());
245 
246  $DIC->database()->useSlave(true);
247 
248  // workaround to show details row
249  $this->setData([['dummy']]);
250 
251  /*
252  ilObjectListGUI::prepareJSLinks('',
253  $this->ctrl->getLinkTargetByClass(['ilcommonactiondispatchergui', 'ilnotegui'], '', '', true, false),
254  $this->ctrl->getLinkTargetByClass(['ilcommonactiondispatchergui', 'iltagginggui'], '', '', true, false)
255  );*/
256 
257  $DIC['ilHelp']->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, $this->blockView->getScreenId());
258 
259  // $this->setContent($this->getViewBlockHtml());
260 
261  // if ('' === $this->getContent()) {
262  // $this->setEnableDetailRow(false);
263  // }
264 
265  $this->ctrl->clearParameters($this);
266 
267  $DIC->database()->useSlave(false);
268 
269  return parent::getHTML();
270  }
setTitle($a_title)
Set Title.
setData($a_data)
Set Data.
$DIC
Definition: xapitoken.php:46
const ID_PART_SCREEN
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLegacyContent()

ilPDSelectedItemsBlockGUI::getLegacyContent ( )
protected

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

References Vendor\Package\$e, $factory, ilBlockGUI\addBlockCommand(), ilObjectActivation\addListGUIActivationProperty(), getGroupedCommandsForView(), and ui().

811  : string
812  {
813  $renderer = $this->ui->renderer();
814  $factory = $this->ui->factory();
815 
816  $this->list_factory = new ilPDSelectedItemsBlockListGUIFactory($this, $this->blockView);
817 
818  $groupedCommands = $this->getGroupedCommandsForView();
819  foreach ($groupedCommands as $group) {
820  foreach ($group as $command) {
821  $this->addBlockCommand(
822  (string) $command['url'],
823  (string) $command['txt'],
824  (string) $command['asyncUrl']
825  );
826  }
827  }
828 
829  $groupedItems = $this->blockView->getItemGroups();
830 
831  $subs = [];
832  foreach ($groupedItems as $group) {
833  $cards = [];
834 
835  foreach ($group->getItems() as $item) {
836  try {
837  $itemListGUI = $this->list_factory->byType($item['type']);
839 
840  $cards[] = $this->getCardForData($item);
841  } catch (ilException $e) {
842  continue;
843  }
844  }
845  if (count($cards) > 0) {
846  $subs[] = $factory->panel()->sub(
847  $group->getLabel(),
848  $factory->deck($cards)->withNormalCardsSize()
849  );
850  }
851  }
852 
853 
854  return $renderer->render($subs);
855  }
Class ilPDSelectedItemsBlockListGUIFactory.
ui()
Definition: ui.php:5
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

◆ getListItemGroups()

ilPDSelectedItemsBlockGUI::getListItemGroups ( )
protected

Get items.

Returns
[]

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

References $DIC, Vendor\Package\$e, $factory, ilBlockGUI\addBlockCommand(), ilObjectActivation\addListGUIActivationProperty(), getGroupedCommandsForView(), and ilBlockGUI\getListItemForData().

700  : array
701  {
702  global $DIC;
703  $factory = $DIC->ui()->factory();
704 
705  // $data = $this->loadData();
706 
707  $this->list_factory = new ilPDSelectedItemsBlockListGUIFactory($this, $this->blockView);
708 
709  $groupedItems = $this->blockView->getItemGroups();
710  $groupedCommands = $this->getGroupedCommandsForView();
711  foreach ($groupedCommands as $group) {
712  foreach ($group as $command) {
713  $this->addBlockCommand(
714  (string) $command['url'],
715  (string) $command['txt'],
716  (string) $command['asyncUrl']
717  );
718  }
719  }
720 
723 
724 
725  $item_groups = [];
726  $list_items = [];
727 
728  foreach ($groupedItems as $group) {
729  $list_items = [];
730 
731  foreach ($group->getItems() as $item) {
732  try {
733  $itemListGUI = $this->list_factory->byType($item['type']);
735 
736  $list_items[] = $this->getListItemForData($item);
737  } catch (ilException $e) {
738  continue;
739  }
740  }
741  if (count($list_items) > 0) {
742  $item_groups[] = $factory->item()->group((string) $group->getLabel(), $list_items);
743  }
744  }
745 
746  /* @todo: checkboxes
747  if ($this->blockView->isInManageMode() && $this->blockView->supportsSelectAll()) {
748  // #11355 - see ContainerContentGUI::renderSelectAllBlock()
749  $this->tpl->setCurrentBlock('select_all_row');
750  $this->tpl->setVariable('CHECKBOXNAME', 'ilToolbarSelectAll');
751  $this->tpl->setVariable('SEL_ALL_PARENT', 'ilToolbar');
752  $this->tpl->setVariable('SEL_ALL_CB_NAME', 'id');
753  $this->tpl->setVariable('TXT_SELECT_ALL', $this->lng->txt('select_all'));
754  $this->tpl->parseCurrentBlock();
755  }
756 
757  return $this->tpl->get();
758  */
759 
760  return $item_groups;
761  }
Class ilPDSelectedItemsBlockListGUIFactory.
getListItemForData(array $data)
Get list item for data array.
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
$DIC
Definition: xapitoken.php:46
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDSelectedItemsBlockGUI::getNoItemFoundContent ( )

No item entry.

Returns
string

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

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

892  : string
893  {
894 
895  $txt = $this->lng->txt("rep_fav_intro1") . "<br>";
896  $txt .= sprintf(
897  $this->lng->txt('rep_fav_intro2'),
898  $this->getRepositoryTitle()
899  ) . "<br>";
900  $txt .= $this->lng->txt("rep_fav_intro3");
901  $mbox = $this->ui->factory()->messageBox()->info($txt);
902  $mbox = $mbox->withLinks([$this->ui->factory()->link()->standard($this->getRepositoryTitle(), ilLink::_getStaticLink(1, 'root', true))]);
903  return $this->ui->renderer()->render($mbox);
904  }
ui()
Definition: ui.php:5
$txt
Definition: error.php:13
+ Here is the call graph for this function:

◆ getRepositoryTitle()

ilPDSelectedItemsBlockGUI::getRepositoryTitle ( )
protected
Returns
string

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

References $nd, and ilBlockGUI\$title.

Referenced by getNoItemFoundContent().

910  {
911  $nd = $this->tree->getNodeData($this->tree->getRootId());
912  $title = $nd['title'];
913 
914  if ($title == 'ILIAS') {
915  $title = $this->lng->txt('repository');
916  }
917 
918  return $title;
919  }
$nd
Definition: error.php:12
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDSelectedItemsBlockGUI::getScreenMode ( )
static

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

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

203  {
204  $cmd = $_GET['cmd'];
205  if ($cmd == 'post') {
206  $cmd = $_POST['cmd'];
207  $cmd = array_shift(array_keys($cmd));
208  }
209 
210  switch ($cmd) {
211  case 'confirmRemove':
212  case 'manage':
213  return IL_SCREEN_FULL;
214 
215  default:
216  return IL_SCREEN_SIDE;
217  }
218  }
$_GET["client_id"]
const IL_SCREEN_FULL
const IL_SCREEN_SIDE
$_POST["username"]

◆ getViewBlockHtml()

ilPDSelectedItemsBlockGUI::getViewBlockHtml ( )
protected
Returns
string

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

References renderGroupedItems().

475  : string
476  {
477  return $this->renderGroupedItems(
478  $this->blockView->getItemGroups()
479  );
480  }
renderGroupedItems(array $grouped_items, $showHeader=true)
+ Here is the call graph for this function:

◆ getViewSettings()

◆ getViewTitle()

ilPDSelectedItemsBlockGUI::getViewTitle ( )
protected

Get view title.

Returns
string

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

Referenced by getHTML().

233  {
234  return $this->blockView->getTitle();
235  }
+ Here is the caller graph for this function:

◆ initAndShow()

ilPDSelectedItemsBlockGUI::initAndShow ( )
protected

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

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

Referenced by changePDItemPresentation(), and changePDItemSorting().

509  {
510  $this->initViewSettings();
511 
512  if ($this->ctrl->isAsynch()) {
513  echo $this->getHTML();
514  exit;
515  }
516 
517  if ($_GET["manage"]) {
518  $this->ctrl->redirect($this, 'manage');
519  }
520 
521  $this->returnToContext();
522  }
exit
Definition: login.php:29
$_GET["client_id"]
initViewSettings()
Evaluates the view settings of this block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initViewSettings()

ilPDSelectedItemsBlockGUI::initViewSettings ( )
protected

Evaluates the view settings of this block.

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

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

Referenced by __construct(), and initAndShow().

129  {
130  $this->viewSettings = new ilPDSelectedItemsBlockViewSettings(
131  $this->user,
133  );
134 
135  $this->viewSettings->parse();
136 
137  $this->blockView = ilPDSelectedItemsBlockViewGUI::bySettings($this->viewSettings);
138 
139  $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
140  }
user()
Definition: user.php:4
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilPDSelectedItemsBlockGUI::isRepositoryObject ( )
protected

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

223  : bool
224  {
225  return false;
226  }

◆ manageObject()

ilPDSelectedItemsBlockGUI::manageObject ( )

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

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

525  {
526  $this->blockView->setIsInManageMode(true);
527 
528  $top_tb = new ilToolbarGUI();
529  $top_tb->setFormAction($this->ctrl->getFormAction($this));
530  $top_tb->setLeadingImage(ilUtil::getImagePath('arrow_upright.svg'), $this->lng->txt('actions'));
531 
532  $button = ilSubmitButton::getInstance();
533  $grouped_items = $this->blockView->getItemGroups();
534  if ($this->viewSettings->isSelectedItemsViewActive()) {
535  $button->setCaption('remove');
536  } else {
537  $button->setCaption('pd_unsubscribe_memberships');
538  foreach ($grouped_items as $group) {
539  $items = $group->getItems();
540  $group->setItems([]);
541  foreach ($items as $item) {
542  if ($this->rbacsystem->checkAccess('leave', $item['ref_id'])) {
543  if (
544  $item['type'] !== 'crs' ||
545  ilParticipants::getInstance($item['ref_id'])->checkLastAdmin([$this->user->getId()])
546  ) {
547  $group->pushItem($item);
548  }
549  }
550  }
551  }
552  }
553  $button->setCommand('confirmRemove');
554  $top_tb->addStickyItem($button);
555 
556  $top_tb->setCloseFormTag(false);
557 
558  $bot_tb = new ilToolbarGUI();
559  $bot_tb->setLeadingImage(ilUtil::getImagePath('arrow_downright.svg'), $this->lng->txt('actions'));
560  $bot_tb->addStickyItem($button);
561  $bot_tb->setOpenFormTag(false);
562 
563  return $top_tb->getHTML() . $this->renderManageList($grouped_items) . $bot_tb->getHTML();
564  }
user()
Definition: user.php:4
static getInstance($a_ref_id)
Get instance by ref_id.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilPDSelectedItemsBlockGUI::removeFromDeskObject ( )

Remove from desktop public.

Implements ilDesktopItemHandling.

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

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

184  {
185  $this->lng->loadLanguageModule("rep");
186  $this->favourites->remove($this->user->getId(), (int) $_GET["item_ref_id"]);
187  ilUtil::sendSuccess($this->lng->txt("rep_removed_from_favourites"), true);
188  $this->returnToContext();
189  }
$_GET["client_id"]
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ renderGroupedItems()

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

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

References $ctrl, $lng, $objectService, $user, ilPDObjectsListRenderer\render(), ilPDObjectsTileRenderer\render(), and ui().

Referenced by getViewBlockHtml().

435  : string
436  {
437  if (0 === count($grouped_items)) {
438  return '';
439  }
440 
441  $listFactory = new ilPDSelectedItemsBlockListGUIFactory($this, $this->blockView);
442 
443  if ($this->viewSettings->isTilePresentation()) {
444  $renderer = new ilPDObjectsTileRenderer(
445  $this->blockView,
446  $this->ui->factory(),
447  $this->ui->renderer(),
448  $listFactory,
449  $this->user,
450  $this->lng,
453  );
454 
455  return $renderer->render($grouped_items, $showHeader);
456  }
457 
458  $renderer = new ilPDObjectsListRenderer(
459  $this->blockView,
460  $this->ui->factory(),
461  $this->ui->renderer(),
462  $listFactory,
463  $this->user,
464  $this->lng,
467  );
468 
469  return $renderer->render($grouped_items, $showHeader);
470  }
Class ilPDSelectedItemsListRenderer.
Class ilPDSelectedItemsBlockListGUIFactory.
ui()
Definition: ui.php:5
Class ilPDObjectsTileRenderer.
render(array $groupedItems, bool $showHeader)
render(array $groupedItems, bool $showHeader)
+ 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 857 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by manageObject().

857  : string
858  {
859  $ui = $this->ui;
860 
861  $this->ctrl->setParameter($this, "manage", "1");
862  $groupedCommands = $this->getGroupedCommandsForView(true);
863  foreach ($groupedCommands as $group) {
864  foreach ($group as $command) {
865  $this->addBlockCommand(
866  (string) $command['url'],
867  (string) $command['txt'],
868  (string) $command['asyncUrl']
869  );
870  }
871  }
872 
873  // action drop down
874  if (is_array($groupedCommands[0])) {
875  $actions = array_map(function ($item) use ($ui) {
876  return $ui->factory()->link()->standard($item["txt"], $item["url"]);
877  }, $groupedCommands[0]);
878  if (count($actions) > 0) {
879  $dd = $this->ui->factory()->dropdown()->standard($actions);
880  $this->main_tpl->setHeaderActionMenu($ui->renderer()->render($dd));
881  }
882  }
883 
884  return (new ilDashObjectsTableRenderer($this))->render($grouped_items);
885  }
Dashboard objects table renderer.
ui()
Definition: ui.php:5
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnToContext()

ilPDSelectedItemsBlockGUI::returnToContext ( )
protected

Return to context.

Parameters

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

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

175  {
176  $this->ctrl->setParameterByClass('ildashboardgui', 'view', $this->viewSettings->getCurrentView());
177  $this->ctrl->redirectByClass('ildashboardgui', 'show');
178  }
+ Here is the caller graph for this function:

◆ setContent()

ilPDSelectedItemsBlockGUI::setContent ( string  $a_content)
protected
Parameters
string$a_content

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

References $a_content.

308  {
309  $this->content = $a_content;
310  }
$a_content
Definition: workflow.php:93

◆ setFooterLinks()

ilPDSelectedItemsBlockGUI::setFooterLinks ( )
protected

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

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

407  {
408  if ('' === $this->getContent()) {
409  $this->setEnableNumInfo(false);
410  return;
411  }
412 
413  if ($this->blockView->isInManageMode()) {
414  return;
415  }
416 
417  // @todo: handle $command['active']
418  $groupedCommands = $this->getGroupedCommandsForView();
419  foreach ($groupedCommands as $group) {
420  foreach ($group as $command) {
421  $this->addBlockCommand(
422  $command['url'],
423  $command['txt'],
424  $command['asyncUrl']
425  );
426  }
427  }
428  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDSelectedItemsBlockGUI::$block_type = 'pditems'
static

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

◆ $blockView

ilPDSelectedItemsBlockGUI::$blockView
protected

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

◆ $content

ilPDSelectedItemsBlockGUI::$content = ''
protected

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

Referenced by getContent().

◆ $ctrl

ilPDSelectedItemsBlockGUI::$ctrl
protected

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

Referenced by renderGroupedItems().

◆ $favourites

ilPDSelectedItemsBlockGUI::$favourites
protected

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

◆ $http

ilPDSelectedItemsBlockGUI::$http
protected

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

◆ $lng

ilPDSelectedItemsBlockGUI::$lng
protected

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

Referenced by renderGroupedItems().

◆ $manage

ilPDSelectedItemsBlockGUI::$manage = false
protected

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

Referenced by getGroupedCommandsForView().

◆ $new_rendering

ilPDSelectedItemsBlockGUI::$new_rendering = true
protected

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

◆ $obj_definition

ilPDSelectedItemsBlockGUI::$obj_definition
protected

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

◆ $objectService

ilPDSelectedItemsBlockGUI::$objectService
protected

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

Referenced by renderGroupedItems().

◆ $rbacsystem

ilPDSelectedItemsBlockGUI::$rbacsystem
protected

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

◆ $settings

ilPDSelectedItemsBlockGUI::$settings
protected

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

◆ $tree

ilPDSelectedItemsBlockGUI::$tree
protected

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

◆ $ui

ilPDSelectedItemsBlockGUI::$ui
protected

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

Referenced by renderManageList().

◆ $user

ilPDSelectedItemsBlockGUI::$user
protected

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

Referenced by renderGroupedItems().

◆ $viewSettings

ilPDSelectedItemsBlockGUI::$viewSettings
protected

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

Referenced by getViewSettings().


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