103 $this->tpl = $DIC[
"tpl"];
104 $this->ctrl = $DIC->ctrl();
105 $this->
user = $DIC->user();
106 $this->lng = $DIC->language();
107 $this->access = $DIC->access();
108 $this->plugin_admin = $DIC[
"ilPluginAdmin"];
109 $this->db = $DIC->database();
110 $this->rbacsystem = $DIC->rbac()->system();
112 $this->obj_definition = $DIC[
"objDefinition"];
115 $this->container_gui = $container_gui_obj;
116 $this->container_obj = $this->container_gui->object;
118 $tpl->addJavaScript(
"./Services/Container/js/Container.js");
123 !$this->container_gui->isActiveAdministrationPanel() &&
124 !$this->container_gui->isActiveOrdering())
125 ? self::VIEW_MODE_TILE
126 : self::VIEW_MODE_LIST;
184 if (
$ilCtrl->getNextClass() ==
"ilcolumngui" &&
190 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
207 if (
$ilCtrl->getNextClass() !=
"ilcolumngui" ||
224 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
229 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
238 if (
$ilCtrl->getNextClass() ==
"ilcolumngui" &&
247 include_once(
"./Services/UIComponent/classes/class.ilUIHookProcessor.php");
249 "Services/Container",
251 array(
"container_content_gui" => $this)
253 if (!$uip->replaced()) {
272 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
274 $tpl->addOnLoadCode(
"il.Object.setRedrawListItemUrl('" .
275 $ilCtrl->getLinkTarget($this->container_gui,
"redrawListItem",
"",
true) .
"');");
277 $tpl->addOnLoadCode(
"il.Object.setRatingUrl('" .
279 array(get_class($this->container_gui),
"ilcommonactiondispatchergui",
"ilratinggui"),
286 switch (
$ilCtrl->getNextClass()) {
288 $this->container_gui->setSideColumnReturn();
293 $ilDB->useSlave(
true);
295 $ilDB->useSlave(
false);
313 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
316 include_once
"Services/Container/classes/class.ilContainerRenderer.php";
320 $this->
getContainerGUI()->isActiveOrdering() && (get_class($this) !=
"ilContainerObjectiveGUI")
322 $sorting->getBlockPositions(),
336 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
372 $this->adminCommands =
false;
384 if (!$this->adminCommands) {
386 if (
$rbacsystem->checkAccess(
"delete", $a_ref_id)) {
387 $this->adminCommands =
true;
390 $this->adminCommands = $a_admin_com_included_in_list;
398 protected function getItemGUI($item_data, $a_show_path =
false)
400 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
403 if (!is_object($this->list_gui[$item_data[
"type"]])) {
406 $this->list_gui[$item_data[
"type"]] = &$item_list_gui;
408 $item_list_gui = &$this->list_gui[$item_data[
"type"]];
412 $item_list_gui->setParentRefId($item_data[
"parent"]);
414 $item_list_gui->setDefaultCommandParameters(array());
415 $item_list_gui->disableTitleLink(
false);
416 $item_list_gui->resetConditionTarget();
426 $item_list_gui->enableComments(
true);
427 $item_list_gui->enableNotes(
true);
428 $item_list_gui->enableTags(
true);
429 $item_list_gui->enableRating(
true);
432 $item_list_gui->forceVisibleOnly(
false);
435 $this->
getContainerGUI()->modifyItemGUI($item_list_gui, $item_data, $a_show_path);
437 return $item_list_gui;
448 foreach ($type_grps as
$type => $v) {
450 if (is_int(strpos($a_container_page_html,
"[list-" .
$type .
"]"))) {
456 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
459 $a_container_page_html = preg_replace(
'~\[' . $found[1] .
'\]~i',
$html, $a_container_page_html);
470 $this->embedded_block[$block_type][] = $block_parameter;
478 return $this->embedded_block;
489 if (is_array($this->embedded_block[
"itgr"])) {
490 $item_groups = array();
491 if (is_array($this->items[
"itgr"])) {
492 foreach ($this->items[
"itgr"] as $ig) {
493 $item_groups[$ig[
"ref_id"]] = $ig;
497 foreach ($this->embedded_block[
"itgr"] as $ref_id) {
498 if (isset($item_groups[$ref_id])) {
505 if (is_array($this->embedded_block[
"type"])) {
506 foreach ($this->embedded_block[
"type"] as $k =>
$type) {
507 if (is_array($this->items[
$type]) &&
508 $this->renderer->addTypeBlock($type)) {
510 if ($type ==
'sess') {
511 $this->items[
'sess'] =
ilUtil::sortArray($this->items[
'sess'],
'start',
'ASC',
true,
true);
516 foreach ($this->items[$type] as $k => $item_data) {
517 if (!$this->renderer->hasItem($item_data[
"child"])) {
520 $this->renderer->addItemToBlock($type, $item_data[
"type"], $item_data[
"child"],
$html);
537 public function renderItem($a_item_data, $a_position = 0, $a_force_icon =
false, $a_pos_prefix =
"")
544 if (!$ilAccess->checkAccess(
'visible',
'', $a_item_data[
'ref_id'], $a_item_data[
'type'], $a_item_data[
'obj_id'], $a_item_data[
'tree'])) {
548 if ($this->
getViewMode() == self::VIEW_MODE_TILE) {
549 return $this->
renderCard($a_item_data, $a_position, $a_force_icon, $a_pos_prefix);
552 $item_list_gui = $this->
getItemGUI($a_item_data);
553 if (
$ilSetting->get(
"icon_position_in_lists") ==
"item_rows" ||
554 $a_item_data[
"type"] ==
"sess" || $a_force_icon) {
555 $item_list_gui->enableIcon(
true);
559 $item_list_gui->enableCheckbox(
true);
562 $item_list_gui->enableDownloadCheckbox($a_item_data[
"ref_id"],
true);
565 if ($this->
getContainerGUI()->isActiveItemOrdering() && ($a_item_data[
'type'] !=
'sess' || get_class($this) !=
'ilContainerSessionsContentGUI')) {
566 $item_list_gui->setPositionInputField(
567 $a_pos_prefix .
"[" . $a_item_data[
"ref_id"] .
"]",
568 sprintf(
'%d', (
int) $a_position * 10)
572 if ($a_item_data[
'type'] ==
'sess' and get_class($this) !=
'ilContainerObjectiveGUI') {
574 case self::DETAILS_TITLE:
576 $item_list_gui->enableExpand(
true);
577 $item_list_gui->setExpanded(
false);
578 $item_list_gui->enableDescription(
false);
579 $item_list_gui->enableProperties(
true);
582 case self::DETAILS_ALL:
584 $item_list_gui->enableExpand(
true);
585 $item_list_gui->setExpanded(
true);
586 $item_list_gui->enableDescription(
true);
587 $item_list_gui->enableProperties(
true);
592 $item_list_gui->enableExpand(
true);
593 $item_list_gui->enableDescription(
true);
594 $item_list_gui->enableProperties(
true);
599 if (method_exists($this,
"addItemDetails")) {
600 $this->addItemDetails($item_list_gui, $a_item_data);
604 if ($a_item_data[
'type'] ==
'sess' and (
612 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
613 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
618 $item_readable = $ilAccess->checkAccess(
'read',
'', $a_item_data[
'ref_id']);
620 foreach ($items as $item) {
623 if (!$ilAccess->checkAccess(
'visible',
'', $item[
'ref_id'])) {
628 $item_list_gui2->enableIcon(
true);
629 $item_list_gui2->enableItemDetailLinks(
false);
632 $item_list_gui2->setParentRefId($a_item_data[
'ref_id']);
635 if (!$item_readable
and !$ilAccess->checkAccess(
'write',
'', $item[
'ref_id'])) {
636 $item_list_gui2->forceVisibleOnly(
true);
640 $item_list_gui2->enableCheckbox(
true);
643 $item_list_gui2->enableDownloadCheckbox($item[
'ref_id'],
true);
647 $item_list_gui2->setPositionInputField(
648 "[sess][" . $a_item_data[
'obj_id'] .
"][" . $item[
"ref_id"] .
"]",
649 sprintf(
'%d', (
int) $pos * 10)
657 $sub_item_html = $item_list_gui2->getListItemHTML(
665 if (strlen($sub_item_html)) {
666 $item_list_gui->addSubItemHTML($sub_item_html);
674 $ilCtrl->setParameter($this->container_gui,
"cmdrefid", $a_item_data[
'ref_id']);
675 $asynch_url =
$ilCtrl->getLinkTarget(
676 $this->container_gui,
682 $ilCtrl->setParameter($this->container_gui,
"cmdrefid",
"");
686 if ($a_item_data[
'type'] ==
'fold' && $fold_set->get(
"bgtask_download") && $fold_set->get(
"enable_download_folder")) {
687 include_once
"Services/BackgroundTask/classes/class.ilFolderDownloadBackgroundTaskHandler.php";
692 include_once
"Services/Object/classes/class.ilObjectActivation.php";
695 $html = $item_list_gui->getListItemHTML(
696 $a_item_data[
'ref_id'],
697 $a_item_data[
'obj_id'],
698 $a_item_data[
'title'],
699 $a_item_data[
'description'],
705 $a_item_data[
"ref_id"],
706 $item_list_gui->adminCommandsIncluded()
721 public function renderCard($a_item_data, $a_position = 0, $a_force_icon =
false, $a_pos_prefix =
"")
724 $f = $DIC->ui()->factory();
725 $r = $DIC->ui()->renderer();
726 $user = $DIC->user();
729 $item_list_gui = $this->
getItemGUI($a_item_data);
732 $a_item_data[
'ref_id'],
733 $a_item_data[
'type'],
734 $a_item_data[
'obj_id']
736 $item_list_gui->initItem(
737 $a_item_data[
'ref_id'],
738 $a_item_data[
'obj_id'],
739 $a_item_data[
'title'],
740 $a_item_data[
'description']
744 $item_list_gui->insertCommands();
746 foreach ($item_list_gui->current_selection_list->getItems() as $item) {
747 if (!isset($item[
"onclick"]) || $item[
"onclick"] ==
"") {
749 $f->button()->shy($item[
"title"], $item[
"link"]);
752 $f->button()->shy($item[
"title"],
"")->withAdditionalOnLoadCode(
function (
$id) use ($item) {
754 "$('#$id').click(function(e) { " . $item[
"onclick"] .
"});";
757 $actions[] = $button;
761 $def_command = $item_list_gui->getDefaultCommand();
762 $dropdown =
$f->dropdown()->standard($actions);
764 $img = $DIC->object()->commonSettings()->tileImage()->getByObjId($a_item_data[
'obj_id']);
766 if (
$img->exists()) {
770 if (!is_file(
$path)) {
776 $title = $a_item_data[
"title"];
780 $item_list_gui->modifySAHSlaunch($def_command[
"link"], $def_command[
"frame"]);
785 if ($def_command[
"frame"] ==
"_top") {
786 $def_command[
"frame"] =
"";
789 $image =
$f->image()->responsive(
$path,
"");
790 if ($def_command[
"link"] !=
"") {
791 if ($def_command[
"frame"] !=
"" && ($modified_link == $def_command[
"link"])) {
792 $image = $image->withAdditionalOnLoadCode(
function (
$id) use ($def_command) {
794 "$('#$id').click(function(e) { window.open('" . str_replace(
"&",
"&", $def_command[
"link"]) .
"', '" . $def_command[
"frame"] .
"');});";
798 $f->button()->shy(
$title,
"")->withAdditionalOnLoadCode(
function (
$id) use ($def_command) {
800 "$('#$id').click(function(e) { window.open('" . str_replace(
"&",
"&", $def_command[
"link"]) .
"', '" . $def_command[
"frame"] .
"');});";
804 $image = $image->withAction($modified_link);
809 if ($a_item_data[
"description"] !=
"") {
810 $sections[] =
$f->legacy(
"<div class='il_info il-multi-line-cap-3'>" . $a_item_data[
"description"] .
"</div>");
813 if ($a_item_data[
"type"] ==
"sess") {
822 $icon =
$f->icon()->standard($a_item_data[
"type"], $this->lng->txt(
"obj_" . $a_item_data[
"type"]))
823 ->withIsOutlined(
true);
826 $card_title_action =
"";
827 if ($def_command[
"link"] !=
"" && ($def_command[
"frame"] ==
"" || $modified_link != $def_command[
"link"])) {
828 $card_title_action = $modified_link;
829 }
else if ($def_command[
'link'] ==
"" &&
830 $item_list_gui->getInfoScreenStatus() &&
835 $a_item_data[
"ref_id"]
838 if ($image->getAction() ==
"") {
839 $image = $image->withAction($card_title_action);
844 $card =
$f->card()->repositoryObject(
845 $title .
"<span data-list-item-id='" . $item_list_gui->getUniqueItemId(
true) .
"'></span>",
853 if ($card_title_action !=
"") {
854 $card = $card->withTitleAction($card_title_action);
859 foreach ($item_list_gui->determineProperties() as $p) {
860 if ($p[
"alert"] && $p[
"property"] != $this->lng->txt(
"learning_progress")) {
861 $l[(string) $p[
"property"]] = (
string) $p[
"value"];
866 $prop_list =
$f->listing()->descriptive(
$l);
867 $sections[] = $prop_list;
869 if (count($sections) > 0) {
870 $card = $card->withSections($sections);
873 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
881 $progressmeter =
$f->chart()->progressMeter()->mini(100, $percentage);
882 $card = $card->withProgress($progressmeter);
899 if (is_int(strpos($a_output_html,
"[list-" .
$type .
"]"))) {
900 $a_output_html = preg_replace(
901 '~\[list-' .
$type .
'\]~i',
902 $this->renderer->renderSingleTypeBlock(
$type),
909 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
910 $itgr_ref_id = (int) $found[2];
912 $a_output_html = preg_replace(
913 '~\[' . $found[1] .
'\]~i',
914 $this->renderer->renderSingleCustomBlock($itgr_ref_id),
919 return $a_output_html;
937 $ref_ids = array_map(
function (
$i) {
938 $parts = explode(
"_",
$i);
943 if (is_array($this->items[
$type]) &&
944 $this->renderer->addTypeBlock($type)) {
948 foreach ($this->items[$type] as $item_data) {
949 $item_ref_id = $item_data[
"child"];
951 if (in_array($item_ref_id, $ref_ids)) {
955 if ($this->block_limit > 0 && $position == $this->block_limit + 1) {
956 if ($position == $this->block_limit + 1) {
958 $this->renderer->addShowMoreButton($type);
963 if (!$this->renderer->hasItem($item_ref_id)) {
966 $this->renderer->addItemToBlock($type, $item_data[
"type"], $item_ref_id,
$html);
972 return $this->renderer->renderSingleTypeBlock($type);
984 if (empty($this->type_grps)) {
986 $objDefinition->getGroupedRepositoryObjectTypes($this->
getContainerObject()->getType());
988 return $this->type_grps;
1000 $lng->loadLanguageModule(
"rep");
1002 $tpl =
new ilTemplate(
"tpl.rep_intro.html",
true,
true,
"Services/Repository");
1003 $tpl->setVariable(
"IMG_REP_LARGE", ilObject::_getIcon(
"",
"big",
"root"));
1004 $tpl->setVariable(
"TXT_WELCOME",
$lng->txt(
"rep_intro"));
1005 $tpl->setVariable(
"TXT_INTRO_1",
$lng->txt(
"rep_intro1"));
1006 $tpl->setVariable(
"TXT_INTRO_2",
$lng->txt(
"rep_intro2"));
1007 $tpl->setVariable(
"TXT_INTRO_3", sprintf(
$lng->txt(
"rep_intro3"),
$lng->txt(
"add")));
1008 $tpl->setVariable(
"TXT_INTRO_4", sprintf(
$lng->txt(
"rep_intro4"),
$lng->txt(
"cat_add")));
1009 $tpl->setVariable(
"TXT_INTRO_5",
$lng->txt(
"rep_intro5"));
1010 $tpl->setVariable(
"TXT_INTRO_6",
$lng->txt(
"rep_intro6"));
1023 if (is_array($this->items[
"itgr"])) {
1024 foreach ($this->items[
"itgr"] as $itgr) {
1025 if (!$this->renderer->hasCustomBlock($itgr[
"child"])) {
1028 $this->renderer->setBlockPosition($itgr[
"ref_id"], ++$a_pos);
1047 $perm_ok = ($ilAccess->checkAccess(
"visible",
"", $a_itgr[
'ref_id']) &&
1048 $ilAccess->checkAccess(
"read",
"", $a_itgr[
'ref_id']));
1050 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
1051 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1057 foreach ($items as $item) {
1058 $this->renderer->hideItem($item[
"child"]);
1064 $item_list_gui->enableNotes(
false);
1065 $item_list_gui->enableTags(
false);
1066 $item_list_gui->enableComments(
false);
1067 $item_list_gui->enableTimings(
false);
1068 $item_list_gui->getListItemHTML(
1072 $a_itgr[
"description"]
1074 $commands_html = $item_list_gui->getCommandsHTML();
1077 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
1078 include_once(
"./Modules/ItemGroup/classes/class.ilItemGroupBehaviour.php");
1080 include_once(
"./Services/Container/classes/class.ilContainerBlockPropertiesStorage.php");
1083 $beh = ($stored_val ==
"1")
1089 "behaviour" => $beh,
1090 "store-url" =>
"./ilias.php?baseClass=ilcontainerblockpropertiesstorage&cmd=store" .
1091 "&cont_block_id=itgr_" . $a_itgr[
'ref_id']
1095 $this->renderer->addCustomBlock($a_itgr[
"ref_id"],
"", $commands_html,
$data);
1097 $this->renderer->addCustomBlock($a_itgr[
"ref_id"], $a_itgr[
"title"], $commands_html,
$data);
1105 )->sortSubItems(
'itgr', $a_itgr[
'obj_id'], $items);
1111 foreach ($items as $item) {
1113 $html2 = $this->
renderItem($item, $position++,
false,
"[itgr][" . $a_itgr[
'obj_id'] .
"]");
1116 $this->renderer->addItemToBlock($a_itgr[
"ref_id"], $item[
"type"], $item[
"child"],
$html2,
true);
const LP_STATUS_COMPLETED_NUM
static lookupHideTitle($a_id)
Lookup hide title.
determineAdminCommands($a_ref_id, $a_admin_com_included_in_list=false)
determin admin commands
static getProperty($a_block_id, $a_user_id, $a_property)
Get property in session or db.
determinePageEmbeddedBlocks($a_container_page_html)
Determine all blocks that are embedded in the container page.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static getCmdSide()
Get Column Side of Current Command.
getViewMode()
Get view mode.
static getItemsByEvent($a_event_id)
Get session material / event items.
getEmbeddedBlocks()
Get page embedded blocks.
renderCard($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render card.
static initObjectListAction()
init js for background download
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
if(!array_key_exists('StateId', $_REQUEST)) $id
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
static lookupBehaviour($a_id)
Lookup behaviour.
getSingleTypeBlockAsynch($type)
Render single block.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
renderPageEmbeddedBlocks()
Render Page Embedded Blocks.
initRenderer()
Init container renderer.
__forwardToColumnGUI()
Get columngui output.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
Parent class of all container content GUIs.
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
getContainerGUI()
Get container GUI object.
Column user interface class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getDetailsLevel($a_item_id)
get details level
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
getContainerObject()
Get container object.
static _appointmentToString($start, $end, $fulltime)
static getListGUIStatus($a_obj_id, $a_image_only=true)
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
static buildAjaxHash( $a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null, $a_news_id=0)
Build ajax hash.
static _lookupType($a_id, $a_reference=false)
lookup object type
clearAdminCommandsDetermination()
cleaer administration commands determination
renderItemGroup($a_itgr)
Render item group.
static getScreenMode()
Get Screen Mode for current command.
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
getCenterColumnHTML()
Get HTML for center column.
getIntroduction()
Get introduction.
static _lookupAppointment($a_obj_id)
lookup appointment
static getItemsByItemGroup($a_item_group_ref_id)
Get materials of item group.
static getLogger($a_component_id)
Get component logger.
static _getInstance($a_obj_id)
get instance by obj_id
__construct(&$container_gui_obj)
Constructor.
Class ilContainerRenderer.
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
addEmbeddedBlock($block_type, $block_parameter)
Add embedded block.
getRightColumnHTML()
Get HTML for right column.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
getGroupedObjTypes()
Get grouped repository object types.
const DETAILS_DEACTIVATED
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
setOutput()
Sets view output into column layout.