ILIAS  release_8 Revision v8.23
ilContainerSessionsContentGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilContainerSessionsContentGUI:
+ Collaboration diagram for ilContainerSessionsContentGUI:

Public Member Functions

 __construct (ilContainerGUI $container_gui_obj)
 
 getMainContent ()
 
 addFooterRow (ilTemplate $tpl)
 
- Public Member Functions inherited from ilContainerContentGUI
 getContainerObject ()
 
 getContainerGUI ()
 
 setOutput ()
 This method sets the output of the right and main column in the global standard template. More...
 
 getMainContent ()
 Get content HTML for main column, this one must be overwritten in derived classes. More...
 
 determinePageEmbeddedBlocks (string $a_container_page_html)
 Determine all blocks that are embedded in the container page. More...
 
 addEmbeddedBlock (string $block_type, $block_parameter)
 Add embedded block. More...
 
 getEmbeddedBlocks ()
 
 renderPageEmbeddedBlocks ()
 
 renderItem (array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
 Render an item. More...
 
 renderCard (array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="")
 
 insertPageEmbeddedBlocks (string $a_output_html)
 Insert blocks into container page. More...
 
 getSingleTypeBlockAsynch (string $type)
 Render single block. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 getIntroduction ()
 
 getItemGroupsHTML (int $a_pos=0)
 
 renderItemGroup (array $a_itgr)
 

Protected Member Functions

 getDetailsLevel (int $a_item_id)
 
 renderSessionLimitLink (bool $a_previous=true)
 
 initDetails ()
 
- Protected Member Functions inherited from ilContainerContentGUI
 getViewMode ()
 
 getDetailsLevel (int $a_item_id)
 
 getRightColumnHTML ()
 
 getCenterColumnHTML ()
 
 initRenderer ()
 Init container renderer. More...
 
 clearAdminCommandsDetermination ()
 
 determineAdminCommands (int $a_ref_id, bool $a_admin_com_included_in_list=false)
 
 getItemGUI (array $item_data)
 
 hasForcedOrderByStartDate (string $type)
 
 handleSessionExpand ()
 

Protected Attributes

ilTabsGUI $tabs
 
array $force_details = []
 
- Protected Attributes inherited from ilContainerContentGUI
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilObjUser $user
 
ilLanguage $lng
 
ilAccessHandler $access
 
ilDBInterface $db
 
ilRbacSystem $rbacsystem
 
ilSetting $settings
 
ilObjectDefinition $obj_definition
 
int $details_level = self::DETAILS_DEACTIVATED
 
ilContainerRenderer $renderer
 
ilLogger $log
 
int $view_mode
 
array $embedded_block = []
 
array $items = []
 
array $list_gui = []
 
ClipboardManager $clipboard
 
StandardGUIRequest $request
 
ItemManager $item_manager
 
BlockSessionRepository $block_repo
 

Private Member Functions

 showMaterials (ilTemplate $a_tpl)
 

Additional Inherited Members

- Data Fields inherited from ilContainerContentGUI
const DETAILS_DEACTIVATED = 0
 
const DETAILS_TITLE = 1
 
const DETAILS_ALL = 2
 
const VIEW_MODE_LIST = 0
 
const VIEW_MODE_TILE = 1
 
ilContainerGUI $container_gui
 
ilContainer $container_obj
 
bool $adminCommands = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Shows all items in one block.

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

Definition at line 24 of file class.ilContainerSessionsContentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerSessionsContentGUI::__construct ( ilContainerGUI  $container_gui_obj)

Definition at line 29 of file class.ilContainerSessionsContentGUI.php.

References $DIC, ilContainerContentGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), initDetails(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

30  {
31  global $DIC;
32 
33  $this->tabs = $DIC->tabs();
34  $this->user = $DIC->user();
35  $this->ctrl = $DIC->ctrl();
36  $lng = $DIC->language();
37  parent::__construct($container_gui_obj);
38  $this->lng = $lng;
39  $this->initDetails();
40  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addFooterRow()

ilContainerSessionsContentGUI::addFooterRow ( ilTemplate  $tpl)

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

References ilContainerContentGUI\$ctrl, ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), ilCtrl\setParameterByClass(), and HTML_Template_IT\setVariable().

205  : void {
206  $ilCtrl = $this->ctrl;
207 
208  $ilCtrl->setParameterByClass(
209  "ilrepositorygui",
210  "ref_id",
211  $this->request->getRefId()
212  );
213 
214  $tpl->setCurrentBlock('container_details_row');
215  $tpl->setVariable('TXT_DETAILS', $this->lng->txt('details'));
216  $tpl->parseCurrentBlock();
217  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ getDetailsLevel()

ilContainerSessionsContentGUI::getDetailsLevel ( int  $a_item_id)
protected

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

References ilContainerContentGUI\getContainerGUI().

43  : int
44  {
45  if ($this->getContainerGUI()->isActiveAdministrationPanel()) {
46  return self::DETAILS_DEACTIVATED;
47  }
48  if ($this->item_manager->getExpanded($a_item_id) !== null) {
49  return $this->item_manager->getExpanded($a_item_id);
50  }
51  if (in_array($a_item_id, $this->force_details)) {
52  return self::DETAILS_ALL;
53  }
54 
55  return self::DETAILS_TITLE;
56  }
+ Here is the call graph for this function:

◆ getMainContent()

ilContainerSessionsContentGUI::getMainContent ( )

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

References ilContainerContentGUI\$tpl, ilGlobalTemplateInterface\get(), and showMaterials().

58  : string
59  {
60  // see bug #7452
61  // $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
62 
63  $tpl = new ilTemplate(
64  "tpl.container_page.html",
65  true,
66  true,
67  "Services/Container"
68  );
69 
70  $this->showMaterials($tpl);
71 
72  return $tpl->get();
73  }
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
+ Here is the call graph for this function:

◆ initDetails()

ilContainerSessionsContentGUI::initDetails ( )
protected

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

References ilContainerContentGUI\$access, $container, $DIC, ilContainerContentGUI\$items, ILIAS\LTI\ToolProvider\$key, ilContainerContentGUI\$request, $session, ilContainerContentGUI\$user, ilDateTime\_after(), ilDateTime\_before(), ilContainerSorting\_getInstance(), ilDateTime\_within(), ilRBACAccessHandler\checkAccess(), ilContainerContentGUI\getContainerObject(), ilObject\getId(), ilObjectFactory\getInstanceByRefId(), ilObjUser\getPref(), ilObject\getRefId(), ilContainer\getViewMode(), ilContainerContentGUI\handleSessionExpand(), IL_CAL_DATE, IL_CAL_DAY, IL_CAL_UNIX, ILIAS\Repository\int(), ilSessionAppointment\lookupLastSessionByCourse(), ilSessionAppointment\lookupNextSessionByCourse(), ilArrayUtil\sortArray(), ilContainer\VIEW_INHERIT, ilContainer\VIEW_SESSIONS, and ilObjUser\writePref().

Referenced by __construct().

219  : void
220  {
221  $this->handleSessionExpand();
222 
224  $this->force_details = $session;
226  $this->force_details = [$session];
227  }
228  }
$session
static lookupNextSessionByCourse(int $a_ref_id)
static lookupLastSessionByCourse(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderSessionLimitLink()

ilContainerSessionsContentGUI::renderSessionLimitLink ( bool  $a_previous = true)
protected

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

References ilContainerContentGUI\$ctrl, $ilUser, ilContainerContentGUI\$lng, ilContainerContentGUI\$tpl, ilContainerContentGUI\$user, ilGlobalTemplateInterface\get(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ILIAS\Survey\Mode\getId(), ilLanguage\loadLanguageModule(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ilLanguage\txt().

Referenced by showMaterials().

156  : string {
157  $lng = $this->lng;
159  $ilCtrl = $this->ctrl;
160 
161  $lng->loadLanguageModule('crs');
162 
163  $tpl = new ilTemplate(
164  'tpl.container_list_item.html',
165  true,
166  true,
167  "Services/Container"
168  );
169  $tpl->setVariable('DIV_CLASS', 'ilContainerListItemOuter');
170  $tpl->setCurrentBlock('item_title_linked');
171 
172  if ($a_previous) {
173  $prefp = $ilUser->getPref('crs_sess_show_prev_' . $this->getContainerObject()->getId());
174 
175  if ($prefp) {
176  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_hide_prev_sessions'));
177  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_prev_sess', (int) !$prefp);
178  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI()), 'view'));
179  } else {
180  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_show_all_prev_sessions'));
181  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_prev_sess', (int) !$prefp);
182  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI()), 'view'));
183  }
184  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
185  } else {
186  $prefn = $ilUser->getPref('crs_sess_show_next_' . $this->getContainerObject()->getId());
187 
188  if ($prefn) {
189  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_hide_next_sessions'));
190  } else {
191  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_show_all_next_sessions'));
192  }
193  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_next_sess', (int) !$prefn);
194  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI()), 'view'));
195  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
196  }
198 
199  return $tpl->get();
200  }
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...
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$ilUser
Definition: imgupload.php:34
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMaterials()

