24include_once(
"./Services/Container/classes/class.ilContainerContentGUI.php");
50 $this->tabs =
$DIC->tabs();
51 $this->
user = $DIC->user();
52 $this->ctrl =
$DIC->ctrl();
73 if (isset(
$_SESSION[
'sess'][
'expanded'][$a_session_id])) {
74 return $_SESSION[
'sess'][
'expanded'][$a_session_id];
76 if (in_array($a_session_id, $this->force_details)) {
96 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
99 "tpl.container_page.html",
125 if ($output_html !=
"") {
129 $prefix = $postfix =
'';
130 if (is_array($this->items[
"sess"]) ||
131 $this->items[
'sess_link'][
'prev'][
'value'] ||
132 $this->items[
'sess_link'][
'next'][
'value']) {
133 $this->items[
'sess'] =
ilUtil::sortArray($this->items[
'sess'],
'start',
'asc',
true,
false);
135 if ($this->items[
'sess_link'][
'prev'][
'value']) {
138 if ($this->items[
'sess_link'][
'next'][
'value']) {
142 $this->renderer->addTypeBlock(
"sess", $prefix, $postfix);
143 $this->renderer->setBlockPosition(
"sess", 1);
146 foreach ($this->items[
"sess"] as $item_data) {
147 if (!$this->renderer->hasItem($item_data[
"child"])) {
148 $html = $this->
renderItem($item_data, $position++,
true);
150 $this->renderer->addItemToBlock(
"sess", $item_data[
"type"], $item_data[
"child"], $html);
154 #22328 render session block if previous or next session link is available
156 !count($this->items[
'sess'] ?? []) &&
157 ($prefix !==
'' || $postfix !==
'')
159 $this->renderer->addItemToBlock(
'sess',
'', 0,
' ');
163 if (is_array($this->items[
"_all"])) {
164 $this->renderer->addCustomBlock(
"_all",
$lng->txt(
"content"));
165 $this->renderer->setBlockPosition(
"_all", ++$pos);
169 foreach ($this->items[
"_all"] as $item_data) {
171 if ($item_data[
"type"] ==
"sess" || $item_data[
"type"] ==
"itgr") {
175 if (!$this->renderer->hasItem($item_data[
"child"])) {
176 $html = $this->
renderItem($item_data, $position++,
true);
178 $this->renderer->addItemToBlock(
"_all", $item_data[
"type"], $item_data[
"child"], $html);
184 $output_html .= $this->renderer->getHTML();
186 $a_tpl->setVariable(
"CONTAINER_PAGE_CONTENT", $output_html);
199 $lng->loadLanguageModule(
'crs');
202 'tpl.container_list_item.html',
207 $tpl->setVariable(
'DIV_CLASS',
'ilContainerListItemOuter');
208 $tpl->setCurrentBlock(
'item_title_linked');
214 $tpl->setVariable(
'TXT_TITLE_LINKED',
$lng->txt(
'crs_link_hide_prev_sessions'));
215 $ilCtrl->setParameterByClass(get_class($this->
getContainerGUI()),
'crs_prev_sess', (
int) !$prefp);
216 $tpl->setVariable(
'HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->
getContainerGUI()),
'view'));
218 $tpl->setVariable(
'TXT_TITLE_LINKED',
$lng->txt(
'crs_link_show_all_prev_sessions'));
219 $ilCtrl->setParameterByClass(get_class($this->
getContainerGUI()),
'crs_prev_sess', (
int) !$prefp);
220 $tpl->setVariable(
'HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->
getContainerGUI()),
'view'));
227 $tpl->setVariable(
'TXT_TITLE_LINKED',
$lng->txt(
'crs_link_hide_next_sessions'));
229 $tpl->setVariable(
'TXT_TITLE_LINKED',
$lng->txt(
'crs_link_show_all_next_sessions'));
231 $ilCtrl->setParameterByClass(get_class($this->
getContainerGUI()),
'crs_next_sess', (
int) !$prefn);
232 $tpl->setVariable(
'HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->
getContainerGUI()),
'view'));
235 $tpl->parseCurrentBlock();
252 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
254 $tpl->setCurrentBlock(
'container_details_row');
255 $tpl->setVariable(
'TXT_DETAILS', $this->lng->txt(
'details'));
256 $tpl->parseCurrentBlock();
270 if (
$_GET[
'expand']) {
271 if (
$_GET[
'expand'] > 0) {
278 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
282 $this->force_details = array(
$session);
294 bool $admin_panel_enabled =
false,
295 bool $include_side_block =
false
301 $tree =
$DIC->repositoryTree();
303 $limit_sessions =
false;
305 !$admin_panel_enabled &&
306 !$include_side_block &&
308 is_array($items[
'sess']) &&
312 $limit_sessions =
true;
316 $parent = $tree->checkForParentType(
$container->getRefId(),
'crs');
323 $limit_sessions =
false;
325 $limit_next = $crs->getNumberOfNextSessions();
326 $limit_prev = $crs->getNumberOfPreviousSessions();
328 $limit_next =
$container->getNumberOfNextSessions();
329 $limit_prev =
$container->getNumberOfPreviousSessions();
332 if (!$limit_sessions) {
339 if (isset(
$_GET[
'crs_prev_sess'])) {
340 $user->writePref(
'crs_sess_show_prev_' .
$container->getId(), (
string) (
int)
$_GET[
'crs_prev_sess']);
342 if (isset(
$_GET[
'crs_next_sess'])) {
343 $user->writePref(
'crs_sess_show_next_' .
$container->getId(), (
string) (
int)
$_GET[
'crs_next_sess']);
346 $session_rbac_checked = [];
347 foreach ($items[
'sess'] as $session_tree_info) {
348 if (
$access->checkAccess(
'visible',
'', $session_tree_info[
'ref_id'])) {
349 $session_rbac_checked[] = $session_tree_info;
352 $sessions =
ilUtil::sortArray($session_rbac_checked,
'start',
'ASC',
true,
false);
355 $previous = $current = $next = array();
356 foreach ($sessions as $key => $item) {
368 $num_previous_remove = max(
369 count($previous) - $limit_prev,
372 while ($num_previous_remove--) {
374 array_shift($previous);
376 $items[
'sess_link'][
'prev'][
'value'] = 1;
379 $num_next_remove = max(
380 count($next) - $limit_next,
383 while ($num_next_remove--) {
388 $items[
'sess_link'][
'next'][
'value'] = 1;
391 $sessions = array_merge($previous, $current, $next);
392 $items[
'sess'] = $sessions;
396 $items[(int) $admin_panel_enabled][(
int) $include_side_block] = $sort->sortItems($items);
An exception for terminatinating execution or to throw for unit testing.
Parent class of all container content GUIs.
initRenderer()
Init container renderer.
getContainerObject()
Get container object.
getContainerGUI()
Get container GUI object.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
clearAdminCommandsDetermination()
cleaer administration commands determination
const DETAILS_DEACTIVATED
Shows all items in one block.
addFooterRow($tpl)
add footer row
renderSessionLimitLink($a_previous=true)
Show link to show/hide all previous/next sessions.
getMainContent()
Get content HTML for main column.
__showMaterials($a_tpl)
Show Materials.
getDetailsLevel($a_session_id)
get details level
initDetails()
init details
__construct($container_gui_obj)
Constructor.
static prepareSessionPresentationLimitation(array $items, ilContainer $container, bool $admin_panel_enabled=false, bool $include_side_block=false)
static _getInstance($a_obj_id)
get instance by obj_id
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $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, $a_compare_field='', $a_tz='')
Check whether an date is within a date duration given by start and end.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static lookupLastSessionByCourse($a_ref_id)
@access public
static lookupNextSessionByCourse($a_ref_id)
@access public
special template class to simplify handling of ITX/PEAR
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc