33 $this->
tabs = $DIC->tabs();
34 $this->
user = $DIC->user();
35 $this->
ctrl = $DIC->ctrl();
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)) {
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);
206 $ilCtrl = $this->
ctrl;
208 $ilCtrl->setParameterByClass(
211 $this->request->getRefId()
214 $tpl->setCurrentBlock(
'container_details_row');
215 $tpl->setVariable(
'TXT_DETAILS', $this->
lng->txt(
'details'));
221 $this->handleSessionExpand();
230 public static function prepareSessionPresentationLimitation(
233 bool $admin_panel_enabled =
false,
234 bool $include_side_block =
false
239 $user =
$DIC->user();
240 $access =
$DIC->access();
241 $tree =
$DIC->repositoryTree();
242 $request =
$DIC->container()
247 $limit_sessions =
false;
249 !$admin_panel_enabled &&
250 !$include_side_block &&
251 isset($items[
'sess']) &&
255 $limit_sessions =
true;
259 $parent = $tree->checkForParentType(
$container->getRefId(),
'crs');
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) {
285 (
string) $request->getPreviousSession()
288 if ($request->getNextSession() !==
null) {
291 (
string) $request->getNextSession()
295 $session_rbac_checked = [];
296 foreach ($items[
'sess'] as $session_tree_info) {
297 if ($access->checkAccess(
'visible',
'', $session_tree_info[
'ref_id'])) {
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--) {
322 if (!$user->getPref(
'crs_sess_show_prev_' .
$container->getId())) {
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--) {
333 if (!$user->getPref(
'crs_sess_show_next_' .
$container->getId())) {
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);
setVariable($variable, $value='')
Sets a variable value.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
Parent class of all container content GUIs.
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.
initRenderer()
Init container renderer.
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
getItemGroupsHTML(int $a_pos=0)
ilGlobalTemplateInterface $tpl
clearAdminCommandsDetermination()
const DETAILS_DEACTIVATED
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showMaterials(ilTemplate $a_tpl)
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
__construct(ilContainerGUI $container_gui_obj)
addFooterRow(ilTemplate $tpl)
renderSessionLimitLink(bool $a_previous=true)
getDetailsLevel(int $a_item_id)
static _getInstance(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@classDescription Date and time handling
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 _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.
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.
loadLanguageModule(string $a_module)
Load language module.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static lookupNextSessionByCourse(int $a_ref_id)
static lookupLastSessionByCourse(int $a_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc