ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 Container Block StandardGUIRequest $request
 
ILIAS Container Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 

Private 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 ( )

Reimplemented in ilCalendarBlockGUI, ilConsultationHoursCalendarBlockGUI, ilPDCalendarBlockGUI, ilClassificationBlockGUI, ilTutorialSupportBlockGUI, ilDashboardBlockGUI, ilDashboardContentBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, ilPDNewsBlockGUI, ilPollBlockGUI, ilDashboardRecommendedContentGUI, ilPDStudyProgrammeSimpleListGUI, ilPDTasksBlockGUI, ilLPProgressBlockGUI, ilWikiFunctionsBlockGUI, and ilWikiImportantPagesBlockGUI.

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

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\Container\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
124 $this->main_tpl->addJavaScript("./assets/js/ilblockcallback.js");
125
126 $this->setLimit(25);
127
128 $this->requested_ref_id = $this->request->getRefId();
129 }
renderer()
factory()
setLimit(int $a_limit)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), factory(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), PRES_SEC_LEG, renderer(), setLimit(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by ilPDNewsBlockGUI\__construct().

+ 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 352 of file class.ilBlockGUI.php.

352 : void
353 {
354 $this->block_commands[] = [
355 "href" => $a_href,
356 "text" => $a_text,
357 "onclick" => $a_onclick,
358 "modal" => $modal
359 ];
360 }

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

+ Here is the caller graph for this function:

◆ addPresentation()

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

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

789 : void
790 {
791 $this->presentations[$label] = $target;
792 if ($active) {
793 $this->activePresentation = $label;
794 }
795 }

Referenced by ilDashboardBlockGUI\addCommandActions().

+ Here is the caller graph for this function:

◆ addRepoCommands()

ilBlockGUI::addRepoCommands ( )
protected

Add repo commands.

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

638 : void
639 {
644
645 if ($this->getRepositoryMode() && $this->isRepositoryObject()) {
646 // #10993
647 // @todo: fix this in new presentation somehow
648 /*
649 if ($this->getAdminCommands()) {
650 $this->tpl->setCurrentBlock("block_check");
651 $this->tpl->setVariable("BL_REF_ID", $this->getRefId());
652 $this->tpl->parseCurrentBlock();
653 }*/
654
655 $parent_type = ilObject::_lookupType($this->requested_ref_id, true);
656 $parent_gui = "ilObj" . $obj_def->getClassName($parent_type) . "GUI";
657
658 if ($access->checkAccess("delete", "", $this->getRefId())) {
659 $this->ctrl->setParameterByClass($parent_gui, 'ref_id', $this->requested_ref_id);
660 $this->ctrl->setParameterByClass($parent_gui, 'item_ref_id', $this->getRefId());
661
662 $this->addBlockCommand(
663 $this->ctrl->getLinkTargetByClass($parent_gui, 'delete'),
664 $lng->txt("delete")
665 );
666
667 $this->addBlockCommand(
668 $this->ctrl->getLinkTargetByClass($parent_gui, 'link'),
669 $lng->txt("link")
670 );
671
672 // see ilObjectListGUI::insertCutCommand();
673 $this->addBlockCommand(
674 $this->ctrl->getLinkTargetByClass($parent_gui, 'cut'),
675 $lng->txt("move")
676 );
677
678 $this->ctrl->clearParameterByClass($parent_gui, 'ref_id');
679 $this->ctrl->clearParameterByClass($parent_gui, 'item_ref_id');
680 }
681
682 // #14595 - see ilObjectListGUI::insertCopyCommand()
683 if ($access->checkAccess("copy", "", $this->getRefId())) {
684 $ctrl->setParameterByClass("ilobjectcopygui", "source_id", $this->getRefId());
685 $copy_cmd = $ctrl->getLinkTargetByClass(
686 array("ilrepositorygui", $parent_gui, "ilobjectcopygui"),
687 "initTargetSelection"
688 );
689
690 // see ilObjectListGUI::insertCopyCommand();
691 $this->addBlockCommand(
692 $copy_cmd,
693 $lng->txt("copy")
694 );
695 }
696 }
697 }
ilAccessHandler $access
ilLanguage $lng
isRepositoryObject()
Returns whether block has a corresponding repository object.
ilObjectDefinition $obj_def
addBlockCommand(string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
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...
getClassName(string $obj_name)
static _lookupType(int $id, bool $reference=false)
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)

References $lng, ilObject\_lookupType(), ilRBACAccessHandler\checkAccess(), ILIAS\Repository\ctrl(), ilObjectDefinition\getClassName(), ilCtrl\getLinkTargetByClass(), and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ addSortOption()

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

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

776 : void
777 {
778 if ($active) {
779 $this->activeSortOption = $option;
780 }
781 $this->sort_options[$option] = $label;
782 }

Referenced by ilDashboardBlockGUI\addCommandActions().

+ Here is the caller graph for this function:

◆ checkOffset()

ilBlockGUI::checkOffset ( int  $offset)

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

219 : bool
220 {
221 return $offset <= $this->max_count && $offset >= 0;
222 }

References $offset.

Referenced by setOffset().

+ Here is the caller graph for this function:

◆ getActionsForPanel()

ilBlockGUI::getActionsForPanel ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ getAdminCommands()

ilBlockGUI::getAdminCommands ( )

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

282 : bool
283 {
285 }

References $admincommands.

◆ getAsynch()

ilBlockGUI::getAsynch ( )

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

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

488 : string
489 {
490 header("Content-type: text/html; charset=UTF-8");
491 return $this->tpl->get();
492 }

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

+ Here is the call graph for this function:

◆ getBlockCommands()

ilBlockGUI::getBlockCommands ( )

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

362 : array
363 {
365 }
array $block_commands

◆ getBlockId()

ilBlockGUI::getBlockId ( )

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

173 : string
174 {
175 return $this->block_id;
176 }

References $block_id.

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

+ Here is the caller graph for this function:

◆ getBlockType()

◆ getConfigParameter()

ilBlockGUI::getConfigParameter ( )
final

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

332 : string
333 {
334 return $this->getBlockType() . "_" . $this->getBlockId() . "_blconf";
335 }

◆ getData()

ilBlockGUI::getData ( )

◆ getEnableEdit()

ilBlockGUI::getEnableEdit ( )

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

239 : bool
240 {
241 return $this->enableedit;
242 }

References $enableedit.

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

+ Here is the caller graph for this function:

◆ getEnableNumInfo()

ilBlockGUI::getEnableNumInfo ( )

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

292 : bool
293 {
295 }

References $enablenuminfo.

◆ getGuiObject()

ilBlockGUI::getGuiObject ( )

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

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

References $gui_object.

◆ getHTML()

ilBlockGUI::getHTML ( )

Reimplemented in ilCalendarBlockGUI, ilCalendarSelectionBlockGUI, ilConsultationHoursCalendarBlockGUI, ilClassificationBlockGUI, ilDashboardBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, ilPDNewsBlockGUI, ilPollBlockGUI, ilPDStudyProgrammeSimpleListGUI, and ilPDTasksBlockGUI.

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

376 : string
377 {
378 $this->initCommands();
379
381 $panel = null;
382
384
385 if ($this->isRepositoryObject()) {
386 if (!$access->checkAccess("read", "", $this->getRefId())) {
387 return "";
388 }
389 }
390
391 $this->addRepoCommands();
392
393 switch ($this->getPresentation()) {
395 $panel = $this->factory->panel()->secondary()->legacy(
396 $this->specialCharsAsEntities($this->getTitle()),
397 $this->factory->legacy()->content($this->getLegacyContent())
398 );
399 break;
400
402 $panel = $this->factory->panel()->standard(
403 $this->specialCharsAsEntities($this->getTitle()),
404 $this->factory->legacy()->content($this->getLegacyContent())
405 );
406 break;
407
409 $this->handleNavigation();
410 $panel = $this->factory->panel()->secondary()->listing(
411 $this->specialCharsAsEntities($this->getTitle()),
412 $this->getListItemGroups()
413 );
414 break;
415
418 $this->handleNavigation();
419 $panel = $this->factory->panel()->listing()->standard(
420 $this->specialCharsAsEntities($this->getTitle()),
421 $this->getListItemGroups()
422 );
423 break;
424 }
425
426 // check for empty list panel
427 if (in_array($this->getPresentation(), [self::PRES_SEC_LIST, self::PRES_MAIN_LIST], true) &&
428 ($panel->getItemGroups() === [] || (count($panel->getItemGroups()) === 1 && $panel->getItemGroups()[0]->getItems() === []))) {
429 if ($this->getPresentation() === self::PRES_SEC_LIST) {
430 $panel = $this->factory->panel()->secondary()->legacy(
431 $this->specialCharsAsEntities($this->getTitle()),
432 $this->factory->legacy()->content($this->getNoItemFoundContent())
433 );
434 } else {
435 $panel = $this->factory->panel()->standard(
436 $this->specialCharsAsEntities($this->getTitle()),
437 $this->factory->legacy()->content($this->getNoItemFoundContent())
438 );
439 }
440 }
441
442 $actions = $this->getActionsForPanel();
443 if ($actions !== null) {
444 $panel = $panel->withActions($actions);
445 }
446 $viewControls = $this->getViewControlsForPanel();
447 if ($viewControls !== [] &&
448 (
449 $panel instanceof StandardPanel ||
450 $panel instanceof SecondaryListingPanel ||
451 $panel instanceof SecondaryLegacyPanel ||
452 $panel instanceof StandardListingPanel
453 )
454 ) {
455 $panel = $panel->withViewControls($viewControls);
456 }
457
458 if ($ctrl->isAsynch()) {
459 $html = $this->renderer->renderAsync([$panel, ...$this->modals]);
460 } else {
461 $html = $this->renderer->render([$panel, ...$this->modals]);
462 }
463
464
465 if ($ctrl->isAsynch()) {
466 $this->send($html);
467 } else {
468 // return incl. wrapping div with id
469 $html = '<div id="' . 'block_' . $this->getBlockType() . '_' . $this->block_id . '">' .
470 $html . '</div>';
471 }
472
473 return $html;
474 }
send(string $output)
Send.
specialCharsAsEntities(string $string)
handleNavigation()
Handle navigation.
const PRES_MAIN_LIST
getListItemGroups()
Get items.
addRepoCommands()
Add repo commands.
const PRES_MAIN_TILE
isAsynch()
@inheritDoc

References ilRBACAccessHandler\checkAccess(), factory(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), ilCtrl\isAsynch(), renderer(), and send().

Referenced by ilPDNewsBlockGUI\getHTML().

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

◆ getLegacyContent()

ilBlockGUI::getLegacyContent ( )
protected

◆ getLimit()

ilBlockGUI::getLimit ( )

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

229 : int
230 {
231 return $this->limit;
232 }

References $limit.

◆ getListItemForData()

ilBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

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

Reimplemented in ilCalendarBlockGUI, ilCalendarSelectionBlockGUI, ilConsultationHoursCalendarBlockGUI, ilTutorialSupportBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, and ilPDTasksBlockGUI.

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

512 {
513 return null;
514 }
Common interface to all items.
Definition: Item.php:32

◆ getListItemGroups()

ilBlockGUI::getListItemGroups ( )
protected

Get items.

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

Reimplemented in ilDashboardBlockGUI.

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

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

References $data, and $DIC.

◆ getMoveParameter()

ilBlockGUI::getMoveParameter ( )
final

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

337 : string
338 {
339 return $this->getBlockType() . "_" . $this->getBlockId() . "_blmove";
340 }

◆ getNavParameter()

ilBlockGUI::getNavParameter ( )
final

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

327 : string
328 {
329 return $this->getBlockType() . "_" . $this->getBlockId() . "_blnav";
330 }

◆ getNoItemFoundContent()

ilBlockGUI::getNoItemFoundContent ( )

Reimplemented in ilCalendarBlockGUI, ilDashboardBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, and ilPDTasksBlockGUI.

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

810 : string
811 {
812 return $this->lng->txt("no_items");
813 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getOffset()

ilBlockGUI::getOffset ( )

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

214 : int
215 {
216 return $this->offset;
217 }

References $offset.

◆ getPaginationViewControl()

ilBlockGUI::getPaginationViewControl ( )

Fill previous/next row.

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

588 {
589 global $DIC;
590 $factory = $DIC->ui()->factory();
591
592 $ilCtrl = $this->ctrl;
593
594 if ($this->max_count <= $this->getLimit()) {
595 return null;
596 }
597
598
599 // $ilCtrl->setParameterByClass("ilcolumngui",
600 // $this->getNavParameter(), "::" . $prevoffset);
601
602 // ajax link
603 $ilCtrl->setParameterByClass(
604 "ilcolumngui",
605 "block_id",
606 "block_" . $this->getBlockType() . "_" . $this->block_id
607 );
608 $block_id = "block_" . $this->getBlockType() . "_" . $this->block_id;
609 $onclick = $ilCtrl->getLinkTargetByClass(
610 "ilcolumngui",
611 "updateBlock",
612 "",
613 true
614 );
615 $ilCtrl->setParameterByClass(
616 "ilcolumngui",
617 "block_id",
618 ""
619 );
620
621 // normal link
622 $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "", "", false, false);
623
624 //$ilCtrl->setParameterByClass("ilcolumngui",
625 // $this->getNavParameter(), "");
626
627 return $factory->viewControl()->pagination()
628 ->withTargetURL($href, $this->getNavParameter() . "page")
629 ->withTotalEntries($this->max_count)
630 ->withPageSize($this->getLimit())
631 ->withMaxPaginationButtons(1)
632 ->withCurrentPage($this->getOffset() / $this->getLimit());
633 }
This describes a Pagination Control.
Definition: Pagination.php:33

References $DIC, and ILIAS\UI\Component\ViewControl\Factory\pagination().

+ Here is the call graph for this function:

◆ getPresentation()

ilBlockGUI::getPresentation ( )

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

163 : int
164 {
165 return $this->presentation;
166 }

References $presentation.

Referenced by ilCalendarBlockGUI\getViewControlsForPanel().

+ Here is the caller graph for this function:

◆ getProperty()

ilBlockGUI::getProperty ( string  $a_property)

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

306 : ?string
307 {
308 return $this->property[$a_property] ?? null;
309 }

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

+ Here is the caller graph for this function:

◆ getRefId()

ilBlockGUI::getRefId ( )

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

272 : int
273 {
274 return $this->refid;
275 }

References $refid.

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

+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilBlockGUI::getRepositoryMode ( )

◆ getRowTemplateDir()

ilBlockGUI::getRowTemplateDir ( )

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

347 : string
348 {
350 }
string $rowtemplatedir

Referenced by ilPollBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ getRowTemplateName()

ilBlockGUI::getRowTemplateName ( )

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

342 : string
343 {
345 }
string $rowtemplatename

Referenced by ilPollBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilBlockGUI::getScreenMode ( )
static

◆ getSubtitle()

ilBlockGUI::getSubtitle ( )

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

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

References $subtitle.

◆ getTitle()

ilBlockGUI::getTitle ( )

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

198 : string
199 {
200 return $this->title;
201 }

References $title.

Referenced by ilWikiFunctionsBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ getViewControlsForPanel()

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

Reimplemented in ilCalendarBlockGUI, and ilDashboardBlockGUI.

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

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

References factory().

+ Here is the call graph for this function:

◆ handleNavigation()

ilBlockGUI::handleNavigation ( )
protected

Handle navigation.

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

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

◆ initCommands()

ilBlockGUI::initCommands ( )
protected

Reimplemented in ilCalendarBlockGUI.

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

372 : void
373 {
374 }

◆ isRepositoryObject()

◆ loadData()

ilBlockGUI::loadData ( )
protected

Load data for current page.

Returns
array

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

548 : array
549 {
550 $data = $this->getData();
551 $this->max_count = count($data);
552 $data = array_slice($data, $this->getOffset(), $this->getLimit(), true);
553 $this->preloadData($data);
554 return $data;
555 }
preloadData(array $data)
Can be overwritten in subclasses.

References $data.

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

+ 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

Reimplemented in ilDashboardBlockGUI, and ilPDMailBlockGUI.

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

480 : void
481 {
482 }

◆ send()

ilBlockGUI::send ( string  $output)
protected

Send.

Exceptions
ResponseSendingException

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

801 : void
802 {
803 $this->http->saveResponse($this->http->response()->withBody(
804 Streams::ofString($output)
805 ));
806 $this->http->sendResponse();
807 $this->http->close();
808 }

References ILIAS\FileDelivery\http().

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

+ 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 277 of file class.ilBlockGUI.php.

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

◆ setBlockId()

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

◆ setData()

ilBlockGUI::setData ( array  $a_data)

◆ setEnableEdit()

ilBlockGUI::setEnableEdit ( bool  $a_enableedit)

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

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

◆ 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 183 of file class.ilBlockGUI.php.

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

◆ setLimit()

◆ setOffset()

ilBlockGUI::setOffset ( int  $a_offset)

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

203 : void
204 {
205 // see https://github.com/ILIAS-eLearning/ILIAS/pull/6551/files
206 $this->max_count = count($this->getData());
207 if ($this->checkOffset($a_offset)) {
208 $this->offset = $a_offset;
209 } else {
210 throw new ilException("ilBlockGUI::setOffset(): Offset out of range.");
211 }
212 }
checkOffset(int $offset)
Base class for ILIAS Exception handling.

References checkOffset(), and getData().

+ Here is the call 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 301 of file class.ilBlockGUI.php.

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

◆ setProperty()

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

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

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

◆ setRefId()

ilBlockGUI::setRefId ( int  $a_refid)

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

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

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

◆ setRepositoryMode()

ilBlockGUI::setRepositoryMode ( bool  $a_repositorymode)

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

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

◆ setRowTemplate()

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

Set Row Template Name.

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

322 : void {
323 $this->rowtemplatename = $a_rowtemplatename;
324 $this->rowtemplatedir = $a_rowtemplatedir;
325 }

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

+ Here is the caller graph for this function:

◆ setSortTarget()

ilBlockGUI::setSortTarget ( string  $target)

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

784 : void
785 {
786 $this->sort_target = $target;
787 }

Referenced by ilDashboardBlockGUI\addCommandActions().

+ Here is the caller graph for this function:

◆ setSubtitle()

ilBlockGUI::setSubtitle ( string  $a_subtitle)

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

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

◆ setTitle()

◆ sortObject()

ilBlockGUI::sortObject ( )

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

771 : string
772 {
773 return $this->getHTML();
774 }

◆ specialCharsAsEntities()

ilBlockGUI::specialCharsAsEntities ( string  $string)
protected

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

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

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.

◆ $block_id

string ilBlockGUI::$block_id = "0"
protected

◆ $block_manager

ILIAS Container 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 ilNewsForContextBlockGUI\getHTML().

◆ $offset

int ilBlockGUI::$offset = 0
private

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

Referenced by checkOffset(), and 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 Container 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.

◆ $rowtemplatename

string ilBlockGUI::$rowtemplatename
private

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

◆ $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.

Referenced by __construct().

◆ 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: