33 $this->
tabs = $DIC->tabs();
34 $this->
user = $DIC->user();
35 $this->
ctrl = $DIC->ctrl();
36 $lng = $DIC->language();
46 return self::DETAILS_DEACTIVATED;
48 if ($this->item_manager->getExpanded($a_item_id) !== null) {
49 return $this->item_manager->getExpanded($a_item_id);
51 if (in_array($a_item_id, $this->force_details)) {
52 return self::DETAILS_ALL;
55 return self::DETAILS_TITLE;
64 "tpl.container_page.html",
87 if ($output_html !=
"") {
91 if (isset($this->items[
"sess"]) ||
92 isset($this->items[
'sess_link'][
'prev'][
'value']) ||
93 isset($this->items[
'sess_link'][
'next'][
'value'])) {
96 $prefix = $postfix =
"";
97 if (isset($this->items[
'sess_link'][
'prev'][
'value'])) {
100 if (isset($this->items[
'sess_link'][
'next'][
'value'])) {
104 $this->renderer->addTypeBlock(
"sess", $prefix, $postfix);
105 $this->renderer->setBlockPosition(
"sess", 1);
109 foreach ($this->items[
"sess"] as $item_data) {
110 if (!$this->renderer->hasItem($item_data[
"child"])) {
111 $html = $this->
renderItem($item_data, $position++,
true);
113 $this->renderer->addItemToBlock(
"sess", $item_data[
"type"], $item_data[
"child"], $html);
117 #22328 render session block if previous or next session link is available 119 !count($this->items[
'sess'] ?? []) &&
120 ($prefix !==
'' || $postfix !==
'')
122 $this->renderer->addItemToBlock(
'sess',
'', 0,
' ');
128 if (isset($this->items[
"_all"])) {
129 $this->renderer->addCustomBlock(
"_all",
$lng->
txt(
"content"));
130 $this->renderer->setBlockPosition(
"_all", ++$pos);
134 foreach ($this->items[
"_all"] as $item_data) {
136 if ($item_data[
"type"] ===
"sess" || $item_data[
"type"] ===
"itgr") {
140 if (!$this->renderer->hasItem($item_data[
"child"])) {
141 $html = $this->
renderItem($item_data, $position++,
true);
143 $this->renderer->addItemToBlock(
"_all", $item_data[
"type"], $item_data[
"child"], $html);
149 $output_html .= $this->renderer->getHTML();
151 $a_tpl->
setVariable(
"CONTAINER_PAGE_CONTENT", $output_html);
155 bool $a_previous =
true 164 'tpl.container_list_item.html',
177 $ilCtrl->setParameterByClass(get_class($this->
getContainerGUI()),
'crs_prev_sess', (
int) !$prefp);
181 $ilCtrl->setParameterByClass(get_class($this->
getContainerGUI()),
'crs_prev_sess', (
int) !$prefp);
193 $ilCtrl->setParameterByClass(get_class($this->
getContainerGUI()),
'crs_next_sess', (
int) !$prefn);
211 $this->request->getRefId()
230 public static function prepareSessionPresentationLimitation(
233 bool $admin_panel_enabled =
false,
234 bool $include_side_block =
false 239 $user = $DIC->user();
241 $tree = $DIC->repositoryTree();
247 $limit_sessions =
false;
249 !$admin_panel_enabled &&
250 !$include_side_block &&
251 isset($items[
'sess']) &&
252 $container->isSessionLimitEnabled() &&
255 $limit_sessions =
true;
259 $parent = $tree->checkForParentType($container->
getRefId(),
'crs');
265 if (!$container->isSessionLimitEnabled()) {
266 $limit_sessions =
false;
268 $limit_next = $crs->getNumberOfNextSessions();
269 $limit_prev = $crs->getNumberOfPreviousSessions();
271 $limit_next = $container->getNumberOfNextSessions();
272 $limit_prev = $container->getNumberOfPreviousSessions();
275 if (!$limit_sessions) {
282 if (
$request->getPreviousSession() !== null) {
284 'crs_sess_show_prev_' . $container->
getId(),
285 (string)
$request->getPreviousSession()
288 if (
$request->getNextSession() !== null) {
290 'crs_sess_show_next_' . $container->
getId(),
295 $session_rbac_checked = [];
296 foreach ($items[
'sess'] as $session_tree_info) {
298 $session_rbac_checked[] = $session_tree_info;
304 $previous = $current = $next = [];
305 foreach ($sessions as
$key => $item) {
317 $num_previous_remove = max(
318 count($previous) - $limit_prev,
321 while ($num_previous_remove--) {
323 array_shift($previous);
325 $items[
'sess_link'][
'prev'][
'value'] = 1;
328 $num_next_remove = max(
329 count($next) - $limit_next,
332 while ($num_next_remove--) {
337 $items[
'sess_link'][
'next'][
'value'] = 1;
340 $sessions = array_merge($previous, $current, $next);
341 $items[
'sess'] = $sessions;
345 $items[(
int) $admin_panel_enabled][(
int) $include_side_block] = $sort->sortItems($items);
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
showMaterials(ilTemplate $a_tpl)
writePref(string $a_keyword, string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
getItemGroupsHTML(int $a_pos=0)
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
ilGlobalTemplateInterface $tpl
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) ...
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
initRenderer()
Init container renderer.
Parent class of all container content GUIs.
__construct(ilContainerGUI $container_gui_obj)
static lookupNextSessionByCourse(int $a_ref_id)
setVariable($variable, $value='')
Sets a variable value.
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.
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static lookupLastSessionByCourse(int $a_ref_id)
getPref(string $a_keyword)
StandardGUIRequest $request
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDetailsLevel(int $a_item_id)
clearAdminCommandsDetermination()
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
renderSessionLimitLink(bool $a_previous=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
static _getInstance(int $a_obj_id)
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
addFooterRow(ilTemplate $tpl)
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check whether an date is within a date duration given by start and end.
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)