24 include_once(
"./Services/Container/classes/class.ilContainerContentGUI.php");
50 $this->tabs = $DIC->tabs();
51 $this->
user = $DIC->user();
52 $this->ctrl = $DIC->ctrl();
53 $lng = $DIC->language();
71 return self::DETAILS_DEACTIVATED;
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)) {
77 return self::DETAILS_ALL;
79 return self::DETAILS_TITLE;
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) {
272 $_SESSION[
'sess'][
'expanded'][abs((
int)
$_GET[
'expand'])] = self::DETAILS_ALL;
274 $_SESSION[
'sess'][
'expanded'][abs((
int)
$_GET[
'expand'])] = self::DETAILS_TITLE;
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 299 $user = $DIC->user();
301 $tree = $DIC->repositoryTree();
303 $limit_sessions =
false;
305 !$admin_panel_enabled &&
306 !$include_side_block &&
308 is_array($items[
'sess']) &&
310 $container->isSessionLimitEnabled()
312 $limit_sessions =
true;
316 $parent = $tree->checkForParentType($container->
getRefId(),
'crs');
322 if (!$container->isSessionLimitEnabled()) {
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--) {
373 if (!
$user->getPref(
'crs_sess_show_prev_' . $container->
getId())) {
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--) {
384 if (!
$user->getPref(
'crs_sess_show_next_' . $container->
getId())) {
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);
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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 _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.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
initRenderer()
Init container renderer.
getViewMode()
Get container view mode.
getMainContent()
Get content HTML for main column.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
Parent class of all container content GUIs.
getDetailsLevel($a_session_id)
get details level
renderSessionLimitLink($a_previous=true)
Show link to show/hide all previous/next sessions.
getId()
get object id public
__showMaterials($a_tpl)
Show Materials.
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container object.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
addFooterRow($tpl)
add footer row
clearAdminCommandsDetermination()
cleaer administration commands determination
static lookupLastSessionByCourse($a_ref_id)
public
__construct($container_gui_obj)
Constructor.
static prepareSessionPresentationLimitation(array $items, ilContainer $container, bool $admin_panel_enabled=false, bool $include_side_block=false)
Shows all items in one block.
__construct(Container $dic, ilPlugin $plugin)
getRefId()
get reference id public
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
initDetails()
init details
static _getInstance($a_obj_id)
get instance by obj_id
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 lookupNextSessionByCourse($a_ref_id)
public