ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilBlockGUI Class Reference

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

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

Public Member Functions

 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 ()
 Get Screen Mode for current command. More...
 

Data Fields

const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 

Protected Member Functions

 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

 $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
 

Detailed Description

This class represents a block method of a block.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilBlockGUI::__construct ( )

Constructor.

Parameters

Reimplemented in ilExternalFeedBlockGUI, ilPollBlockGUI, ilPDStudyProgrammeExpandableListGUI, ilPDStudyProgrammeSimpleListGUI, ilWikiFunctionsBlockGUI, ilWikiImportantPagesBlockGUI, ilCalendarBlockGUI, ilPDCalendarBlockGUI, ilClassificationBlockGUI, ilDashboardContentBlockGUI, ilPDSelectedItemsBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, ilPDNewsBlockGUI, and ilPDTasksBlockGUI.

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

109 {
110 global $DIC;
111
112 // default presentation
113 $this->presentation = self::PRES_SEC_LEG;
114
115 $this->user = $DIC->user();
116 $this->ctrl = $DIC->ctrl();
117 $this->access = $DIC->access();
118 $this->lng = $DIC->language();
119 $this->main_tpl = $DIC["tpl"];
120 $this->obj_def = $DIC["objDefinition"];
121 $this->ui = $DIC->ui();
122
123 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
125 $this->main_tpl->addJavaScript("./Services/Block/js/ilblockcallback.js");
126
127 $this->setLimit($this->user->getPref("hits_per_page"));
128 }
user()
Definition: user.php:4
setLimit($a_limit)
Set Limit.
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46

References $DIC, ilYuiUtil\initConnection(), PRES_SEC_LEG, setLimit(), ui(), and 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 = "" 
)

Add Block Command.

Parameters
string$a_href
string$a_text
string$a_onclick

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

477 : void
478 {
479 $this->block_commands[] = [
480 "href" => $a_href,
481 "text" => $a_text,
482 "onclick" => $a_onclick
483 ];
484 }

Referenced by ilCalendarSelectionBlockGUI\__construct(), addRepoCommands(), ilWikiImportantPagesBlockGUI\getHTML(), ilExternalFeedBlockGUI\getHTML(), ilPollBlockGUI\getHTML(), getHTML(), ilCalendarBlockGUI\getHTML(), ilNewsForContextBlockGUI\getHTML(), ilPDNewsBlockGUI\getHTML(), ilPDSelectedItemsBlockGUI\getLegacyContent(), ilPDSelectedItemsBlockGUI\getListItemGroups(), ilCalendarBlockGUI\initCommands(), ilPDSelectedItemsBlockGUI\renderManageList(), and ilPDSelectedItemsBlockGUI\setFooterLinks().

+ Here is the caller graph for this function:

◆ addRepoCommands()

ilBlockGUI::addRepoCommands ( )
protected

Add repo commands.

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

1099 {
1101 $lng = $this->lng;
1104
1105 if ($this->getRepositoryMode() && $this->isRepositoryObject()) {
1106 // #10993
1107 // @todo: fix this in new presentation somehow
1108 /*
1109 if ($this->getAdminCommands()) {
1110 $this->tpl->setCurrentBlock("block_check");
1111 $this->tpl->setVariable("BL_REF_ID", $this->getRefId());
1112 $this->tpl->parseCurrentBlock();
1113 }*/
1114
1115 if ($access->checkAccess("delete", "", $this->getRefId())) {
1116 $this->addBlockCommand(
1117 "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $_GET["ref_id"] . "&cmd=delete" .
1118 "&item_ref_id=" . $this->getRefId(),
1119 $lng->txt("delete")
1120 );
1121
1122 // see ilObjectListGUI::insertCutCommand();
1123 $this->addBlockCommand(
1124 "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $_GET["ref_id"] . "&cmd=cut" .
1125 "&item_ref_id=" . $this->getRefId(),
1126 $lng->txt("move")
1127 );
1128 }
1129
1130 // #14595 - see ilObjectListGUI::insertCopyCommand()
1131 if ($access->checkAccess("copy", "", $this->getRefId())) {
1132 $parent_type = ilObject::_lookupType($_GET["ref_id"], true);
1133 $parent_gui = "ilObj" . $obj_def->getClassName($parent_type) . "GUI";
1134
1135 $ctrl->setParameterByClass("ilobjectcopygui", "source_id", $this->getRefId());
1136 $copy_cmd = $ctrl->getLinkTargetByClass(
1137 array("ilrepositorygui", $parent_gui, "ilobjectcopygui"),
1138 "initTargetSelection"
1139 );
1140
1141 // see ilObjectListGUI::insertCopyCommand();
1142 $this->addBlockCommand(
1143 $copy_cmd,
1144 $lng->txt("copy")
1145 );
1146 }
1147 }
1148 }
$_GET["client_id"]
isRepositoryObject()
Returns whether block has a corresponding repository object.
getRepositoryMode()
Get RepositoryMode.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
static _lookupType($a_id, $a_reference=false)
lookup object type

References $_GET, $access, $ctrl, $lng, $obj_def, ilObject\_lookupType(), addBlockCommand(), getRefId(), getRepositoryMode(), and isRepositoryObject().

Referenced by getHTMLNew().

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

◆ correctOffset()

ilBlockGUI::correctOffset ( )

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

256 {
257 if (!($this->offset < $this->max_count)) {
258 $this->setOffset(0);
259 }
260 }
setOffset($a_offset)
Set Offset.

References setOffset().

Referenced by fillDataSection(), and loadData().

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

◆ fillDataSection()

ilBlockGUI::fillDataSection ( )

Standard implementation for row based data.

Overwrite this and call setContent for other data.

Reimplemented in ilExternalFeedBlockGUI, ilPollBlockGUI, ilPDStudyProgrammeSimpleListGUI, ilWikiFunctionsBlockGUI, ilWikiImportantPagesBlockGUI, ilCalendarBlockGUI, ilCalendarSelectionBlockGUI, ilClassificationBlockGUI, ilDashboardContentBlockGUI, ilPDSelectedItemsBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, ilPDNewsBlockGUI, ilObjectMetaDataBlockGUI, ilRepositoryObjectSearchBlockGUI, and ilPDTasksBlockGUI.

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