ilContainerSessionsContentGUI::showMaterials ( ilTemplate  $a_tpl)
private

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

References ilContainerContentGUI\$lng, ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\initRenderer(), ilContainerContentGUI\insertPageEmbeddedBlocks(), ilContainerContentGUI\renderItem(), renderSessionLimitLink(), HTML_Template_IT\setVariable(), ilArrayUtil\sortArray(), and ilLanguage\txt().

Referenced by getMainContent().

75  : void
76  {
77  $lng = $this->lng;
78 
79  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
81 
82  $this->initRenderer();
83 
84  $output_html = $this->getContainerGUI()->getContainerPageHTML();
85 
86  // get embedded blocks
87  if ($output_html != "") {
88  $output_html = $this->insertPageEmbeddedBlocks($output_html);
89  }
90 
91  if (isset($this->items["sess"]) ||
92  isset($this->items['sess_link']['prev']['value']) ||
93  isset($this->items['sess_link']['next']['value'])) {
94  $this->items['sess'] = ilArrayUtil::sortArray($this->items['sess'], 'start', 'asc', true, false);
95 
96  $prefix = $postfix = "";
97  if (isset($this->items['sess_link']['prev']['value'])) {
98  $prefix = $this->renderSessionLimitLink(true);
99  }
100  if (isset($this->items['sess_link']['next']['value'])) {
101  $postfix = $this->renderSessionLimitLink(false);
102  }
103 
104  $this->renderer->addTypeBlock("sess", $prefix, $postfix);
105  $this->renderer->setBlockPosition("sess", 1);
106 
107  $position = 1;
108 
109  foreach ($this->items["sess"] as $item_data) {
110  if (!$this->renderer->hasItem($item_data["child"])) {
111  $html = $this->renderItem($item_data, $position++, true);
112  if ($html != "") {
113  $this->renderer->addItemToBlock("sess", $item_data["type"], $item_data["child"], $html);
114  }
115  }
116  }
117  #22328 render session block if previous or next session link is available
118  if (
119  !count($this->items['sess'] ?? []) &&
120  ($prefix !== '' || $postfix !== '')
121  ) {
122  $this->renderer->addItemToBlock('sess', '', 0, ' ');
123  }
124  }
125 
126  $pos = $this->getItemGroupsHTML(1);
127 
128  if (isset($this->items["_all"])) {
129  $this->renderer->addCustomBlock("_all", $lng->txt("content"));
130  $this->renderer->setBlockPosition("_all", ++$pos);
131 
132  $position = 1;
133 
134  foreach ($this->items["_all"] as $item_data) {
135  // #14599
136  if ($item_data["type"] === "sess" || $item_data["type"] === "itgr") {
137  continue;
138  }
139 
140  if (!$this->renderer->hasItem($item_data["child"])) {
141  $html = $this->renderItem($item_data, $position++, true);
142  if ($html != "") {
143  $this->renderer->addItemToBlock("_all", $item_data["type"], $item_data["child"], $html);
144  }
145  }
146  }
147  }
148 
149  $output_html .= $this->renderer->getHTML();
150 
151  $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
152  }
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...
initRenderer()
Init container renderer.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
renderItem(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
Render an item.
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $force_details

array ilContainerSessionsContentGUI::$force_details = []
protected

Definition at line 27 of file class.ilContainerSessionsContentGUI.php.

◆ $tabs

ilTabsGUI ilContainerSessionsContentGUI::$tabs
protected

Definition at line 26 of file class.ilContainerSessionsContentGUI.php.


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