ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilBlockGUI Class Reference

This class represents a block method of a block. More...

+ Inheritance diagram for ilBlockGUI:
+ Collaboration diagram for ilBlockGUI:

Public Member Functions

 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 checkOffset (int $offset)
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="", RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 getNoItemFoundContent ()
 

Static Public Member Functions

static getScreenMode ()
 

Data Fields

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
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Protected Attributes

ILIAS UI Renderer $renderer
 
Factory $factory
 
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
 

Private Attributes

int $offset = 0
 
int $limit
 
bool $enableedit
 
string $subtitle
 
int $refid
 
string $rowtemplatename
 
string $rowtemplatedir
 
array $modals = []
 
array $sort_options = []
 
array $presentations = []
 
string $activePresentation = ''
 
string $activeSortOption = ''
 
string $sort_target = ''
 
ILIAS HTTP GlobalHttpState $http
 

Detailed Description

This class represents a block method of a block.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilBlockGUI::__construct ( )

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

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), getBlockType(), ILIAS\FileDelivery\http(), ilYuiUtil\initConnection(), isRepositoryObject(), ILIAS\Repository\lng(), setLimit(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by ilPDNewsBlockGUI\__construct().

98  {
99  global $DIC;
100  $this->factory = $DIC->ui()->factory();
101  $this->renderer = $DIC->ui()->renderer();
102 
103  $this->http = $DIC->http();
104  $block_service = new ILIAS\Block\Service($DIC);
105  $this->block_manager = $block_service->internal()
106  ->domain()
107  ->block();
108  $this->request = $block_service->internal()
109  ->gui()
110  ->standardRequest();
111 
112 
113  // default presentation
114  $this->presentation = self::PRES_SEC_LEG;
115 
116  $this->user = $DIC->user();
117  $this->ctrl = $DIC->ctrl();
118  $this->access = $DIC->access();
119  $this->lng = $DIC->language();
120  $this->main_tpl = $DIC["tpl"];
121  $this->obj_def = $DIC["objDefinition"];
122  $this->ui = $DIC->ui();
123 
125  $this->main_tpl->addJavaScript("./Services/Block/js/ilblockcallback.js");
126 
127  $this->setLimit((int) $this->user->getPref("hits_per_page"));
128 
129  $this->requested_ref_id = $this->request->getRefId();
130  }
setLimit(int $a_limit)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ addBlockCommand()

ilBlockGUI::addBlockCommand ( string  $a_href,
string  $a_text,
string  $a_onclick = "",
RoundTrip  $modal = null 
)

Definition at line 353 of file class.ilBlockGUI.php.

Referenced by ilCalendarSelectionBlockGUI\__construct(), ilDashboardBlockGUI\addCommandActions(), addRepoCommands(), ilWikiImportantPagesBlockGUI\getHTML(), ilPollBlockGUI\getHTML(), ilPDNewsBlockGUI\getHTML(), ilNewsForContextBlockGUI\getHTML(), ilCalendarBlockGUI\getHTML(), and ilCalendarBlockGUI\initCommands().

353  : void
354  {
355  $this->block_commands[] = [
356  "href" => $a_href,
357  "text" => $a_text,
358  "onclick" => $a_onclick,
359  "modal" => $modal
360  ];
361  }
+ Here is the caller graph for this function:

◆ addPresentation()

ilBlockGUI::addPresentation ( string  $label,
string  $target,
bool  $active 
)

Definition at line 787 of file class.ilBlockGUI.php.

Referenced by ilDashboardBlockGUI\addCommandActions().

787  : void
788  {
789  $this->presentations[$label] = $target;
790  if ($active) {
791  $this->activePresentation = $label;
792  }
793  }
+ Here is the caller graph for this function:

◆ addRepoCommands()

ilBlockGUI::addRepoCommands ( )
protected

Add repo commands.

Definition at line 639 of file class.ilBlockGUI.php.

References $access, $ctrl, $lng, $obj_def, ilObject\_lookupType(), addBlockCommand(), ilRBACAccessHandler\checkAccess(), ilObjectDefinition\getClassName(), ilCtrl\getLinkTargetByClass(), getRefId(), getRepositoryMode(), isRepositoryObject(), ilCtrl\setParameterByClass(), and ilLanguage\txt().

Referenced by getHTML().

639  : void
640  {
642  $lng = $this->lng;
643  $ctrl = $this->ctrl;
645 
646  if ($this->getRepositoryMode() && $this->isRepositoryObject()) {
647  // #10993
648  // @todo: fix this in new presentation somehow
649  /*
650  if ($this->getAdminCommands()) {
651  $this->tpl->setCurrentBlock("block_check");
652  $this->tpl->setVariable("BL_REF_ID", $this->getRefId());
653  $this->tpl->parseCurrentBlock();
654  }*/
655 
656  if ($access->checkAccess("delete", "", $this->getRefId())) {
657  $this->addBlockCommand(
658  "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $this->requested_ref_id . "&cmd=delete" .
659  "&item_ref_id=" . $this->getRefId(),
660  $lng->txt("delete")
661  );
662 
663  $this->addBlockCommand(
664  "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $this->requested_ref_id . "&cmd=link" .
665  "&item_ref_id=" . $this->getRefId(),
666  $lng->txt("link")
667  );
668 
669  // see ilObjectListGUI::insertCutCommand();
670  $this->addBlockCommand(
671  "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $this->requested_ref_id . "&cmd=cut" .
672  "&item_ref_id=" . $this->getRefId(),
673  $lng->txt("move")
674  );
675  }
676 
677  // #14595 - see ilObjectListGUI::insertCopyCommand()
678  if ($access->checkAccess("copy", "", $this->getRefId())) {
679  $parent_type = ilObject::_lookupType($this->requested_ref_id, true);
680  $parent_gui = "ilObj" . $obj_def->getClassName($parent_type) . "GUI";
681 
682  $ctrl->setParameterByClass("ilobjectcopygui", "source_id", $this->getRefId());
683  $copy_cmd = $ctrl->getLinkTargetByClass(
684  array("ilrepositorygui", $parent_gui, "ilobjectcopygui"),
685  "initTargetSelection"
686  );
687 
688  // see ilObjectListGUI::insertCopyCommand();
689  $this->addBlockCommand(
690  $copy_cmd,
691  $lng->txt("copy")
692  );
693  }
694  }
695  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
ilObjectDefinition $obj_def
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
setParameterByClass(string $a_class, string $a_parameter, $a_value)
getClassName(string $obj_name)
addBlockCommand(string $a_href, string $a_text, string $a_onclick="", RoundTrip $modal=null)
isRepositoryObject()
Returns whether block has a corresponding repository object.
ilAccessHandler $access
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSortOption()

ilBlockGUI::addSortOption ( string  $option,
string  $label,
bool  $active 
)

Definition at line 773 of file class.ilBlockGUI.php.

Referenced by ilDashboardBlockGUI\addCommandActions().

773  : void
774  {
775  if ($active) {
776  $this->activeSortOption = $label;
777  } else {
778  $this->sort_options[$option] = $label;
779  }
780  }
+ Here is the caller graph for this function:

◆ checkOffset()

ilBlockGUI::checkOffset ( int  $offset)

Definition at line 220 of file class.ilBlockGUI.php.

Referenced by setOffset().

220  : bool
221  {
222  return $offset <= $this->max_count && $offset >= 0;
223  }
+ Here is the caller graph for this function:

◆ getActionsForPanel()

ilBlockGUI::getActionsForPanel ( )
protected

Definition at line 697 of file class.ilBlockGUI.php.

References $id, getBlockCommands(), getBlockType(), getTitle(), ILIAS\Repository\lng(), specialCharsAsEntities(), and ILIAS\UI\Component\JavaScriptBindable\withOnLoadCode().

Referenced by getHTML().

697  : ?Dropdown
698  {
699  // actions
700  $actions = [];
701  $modals = [];
702 
703  foreach ($this->getBlockCommands() as $command) {
704  $href = ($command['onclick'] !== '')
705  ? ''
706  : $command['href'];
707  $button = $this->factory->button()->shy($command['text'], $href);
708  if ($command['onclick']) {
709  $button = $button->withOnLoadCode(function ($id) use ($command) {
710  return
711  "$(\"#$id\").click(function() { ilBlockJSHandler('" . "block_" . $this->getBlockType() . "_" . $this->block_id .
712  "','" . $command["onclick"] . "');});";
713  });
714  }
715 
716  if (isset($command['modal']) && $command['modal'] instanceof Modal) {
717  $button = $button->withOnClick($command['modal']->getShowSignal());
718  $this->modals[] = $command['modal'];
719  }
720  $actions[] = $button;
721  }
722 
723  if (count($actions) > 0) {
724  $actions = $this->factory->dropdown()->standard($actions)
725  ->withAriaLabel(sprintf(
726  $this->lng->txt('actions_for'),
727  $this->specialCharsAsEntities($this->getTitle())
728  ));
729  return $actions;
730  }
731  return null;
732  }
This describes commonalities between the different modals.
Definition: Modal.php:34
specialCharsAsEntities(string $string)
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdminCommands()

ilBlockGUI::getAdminCommands ( )

Definition at line 283 of file class.ilBlockGUI.php.

References $admincommands.

Referenced by ilPollBlockGUI\fillRow().

283  : bool
284  {
285  return $this->admincommands;
286  }
+ Here is the caller graph for this function:

◆ getAsynch()

ilBlockGUI::getAsynch ( )

Use this for final get before sending asynchronous output (ajax) per echo to output.

Definition at line 489 of file class.ilBlockGUI.php.

References ILIAS\UI\examples\Symbol\Glyph\Header\header().

489  : string
490  {
491  header("Content-type: text/html; charset=UTF-8");
492  return $this->tpl->get();
493  }
+ Here is the call graph for this function:

◆ getBlockCommands()

ilBlockGUI::getBlockCommands ( )

Definition at line 363 of file class.ilBlockGUI.php.

References $block_commands.

Referenced by getActionsForPanel().

363  : array
364  {
365  return $this->block_commands;
366  }
array $block_commands
+ Here is the caller graph for this function:

◆ getBlockId()

ilBlockGUI::getBlockId ( )

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

References $block_id.

Referenced by ilCalendarBlockGUI\__construct(), getConfigParameter(), ilNewsForContextBlockGUI\getDynamicReload(), ilNewsForContextBlockGUI\getJSEnabler(), getMoveParameter(), getNavParameter(), and ilCalendarBlockGUI\setSeed().

174  : string
175  {
176  return $this->block_id;
177  }
+ Here is the caller graph for this function:

◆ getBlockType()

ilBlockGUI::getBlockType ( )
abstract

◆ getConfigParameter()

ilBlockGUI::getConfigParameter ( )
final

Definition at line 333 of file class.ilBlockGUI.php.

References getBlockId(), and getBlockType().

333  : string
334  {
335  return $this->getBlockType() . "_" . $this->getBlockId() . "_blconf";
336  }
+ Here is the call graph for this function:

◆ getData()

ilBlockGUI::getData ( )

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

References $data.

Referenced by ilNewsForContextBlockGUI\getHTML(), ilPollBlockGUI\getLegacyContent(), ilNewsForContextBlockGUI\getOverview(), loadData(), setOffset(), and ilNewsForContextBlockGUI\showNews().

154  : array
155  {
156  return $this->data;
157  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilBlockGUI::getEnableEdit ( )

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

References $enableedit.

Referenced by ilNewsForContextBlockGUI\executeCommand(), and ilNewsForContextBlockGUI\getHTML().

240  : bool
241  {
242  return $this->enableedit;
243  }
+ Here is the caller graph for this function:

◆ getEnableNumInfo()

ilBlockGUI::getEnableNumInfo ( )

Definition at line 293 of file class.ilBlockGUI.php.

References $enablenuminfo.

293  : bool
294  {
295  return $this->enablenuminfo;
296  }

◆ getGuiObject()

ilBlockGUI::getGuiObject ( )

Definition at line 189 of file class.ilBlockGUI.php.

References $gui_object.

189  : object
190  {
191  return $this->gui_object;
192  }
object $gui_object

◆ getHTML()

ilBlockGUI::getHTML ( )

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

References $access, $ctrl, addRepoCommands(), ilRBACAccessHandler\checkAccess(), getActionsForPanel(), getBlockType(), getListItemGroups(), getPresentation(), getTitle(), getViewControlsForPanel(), handleNavigation(), initCommands(), ilCtrl\isAsynch(), isRepositoryObject(), send(), and specialCharsAsEntities().

Referenced by ilPDNewsBlockGUI\getHTML(), and sortObject().

377  : string
378  {
379  $this->initCommands();
380 
382  $panel = null;
383 
384  $ctrl = $this->ctrl;
385 
386  if ($this->isRepositoryObject()) {
387  if (!$access->checkAccess("read", "", $this->getRefId())) {
388  return "";
389  }
390  }
391 
392  $this->addRepoCommands();
393 
394  switch ($this->getPresentation()) {
395  case self::PRES_SEC_LEG:
396  $panel = $this->factory->panel()->secondary()->legacy(
397  $this->specialCharsAsEntities($this->getTitle()),
398  $this->factory->legacy($this->getLegacyContent())
399  );
400  break;
401 
402  case self::PRES_MAIN_LEG:
403  $panel = $this->factory->panel()->standard(
404  $this->specialCharsAsEntities($this->getTitle()),
405  $this->factory->legacy($this->getLegacyContent())
406  );
407  break;
408 
409  case self::PRES_SEC_LIST:
410  $this->handleNavigation();
411  $panel = $this->factory->panel()->secondary()->listing(
412  $this->specialCharsAsEntities($this->getTitle()),
413  $this->getListItemGroups()
414  );
415  break;
416 
417  case self::PRES_MAIN_TILE:
418  case self::PRES_MAIN_LIST:
419  $this->handleNavigation();
420  $panel = $this->factory->panel()->listing()->standard(
421  $this->specialCharsAsEntities($this->getTitle()),
422  $this->getListItemGroups()
423  );
424  break;
425  }
426 
427  // check for empty list panel
428  if (in_array($this->getPresentation(), [self::PRES_SEC_LIST, self::PRES_MAIN_LIST], true) &&
429  ($panel->getItemGroups() === [] || (count($panel->getItemGroups()) === 1 && $panel->getItemGroups()[0]->getItems() === []))) {
430  if ($this->getPresentation() === self::PRES_SEC_LIST) {
431  $panel = $this->factory->panel()->secondary()->legacy(
432  $this->specialCharsAsEntities($this->getTitle()),
433  $this->factory->legacy($this->getNoItemFoundContent())
434  );
435  } else {
436  $panel = $this->factory->panel()->standard(
437  $this->specialCharsAsEntities($this->getTitle()),
438  $this->factory->legacy($this->getNoItemFoundContent())
439  );
440  }
441  }
442 
443  $actions = $this->getActionsForPanel();
444  if ($actions !== null) {
445  $panel = $panel->withActions($actions);
446  }
447  $viewControls = $this->getViewControlsForPanel();
448  if ($viewControls !== [] &&
449  (
450  $panel instanceof StandardPanel ||
451  $panel instanceof SecondaryListingPanel ||
452  $panel instanceof SecondaryLegacyPanel ||
453  $panel instanceof StandardListingPanel
454  )
455  ) {
456  $panel = $panel->withViewControls($viewControls);
457  }
458 
459  if ($ctrl->isAsynch()) {
460  $html = $this->renderer->renderAsync([$panel, ...$this->modals]);
461  } else {
462  $html = $this->renderer->render([$panel, ...$this->modals]);
463  }
464 
465 
466  if ($ctrl->isAsynch()) {
467  $this->send($html);
468  } else {
469  // return incl. wrapping div with id
470  $html = '<div id="' . 'block_' . $this->getBlockType() . '_' . $this->block_id . '">' .
471  $html . '</div>';
472  }
473 
474  return $html;
475  }
handleNavigation()
Handle navigation.
send(string $output)
Send.
addRepoCommands()
Add repo commands.
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
specialCharsAsEntities(string $string)
getListItemGroups()
Get items.
isRepositoryObject()
Returns whether block has a corresponding repository object.
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLegacyContent()

ilBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Definition at line 501 of file class.ilBlockGUI.php.

501  : string
502  {
503  return "";
504  }

◆ getLimit()

ilBlockGUI::getLimit ( )

Definition at line 230 of file class.ilBlockGUI.php.

References $limit.

Referenced by getPaginationViewControl(), handleNavigation(), and loadData().

230  : int
231  {
232  return $this->limit;
233  }
+ Here is the caller graph for this function:

◆ getListItemForData()

ilBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|

Definition at line 512 of file class.ilBlockGUI.php.

Referenced by getListItemGroups().

513  {
514  return null;
515  }
Common interface to all items.
Definition: Item.php:31
+ Here is the caller graph for this function:

◆ getListItemGroups()

ilBlockGUI::getListItemGroups ( )
protected

Get items.

Returns
[]

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

References $DIC, getListItemForData(), and loadData().

Referenced by getHTML().

564  : array
565  {
566  global $DIC;
567  $factory = $DIC->ui()->factory();
568 
569  $data = $this->loadData();
570 
571  $items = [];
572 
573  foreach ($data as $record) {
574  $item = $this->getListItemForData($record);
575  if ($item !== null) {
576  $items[] = $item;
577  }
578  }
579 
580  $item_group = $factory->item()->group("", $items);
581 
582  return [$item_group];
583  }
Factory $factory
global $DIC
Definition: feed.php:28
getListItemForData(array $data)
Get list item for data array.
loadData()
Load data for current page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMoveParameter()

ilBlockGUI::getMoveParameter ( )
final

Definition at line 338 of file class.ilBlockGUI.php.

References getBlockId(), and getBlockType().

338  : string
339  {
340  return $this->getBlockType() . "_" . $this->getBlockId() . "_blmove";
341  }
+ Here is the call graph for this function:

◆ getNavParameter()

ilBlockGUI::getNavParameter ( )
final

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

References getBlockId(), and getBlockType().

Referenced by getPaginationViewControl(), and handleNavigation().

328  : string
329  {
330  return $this->getBlockType() . "_" . $this->getBlockId() . "_blnav";
331  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNoItemFoundContent()

ilBlockGUI::getNoItemFoundContent ( )

Definition at line 808 of file class.ilBlockGUI.php.

References ILIAS\Repository\lng().

808  : string
809  {
810  return $this->lng->txt("no_items");
811  }
+ Here is the call graph for this function:

◆ getOffset()

ilBlockGUI::getOffset ( )

Definition at line 215 of file class.ilBlockGUI.php.

References $offset.

Referenced by getPaginationViewControl(), and loadData().

215  : int
216  {
217  return $this->offset;
218  }
+ Here is the caller graph for this function:

◆ getPaginationViewControl()

ilBlockGUI::getPaginationViewControl ( )

Fill previous/next row.

Definition at line 588 of file class.ilBlockGUI.php.

References $block_id, $ctrl, $DIC, getBlockType(), getLimit(), getNavParameter(), getOffset(), ILIAS\UI\Component\ViewControl\Factory\pagination(), and ilCtrl\setParameterByClass().

Referenced by getViewControlsForPanel().

589  {
590  global $DIC;
591  $factory = $DIC->ui()->factory();
592 
593  $ilCtrl = $this->ctrl;
594 
595  if ($this->max_count <= $this->getLimit()) {
596  return null;
597  }
598 
599 
600  // $ilCtrl->setParameterByClass("ilcolumngui",
601  // $this->getNavParameter(), "::" . $prevoffset);
602 
603  // ajax link
604  $ilCtrl->setParameterByClass(
605  "ilcolumngui",
606  "block_id",
607  "block_" . $this->getBlockType() . "_" . $this->block_id
608  );
609  $block_id = "block_" . $this->getBlockType() . "_" . $this->block_id;
610  $onclick = $ilCtrl->getLinkTargetByClass(
611  "ilcolumngui",
612  "updateBlock",
613  "",
614  true
615  );
616  $ilCtrl->setParameterByClass(
617  "ilcolumngui",
618  "block_id",
619  ""
620  );
621 
622  // normal link
623  $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "", "", false, false);
624 
625  //$ilCtrl->setParameterByClass("ilcolumngui",
626  // $this->getNavParameter(), "");
627 
628  return $factory->viewControl()->pagination()
629  ->withTargetURL($href, $this->getNavParameter() . "page")
630  ->withTotalEntries($this->max_count)
631  ->withPageSize($this->getLimit())
632  ->withMaxPaginationButtons(1)
633  ->withCurrentPage($this->getOffset() / $this->getLimit());
634  }
Factory $factory
setParameterByClass(string $a_class, string $a_parameter, $a_value)
This describes a Pagination Control.
Definition: Pagination.php:32
global $DIC
Definition: feed.php:28
pagination()
description: purpose: > Pagination allows structured data being displayed in chunks by limiting the ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPresentation()

ilBlockGUI::getPresentation ( )

Definition at line 164 of file class.ilBlockGUI.php.

References $presentation.

Referenced by getHTML(), getViewControlsForPanel(), and ilCalendarBlockGUI\getViewControlsForPanel().

164  : int
165  {
166  return $this->presentation;
167  }
+ Here is the caller graph for this function:

◆ getProperty()

ilBlockGUI::getProperty ( string  $a_property)

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

Referenced by ilNewsForContextBlockGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilNewsForContextBlockGUI\initSettingsForm(), ilNewsForContextBlockGUI\saveSettings(), and ilNewsForContextBlockGUI\showNews().

307  : ?string
308  {
309  return $this->property[$a_property] ?? null;
310  }
+ Here is the caller graph for this function:

◆ getRefId()

ilBlockGUI::getRefId ( )

Definition at line 273 of file class.ilBlockGUI.php.

References $refid.

Referenced by addRepoCommands(), ilPollBlockGUI\fillRow(), ilPollBlockGUI\getHTML(), ilPollBlockGUI\getVoteURL(), and ilPollBlockGUI\initContentRenderer().

273  : int
274  {
275  return $this->refid;
276  }
+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilBlockGUI::getRepositoryMode ( )

◆ getRowTemplateDir()

ilBlockGUI::getRowTemplateDir ( )

Definition at line 348 of file class.ilBlockGUI.php.

References $rowtemplatedir.

Referenced by ilPollBlockGUI\getLegacyContent().

348  : string
349  {
350  return $this->rowtemplatedir;
351  }
string $rowtemplatedir
+ Here is the caller graph for this function:

◆ getRowTemplateName()

ilBlockGUI::getRowTemplateName ( )

Definition at line 343 of file class.ilBlockGUI.php.

References $rowtemplatename.

Referenced by ilPollBlockGUI\getLegacyContent().

343  : string
344  {
345  return $this->rowtemplatename;
346  }
string $rowtemplatename
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilBlockGUI::getScreenMode ( )
static

Definition at line 368 of file class.ilBlockGUI.php.

References IL_SCREEN_SIDE.

368  : string
369  {
370  return IL_SCREEN_SIDE;
371  }
const IL_SCREEN_SIDE

◆ getSubtitle()

ilBlockGUI::getSubtitle ( )

Definition at line 260 of file class.ilBlockGUI.php.

References $subtitle.

260  : string
261  {
262  return $this->subtitle;
263  }

◆ getTitle()

ilBlockGUI::getTitle ( )

Definition at line 199 of file class.ilBlockGUI.php.

References $title.

Referenced by ilMembershipBlockGUI\emptyHandling(), ilSelectedItemsBlockGUI\emptyHandling(), getActionsForPanel(), getHTML(), and ilWikiFunctionsBlockGUI\getLegacyContent().

199  : string
200  {
201  return $this->title;
202  }
+ Here is the caller graph for this function:

◆ getViewControlsForPanel()

ilBlockGUI::getViewControlsForPanel ( )
Returns
ViewControl[]|ViewControl[]

Definition at line 735 of file class.ilBlockGUI.php.

References $presentation, getPaginationViewControl(), and getPresentation().

Referenced by getHTML().

735  : array
736  {
737  $viewControls = [];
738  if (count($this->presentations) > 1) {
739  $presentation = $this->factory->viewControl()->mode(
740  $this->presentations,
741  'label'
742  )->withActive($this->activePresentation);
743  $viewControls[] = $presentation;
744  }
745 
746  if ($this->sort_options !== []) {
747  $sortation = $this->factory->viewControl()->sortation(
748  $this->sort_options
749  )->withTargetURL(
750  $this->sort_target,
751  'sorting'
752  )->withLabel(
753  $this->activeSortOption
754  );
755  $viewControls[] = $sortation;
756  }
757 
758 
759  if ($this->getPresentation() === self::PRES_SEC_LIST) {
760  $pg_view_control = $this->getPaginationViewControl();
761  if ($pg_view_control !== null) {
762  $viewControls[] = $pg_view_control;
763  }
764  }
765  return $viewControls;
766  }
getPaginationViewControl()
Fill previous/next row.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleNavigation()

ilBlockGUI::handleNavigation ( )
protected

Handle navigation.

Definition at line 521 of file class.ilBlockGUI.php.

References getLimit(), getNavParameter(), and setOffset().

Referenced by getHTML().

521  : void
522  {
523  $reg_page = $this->request->getNavPage($this->getNavParameter());
524  if ($reg_page !== "") {
525  $this->nav_value = "::" . ($reg_page * $this->getLimit());
526  }
527 
528  if ($this->nav_value == "") {
529  $this->nav_value = $this->block_manager->getNavPar($this->getNavParameter());
530  }
531 
532  $this->block_manager->setNavPar(
533  $this->getNavParameter(),
534  $this->nav_value
535  );
536 
537  $nav = explode(":", $this->nav_value);
538  if (isset($nav[2])) {
539  $this->setOffset((int) $nav[2]);
540  } else {
541  $this->setOffset(0);
542  }
543  }
setOffset(int $a_offset)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCommands()

ilBlockGUI::initCommands ( )
protected

Definition at line 373 of file class.ilBlockGUI.php.

Referenced by getHTML().

373  : void
374  {
375  }
+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilBlockGUI::isRepositoryObject ( )
abstractprotected

Returns whether block has a corresponding repository object.

Referenced by __construct(), addRepoCommands(), and getHTML().

+ Here is the caller graph for this function:

◆ loadData()

ilBlockGUI::loadData ( )
protected

Load data for current page.

Returns
array

Definition at line 549 of file class.ilBlockGUI.php.

References $data, getData(), getLimit(), getOffset(), and preloadData().

Referenced by ilDashboardBlockGUI\getLegacyContent(), ilDashboardBlockGUI\getListItemGroups(), and getListItemGroups().

549  : array
550  {
551  $data = $this->getData();
552  $this->max_count = count($data);
553  $data = array_slice($data, $this->getOffset(), $this->getLimit(), true);
554  $this->preloadData($data);
555  return $data;
556  }
preloadData(array $data)
Can be overwritten in subclasses.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preloadData()

ilBlockGUI::preloadData ( array  $data)
protected

Can be overwritten in subclasses.

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

Parameters
array$data

Definition at line 481 of file class.ilBlockGUI.php.

Referenced by loadData().

481  : void
482  {
483  }
+ Here is the caller graph for this function:

◆ send()

ilBlockGUI::send ( string  $output)
protected

Send.

Exceptions
ResponseSendingException

Definition at line 799 of file class.ilBlockGUI.php.

References ILIAS\FileDelivery\http().

Referenced by ilNewsForContextBlockGUI\enableJS(), getHTML(), ilNewsForContextBlockGUI\hideNotifications(), and ilNewsForContextBlockGUI\showNotifications().

799  : void
800  {
801  $this->http->saveResponse($this->http->response()->withBody(
802  Streams::ofString($output)
803  ));
804  $this->http->sendResponse();
805  $this->http->close();
806  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdminCommands()

ilBlockGUI::setAdminCommands ( bool  $a_admincommands)

Definition at line 278 of file class.ilBlockGUI.php.

278  : void
279  {
280  $this->admincommands = $a_admincommands;
281  }

◆ setBlockId()

ilBlockGUI::setBlockId ( string  $a_block_id = "0")

Definition at line 169 of file class.ilBlockGUI.php.

Referenced by ilPDCalendarBlockGUI\__construct(), ilConsultationHoursCalendarBlockGUI\__construct(), ilObjectMetaDataBlockGUI\__construct(), ilNewsForContextBlockGUI\__construct(), ilCalendarBlockGUI\__construct(), and ilPollBlockGUI\setBlock().

169  : void
170  {
171  $this->block_id = $a_block_id;
172  }
+ Here is the caller graph for this function:

◆ setData()

ilBlockGUI::setData ( array  $a_data)

◆ setEnableEdit()

ilBlockGUI::setEnableEdit ( bool  $a_enableedit)

Definition at line 235 of file class.ilBlockGUI.php.

235  : void
236  {
237  $this->enableedit = $a_enableedit;
238  }

◆ setEnableNumInfo()

◆ setGuiObject()

ilBlockGUI::setGuiObject ( object  $a_gui_object)

Set GuiObject.

Only used for repository blocks, that are represented as real repository objects (have a ref id and permissions)

Definition at line 184 of file class.ilBlockGUI.php.

184  : void
185  {
186  $this->gui_object = $a_gui_object;
187  }

◆ setLimit()

◆ setOffset()

ilBlockGUI::setOffset ( int  $a_offset)

Definition at line 204 of file class.ilBlockGUI.php.

References checkOffset(), and getData().

Referenced by handleNavigation().

204  : void
205  {
206  // see https://github.com/ILIAS-eLearning/ILIAS/pull/6551/files
207  $this->max_count = count($this->getData());
208  if ($this->checkOffset($a_offset)) {
209  $this->offset = $a_offset;
210  } else {
211  throw new ilException("ilBlockGUI::setOffset(): Offset out of range.");
212  }
213  }
checkOffset(int $offset)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPresentation()

◆ setProperties()

ilBlockGUI::setProperties ( array  $a_properties)

This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties.

Definition at line 302 of file class.ilBlockGUI.php.

302  : void
303  {
304  $this->property = $a_properties;
305  }

◆ setProperty()

ilBlockGUI::setProperty ( string  $a_property,
string  $a_value 
)

Definition at line 312 of file class.ilBlockGUI.php.

312  : void
313  {
314  $this->property[$a_property] = $a_value;
315  }

◆ setRefId()

ilBlockGUI::setRefId ( int  $a_refid)

Set Ref Id (only used if isRepositoryObject() is true).

Definition at line 268 of file class.ilBlockGUI.php.

268  : void
269  {
270  $this->refid = $a_refid;
271  }

◆ setRepositoryMode()

ilBlockGUI::setRepositoryMode ( bool  $a_repositorymode)

Definition at line 245 of file class.ilBlockGUI.php.

245  : void
246  {
247  $this->repositorymode = $a_repositorymode;
248  }

◆ setRowTemplate()

ilBlockGUI::setRowTemplate ( string  $a_rowtemplatename,
string  $a_rowtemplatedir = "" 
)

Set Row Template Name.

Definition at line 320 of file class.ilBlockGUI.php.

Referenced by ilPDNewsBlockGUI\__construct(), ilPollBlockGUI\__construct(), and ilNewsForContextBlockGUI\__construct().

323  : void {
324  $this->rowtemplatename = $a_rowtemplatename;
325  $this->rowtemplatedir = $a_rowtemplatedir;
326  }
+ Here is the caller graph for this function:

◆ setSortTarget()

ilBlockGUI::setSortTarget ( string  $target)

Definition at line 782 of file class.ilBlockGUI.php.

Referenced by ilDashboardBlockGUI\addCommandActions().

782  : void
783  {
784  $this->sort_target = $target;
785  }
+ Here is the caller graph for this function:

◆ setSubtitle()

ilBlockGUI::setSubtitle ( string  $a_subtitle)

Definition at line 255 of file class.ilBlockGUI.php.

255  : void
256  {
257  $this->subtitle = $a_subtitle;
258  }

◆ setTitle()

◆ sortObject()

ilBlockGUI::sortObject ( )

Definition at line 768 of file class.ilBlockGUI.php.

References getHTML().

768  : string
769  {
770  return $this->getHTML();
771  }
+ Here is the call graph for this function:

◆ specialCharsAsEntities()

ilBlockGUI::specialCharsAsEntities ( string  $string)
protected

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

Referenced by getActionsForPanel(), and getHTML().

139  : string
140  {
141  // Should be replaced by a proper refinery transformation once https://github.com/ILIAS-eLearning/ILIAS/pull/6314 is merged
142  return htmlspecialchars(
143  $string,
144  ENT_QUOTES | ENT_SUBSTITUTE,
145  'utf-8'
146  );
147  }
+ Here is the caller graph for this function:

Field Documentation

◆ $access

◆ $activePresentation

string ilBlockGUI::$activePresentation = ''
private

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

◆ $activeSortOption

string ilBlockGUI::$activeSortOption = ''
private

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

◆ $admincommands

bool ilBlockGUI::$admincommands = false
protected

Definition at line 85 of file class.ilBlockGUI.php.

Referenced by getAdminCommands().

◆ $allow_moving

bool ilBlockGUI::$allow_moving = true
protected

Definition at line 75 of file class.ilBlockGUI.php.

◆ $block_commands

array ilBlockGUI::$block_commands = array()
protected

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

Referenced by getBlockCommands().

◆ $block_id

string ilBlockGUI::$block_id = "0"
protected

◆ $block_manager

ILIAS Block BlockManager ilBlockGUI::$block_manager
protected

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

◆ $close_command

bool ilBlockGUI::$close_command = false
protected

Definition at line 79 of file class.ilBlockGUI.php.

◆ $css_row

string ilBlockGUI::$css_row = ""
protected

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

◆ $ctrl

◆ $data

◆ $dropdown

array ilBlockGUI::$dropdown
protected

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

◆ $enableedit

bool ilBlockGUI::$enableedit
private

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

Referenced by getEnableEdit().

◆ $enablenuminfo

bool ilBlockGUI::$enablenuminfo = true
protected

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

Referenced by getEnableNumInfo().

◆ $factory

◆ $footer_links

array ilBlockGUI::$footer_links = array()
protected

Definition at line 73 of file class.ilBlockGUI.php.

◆ $gui_object

object ilBlockGUI::$gui_object
protected

Definition at line 64 of file class.ilBlockGUI.php.

Referenced by getGuiObject().

◆ $http

ILIAS HTTP GlobalHttpState ilBlockGUI::$http
private

Definition at line 67 of file class.ilBlockGUI.php.

◆ $image

bool ilBlockGUI::$image = false
protected

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

◆ $limit

int ilBlockGUI::$limit
private

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

Referenced by getLimit().

◆ $lng

◆ $main_tpl

◆ $max_count

int ilBlockGUI::$max_count = 0
protected

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

◆ $modals

array ilBlockGUI::$modals = []
private

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

◆ $move

array ilBlockGUI::$move = array("left" => false, "right" => false, "up" => false, "down" => false)
protected

Definition at line 76 of file class.ilBlockGUI.php.

◆ $nav_value

string ilBlockGUI::$nav_value = ""
protected

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

◆ $obj_def

ilObjectDefinition ilBlockGUI::$obj_def
protected

Definition at line 93 of file class.ilBlockGUI.php.

Referenced by addRepoCommands(), and ilNewsForContextBlockGUI\getHTML().

◆ $offset

int ilBlockGUI::$offset = 0
private

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

Referenced by getOffset().

◆ $presentation

◆ $presentations

array ilBlockGUI::$presentations = []
private

Definition at line 58 of file class.ilBlockGUI.php.

Referenced by ilDashboardBlockGUI\addCommandActions().

◆ $property

array ilBlockGUI::$property = []
protected

Definition at line 81 of file class.ilBlockGUI.php.

◆ $refid

int ilBlockGUI::$refid
private

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

Referenced by getRefId().

◆ $renderer

ILIAS UI Renderer ilBlockGUI::$renderer
protected

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

Referenced by ilNewsForContextBlockGUI\showNews().

◆ $repositorymode

bool ilBlockGUI::$repositorymode = false
protected

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

Referenced by getRepositoryMode().

◆ $request

ILIAS Block StandardGUIRequest ilBlockGUI::$request
protected

◆ $requested_ref_id

int ilBlockGUI::$requested_ref_id
protected

Definition at line 95 of file class.ilBlockGUI.php.

Referenced by ilClassificationBlockGUI\__construct().

◆ $rowtemplatedir

string ilBlockGUI::$rowtemplatedir
private

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

Referenced by getRowTemplateDir().

◆ $rowtemplatename

string ilBlockGUI::$rowtemplatename
private

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

Referenced by getRowTemplateName().

◆ $sort_options

array ilBlockGUI::$sort_options = []
private

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

◆ $sort_target

string ilBlockGUI::$sort_target = ''
private

Definition at line 61 of file class.ilBlockGUI.php.

◆ $subtitle

string ilBlockGUI::$subtitle
private

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

Referenced by getSubtitle().

◆ $title

◆ $tpl

◆ $ui

◆ $user

◆ PRES_MAIN_LEG

const ilBlockGUI::PRES_MAIN_LEG = 0

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

◆ PRES_MAIN_LIST

const ilBlockGUI::PRES_MAIN_LIST = 3

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

◆ PRES_MAIN_TILE

const ilBlockGUI::PRES_MAIN_TILE = 4

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

◆ PRES_SEC_LEG

const ilBlockGUI::PRES_SEC_LEG = 1

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

◆ PRES_SEC_LIST

const ilBlockGUI::PRES_SEC_LIST = 2

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


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