719 {
720 $this->nav_value = (isset($_POST[$this->getNavParameter()]) && $_POST[$this->getNavParameter()] != "")
721 ? $_POST[$this->getNavParameter()]
722 : (isset($_GET[$this->getNavParameter()]) ? $_GET[$this->getNavParameter()] : $this->nav_value);
723 $this->nav_value = ($this->nav_value == "" && isset($_SESSION[$this->getNavParameter()]))
724 ? $_SESSION[$this->getNavParameter()]
726
728
729 $nav = explode(":", $this->nav_value);
730 if (isset($nav[2])) {
731 $this->setOffset($nav[2]);
732 } else {
733 $this->setOffset(0);
734 }
735
736 // data
737 $this->tpl->addBlockFile(
738 "BLOCK_ROW",
739 "block_row",
740 $this->getRowTemplateName(),
741 $this->getRowTemplateDir()
742 );
743
744 $data = $this->getData();
745 $this->max_count = count($data);
746 $this->correctOffset();
747 $data = array_slice($data, $this->getOffset(), $this->getLimit());
748
749 $this->preloadData($data);
750
751 foreach ($data as $record) {
752 $this->tpl->setCurrentBlock("block_row");
753 $this->fillRowColor();
754 $this->fillRow($record);
755 $this->tpl->setCurrentBlock("block_row");
756 $this->tpl->parseCurrentBlock();
757 }
758 }
$_POST["username"]
$_SESSION["AccountId"]
getOffset()
Get Offset.
preloadData(array $data)
Can be overwritten in subclasses.
getRowTemplateDir()
Get Row Template Directory.
fillRowColor($a_placeholder="CSS_ROW")
getRowTemplateName()
Get Row Template Name.
getLimit()
Get Limit.
getData()
Get Data.

References $_GET, $_POST, $_SESSION, $data, $nav_value, correctOffset(), fillRow(), fillRowColor(), getData(), getLimit(), getNavParameter(), getOffset(), getRowTemplateDir(), getRowTemplateName(), preloadData(), and setOffset().

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

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

◆ fillFooter()

ilBlockGUI::fillFooter ( )

Reimplemented in ilCalendarBlockGUI, ilDashboardContentBlockGUI, and ilPDSelectedItemsBlockGUI.

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

768 {
769 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ fillHeaderCommands()

ilBlockGUI::fillHeaderCommands ( )

Fill header commands block.

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

638 {
639 // adv selection gui
640 include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
642 $dropdown->setUseImages(true);
645 $dropdown->setId("block_dd_" . $this->getBlockType() . "_" . $this->block_id);
646 foreach ($this->dropdown as $item) {
647 if ($item["href"] || $item["onclick"]) {
648 if ($item["checked"]) {
649 $item["image"] = ilUtil::getImagePath("icon_checked.svg");
650 }
651 $dropdown->addItem(
652 $item["text"],
653 "",
654 $item["href"],
655 $item["image"],
656 $item["text"],
657 "",
658 "",
659 false,
660 $item["onclick"]
661 );
662 }
663 }
664 $dropdown = $dropdown->getHTML();
665 $this->tpl->setCurrentBlock("header_dropdown");
666 $this->tpl->setVariable("ADV_DROPDOWN", $dropdown);
667 $this->tpl->parseCurrentBlock();
668
669 $this->tpl->setCurrentBlock("hitem");
670 $this->tpl->parseCurrentBlock();
671 }
User interface class for advanced drop-down selection lists.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $dropdown, getBlockType(), ilUtil\getImagePath(), ilAdvancedSelectionListGUI\ICON_CONFIG, and ilAdvancedSelectionListGUI\STYLE_LINK_BUTTON.

Referenced by getHTML().

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

◆ fillHeaderTitleBlock()

ilBlockGUI::fillHeaderTitleBlock ( )

Fill header title block (title and.

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

678 {
680
681
682 // header title
683 $this->tpl->setCurrentBlock("header_title");
684 $this->tpl->setVariable(
685 "BTID",
686 "block_" . $this->getBlockType() . "_" . $this->block_id
687 );
688 $this->tpl->setVariable(
689 "BLOCK_TITLE",
690 $this->getTitle()
691 );
692 $this->tpl->setVariable(
693 "TXT_BLOCK",
694 $lng->txt("block")
695 );
696 $this->tpl->parseCurrentBlock();
697
698 $this->tpl->setCurrentBlock("hitem");
699 $this->tpl->parseCurrentBlock();
700 }
getTitle()
Get Title.

References $lng, getBlockType(), and getTitle().

Referenced by getHTML().

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

◆ fillPreviousNext()

ilBlockGUI::fillPreviousNext ( )

Fill previous/next row.

Reimplemented in ilDashboardContentBlockGUI.

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

783 {
785
786 // table pn numinfo
787 $numinfo = "";
788 if ($this->getEnableNumInfo() && $this->max_count > 0) {
789 $start = $this->getOffset() + 1; // compute num info
790 $end = $this->getOffset() + $this->getLimit();
791
792 if ($end > $this->max_count or $this->getLimit() == 0) {
793 $end = $this->max_count;
794 }
795
796 $numinfo = "(" . $start . "-" . $end . " " . strtolower($lng->txt("of")) . " " . $this->max_count . ")";
797 }
798
799 $this->setPreviousNextLinks();
800 $this->tpl->setVariable("NUMINFO", $numinfo);
801 }
getEnableNumInfo()
Get Enable Item Number Info.
setPreviousNextLinks()
Get previous/next linkbar.

References $lng, $max_count, getEnableNumInfo(), getLimit(), getOffset(), and setPreviousNextLinks().

Referenced by getHTML().

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

◆ fillRow()

ilBlockGUI::fillRow (   $a_set)

Reimplemented in ilPollBlockGUI, ilPDTasksBlockGUI, ilNewsForContextBlockGUI, ilExternalFeedBlockGUI, and ilPDMailBlockGUI.

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

761 {
762 foreach ($a_set as $key => $value) {
763 $this->tpl->setVariable("VAL_" . strtoupper($key), $value);
764 }
765 }

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ fillRowColor()

ilBlockGUI::fillRowColor (   $a_placeholder = "CSS_ROW")
finalprotected

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

772 {
773 $this->css_row = ($this->css_row != "ilBlockRow1")
774 ? "ilBlockRow1"
775 : "ilBlockRow2";
776 $this->tpl->setVariable($a_placeholder, $this->css_row);
777 }

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getAdminCommands()

ilBlockGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

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

378 : bool
379 {
381 }

References $admincommands.

Referenced by getHTML().

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

927 {
928 header("Content-type: text/html; charset=UTF-8");
929 return $this->tpl->get();
930 }

◆ getBlockCommands()

ilBlockGUI::getBlockCommands ( )

Get Block commands.

Returns
array

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

491 : array
492 {
494 }

References $block_commands.

Referenced by getHTML(), and getHTMLNew().

+ Here is the caller graph for this function:

◆ getBlockId()

◆ getBlockType()

◆ getConfigParameter()

ilBlockGUI::getConfigParameter ( )
final

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

441 {
442 return $this->getBlockType() . "_" . $this->getBlockId() . "_blconf";
443 }
getBlockId()
Get Block Id.

References getBlockId(), and getBlockType().

+ Here is the call graph for this function:

◆ getData()

◆ getEnableEdit()

ilBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

Reimplemented in ilCalendarBlockGUI, and ilNewsForContextBlockGUI.

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

298 {
299 return $this->enableedit;
300 }

◆ getEnableNumInfo()

ilBlockGUI::getEnableNumInfo ( )

Get Enable Item Number Info.

Returns
boolean Enable Item Number Info

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

399 {
401 }

References $enablenuminfo.

Referenced by ilDashboardContentBlockGUI\fillFooter(), and fillPreviousNext().

+ Here is the caller graph for this function:

◆ getGuiObject()

ilBlockGUI::getGuiObject ( )

Get GuiObject.

Returns
object GUI object

Reimplemented in ilExternalFeedBlockGUI.

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

210 {
211 return $this->gui_object;
212 }

◆ getHTML()

ilBlockGUI::getHTML ( )

Get HTML.

Reimplemented in ilExternalFeedBlockGUI, ilPollBlockGUI, ilPDStudyProgrammeSimpleListGUI, ilWikiFunctionsBlockGUI, ilCalendarBlockGUI, ilCalendarSelectionBlockGUI, ilClassificationBlockGUI, ilDashboardContentBlockGUI, ilPDSelectedItemsBlockGUI, ilPDMailBlockGUI, ilNewsForContextBlockGUI, ilPDNewsBlockGUI, and ilRepositoryObjectSearchBlockGUI.

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

518 {
519 $this->initCommands();
520
521 if ($this->new_rendering) {
522 return $this->getHTMLNew();
523 }
524
527 $ilAccess = $this->access;
529 $objDefinition = $this->obj_def;
530
531 if ($this->isRepositoryObject()) {
532 if (!$ilAccess->checkAccess("read", "", $this->getRefId())) {
533 return "";
534 }
535 }
536
537 $this->tpl = new ilTemplate("tpl.block.html", true, true, "Services/Block");
538
539 // $this->handleConfigStatus();
540
541 $this->fillDataSection();
542 if ($this->getRepositoryMode() && $this->isRepositoryObject()) {
543 // #10993
544 // @todo: fix this in new presentation somehow
545 if ($this->getAdminCommands()) {
546 $this->tpl->setCurrentBlock("block_check");
547 $this->tpl->setVariable("BL_REF_ID", $this->getRefId());
548 $this->tpl->parseCurrentBlock();
549 }
550
551 if ($ilAccess->checkAccess("delete", "", $this->getRefId())) {
552 $this->addBlockCommand(
553 "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $_GET["ref_id"] . "&cmd=delete" .
554 "&item_ref_id=" . $this->getRefId(),
555 $lng->txt("delete")
556 );
557
558 // see ilObjectListGUI::insertCutCommand();
559 $this->addBlockCommand(
560 "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $_GET["ref_id"] . "&cmd=cut" .
561 "&item_ref_id=" . $this->getRefId(),
562 $lng->txt("move")
563 );
564 }
565
566 // #14595 - see ilObjectListGUI::insertCopyCommand()
567 if ($ilAccess->checkAccess("copy", "", $this->getRefId())) {
568 $parent_type = ilObject::_lookupType($_GET["ref_id"], true);
569 $parent_gui = "ilObj" . $objDefinition->getClassName($parent_type) . "GUI";
570
571 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_id", $this->getRefId());
572 $copy_cmd = $ilCtrl->getLinkTargetByClass(
573 array("ilrepositorygui", $parent_gui, "ilobjectcopygui"),
574 "initTargetSelection"
575 );
576
577 // see ilObjectListGUI::insertCopyCommand();
578 $this->addBlockCommand(
579 $copy_cmd,
580 $lng->txt("copy")
581 );
582 }
583 }
584
585 $this->dropdown = array();
586
587 // commands
588 if (count($this->getBlockCommands()) > 0) {
589 foreach ($this->getBlockCommands() as $command) {
590 if ($command["onclick"]) {
591 $command["onclick"] = "ilBlockJSHandler('" . "block_" . $this->getBlockType() . "_" . $this->block_id .
592 "','" . $command["onclick"] . "')";
593 }
594 $this->dropdown[] = $command;
595 }
596 }
597
598 // fill previous next
599 $this->fillPreviousNext();
600
601 // fill footer
602 $this->fillFooter();
603
604
605 // for screen readers we first output the title and the commands
606 // (e.g. close icon afterwards), otherwise we first output the
607 // header commands, since we want to have the close icon top right
608 // and not floated after the title
609 if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization")) {
610 $this->fillHeaderTitleBlock();
611 $this->fillHeaderCommands();
612 } else {
613 $this->fillHeaderCommands();
614 $this->fillHeaderTitleBlock();
615 }
616
617 if ($this->getPresentation() === self::PRES_MAIN_LEG) {
618 $this->tpl->touchBlock("hclassb");
619 } else {
620 $this->tpl->touchBlock("hclass");
621 }
622
623 if ($ilCtrl->isAsynch()) {
624 // return without div wrapper
625 echo $this->tpl->get();
626 //echo $this->tpl->getAsynch();
627 } else {
628 // return incl. wrapping div with id
629 return '<div id="' . "block_" . $this->getBlockType() . "_" . $this->block_id . '">' .
630 $this->tpl->get() . '</div>';
631 }
632 }
initCommands()
Init commands.
getBlockCommands()
Get Block commands.
fillHeaderCommands()
Fill header commands block.
getHTMLNew()
Get HTML.
getAdminCommands()
Get Administration Commmands.
fillHeaderTitleBlock()
Fill header title block (title and.
fillDataSection()
Standard implementation for row based data.
getPresentation()
Get presentation type.
fillPreviousNext()
Fill previous/next row.
special template class to simplify handling of ITX/PEAR
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18

References $_GET, $access, $ctrl, $ilCtrl, $ilUser, $lng, $obj_def, $user, ilObject\_lookupType(), addBlockCommand(), fillDataSection(), fillFooter(), fillHeaderCommands(), fillHeaderTitleBlock(), fillPreviousNext(), getAdminCommands(), getBlockCommands(), getBlockType(), getHTMLNew(), getPresentation(), getRefId(), getRepositoryMode(), initCommands(), and isRepositoryObject().

Referenced by ilPDNewsBlockGUI\getHTML().

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

◆ getHTMLNew()

ilBlockGUI::getHTMLNew ( )

Get HTML.

Reimplemented in ilPDTasksBlockGUI.

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

1154 {
1155 global $DIC;
1156 $factory = $DIC->ui()->factory();
1157 $renderer = $DIC->ui()->renderer();
1159
1161
1162 if ($this->isRepositoryObject()) {
1163 if (!$access->checkAccess("read", "", $this->getRefId())) {
1164 return "";
1165 }
1166 }
1167
1168 $this->addRepoCommands();
1169
1170 switch ($this->getPresentation()) {
1171 case self::PRES_SEC_LEG:
1172 $panel = $factory->panel()->secondary()->legacy(
1173 $this->getTitle(),
1174 $factory->legacy($this->getLegacyContent())
1175 );
1176 break;
1177
1179 $panel = $factory->panel()->standard(
1180 $this->getTitle(),
1181 $factory->legacy($this->getLegacyContent())
1182 );
1183 break;
1184
1186 $this->handleNavigation();
1187 $panel = $factory->panel()->secondary()->listing(
1188 $this->getTitle(),
1189 $this->getListItemGroups()
1190 );
1191 break;
1192
1194 $this->handleNavigation();
1195 $panel = $factory->panel()->listing()->standard(
1196 $this->getTitle(),
1197 $this->getListItemGroups()
1198 );
1199 break;
1200
1201 case self::PRES_MAIN_TILE:
1202 $this->handleNavigation();
1203 $panel = $factory->panel()->listing()->standard(
1204 $this->getTitle(),
1205 $this->getListItemGroups()
1206 );
1207 break;
1208 }
1209
1210 // actions
1211 $actions = [];
1212
1213 foreach ($this->getBlockCommands() as $command) {
1214 $href = ($command["onclick"] != "")
1215 ? ""
1216 : $command["href"];
1217 $button = $factory->button()->shy($command["text"], $href);
1218 if ($command["onclick"]) {
1219 $button = $button->withOnLoadCode(function ($id) use ($command) {
1220 return
1221 "$(\"#$id\").click(function() { ilBlockJSHandler('" . "block_" . $this->getBlockType() . "_" . $this->block_id .
1222 "','" . $command["onclick"] . "');});";
1223 });
1224 }
1225 $actions[] = $button;
1226 }
1227
1228 // check for empty list panel
1229 if (in_array($this->getPresentation(), [self::PRES_SEC_LIST, self::PRES_MAIN_LIST]) &&
1230 (count($panel->getItemGroups()) == 0 || (count($panel->getItemGroups()) == 1 && count($panel->getItemGroups()[0]->getItems()) == 0))) {
1231 if ($this->getPresentation() == self::PRES_SEC_LIST) {
1232 $panel = $factory->panel()->secondary()->legacy(
1233 $this->getTitle(),
1234 $factory->legacy($this->getNoItemFoundContent())
1235 );
1236 } else {
1237 $panel = $factory->panel()->standard(
1238 $this->getTitle(),
1239 $factory->legacy($this->getNoItemFoundContent())
1240 );
1241 }
1242 }
1243
1244
1245 if (count($actions) > 0) {
1246 $actions = $factory->dropdown()->standard($actions)
1247 ->withAriaLabel(sprintf(
1248 $this->lng->txt('actions_for'),
1249 $this->getTitle()
1250 ));
1251 $panel = $panel->withActions($actions);
1252 }
1253
1254 // view controls
1255 if (count($this->getViewControls()) > 0) {
1256 $panel = $panel->withViewControls($this->getViewControls());
1257 }
1258
1259 if ($ctrl->isAsynch()) {
1260 $html = $renderer->renderAsync($panel);
1261 } else {
1262 $html = $renderer->render($panel);
1263 }
1264
1265
1266 if ($ctrl->isAsynch()) {
1267 echo $html;
1268 exit;
1269 } else {
1270 // return incl. wrapping div with id
1271 $html = '<div id="' . "block_" . $this->getBlockType() . "_" . $this->block_id . '">' .
1272 $html . '</div>';
1273 }
1274
1275 //$this->new_rendering = false;
1276 //$html.= $this->getHTML();
1277
1278 return $html;
1279 }
getNoItemFoundContent()
No item entry.
handleNavigation()
Handle navigation.
const PRES_MAIN_LIST
getListItemGroups()
Get items.
addRepoCommands()
Add repo commands.
getViewControls()
Get view controls.
exit
Definition: login.php:29
$factory
Definition: metadata.php:58

References $access, $ctrl, $DIC, $factory, addRepoCommands(), exit, getBlockCommands(), getBlockType(), getListItemGroups(), getNoItemFoundContent(), getPresentation(), getTitle(), getViewControls(), handleNavigation(), isRepositoryObject(), PRES_MAIN_LEG, PRES_MAIN_LIST, PRES_SEC_LEG, and PRES_SEC_LIST.

Referenced by getHTML().

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

◆ getLegacyContent()

ilBlockGUI::getLegacyContent ( )
protected

◆ getLimit()

ilBlockGUI::getLimit ( )

Get Limit.

Returns
int Limit

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

278 {
279 return $this->limit;
280 }

Referenced by fillDataSection(), fillPreviousNext(), getPaginationViewControl(), handleNavigation(), loadData(), and setPreviousNextLinks().

+ 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|\ILIAS\UI\Component\Item\Item

Reimplemented in ilExternalFeedBlockGUI, ilCalendarBlockGUI, ilCalendarSelectionBlockGUI, ilNewsForContextBlockGUI, ilPDTasksBlockGUI, and ilPDMailBlockGUI.

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

973 {
974 return null;
975 }
Common interface to all items.
Definition: Item.php:11

Referenced by getListItemGroups(), and ilPDSelectedItemsBlockGUI\getListItemGroups().

+ Here is the caller graph for this function:

◆ getListItemGroups()

ilBlockGUI::getListItemGroups ( )
protected

Get items.

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

Reimplemented in ilPDSelectedItemsBlockGUI.

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

1023 : array
1024 {
1025 global $DIC;
1026 $factory = $DIC->ui()->factory();
1027
1028 $data = $this->loadData();
1029
1030 $items = [];
1031
1032 foreach ($data as $record) {
1033 $item = $this->getListItemForData($record);
1034 if ($item !== null) {
1035 $items[] = $item;
1036 }
1037 }
1038
1039 $item_group = $factory->item()->group("", $items);
1040
1041 return [$item_group];
1042 }
loadData()
Load data for current page.
getListItemForData(array $data)
Get list item for data array.

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

Referenced by getHTMLNew().

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

◆ getMoveParameter()

ilBlockGUI::getMoveParameter ( )
final

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

446 {
447 return $this->getBlockType() . "_" . $this->getBlockId() . "_blmove";
448 }

References getBlockId(), and getBlockType().

+ Here is the call graph for this function:

◆ getNavParameter()

ilBlockGUI::getNavParameter ( )
final

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

436 {
437 return $this->getBlockType() . "_" . $this->getBlockId() . "_blnav";
438 }

References getBlockId(), and getBlockType().

Referenced by fillDataSection(), getPaginationViewControl(), handleNavigation(), and setPreviousNextLinks().

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

◆ getNoItemFoundContent()

ilBlockGUI::getNoItemFoundContent ( )
protected

No item entry.

Returns
string

Reimplemented in ilCalendarBlockGUI, ilPDMembershipBlockGUI, ilPDSelectedItemsBlockGUI, ilNewsForContextBlockGUI, and ilPDTasksBlockGUI.

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

1286 : string
1287 {
1288 return $this->lng->txt("no_items");
1289 }

Referenced by getHTMLNew().

+ Here is the caller graph for this function:

◆ getOffset()

ilBlockGUI::getOffset ( )

Get Offset.

Returns
int Offset

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

251 {
252 return $this->offset;
253 }

Referenced by fillDataSection(), fillPreviousNext(), getPaginationViewControl(), loadData(), and setPreviousNextLinks().

+ Here is the caller graph for this function:

◆ getPaginationViewControl()

ilBlockGUI::getPaginationViewControl ( )

Fill previous/next row.

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

1048 {
1049 global $DIC;
1050 $factory = $DIC->ui()->factory();
1051
1053
1054
1055 // $ilCtrl->setParameterByClass("ilcolumngui",
1056 // $this->getNavParameter(), "::" . $prevoffset);
1057
1058 // ajax link
1059 $ilCtrl->setParameterByClass(
1060 "ilcolumngui",
1061 "block_id",
1062 "block_" . $this->getBlockType() . "_" . $this->block_id
1063 );
1064 $block_id = "block_" . $this->getBlockType() . "_" . $this->block_id;
1065 $onclick = $ilCtrl->getLinkTargetByClass(
1066 "ilcolumngui",
1067 "updateBlock",
1068 "",
1069 true
1070 );
1071 $ilCtrl->setParameterByClass(
1072 "ilcolumngui",
1073 "block_id",
1074 ""
1075 );
1076
1077 // normal link
1078 $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "", "", false, false);
1079
1080 //$ilCtrl->setParameterByClass("ilcolumngui",
1081 // $this->getNavParameter(), "");
1082
1083 if ($this->max_count <= $this->getLimit()) {
1084 return null;
1085 }
1086
1087 return $factory->viewControl()->pagination()
1088 ->withTargetURL($href, $this->getNavParameter() . "page")
1089 ->withTotalEntries($this->max_count)
1090 ->withPageSize($this->getLimit())
1091 ->withMaxPaginationButtons(5)
1092 ->withCurrentPage((int) $this->getOffset() / $this->getLimit());
1093 }

References $block_id, $ctrl, $DIC, $factory, $ilCtrl, getBlockType(), getLimit(), getNavParameter(), and getOffset().

Referenced by getViewControls().

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

◆ getPresentation()

ilBlockGUI::getPresentation ( )

Get presentation type.

Returns
int

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

166 : int
167 {
168 return $this->presentation;
169 }

References $presentation.

Referenced by getHTML(), getHTMLNew(), getViewControls(), and ilCalendarBlockGUI\getViewControls().

+ Here is the caller graph for this function:

◆ getProperty()

ilBlockGUI::getProperty (   $a_property)

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

415 {
416 return $this->property[$a_property];
417 }

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

+ Here is the caller graph for this function:

◆ getRefId()

ilBlockGUI::getRefId ( )

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

Returns
int Ref Id

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

359 {
360 return $this->refid;
361 }

Referenced by addRepoCommands(), ilPollBlockGUI\commentJSCall(), ilPollBlockGUI\fillRow(), ilExternalFeedBlockGUI\getHTML(), ilPollBlockGUI\getHTML(), and getHTML().

+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilBlockGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

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

318 {
319 return $this->repositorymode;
320 }

Referenced by ilCalendarBlockGUI\addConsultationHourButtons(), addRepoCommands(), getHTML(), ilNewsForContextBlockGUI\getHTML(), ilCalendarBlockGUI\getTargetGUIClassPath(), and ilCalendarBlockGUI\initCommands().

+ Here is the caller graph for this function:

◆ getRowTemplateDir()

ilBlockGUI::getRowTemplateDir ( )

Get Row Template Directory.

Returns
string Row Template Directory

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

466 {
467 return $this->rowtemplatedir;
468 }

Referenced by fillDataSection(), and ilPollBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ getRowTemplateName()

ilBlockGUI::getRowTemplateName ( )

Get Row Template Name.

Returns
string Row Template Name

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

456 {
457 return $this->rowtemplatename;
458 }

Referenced by fillDataSection(), and ilPollBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ getScreenMode()

◆ getSubtitle()

ilBlockGUI::getSubtitle ( )

Get Subtitle.

Returns
string Subtitle

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

339 {
340 return $this->subtitle;
341 }

◆ getTitle()

ilBlockGUI::getTitle ( )

Get Title.

Returns
string Title

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

231 {
232 return (string) $this->title;
233 }

References $title.

Referenced by fillHeaderTitleBlock(), getHTMLNew(), ilWikiFunctionsBlockGUI\getLegacyContent(), ilObjectMetaDataBlockGUI\getLegacyContent(), and ilExternalFeedBlockGUI\showFeedItem().

+ Here is the caller graph for this function:

◆ getViewControls()

ilBlockGUI::getViewControls ( )
protected

Get view controls.

Returns
array

Reimplemented in ilCalendarBlockGUI.

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

955 : array
956 {
957 if ($this->getPresentation() == self::PRES_SEC_LIST) {
958 $pg_view_control = $this->getPaginationViewControl();
959 if (!is_null($pg_view_control)) {
960 return [$pg_view_control];
961 }
962 }
963 return [];
964 }
getPaginationViewControl()
Fill previous/next row.

References getPaginationViewControl(), and getPresentation().

Referenced by getHTMLNew().

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

982 {
983 $reg_page = $_REQUEST[$this->getNavParameter() . "page"];
984 if ($reg_page !== "") {
985 $this->nav_value = "::" . ($reg_page * $this->getLimit());
986 }
987
988 if ($this->nav_value == "" && isset($_SESSION[$this->getNavParameter()])) {
989 $this->nav_value = $_SESSION[$this->getNavParameter()];
990 }
991
993
994 $nav = explode(":", $this->nav_value);
995 if (isset($nav[2])) {
996 $this->setOffset($nav[2]);
997 } else {
998 $this->setOffset(0);
999 }
1000 }

References $_SESSION, $nav_value, getLimit(), getNavParameter(), and setOffset().

Referenced by getHTMLNew().

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

◆ initCommands()

ilBlockGUI::initCommands ( )
protected

Init commands.

Reimplemented in ilCalendarBlockGUI.

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

510 {
511 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ isRepositoryObject()

◆ loadData()

ilBlockGUI::loadData ( )
protected

Load data for current page.

Returns
array

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

1008 {
1009 $data = $this->getData();
1010 $this->max_count = count($data);
1011 $this->correctOffset();
1012 $data = array_slice($data, $this->getOffset(), $this->getLimit());
1013 $this->preloadData($data);
1014 return $data;
1015 }

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

Referenced by getListItemGroups().

+ 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

Reimplemented in ilPDMailBlockGUI.

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

919 {
920 }

Referenced by fillDataSection(), and loadData().

+ Here is the caller graph for this function:

◆ setAdminCommands()

ilBlockGUI::setAdminCommands ( bool  $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

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

369 {
370 $this->admincommands = $a_admincommands;
371 }

◆ setBlockId()

ilBlockGUI::setBlockId (   $a_block_id = 0)

Set Block Id.

Parameters
int$a_block_idBlock ID

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

177 {
178 $this->block_id = $a_block_id;
179 }

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

+ Here is the caller graph for this function:

◆ setData()

◆ setDataSection()

ilBlockGUI::setDataSection (   $a_content)

Call this from overwritten fillDataSection(), if standard row based data is not used.

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

707 {
708 $this->tpl->setCurrentBlock("data_section");
709 $this->tpl->setVariable("DATA", $a_content);
710 $this->tpl->parseCurrentBlock();
711 $this->tpl->setVariable("BLOCK_ROW", "");
712 }
$a_content
Definition: workflow.php:93

References $a_content.

Referenced by ilExternalFeedBlockGUI\fillDataSection(), ilPollBlockGUI\fillDataSection(), ilWikiFunctionsBlockGUI\fillDataSection(), ilWikiImportantPagesBlockGUI\fillDataSection(), ilCalendarBlockGUI\fillDataSection(), ilPDSelectedItemsBlockGUI\fillDataSection(), ilPDMailBlockGUI\fillDataSection(), ilNewsForContextBlockGUI\fillDataSection(), ilPDNewsBlockGUI\fillDataSection(), ilObjectMetaDataBlockGUI\fillDataSection(), ilRepositoryObjectSearchBlockGUI\fillDataSection(), and ilPDTasksBlockGUI\fillDataSection().

+ Here is the caller graph for this function:

◆ setEnableEdit()

ilBlockGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

Reimplemented in ilCalendarBlockGUI, and ilNewsForContextBlockGUI.

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

288 {
289 $this->enableedit = $a_enableedit;
290 }

◆ setEnableNumInfo()

◆ setGuiObject()

ilBlockGUI::setGuiObject ( $a_gui_object)

Set GuiObject.

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

Parameters
object$a_gui_objectGUI object

Reimplemented in ilExternalFeedBlockGUI.

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

200 {
201 $this->gui_object = $a_gui_object;
202 }

◆ setLimit()

◆ setOffset()

ilBlockGUI::setOffset (   $a_offset)

Set Offset.

Parameters
int$a_offsetOffset

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

241 {
242 $this->offset = $a_offset;
243 }

Referenced by correctOffset(), fillDataSection(), and handleNavigation().

+ Here is the caller graph for this function:

◆ setPresentation()

◆ setPreviousNextLinks()

ilBlockGUI::setPreviousNextLinks ( )

Get previous/next linkbar.

Author
Sascha Hofmann shofm.nosp@m.ann@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Returns
array linkbar or false on error

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

811 {
812 // @todo: fix this
813 return false;
814
815
818
819 // if more entries then entries per page -> show link bar
820 if ($this->max_count > $this->getLimit() && ($this->getLimit() != 0)) {
821 // previous link
822 if ($this->getOffset() >= 1) {
823 $prevoffset = $this->getOffset() - $this->getLimit();
824
825 $ilCtrl->setParameterByClass(
826 "ilcolumngui",
827 $this->getNavParameter(),
828 "::" . $prevoffset
829 );
830
831 // ajax link
832 $ilCtrl->setParameterByClass(
833 "ilcolumngui",
834 "block_id",
835 "block_" . $this->getBlockType() . "_" . $this->block_id
836 );
837 $block_id = "block_" . $this->getBlockType() . "_" . $this->block_id;
838 $onclick = $ilCtrl->getLinkTargetByClass(
839 "ilcolumngui",
840 "updateBlock",
841 "",
842 true
843 );
844 $ilCtrl->setParameterByClass(
845 "ilcolumngui",
846 "block_id",
847 ""
848 );
849
850 // normal link
851 $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "");
852 $text = $lng->txt("previous");
853
854 // $this->addFooterLink($text, $href, $onclick, $block_id, true);
855 }
856
857 // calculate number of pages
858 $pages = intval($this->max_count / $this->getLimit());
859
860 // add a page if a rest remains
861 if (($this->max_count % $this->getLimit())) {
862 $pages++;
863 }
864
865 // show next link (if not last page)
866 if (!(($this->getOffset() / $this->getLimit()) == ($pages - 1)) && ($pages != 1)) {
867 $newoffset = $this->getOffset() + $this->getLimit();
868
869 $ilCtrl->setParameterByClass(
870 "ilcolumngui",
871 $this->getNavParameter(),
872 "::" . $newoffset
873 );
874
875 // ajax link
876 $ilCtrl->setParameterByClass(
877 "ilcolumngui",
878 "block_id",
879 "block_" . $this->getBlockType() . "_" . $this->block_id
880 );
881 //$this->tpl->setCurrentBlock("pnonclick");
882 $block_id = "block_" . $this->getBlockType() . "_" . $this->block_id;
883 $onclick = $ilCtrl->getLinkTargetByClass(
884 "ilcolumngui",
885 "updateBlock",
886 "",
887 true
888 );
889 //echo "-".$onclick."-";
890 //$this->tpl->parseCurrentBlock();
891 $ilCtrl->setParameterByClass(
892 "ilcolumngui",
893 "block_id",
894 ""
895 );
896
897 // normal link
898 $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "");
899 $text = $lng->txt("next");
900
901 // $this->addFooterLink($text, $href, $onclick, $block_id, true);
902 }
903 $ilCtrl->setParameterByClass(
904 "ilcolumngui",
905 $this->getNavParameter(),
906 ""
907 );
908 return true;
909 } else {
910 return false;
911 }
912 }

References $block_id, $ctrl, $ilCtrl, $lng, getBlockType(), getLimit(), getNavParameter(), and getOffset().

Referenced by fillPreviousNext().

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

◆ setProperties()

ilBlockGUI::setProperties (   $a_properties)

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

Parameters
string$a_propertiesproperties array (key => value)

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

410 {
411 $this->property = $a_properties;
412 }

◆ setProperty()

ilBlockGUI::setProperty (   $a_property,
  $a_value 
)

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

420 {
421 $this->property[$a_property] = $a_value;
422 }

◆ setRefId()

ilBlockGUI::setRefId (   $a_refid)

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

Parameters
int$a_refidRef Id

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

349 {
350 $this->refid = $a_refid;
351 }

◆ setRepositoryMode()

ilBlockGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

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

308 {
309 $this->repositorymode = $a_repositorymode;
310 }

◆ setRowTemplate()

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

Set Row Template Name.

Parameters
string$a_rowtemplatenameRow Template Name

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

430 {
431 $this->rowtemplatename = $a_rowtemplatename;
432 $this->rowtemplatedir = $a_rowtemplatedir;
433 }

Referenced by ilExternalFeedBlockGUI\__construct(), ilPollBlockGUI\__construct(), ilNewsForContextBlockGUI\__construct(), ilPDNewsBlockGUI\__construct(), ilCalendarBlockGUI\fillDataSection(), ilPDMailBlockGUI\fillDataSection(), and ilPDTasksBlockGUI\fillDataSection().

+ Here is the caller graph for this function:

◆ setSubtitle()

ilBlockGUI::setSubtitle (   $a_subtitle)

Set Subtitle.

Parameters
string$a_subtitleSubtitle

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

329 {
330 $this->subtitle = $a_subtitle;
331 }

◆ setTitle()

Field Documentation

◆ $access

◆ $admincommands

ilBlockGUI::$admincommands = false
protected

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

Referenced by getAdminCommands().

◆ $allow_moving

ilBlockGUI::$allow_moving = true
protected

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

◆ $block_commands

ilBlockGUI::$block_commands = array()
protected

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

Referenced by getBlockCommands().

◆ $block_id

◆ $close_command

ilBlockGUI::$close_command = false
protected

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

◆ $css_row

ilBlockGUI::$css_row = ""
protected

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

◆ $ctrl

ilBlockGUI::$ctrl
protected

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

Referenced by addRepoCommands(), ilExternalFeedBlockGUI\cancelSaveFeedBlock(), ilNewsForContextBlockGUI\cancelSettings(), ilPDNewsBlockGUI\cancelSettings(), ilPDNewsBlockGUI\changeFeedSettings(), ilExternalFeedBlockGUI\disableJS(), ilNewsForContextBlockGUI\disableJS(), ilPDNewsBlockGUI\editSettings(), ilExternalFeedBlockGUI\executeCommand(), ilPollBlockGUI\executeCommand(), ilWikiFunctionsBlockGUI\executeCommand(), ilWikiImportantPagesBlockGUI\executeCommand(), ilClassificationBlockGUI\executeCommand(), ilNewsForContextBlockGUI\executeCommand(), ilPDNewsBlockGUI\executeCommand(), ilObjectMetaDataBlockGUI\executeCommand(), ilRepositoryObjectSearchBlockGUI\executeCommand(), ilPDTasksBlockGUI\executeCommand(), ilClassificationBlockGUI\fillDataSection(), ilPollBlockGUI\fillRow(), ilExternalFeedBlockGUI\fillRow(), ilExternalFeedBlockGUI\getDynamic(), ilNewsForContextBlockGUI\getDynamic(), ilExternalFeedBlockGUI\getDynamicReload(), ilNewsForContextBlockGUI\getDynamicReload(), ilWikiImportantPagesBlockGUI\getHTML(), ilExternalFeedBlockGUI\getHTML(), ilPollBlockGUI\getHTML(), ilWikiFunctionsBlockGUI\getHTML(), getHTML(), ilClassificationBlockGUI\getHTML(), ilNewsForContextBlockGUI\getHTML(), ilPDNewsBlockGUI\getHTML(), getHTMLNew(), ilNewsForContextBlockGUI\getInfoForData(), ilExternalFeedBlockGUI\getJSEnabler(), ilNewsForContextBlockGUI\getJSEnabler(), ilWikiFunctionsBlockGUI\getLegacyContent(), ilWikiImportantPagesBlockGUI\getLegacyContent(), ilRepositoryObjectSearchBlockGUI\getLegacyContent(), ilExternalFeedBlockGUI\getListItemForData(), ilNewsForContextBlockGUI\getNewsData(), ilExternalFeedBlockGUI\getOverview(), ilNewsForContextBlockGUI\getOverview(), getPaginationViewControl(), ilNewsForContextBlockGUI\hideNotifications(), ilExternalFeedBlockGUI\initImportForm(), ilPDNewsBlockGUI\initPrivateSettingsForm(), ilNewsForContextBlockGUI\initSettingsForm(), ilNewsForContextBlockGUI\saveSettings(), ilPDNewsBlockGUI\saveSettings(), ilExternalFeedBlockGUI\setBlock(), setPreviousNextLinks(), ilPDStudyProgrammeSimpleListGUI\shouldShowThisList(), ilExternalFeedBlockGUI\showFeedItem(), ilNewsForContextBlockGUI\showFeedUrl(), ilPDNewsBlockGUI\showFeedUrl(), ilNewsForContextBlockGUI\showNews(), ilNewsForContextBlockGUI\showNotifications(), ilNewsForContextBlockGUI\subscribeNews(), and ilNewsForContextBlockGUI\unsubscribeNews().

◆ $data

◆ $dropdown

ilBlockGUI::$dropdown
protected

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

Referenced by fillHeaderCommands().

◆ $enablenuminfo

ilBlockGUI::$enablenuminfo = true
protected

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

Referenced by getEnableNumInfo().

◆ $footer_links

ilBlockGUI::$footer_links = array()
protected

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

◆ $image

ilBlockGUI::$image = false
protected

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

◆ $lng

ilBlockGUI::$lng
protected

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

Referenced by ilCalendarSelectionBlockGUI\__construct(), ilExternalFeedBlockGUI\__construct(), ilPollBlockGUI\__construct(), ilPDStudyProgrammeSimpleListGUI\__construct(), ilWikiFunctionsBlockGUI\__construct(), ilWikiImportantPagesBlockGUI\__construct(), ilCalendarBlockGUI\__construct(), ilClassificationBlockGUI\__construct(), ilNewsForContextBlockGUI\__construct(), ilPDNewsBlockGUI\__construct(), ilPDTasksBlockGUI\__construct(), ilCalendarBlockGUI\addMiniMonth(), addRepoCommands(), ilCalendarBlockGUI\addSubscriptionButton(), ilNewsForContextBlockGUI\addToSettingsForm(), ilPDNewsBlockGUI\changeFeedSettings(), ilPDNewsBlockGUI\editSettings(), ilCalendarSelectionBlockGUI\fillDataSection(), ilDashboardContentBlockGUI\fillFooter(), fillHeaderTitleBlock(), fillPreviousNext(), ilPollBlockGUI\fillRow(), ilPDTasksBlockGUI\fillRow(), ilClassificationBlockGUI\filterContainer(), ilCalendarBlockGUI\getData(), ilExternalFeedBlockGUI\getDynamicReload(), ilNewsForContextBlockGUI\getDynamicReload(), ilWikiImportantPagesBlockGUI\getHTML(), ilExternalFeedBlockGUI\getHTML(), ilPollBlockGUI\getHTML(), ilWikiFunctionsBlockGUI\getHTML(), getHTML(), ilCalendarBlockGUI\getHTML(), ilNewsForContextBlockGUI\getHTML(), ilPDNewsBlockGUI\getHTML(), ilNewsForContextBlockGUI\getInfoForData(), ilExternalFeedBlockGUI\getJSEnabler(), ilNewsForContextBlockGUI\getJSEnabler(), ilWikiFunctionsBlockGUI\getLegacyContent(), ilWikiImportantPagesBlockGUI\getLegacyContent(), ilRepositoryObjectSearchBlockGUI\getLegacyContent(), ilPDTasksBlockGUI\getListItemForData(), ilExternalFeedBlockGUI\getOverview(), ilCalendarBlockGUI\getOverview(), ilNewsForContextBlockGUI\getOverview(), ilPDTasksBlockGUI\getOverview(), ilCalendarBlockGUI\getViewControl(), ilExternalFeedBlockGUI\importFile(), ilCalendarBlockGUI\initCommands(), ilExternalFeedBlockGUI\initFormFeedBlock(), ilExternalFeedBlockGUI\initImportForm(), ilPDNewsBlockGUI\initPrivateSettingsForm(), ilNewsForContextBlockGUI\initSettingsForm(), setPreviousNextLinks(), ilExternalFeedBlockGUI\showFeedItem(), ilNewsForContextBlockGUI\showFeedUrl(), ilPDNewsBlockGUI\showFeedUrl(), and ilNewsForContextBlockGUI\showNews().

◆ $main_tpl

◆ $max_count

ilBlockGUI::$max_count = false
protected

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

Referenced by fillPreviousNext().

◆ $move

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

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

◆ $nav_value

ilBlockGUI::$nav_value = ""
protected

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

Referenced by fillDataSection(), and handleNavigation().

◆ $new_rendering

ilBlockGUI::$new_rendering = false
protected

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

◆ $obj_def

ilBlockGUI::$obj_def
protected

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

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

◆ $presentation

◆ $property

ilBlockGUI::$property = false
protected

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

◆ $title

◆ $tpl

◆ $ui

ilBlockGUI::$ui
protected

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

◆ $user

◆ PRES_MAIN_LEG

const ilBlockGUI::PRES_MAIN_LEG = 0

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

Referenced by getHTMLNew().

◆ PRES_MAIN_LIST

const ilBlockGUI::PRES_MAIN_LIST = 3

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

Referenced by getHTMLNew().

◆ PRES_SEC_LEG

const ilBlockGUI::PRES_SEC_LEG = 1

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

Referenced by __construct(), and getHTMLNew().

◆ PRES_SEC_LIST

const ilBlockGUI::PRES_SEC_LIST = 2

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

Referenced by getHTMLNew().


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