4define(
"IL_LIST_AS_TRIGGER",
"trigger");
5define(
"IL_LIST_FULL",
"full");
6require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
186 public function __construct($a_context = self::CONTEXT_REPOSITORY)
189 $this->access =
$DIC->access();
190 $this->
user = $DIC->user();
191 $this->obj_definition =
$DIC[
"objDefinition"];
192 $this->tree =
$DIC->repositoryTree();
195 $this->
ui = $DIC->ui();
196 $this->rbacsystem =
$DIC->rbac()->system();
197 $this->ctrl =
$DIC->ctrl();
198 $this->lng =
$DIC->language();
200 $this->path_enabled =
false;
201 $this->context = $a_context;
203 $this->object_service =
$DIC->object();
215 include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
219 $this->lng->loadLanguageModule(
"obj");
220 $this->lng->loadLanguageModule(
"rep");
232 $this->container_obj = $container_obj;
244 return $this->container_obj;
256 $this->static_link_enabled =
true;
257 $this->delete_enabled =
true;
258 $this->cut_enabled =
true;
259 $this->subscribe_enabled =
true;
260 $this->link_enabled =
false;
261 $this->copy_enabled =
false;
262 $this->progress_enabled =
false;
263 $this->notice_properties_enabled =
true;
264 $this->info_screen_enabled =
false;
266 $this->gui_class_name =
"";
269 include_once(
'./Services/Object/classes/class.ilObjectAccess.php');
282 $this->properties_enabled = $a_status;
304 $this->preconditions_enabled = $a_status;
322 $this->notice_properties_enabled = $a_status;
344 $this->description_enabled = $a_status;
378 $this->search_fragment_enabled = $a_status;
390 $this->path_linked = $a_status;
408 $this->enabled_relevance = $a_status;
418 $this->relevance = $a_rel;
438 $this->icons_enabled = $a_status;
458 $this->checkboxes_enabled = $a_status;
478 $this->expand_enabled = $a_status;
493 $this->is_expanded = $a_status;
508 $this->position_enabled =
true;
509 $this->position_field_index = $a_field_index;
510 $this->position_value = $a_position_value;
521 $this->delete_enabled = $a_status;
533 return $this->delete_enabled;
544 $this->cut_enabled = $a_status;
555 return $this->cut_enabled;
566 $this->copy_enabled = $a_status;
588 $this->subscribe_enabled = $a_status;
599 return $this->subscribe_enabled;
610 $this->link_enabled = $a_status;
621 return $this->link_enabled;
633 $this->path_enabled = $a_path;
634 $this->path_start_node = (int) $a_start_node;
645 return $this->path_enabled;
656 $this->commands_enabled = $a_status;
657 $this->std_cmd_only = $a_std_only;
677 $this->info_screen_enabled = $a_info_screen;
687 $this->sub_item_html[] = $a_html;
709 $this->progress_enabled = $a_status;
733 $this->substitutions_enabled = $a_status;
757 $this->item_detail_links_enabled = $a_status;
780 $this->item_detail_links = $a_detail_links;
781 $this->item_detail_links_intro = $a_intro_txt;
793 if (!count($this->item_detail_links)) {
796 if (strlen($this->item_detail_links_intro)) {
797 $this->tpl->setCurrentBlock(
'item_detail_intro');
798 $this->tpl->setVariable(
'ITEM_DETAIL_INTRO_TXT', $this->item_detail_links_intro);
799 $this->tpl->parseCurrentBlock();
802 foreach ($this->item_detail_links as $info) {
803 $this->tpl->setCurrentBlock(
'item_detail_link');
804 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_TARGET', $info[
'target']);
805 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_DESC', $info[
'desc']);
806 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_HREF', $info[
'link']);
807 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_NAME', $info[
'name']);
808 $this->tpl->parseCurrentBlock();
810 $this->tpl->setCurrentBlock(
'item_detail_links');
811 $this->tpl->parseCurrentBlock();
822 $this->title = strip_tags(
844 $this->description = strip_tags(
857 return $this->description;
867 $this->search_fragment = $a_text;
886 $this->separate_commands = $a_val;
919 $this->additional_information = $a_val;
941 $this->details_level = $a_level;
960 $this->repository_transfer_enabled = (bool) $a_value;
970 $this->restrict_to_goto = (bool) $a_value;
981 return $this->default_command;
998 $cache_prefix =
null;
999 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
1000 $cache_prefix =
"wsp";
1001 if (!$this->ws_access) {
1002 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1007 if (isset($this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id])) {
1008 return $this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id];
1011 if ($this->context == self::CONTEXT_REPOSITORY) {
1012 $access = $ilAccess->checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
1013 if ($ilAccess->getPreventCachingLastResult()) {
1014 $this->prevent_access_caching =
true;
1017 $access = $this->ws_access->checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type);
1020 $this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id] =
$access;
1033 public function initItem($a_ref_id, $a_obj_id,
$type, $a_title =
"", $a_description =
"")
1035 $this->offline_mode =
false;
1036 if ($this->type ==
"sahs") {
1037 include_once(
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
1040 $this->access_cache = array();
1041 $this->ref_id = $a_ref_id;
1042 $this->obj_id = $a_obj_id;
1045 #$this->description = $a_description;
1048 $this->adm_commands_included =
false;
1049 $this->prevent_access_caching =
false;
1052 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1053 if ($this->context == self::CONTEXT_REPOSITORY) {
1063 $this->condition_target = array(
1064 'ref_id' => $a_ref_id,
1065 'obj_id' => $a_obj_id,
1066 'target_type' => $a_target_type
1072 $this->condition_target = array();
1077 $this->title_link_disabled = $a_status;
1083 $this->default_command_params = $a_params;
1098 if ($this->static_link_enabled and !$this->default_command_params) {
1099 include_once(
'./Services/Link/classes/class.ilLink.php');
1101 $command[
'link'] = $link;
1102 $command[
'frame'] =
'_top';
1105 if ($this->default_command_params) {
1107 foreach ($this->default_command_params as
$name => $value) {
1108 $params[] =
$name .
'=' . $value;
1110 $params = implode(
'&', $params);
1113 if (!stristr($command[
'link'],
'?')) {
1114 $command[
'link'] .=
'?' . $params;
1116 $command[
'link'] .=
'&' . $params;
1136 if ($this->context == self::CONTEXT_REPOSITORY) {
1138 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1142 return $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
1146 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
getCommandId());
1147 $cmd_link = $this->ctrl->getLinkTargetByClass(
"ilrepositorygui", $a_cmd);
1148 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1157 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id",
"");
1158 $this->ctrl->setParameterByClass($this->gui_class_name,
"wsp_id", $this->ref_id);
1159 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1176 if ($a_cmd ==
'fileManagerLaunch') {
1221 if ($this->context == self::CONTEXT_REPOSITORY) {
1227 'property' =>
$lng->txt(
"status"),
1228 'value' =>
$lng->txt(
"offline")
1233 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1236 require_once(
'Services/WebDAV/classes/lock/class.ilWebDAVLockBackend.php');
1239 if ($lock = $webdav_lock_backend->getLocksOnObjectId($this->obj_id)) {
1240 $lock_user =
new ilObjUser($lock->getIliasOwner());
1244 "property" =>
$lng->txt(
"in_use_by"),
1245 "value" => $lock_user->getLogin(),
1246 "link" =>
"./ilias.php?user=" . $lock_user->getId() .
'&cmd=showUserProfile&cmdClass=ildashboardgui&baseClass=ilDashboardGUI',
1271 $this->cust_prop[] = array(
"property" => $a_property,
"value" => $a_value,
1272 "alert" => $a_alert,
"newline" => $a_newline);
1280 if (is_array($this->cust_prop)) {
1281 foreach ($this->cust_prop as $prop) {
1296 if ($prop[
'alert'] ==
true) {
1308 $this->notice_prop = array();
1309 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true)) {
1310 foreach ($infos as $info) {
1311 $this->notice_prop[] = array(
'value' => $info);
1314 return $this->notice_prop ? $this->notice_prop : array();
1321 $this->cust_commands[] =
1322 array(
"link" => $a_link,
"lang_var" => $a_lang_var,
1323 "frame" => $a_frame,
"onclick" => $onclick);
1332 $this->force_visible_only = $a_stat;
1372 $ref_commands = array();
1373 foreach ($this->commands as $command) {
1374 $permission = $command[
"permission"];
1375 $cmd = $command[
"cmd"];
1376 $lang_var = $command[
"lang_var"];
1378 $info_object =
null;
1380 if (isset($command[
"txt"])) {
1381 $txt = $command[
"txt"];
1386 $command[
'enable_anonymous'] ==
'false') {
1399 $access_granted =
true;
1401 $access_granted =
false;
1402 $info_object = $ilAccess->getInfo();
1405 if (!isset($command[
"default"])) {
1406 $command[
"default"] =
"";
1408 $ref_commands[] = array(
1409 "permission" => $permission,
1411 "link" => $cmd_link,
1412 "frame" => $cmd_frame,
1413 "lang_var" => $lang_var,
1415 "granted" => $access_granted,
1416 "access_info" => $info_object,
1417 "img" => $cmd_image,
1418 "default" => $command[
"default"]
1422 return $ref_commands;
1434 if ($this->type ==
"sahs" && $this->offline_mode) {
1435 return $this->type .
"_offline";
1449 if ($this->restrict_to_goto) {
1450 $this->default_command = array(
"frame" =>
"",
1455 !$this->default_command ||
1457 $this->title_link_disabled
1460 $this->tpl->setCurrentBlock(
"item_title");
1461 $this->tpl->setVariable(
"TXT_TITLE", $this->
getTitle());
1462 $this->tpl->parseCurrentBlock();
1464 $this->default_command[
'link'] = $this->
modifyTitleLink($this->default_command[
'link']);
1466 $this->default_command[
"link"] =
1467 $this->
modifySAHSlaunch($this->default_command[
"link"], $this->default_command[
"frame"]);
1469 if ($this->default_command[
"frame"] !=
"") {
1470 $this->tpl->setCurrentBlock(
"title_linked_frame");
1471 $this->tpl->setVariable(
"TARGET_TITLE_LINKED", $this->default_command[
"frame"]);
1472 $this->tpl->parseCurrentBlock();
1476 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1477 $this->default_command[
"link"] =
1480 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1484 $this->tpl->setCurrentBlock(
"item_title_linked");
1485 $this->tpl->setVariable(
"TXT_TITLE_LINKED", $this->
getTitle());
1486 $this->tpl->setVariable(
"HREF_TITLE_LINKED", $this->default_command[
"link"]);
1489 include_once(
"./Services/Preview/classes/class.ilPreview.php");
1491 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
1494 $access_handler =
null;
1495 switch ($this->context) {
1499 include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
1506 $access_handler = $ilAccess;
1512 $preview_status_class =
"";
1513 $preview_text_topic =
"preview_show";
1515 $preview_status_class =
"ilPreviewStatusNone";
1516 $preview_text_topic =
"preview_none";
1518 $this->tpl->setCurrentBlock(
"item_title_linked");
1519 $this->tpl->setVariable(
"PREVIEW_STATUS_CLASS", $preview_status_class);
1521 $this->tpl->setVariable(
"ALT_PREVIEW_ICON", $this->lng->txt($preview_text_topic));
1522 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt($preview_text_topic));
1523 $this->tpl->setVariable(
"SCRIPT_PREVIEW_CLICK",
$preview->getJSCall($this->getUniqueItemId(
true)));
1524 $this->tpl->parseCurrentBlock();
1527 $this->tpl->parseCurrentBlock();
1530 if ($this->bold_title ==
true) {
1531 $this->tpl->touchBlock(
'bold_title_start');
1532 $this->tpl->touchBlock(
'bold_title_end');
1538 switch ($this->context) {
1540 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1557 $fields_shown =
false;
1558 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as
$data) {
1559 if (
$data[
'bold']) {
1560 $data[
'name'] =
'<strong>' .
$data[
'name'] .
'</strong>';
1561 $data[
'value'] =
'<strong>' .
$data[
'value'] .
'</strong>';
1563 $this->tpl->touchBlock(
"std_prop");
1564 $this->tpl->setCurrentBlock(
'item_property');
1565 if (
$data[
'show_field']) {
1566 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1568 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1569 $this->tpl->parseCurrentBlock();
1571 if (
$data[
'newline']) {
1572 $this->tpl->touchBlock(
'newline_prop');
1574 $fields_shown =
false;
1576 if ($fields_shown) {
1577 $this->tpl->touchBlock(
'newline_prop');
1593 if (!$this->substitutions->isDescriptionEnabled()) {
1601 $d = strip_tags(
$d);
1602 $this->tpl->setCurrentBlock(
"item_description");
1603 $this->tpl->setVariable(
"TXT_DESC",
$d);
1604 $this->tpl->parseCurrentBlock();
1614 $this->tpl->setCurrentBlock(
'search_fragment');
1615 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT', $this->
getSearchFragment() .
' ...');
1616 $this->tpl->parseCurrentBlock();
1631 include_once
"Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
1635 $this->tpl->setCurrentBlock(
'relevance');
1636 $this->tpl->setVariable(
'REL_PBAR', $pbar->render());
1637 $this->tpl->parseCurrentBlock();
1647 $this->mode = $a_mode;
1665 $this->condition_depth = $a_depth;
1677 if ($a_mode == $this->mode) {
1697 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1699 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
1702 $props[] = array(
"alert" =>
false,
1703 "property" =>
$lng->txt(
"learning_progress"),
1711 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id)) {
1712 $props[] = array(
"alert" =>
true,
1713 "value" =>
$lng->txt(
"no_access_item_public"),
1722 if ($this->reference_ref_id) {
1724 $note_obj_id = $this->reference_obj_id;
1726 $redraw_js =
"il.Object.redrawListItem(" . $note_ref_id .
");";
1729 require_once
'Services/Notes/classes/class.ilNote.php';
1732 self::$cnt_tags[$note_obj_id] > 0 ||
1733 is_array(self::$tags[$note_obj_id])) &&
1735 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
1736 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
1741 $props[] = array(
"alert" =>
false,
1742 "property" =>
$lng->txt(
"notes_comments"),
1743 "value" =>
"<a href='#' onclick=\"return " .
1750 if ($this->notes_enabled && self::$cnt_notes[$note_obj_id][
IL_NOTE_PRIVATE] > 0) {
1751 $props[] = array(
"alert" =>
false,
1752 "property" =>
$lng->txt(
"notes"),
1753 "value" =>
"<a href='#' onclick=\"return " .
1759 if ($this->tags_enabled &&
1760 (self::$cnt_tags[$note_obj_id] > 0 ||
1761 is_array(self::$tags[$note_obj_id]))) {
1763 if ($tags_set->get(
"enable")) {
1767 if (is_array(self::$tags[$note_obj_id])) {
1768 $tags_tmp = array();
1769 foreach (self::$tags[$note_obj_id] as $tag => $is_tag_owner) {
1770 if ($is_tag_owner) {
1771 $tags_tmp[] =
"<a class=\"ilTag ilTagRelHigh\" href='#' onclick=\"return " .
1772 $tags_url .
"\">" . $tag .
"</a>";
1774 $tags_tmp[] =
"<span class=\"ilTag ilTagRelMiddle\">" . $tag .
"</span>";
1777 $tags_value = implode(
" ", $tags_tmp);
1782 $tags_value =
"<a href='#' onclick=\"return " . $tags_url .
"\">" .
1783 self::$cnt_tags[$note_obj_id] .
"</a>";
1784 $prop_text =
$lng->txt(
"tagging_tags");
1786 $props[] = array(
"alert" =>
false,
1787 "property" => $prop_text,
1788 "value" => $tags_value,
1794 if (!is_array($props)) {
1809 if (is_array($props) && count($props) > 0) {
1810 foreach ($props as $prop) {
1812 $this->tpl->touchBlock(
"separator_prop");
1815 if ($prop[
"alert"] ==
true) {
1816 $this->tpl->touchBlock(
"alert_prop");
1818 $this->tpl->touchBlock(
"std_prop");
1820 if ($prop[
"newline"] ==
true && $cnt > 1) {
1821 $this->tpl->touchBlock(
"newline_prop");
1824 if (isset($prop[
"property"]) && $prop[
'propertyNameVisible'] !==
false && $prop[
"property"] !=
"") {
1826 $this->tpl->setCurrentBlock(
"prop_name");
1827 $this->tpl->setVariable(
"TXT_PROP", $prop[
"property"]);
1828 $this->tpl->parseCurrentBlock();
1830 $this->tpl->setCurrentBlock(
"item_property");
1832 if ($prop[
'link']) {
1833 $this->tpl->setVariable(
"LINK_PROP", $prop[
'link']);
1834 $this->tpl->setVariable(
"LINK_VAL_PROP", $prop[
"value"]);
1836 $this->tpl->setVariable(
"VAL_PROP", $prop[
"value"]);
1839 $this->tpl->parseCurrentBlock();
1843 $this->tpl->setCurrentBlock(
"item_properties");
1844 $this->tpl->parseCurrentBlock();
1851 foreach ($this->notice_prop as $property) {
1852 $this->tpl->setCurrentBlock(
'notice_item');
1853 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE', $property[
'value']);
1854 $this->tpl->parseCurrentBlock();
1856 $this->tpl->setCurrentBlock(
'notice_property');
1857 $this->tpl->parseCurrentBlock();
1867 $num_optional_required =
1871 $visible_conditions = array();
1872 $passed_optional = 0;
1873 foreach ($conditions as $condition) {
1874 if ($obligatory and !$condition[
'obligatory']) {
1877 if (!$obligatory and $condition[
'obligatory']) {
1881 if (
$tree->isDeleted($condition[
'trigger_ref_id'])) {
1885 include_once
'Services/Container/classes/class.ilMemberViewSettings.php';
1890 $visible_conditions[] = $condition[
'id'];
1893 if (!$obligatory and
$ok) {
1896 if ($passed_optional >= $num_optional_required) {
1902 foreach ($conditions as $condition) {
1903 if (!in_array($condition[
'id'], $visible_conditions)) {
1907 include_once
'./Services/Conditions/classes/class.ilConditionHandlerGUI.php';
1911 $class = $objDefinition->getClassName($condition[
"trigger_type"]);
1912 $location = $objDefinition->getLocation($condition[
"trigger_type"]);
1916 $missing_cond_exist =
true;
1918 $full_class =
"ilObj" . $class .
"ListGUI";
1919 include_once(
$location .
"/class." . $full_class .
".php");
1920 $item_list_gui =
new $full_class($this);
1922 $item_list_gui->enablePath(
false);
1923 $item_list_gui->enableIcon(
true);
1924 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1926 $item_list_gui->addCustomProperty($this->lng->txt(
"precondition_required_itemlist"), $cond_txt,
false,
true);
1928 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1929 $item_list_gui->enableProperties($this->properties_enabled);
1931 $trigger_html = $item_list_gui->getListItemHTML(
1932 $condition[
'trigger_ref_id'],
1933 $condition[
'trigger_obj_id'],
1937 $this->tpl->setCurrentBlock(
"precondition");
1938 if ($trigger_html ==
"") {
1939 $trigger_html = $this->lng->txt(
"precondition_not_accessible");
1941 $this->tpl->setVariable(
"TXT_CONDITION", trim($cond_txt));
1942 $this->tpl->setVariable(
"TRIGGER_ITEM", $trigger_html);
1943 $this->tpl->parseCurrentBlock();
1946 if ($missing_cond_exist and $obligatory) {
1947 $this->tpl->setCurrentBlock(
"preconditions");
1948 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_obl_" . $toggle_id);
1949 $this->tpl->setVariable(
"TXT_PRECONDITIONS",
$lng->txt(
"preconditions_obligatory_hint"));
1950 $this->tpl->parseCurrentBlock();
1951 } elseif ($missing_cond_exist and !$obligatory) {
1952 $this->tpl->setCurrentBlock(
"preconditions");
1953 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_opt_" . $toggle_id);
1954 $this->tpl->setVariable(
"TXT_PRECONDITIONS", sprintf(
$lng->txt(
"preconditions_optional_hint"), $num_optional_required));
1955 $this->tpl->parseCurrentBlock();
1958 return !$missing_cond_exist;
1966 include_once(
"./Services/Conditions/classes/class.ilConditionHandler.php");
1969 if ($this->condition_depth > 0) {
1973 if ($this->condition_target) {
1974 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget(
1975 $this->condition_target[
'ref_id'],
1976 $this->condition_target[
'obj_id'],
1977 $this->condition_target[
'target_type']
1980 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget($this->ref_id, $this->obj_id);
1983 if (
sizeof($conditions)) {
1984 for (
$i = 0;
$i < count($conditions);
$i++) {
1992 $all_done_obl = $this->
parseConditions(self::$js_unique_id, $conditions,
true);
1993 $all_done_opt = $this->
parseConditions(self::$js_unique_id, $conditions,
false);
1995 if (!$all_done_obl || !$all_done_opt) {
1996 $this->tpl->setCurrentBlock(
"preconditions_toggle");
1997 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_INTRO", $this->lng->txt(
"precondition_toggle"));
1998 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt(
"show"));
1999 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_ID", self::$js_unique_id);
2000 $this->tpl->setVariable(
"TXT_PRECONDITION_SHOW", $this->lng->txt(
"show"));
2001 $this->tpl->setVariable(
"TXT_PRECONDITION_HIDE", $this->lng->txt(
"hide"));
2002 $this->tpl->parseCurrentBlock();
2015 public function insertCommand($a_href, $a_text, $a_frame =
"", $a_img =
"", $a_cmd =
"", $a_onclick =
"")
2018 $chksum = md5($a_href . $a_text);
2019 if ($a_href ==
"#" ||
2020 !in_array($chksum, $this->prevent_duplicate_commands)) {
2021 if ($a_href !=
"#") {
2022 $this->prevent_duplicate_commands[] = $chksum;
2025 $prevent_background_click =
false;
2026 if ($a_cmd ==
'mount_webfolder') {
2027 $a_onclick =
"triggerWebDAVModal('$a_href')";
2032 $this->current_selection_list->addItem(
2040 $prevent_background_click,
2055 if ($this->std_cmd_only) {
2065 $this->adm_commands_included =
true;
2072 $this->ctrl->setParameter(
2073 $this->container_obj,
2075 $this->container_obj->object->getRefId()
2077 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2078 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"delete");
2081 $this->lng->txt(
"delete"),
2085 $this->adm_commands_included =
true;
2100 if ($this->std_cmd_only) {
2106 !$objDefinition->allowLink($this->type)) {
2117 $this->adm_commands_included =
true;
2124 $this->ctrl->setParameter(
2125 $this->container_obj,
2127 $this->container_obj->object->getRefId()
2129 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2130 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"link");
2133 $this->lng->txt(
"link"),
2137 $this->adm_commands_included =
true;
2149 if ($this->std_cmd_only) {
2159 $this->adm_commands_included =
true;
2169 $this->container_obj->object) {
2170 $this->ctrl->setParameter(
2171 $this->container_obj,
2173 $this->container_obj->object->getRefId()
2175 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2177 if (!$a_to_repository) {
2178 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut");
2181 $this->lng->txt(
"move"),
2186 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut_for_repository");
2189 $this->lng->txt(
"wsp_move_to_repository"),
2195 $this->adm_commands_included =
true;
2208 if ($this->std_cmd_only) {
2213 $objDefinition->allowCopy($this->type)) {
2214 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
2215 $this->ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id', $this->
getCommandId());
2216 $cmd_copy = $this->ctrl->getLinkTargetByClass(
'ilobjectcopygui',
'initTargetSelection');
2219 $this->ctrl->setParameter(
2220 $this->container_obj,
2222 $this->container_obj->object->getRefId()
2224 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2226 if (!$a_to_repository) {
2227 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy');
2230 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
2231 $this->
insertCommand($cmd_copy, $this->lng->txt(
'wsp_copy_to_repository'));
2235 $this->adm_commands_included =
true;
2248 if ($this->std_cmd_only) {
2262 $this->adm_commands_included =
true;
2280 if ($this->std_cmd_only) {
2287 if (!(
bool)
$ilSetting->get(
'rep_favourites',
"0")) {
2295 if (is_object($this->container_obj) &&
2297 is_object($this->container_obj->object)) {
2298 $this->ctrl->setParameter($this->container_obj,
"ref_id", $this->container_obj->object->getRefId());
2301 if (!$this->fav_manager->ifIsFavourite(
$ilUser->getId(), $this->getCommandId())) {
2303 if ($this->
checkCommandAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id)) {
2305 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2306 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2307 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"addToDesk");
2310 $this->lng->txt(
"rep_add_to_favourites"),
2318 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2319 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2320 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"removeFromDesk");
2323 $this->lng->txt(
"rep_remove_from_favourites"),
2337 if ($this->std_cmd_only) {
2344 $this->lng->txt(
"info_short"),
2361 if ($this->std_cmd_only ||
2365 $lng->loadLanguageModule(
"notes");
2366 $lng->loadLanguageModule(
"tagging");
2368 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2372 if ($this->reference_ref_id) {
2376 $js_updater = $a_header_actions
2377 ?
"il.Object.redrawActionHeader();"
2378 :
"il.Object.redrawListItem(" . $note_ref_id .
")";
2384 $this->lng->txt(
"notes_comments"),
2392 if ($this->notes_enabled) {
2395 $this->lng->txt(
"notes"),
2403 if ($this->tags_enabled) {
2404 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2408 $this->lng->txt(
"tagging_set_tag"),
2424 if ($this->std_cmd_only || !$this->container_obj->object) {
2429 $parent_type = $this->container_obj->object->getType();
2432 if ($this->reference_ref_id) {
2433 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->reference_ref_id);
2438 $this->ctrl->setParameterByClass(
2439 'ilobjectactivationgui',
2443 $this->ctrl->setParameterByClass(
2444 'ilobjectactivationgui',
2448 $cmd_lnk = $this->ctrl->getLinkTargetByClass(
2449 array($this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui'),
2453 $this->
insertCommand($cmd_lnk, $this->lng->txt(
'obj_activation_list_gui'));
2456 if ($this->reference_ref_id) {
2457 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->ref_id);
2471 $a_use_asynch =
false,
2472 $a_get_asynch_commands =
false,
2474 $a_header_actions =
false
2483 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2485 $this->current_selection_list->setAriaListTitle(
2487 $this->lng->txt(
'actions_for'),
2488 htmlspecialchars(addslashes($this->
getTitle()))
2491 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2492 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2493 if ($a_header_actions) {
2494 $this->current_selection_list->setListTitle(
"<span class='hidden-xs'>" .
$lng->txt(
"actions") .
"</span>");
2496 $this->current_selection_list->setListTitle(
"");
2498 $this->current_selection_list->setId(
"act_" . $this->
getUniqueItemId(
false));
2499 $this->current_selection_list->setSelectionHeaderClass(
"small");
2500 $this->current_selection_list->setItemLinkClass(
"xsmall");
2501 $this->current_selection_list->setLinksMode(
"il_ContainerItemCommand2");
2503 $this->current_selection_list->setUseImages(
false);
2504 $this->current_selection_list->setAdditionalToggleElement($this->
getUniqueItemId(
true),
"ilContainerListItemOuterHighlight");
2506 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id", $this->ref_id);
2509 $only_default =
false;
2510 if ($a_use_asynch && !$a_get_asynch_commands) {
2511 $only_default =
true;
2514 $this->default_command =
false;
2515 $this->prevent_duplicate_commands = array();
2518 $valid_header_commands = array(
"mount_webfolder");
2520 $commands = $this->
getCommands($this->ref_id, $this->obj_id);
2521 foreach ($commands as $command) {
2522 if ($a_header_actions && !in_array($command[
"cmd"], $valid_header_commands)) {
2526 if ($command[
"granted"] ==
true) {
2527 if (!$command[
"default"] ===
true) {
2528 if (!$this->std_cmd_only && !$only_default) {
2533 $cmd_link = $command[
"link"];
2534 $txt = ($command[
"lang_var"] ==
"")
2536 : $this->lng->txt($command[
"lang_var"]);
2552 if (!$only_default) {
2554 if (is_array($this->cust_commands)) {
2555 foreach ($this->cust_commands as $command) {
2558 $this->lng->txt($command[
"lang_var"]),
2574 if ($this->timings_enabled) {
2579 if ($this->delete_enabled) {
2584 if ($this->link_enabled) {
2589 if ($this->cut_enabled) {
2594 if ($this->copy_enabled) {
2599 if ($this->repository_transfer_enabled) {
2605 if ($this->subscribe_enabled) {
2610 if ($this->multi_download_enabled && $a_header_actions) {
2615 if ($this->cut_enabled or $this->link_enabled) {
2627 if (!$a_header_actions) {
2628 $this->ctrl->clearParametersByClass($this->gui_class_name);
2635 if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions) {
2637 include_once(
"./Services/Container/classes/class.ilContainer.php");
2638 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
2649 if ($a_use_asynch && $a_get_asynch_commands) {
2650 return $this->current_selection_list->getHTML(
true);
2653 return $this->current_selection_list->getHTML();
2670 $this->comments_enabled = (bool) $a_value;
2671 $this->comments_settings_enabled = (bool) $a_enable_comments_settings;
2688 $this->notes_enabled = (bool) $a_value;
2699 if (!$tags_set->get(
"enable")) {
2702 $this->tags_enabled = (bool) $a_value;
2713 public function enableRating($a_value, $a_text =
null, $a_categories =
false, array $a_ctrl_path =
null)
2715 $this->rating_enabled = (bool) $a_value;
2717 if ($this->rating_enabled) {
2718 $this->rating_categories_enabled = (bool) $a_categories;
2719 $this->rating_text = $a_text;
2720 $this->rating_ctrl_path = $a_ctrl_path;
2732 if (!$folder_set->get(
"enable_multi_download")) {
2735 $this->multi_download_enabled = (bool) $a_value;
2742 if ($this->std_cmd_only) {
2758 $user_id = $this->
user->getId();
2759 $hasAdminAccess = $this->access->checkAccessOfUser($user_id,
"crs_admin", $this->ctrl->getCmd(),
$_GET[
'ref_id']);
2762 if ($hasAdminAccess) {
2763 $cmd =
$_GET[
"cmd"] ==
"enableAdministrationPanel" ?
"render" :
"enableAdministrationPanel";
2765 $cmd =
$_GET[
"cmd"] ==
"enableMultiDownload" ?
"render" :
"enableMultiDownload";
2768 $this->
insertCommand($cmd_link, $this->lng->txt(
"download_multiple_objects"));
2781 if (in_array($this->type, array(
"file",
"fold")) &&
2782 $ilAccess->checkAccess(
"read",
"", $a_ref_id, $this->type)) {
2800 public static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl =
null)
2805 if (is_null($a_tpl)) {
2810 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2815 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2819 if ($a_redraw_url) {
2820 $a_tpl->addOnLoadCode(
"il.Object.setRedrawAHUrl('" .
2821 $a_redraw_url .
"');");
2833 $this->sub_obj_type = $a_type;
2834 $this->sub_obj_id = (int) $a_id;
2846 public function addHeaderIcon($a_id, $a_img, $a_tooltip =
null, $a_onclick =
null, $a_status_text =
null, $a_href =
null)
2848 $this->header_icons[$a_id] = array(
"img" => $a_img,
2849 "tooltip" => $a_tooltip,
2850 "onclick" => $a_onclick,
2851 "status_text" => $a_status_text,
2862 $this->header_icons[$a_id] = $a_html;
2872 $this->header_icons[$a_id] = array(
"glyph" => $a_glyph,
"onclick" => $a_onclick);
2877 $this->ajax_hash = $a_hash;
2892 if ($a_main_tpl ==
null) {
2893 $main_tpl =
$DIC[
"tpl"];
2895 $main_tpl = $a_main_tpl;
2898 $htpl =
new ilTemplate(
"tpl.header_action.html",
true,
true,
"Services/Repository");
2900 $redraw_js =
"il.Object.redrawActionHeader();";
2903 if ($this->tags_enabled) {
2904 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
2912 if (count(
$tags) > 0) {
2913 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2914 $lng->loadLanguageModule(
"tagging");
2921 $f = $this->
ui->factory();
2924 $f->symbol()->glyph()->tag(
"#")
2925 ->withCounter(
$f->counter()->status((
int) count(
$tags))),
2934 include_once(
"./Services/Notes/classes/class.ilNote.php");
2935 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2936 $type = ($this->sub_obj_type ==
"")
2938 : $this->sub_obj_type;
2941 if ($this->notes_enabled && $cnt[$this->obj_id][
IL_NOTE_PRIVATE] > 0) {
2949 $f = $this->
ui->factory();
2952 $f->symbol()->glyph()->note(
"#")
2953 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PRIVATE])),
2959 $lng->loadLanguageModule(
"notes");
2967 $f = $this->
ui->factory();
2970 $f->symbol()->glyph()->comment(
"#")
2971 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PUBLIC])),
2978 if ($this->rating_enabled) {
2979 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
2981 $rating_gui->enableCategories($this->rating_categories_enabled);
2983 $rating_gui->setObject($this->obj_id, $this->type);
2984 if ($this->rating_text) {
2985 $rating_gui->setYourRatingText($this->rating_text);
2988 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"cadh", $this->ajax_hash);
2989 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"rnsb",
true);
2990 if ($this->rating_ctrl_path) {
2991 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2992 $ajax_url = $this->ctrl->getLinkTargetByClass($this->rating_ctrl_path,
"saveRating",
"",
true,
false);
2995 $ajax_url = $this->ctrl->getLinkTargetByClass(
"ilRatingGUI",
"saveRating",
"",
true,
false);
2997 $main_tpl->addOnLoadCode(
"il.Object.setRatingUrl('" . $ajax_url .
"');");
3000 $rating_gui->getHtml(
3002 $this->checkCommandAccess(
"read",
"", $this->ref_id, $this->type),
3003 "il.Object.saveRating(%rating%);"
3008 if ($this->header_icons) {
3009 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
3012 foreach ($this->header_icons as $id => $attr) {
3013 $id =
"headp_" . $id;
3015 if (is_array($attr)) {
3016 if ($attr[
"glyph"]) {
3017 if ($attr[
"onclick"]) {
3018 $htpl->setCurrentBlock(
"prop_glyph_oc");
3019 $htpl->setVariable(
"GLYPH_ONCLICK", $attr[
"onclick"]);
3020 $htpl->parseCurrentBlock();
3022 $renderer = $this->
ui->renderer();
3023 $html = $renderer->render($attr[
"glyph"]);
3024 $htpl->setCurrentBlock(
"prop_glyph");
3025 $htpl->setVariable(
"GLYPH", $html);
3026 $htpl->parseCurrentBlock();
3028 if ($attr[
"onclick"]) {
3029 $htpl->setCurrentBlock(
"onclick");
3030 $htpl->setVariable(
"PROP_ONCLICK", $attr[
"onclick"]);
3031 $htpl->parseCurrentBlock();
3034 if ($attr[
"status_text"]) {
3035 $htpl->setCurrentBlock(
"status");
3036 $htpl->setVariable(
"PROP_TXT", $attr[
"status_text"]);
3037 $htpl->parseCurrentBlock();
3041 $htpl->setCurrentBlock(
"prop");
3042 if ($attr[
"href"] || $attr[
"onclick"]) {
3043 $htpl->setVariable(
"TAG",
"a");
3045 $htpl->setVariable(
"TAG",
"span");
3047 $htpl->setVariable(
"PROP_ID", $id);
3048 $htpl->setVariable(
"IMG",
ilUtil::img($attr[
"img"], $attr[
"tooltip"]));
3049 if ($attr[
"href"] !=
"") {
3050 $htpl->setVariable(
"PROP_HREF",
' href="' . $attr[
"href"] .
'" ');
3052 $htpl->parseCurrentBlock();
3054 if ($attr[
"tooltip"]) {
3063 if (
sizeof($chunks)) {
3066 implode(
" ", $chunks) .
" "
3077 return $htpl->get();
3088 if ((strtolower(
$_GET[
"baseClass"]) !=
"ilrepositorygui") &&
3089 is_int(strpos($a_link,
"baseClass=ilRepositoryGUI"))) {
3090 if ($this->type !=
"frm") {
3101 if ($this->default_command_params) {
3103 foreach ($this->default_command_params as
$name => $value) {
3104 $params[] =
$name .
'=' . $value;
3106 $params = implode(
'&', $params);
3110 if (!stristr($a_default_link,
'?')) {
3111 $a_default_link = ($a_default_link .
'?' . $params);
3113 $a_default_link = ($a_default_link .
'&' . $params);
3116 return $a_default_link;
3126 if (strstr($a_link,
'ilSAHSPresentationGUI') && !$this->offline_mode) {
3127 include_once
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
3129 $om = $sahs_obj->getOpenMode();
3130 $width = $sahs_obj->getWidth();
3131 $height = $sahs_obj->getHeight();
3132 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
3135 if ($om != 0 && !
$DIC[
'ilBrowser']->isMobile()) {
3136 $this->default_command[
"frame"] =
"";
3137 $a_link =
"javascript:void(0); onclick=startSAHS('" . $a_link .
"','" . $wtarget .
"'," . $om .
"," . $width .
"," . $height .
");";
3151 if (!$this->path_gui instanceof \
ilPathGUI) {
3157 $path_gui->enableTextOnly(!$this->path_linked);
3160 $start_node = $this->path_start_node
3161 ? $this->path_start_node
3164 $this->tpl->setCurrentBlock(
"path_item");
3165 $this->tpl->setVariable(
'PATH_ITEM',
$path_gui->getPath($start_node, $this->ref_id));
3166 $this->tpl->parseCurrentBlock();
3168 $this->tpl->setCurrentBlock(
"path");
3169 $this->tpl->setVariable(
"TXT_LOCATION",
$lng->txt(
"locator"));
3170 $this->tpl->parseCurrentBlock();
3197 $this->tpl->setCurrentBlock(
"check");
3198 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3199 $this->tpl->parseCurrentBlock();
3202 $this->tpl->setCurrentBlock(
"check_download");
3204 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3206 $this->tpl->setVariable(
"VAL_VISIBILITY",
"visibility: hidden;\" disabled=\"disabled");
3208 $this->tpl->parseCurrentBlock();
3211 $this->tpl->setCurrentBlock(
'expand');
3214 $this->ctrl->setParameter($this->container_obj,
'expand', -1 * $this->obj_id);
3216 $this->tpl->setVariable(
'EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj,
'view', $this->getUniqueItemId(
true)));
3217 $this->ctrl->clearParameters($this->container_obj);
3219 $this->tpl->setVariable(
'EXP_ALT', $this->lng->txt(
'collapse'));
3221 $this->ctrl->setParameter($this->container_obj,
'expand', $this->obj_id);
3223 $this->tpl->setVariable(
'EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj,
'view', $this->getUniqueItemId(
true)));
3224 $this->ctrl->clearParameters($this->container_obj);
3226 $this->tpl->setVariable(
'EXP_ALT', $this->lng->txt(
'expand'));
3229 $this->tpl->parseCurrentBlock();
3235 $this->tpl->touchBlock(
"i_1");
3239 if ($this->title_link_disabled || !$this->default_command || (!$this->
getCommandsStatus() && !$this->restrict_to_goto)) {
3257 $this->tpl->setCurrentBlock(
"icon");
3258 if (!$objDefinition->isPlugin($this->getIconImageType())) {
3259 $this->tpl->setVariable(
"ALT_ICON",
$lng->txt(
"obj_" . $this->getIconImageType()));
3261 include_once(
"Services/Component/classes/class.ilPlugin.php");
3262 $this->tpl->setVariable(
3268 $this->tpl->setVariable(
3272 $this->tpl->parseCurrentBlock();
3276 $this->tpl->touchBlock(
"d_" . $cnt);
3285 return ilObject::getIconForReference(
3286 (
int) $this->ref_id,
3287 (
int) $this->obj_id,
3298 foreach ($this->sub_item_html as $sub_html) {
3299 $this->tpl->setCurrentBlock(
"subitem");
3300 $this->tpl->setVariable(
"SUBITEM", $sub_html);
3301 $this->tpl->parseCurrentBlock();
3310 if ($this->position_enabled) {
3311 $this->tpl->setCurrentBlock(
"position");
3312 $this->tpl->setVariable(
"POS_ID", $this->position_field_index);
3313 $this->tpl->setVariable(
"POS_VAL", $this->position_value);
3314 $this->tpl->parseCurrentBlock();
3324 return $this->adm_commands_included;
3333 if ($this->acache->getLastAccessStatus() ==
"miss" &&
3334 !$this->prevent_access_caching) {
3335 $this->acache->storeEntry(
3336 $ilUser->getId() .
":" . $this->ref_id,
3337 serialize($this->access_cache),
3362 $a_use_asynch =
false,
3363 $a_get_asynch_commands =
false,
3370 $this->adm_commands_included =
false;
3376 $this->
initItem($a_ref_id, $a_obj_id,
$type, $a_title, $a_description);
3378 if ($a_use_asynch && $a_get_asynch_commands) {
3382 if ($this->rating_enabled) {
3387 $rating->setObject($this->obj_id, $this->type);
3396 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3404 include_once(
"Services/Object/classes/class.ilListItemAccessCache.php");
3406 $cres = $this->acache->getEntry(
$ilUser->getId() .
":" . $a_ref_id);
3407 if ($this->acache->getLastAccessStatus() ==
"hit") {
3408 $this->access_cache = unserialize($cres);
3429 static::$tpl_file_name,
3432 static::$tpl_component,
3440 $this->tpl->setVariable(
3441 "COMMAND_SELECTION_LIST",
3442 $this->
insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url)
3504 $this->tpl->setVariable(
"DIV_CLASS",
'ilContainerListItemOuter');
3513 return $this->tpl->get();
3522 $this->cust_prop = array();
3523 $this->cust_commands = array();
3524 $this->sub_item_html = array();
3525 $this->position_enabled =
false;
3535 $this->parent_ref_id = $a_ref_id;
3547 $id_ref = ($this->reference_ref_id > 0)
3548 ? $this->reference_ref_id
3552 if ($this->condition_depth) {
3563 return "lg_div_" . $id_ref;
3590 $this->bold_title = $a_bold_title;
3615 if ($a_context == self::CONTEXT_REPOSITORY) {
3616 $active_notes = !
$ilSetting->get(
"disable_notes");
3617 $active_comments = !
$ilSetting->get(
"disable_comments");
3619 if ($active_notes || $active_comments) {
3620 include_once(
"./Services/Notes/classes/class.ilNote.php");
3623 if ($active_comments) {
3629 if (
$ilSetting->get(
'comments_tagging_in_lists')) {
3630 if ($active_notes || $active_comments) {
3633 $lng->loadLanguageModule(
"notes");
3637 if ($tags_set->get(
"enable")) {
3638 $all_users = $tags_set->get(
"enable_all_users");
3640 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
3641 if (!
$ilSetting->get(
'comments_tagging_in_lists_tags')) {
3644 $tag_user_id =
null;
3646 $tag_user_id =
$ilUser->getId();
3651 $lng->loadLanguageModule(
"tagging");
3655 $lng->loadLanguageModule(
"rating");
3658 self::$preload_done =
true;
3671 protected function isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access =
true)
3673 if ($this->comments_enabled) {
3674 if (!$this->comments_settings_enabled) {
3677 if ($a_check_write_access && $this->
checkCommandAccess(
'write',
'', $a_ref_id, $a_type)) {
3682 if (!$a_header_actions && self::$preload_done) {
3683 if (self::$comments_activation[$a_obj_id][$a_type]) {
3687 include_once(
"./Services/Notes/classes/class.ilNote.php");
3705 $this->timings_enabled = (bool) $a_status;
3716 include_once(
"./Services/FileUpload/classes/class.ilFileUploadUtil.php");
3725 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
3730 $this->tpl->setCurrentBlock(
"fileupload");
3731 $this->tpl->setVariable(
"FILE_UPLOAD", $upload->getHTML());
3732 $this->tpl->parseCurrentBlock();
3751 ) : ?\
ILIAS\
UI\Component\Item\Item {
3755 $description = strip_tags($description);
3770 foreach ($this->current_selection_list->getItems() as $action_item) {
3771 $action =
$ui->factory()
3773 ->shy($action_item[
'title'], $action_item[
'link']);
3776 if ($action_item[
'onclick'] !=
null && $action_item[
'onclick'] !=
'') {
3777 $action = $action->withAdditionalOnLoadCode(
function ($id) use ($action_item) {
3778 return "$('#$id').click(function(){" . $action_item[
'onclick'] .
";});";
3782 $actions[] = $action;
3785 $dropdown =
$ui->factory()
3787 ->standard($actions)
3788 ->withAriaLabel(sprintf(
3789 $this->lng->txt(
'actions_for'),
3790 htmlspecialchars(addslashes($title))
3795 $icon = $this->
ui->factory()
3799 ->withSize(
'medium');
3802 if ($def_command[
'link']) {
3803 $def_command[
'link'] = $this->
modifySAHSlaunch($def_command[
'link'], $def_command[
'frame']);
3804 $new_viewport = !in_array($this->
getDefaultCommand()[
'frame'], [
'',
'_top',
'_self',
'_parent'],
true);
3805 $link = $this->
ui->factory()
3807 ->standard($this->
getTitle(), $def_command[
'link'])
3808 ->withOpenInNewViewport($new_viewport);
3809 $list_item =
$ui->factory()->item()->standard($link);
3811 $list_item =
$ui->factory()->item()->standard($this->
getTitle());
3814 if ($description !=
"") {
3815 $list_item = $list_item->withDescription($description);
3817 $list_item = $list_item->withActions($dropdown)->withLeadIcon($icon);
3828 $l[(string) $p[
'property']] = (
string) $p[
'value'];
3831 if (count($l) > 0) {
3832 $list_item = $list_item->withProperties($l);
3873 ) : ?\
ILIAS\
UI\Component\Card\Card {
3877 $description = strip_tags($description);
3887 $user = $this->user;
3888 $access = $this->access;
3890 $this->enableCommands(
true);
3895 if ($description !=
"") {
3896 $sections[] = $ui->factory()->legacy(
"<div class='il-multi-line-cap-3'>" . $description .
"</div>");
3899 $this->insertCommands();
3902 foreach ($this->current_selection_list->getItems() as $item) {
3903 if (!isset($item[
"onclick"]) || $item[
"onclick"] ==
"") {
3905 $ui->factory()->button()->shy($item[
"title"], $item[
"link"]);
3908 $ui->factory()->button()->shy($item[
"title"],
"")->withAdditionalOnLoadCode(
function ($id) use ($item) {
3910 "$('#$id').click(function(e) { " . $item[
"onclick"] .
"});";
3915 $def_command = $this->getDefaultCommand();
3917 if ($def_command[
"frame"] !=
"") {
3931 $dropdown = $ui->factory()->dropdown()->standard($actions)
3932 ->withAriaLabel(sprintf(
3933 $this->lng->txt(
'actions_for'),
3934 htmlspecialchars(addslashes($title))
3938 $path = $this->getTileImagePath();
3943 if ($def_command[
"frame"] ==
"_top") {
3944 $def_command[
"frame"] =
"";
3949 $this->modifySAHSlaunch($def_command[
"link"], $def_command[
"frame"]);
3951 $image = $this->
ui->factory()
3953 ->responsive($path,
'');
3954 if ($def_command[
'link'] !=
'') {
3955 if ($def_command[
"frame"] !=
"" && ($modified_link == $def_command[
"link"])) {
3956 $image = $image->withAdditionalOnLoadCode(
function ($id) use ($def_command) {
3958 "$('#$id').click(function(e) { window.open('" . str_replace(
3961 $def_command[
"link"]
3962 ) .
"', '" . $def_command[
"frame"] .
"');});";
3966 $ui->factory()->button()->shy($title,
"")->withAdditionalOnLoadCode(
function ($id) use (
3970 "$('#$id').click(function(e) { window.open('" . str_replace(
3973 $def_command[
"link"]
3974 ) .
"', '" . $def_command[
"frame"] .
"');});";
3976 $title = $ui->renderer()->render($button);
3978 $image = $image->withAction($modified_link);
3982 if (
$type ==
'sess') {
3984 $title =
": " . $title;
3990 $app_info[
'fullday']
3994 $icon = $this->
ui->factory()
3997 ->standard($type, $this->lng->txt(
'obj_' .
$type))
3998 ->withIsOutlined(
true);
4001 $card_title_action =
"";
4002 if ($def_command[
"link"] !=
"" && ($def_command[
"frame"] ==
"" || $modified_link != $def_command[
"link"])) {
4003 $card_title_action = $modified_link;
4004 } elseif ($def_command[
'link'] ==
"" &&
4005 $this->getInfoScreenStatus() &&
4006 $access->checkAccessOfUser(
4013 if ($image->getAction() ==
"") {
4014 $image = $image->withAction($card_title_action);
4018 $card = $ui->factory()->card()->repositoryObject(
4019 $title .
'<span data-list-item-id="' . $this->getUniqueItemId(
true) .
'"></span>',
4027 if ($card_title_action !=
"") {
4028 $card = $card->withTitleAction($card_title_action);
4032 foreach ($this->determineProperties() as $p) {
4033 if ($p[
"alert"] && $p[
'property'] !== $this->lng->txt(
'learning_progress')) {
4034 $l[(string) $p[
'property']] = (
string) $p[
'value'];
4037 if (count($l) > 0) {
4038 $prop_list = $ui->factory()->listing()->descriptive($l);
4039 $sections[] = $prop_list;
4041 if (count($sections) > 0) {
4042 $card = $card->withSections($sections);
4046 if (is_array($lp) && array_key_exists(
'status', $lp)) {
4052 $card = $card->withProgress(
4056 ->mini(100, $percentage)
4065 $img = $this->object_service->commonSettings()->tileImage()->getByObjId($this->obj_id);
4066 if (
$img->exists()) {
4067 $path =
$img->getFullPath();
4070 if (!is_file($path)) {
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
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 translateOperator($a_obj_id, $a_operator)
Translate operator.
static _checkCondition($condition, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static getEffectiveOptionalConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_obj_type='')
Get optional conditions.
static calculateEffectiveRequiredTriggers($a_target_ref_id, $a_target_obj_id, $a_target_obj_type='')
calculate number of obligatory items
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _isActive()
Static getter.
Manages favourites, currently the interface for other components, needs discussion.
static initFileUpload()
Initializes the file upload and loads the needed javascripts and styles.
static isUploadAllowed($a_ref_id, $a_type="")
Determines whether files can be uploaded to the object with the specified reference id.
static _getInstance()
Get singleton instance of this class.
const LP_STATUS_COMPLETED_NUM
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
static getListGUIStatus($a_obj_id, $a_image_only=true)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
Caches (check) access information on list items.
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
static getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
static _countNotesAndComments( $a_rep_obj_id, $a_sub_obj_id=null, $a_obj_type="", $a_news_id=0)
Get all notes related to a specific object.
static _countNotesAndCommentsMultiple($a_rep_obj_ids, $a_no_sub_objs=false)
Get all notes related to multiple objcts.
static getRepObjActivation($a_rep_obj_ids)
Get activation for repository objects.
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
Class ilObjSCORMLearningModule.
static _getCommands()
get commands
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
getProperties()
Get item properties.
enableDescription($a_status)
En/disable description.
getAdditionalInformation()
Get additional information.
enabledRelevance()
enabled relevance
$search_fragments_enabled
getContainerObject()
get container object
setHeaderSubObject($a_type, $a_id)
Set sub object identifier.
getAsListItem(int $ref_id, int $obj_id, string $type, string $title, string $description)
Get list item ui object.
getTitle()
getTitle overwritten in class.ilObjLinkResourceList.php
isTitleBold()
@access public
const DOWNLOAD_CHECKBOX_DISABLED
setBoldTitle($a_bold_title)
@access public @params boolean $a_bold_title set the item title bold
addHeaderIconHTML($a_id, $a_html)
setSearchFragment($a_text)
set search fragment
setMode($a_mode)
set output mode
determineProperties()
Determine properties.
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
getAlertProperties()
get all alert properties
enableLinkedPath($a_status)
Enable linked path.
storeAccessCache()
Store access cache.
modifyTitleLink($a_default_link)
adminCommandsIncluded()
returns whether any admin commands (link, delete, cut) are included in the output
insertTitle()
insert item title
$rating_categories_enabled
setDetailsLevel($a_level)
Details level Currently used in Search which shows only limited properties of forums Currently used f...
enableDownloadCheckbox($a_ref_id, $a_value)
$notice_properties_enabled
enableCommands($a_status, $a_std_only=false)
En/disable commands.
getDefaultCommand()
Get default command.
setDefaultCommandParameters(array $a_params)
getCommandLink($a_cmd)
Get command link url.
const CONTEXT_WORKSPACE_SHARING
enableRepositoryTransfer($a_value)
Enable copy/move to repository (from personal workspace)
getCommands()
get all current commands for a specific ref id (in the permission context of the current user)
insertRelevance()
insert relevance
insertSubstitutions()
Insert substitutions.
enableProperties($a_status)
En/disable properties.
getIconImageType()
Returns the icon image type.
setSeparateCommands($a_val)
Set separate commands.
insertFileUpload()
Inserts a file upload component.
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
getHeaderAction(ilGlobalTemplateInterface $a_main_tpl=null)
Get header action.
insertPreconditions()
insert all missing preconditions
const CONTEXT_PERSONAL_DESKTOP
isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access=true)
Check comments status against comments settings and context.
enableRelevance($a_status)
enable relevance
const DOWNLOAD_CHECKBOX_NONE
parseConditions($toggle_id, $conditions, $obligatory=true)
enablePath($a_path, $a_start_node=null, \ilPathGUI $path_gui=null)
En/disable path.
addCustomCommand($a_link, $a_lang_var, $a_frame="", $onclick="")
add a custom command
isMode($a_mode)
check current output mode
insertPasteCommand()
Insert paste command.
getAsCard(int $ref_id, int $obj_id, string $type, string $title, string $description)
Get card object.
enableLink($a_status)
En/disable link.
getSearchFragmentStatus()
Show hide search result fragments.
$item_detail_links_enabled
enableSubstitutions($a_status)
Enable substitutions.
isSideBlock()
Returns whether current item is a block in a side column or not.
isVisibleOnlyForced()
Force unreadable.
enableCheckbox($a_status)
En/Dis-able checkboxes.
const DOWNLOAD_CHECKBOX_ENABLED
insertMultiDownloadCommand()
getCommandsHTML()
Get commands HTML (must be called after get list item html)
setConditionDepth($a_depth)
set depth for precondition output (stops at level 5)
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
getItemDetailLinkStatus()
get item detail link status
resetCustomData()
reset properties and commands
forceVisibleOnly($a_stat)
Force visible access only.
$repository_transfer_enabled
addSubItemHTML($a_html)
Add HTML for subitem (used for sessions)
getCommandFrame($a_cmd)
Get command target frame.
getNoticeProperties()
get notice properties
getTypeIcon()
Get object type specific type icon.
enableNotes($a_value)
Toogle notes action status.
insertTimingsCommand()
insert edit timings command
insertInfoScreenCommand()
insert info screen command
enableNoticeProperties($a_status)
En/disable notices.
getUniqueItemId($a_as_div=false)
Get unique item identifier (for js-actions)
getCommandImage($a_cmd)
Get command icon image.
setParentRefId($a_ref_id)
Set current parent ref id to enable unique js-ids (sessions, etc.)
enableIcon($a_status)
En/Dis-able icons.
getSearchFragment()
get search fragment
insertSearchFragment()
Insert highlighted search fragment.
insertCutCommand($a_to_repository=false)
insert cut command
createDefaultCommand($command)
Get default command link Overwritten for e.g categories,courses => they return a goto link If search ...
enableSearchFragments($a_status)
En/disable description.
enableCopy($a_status)
En/disable copy.
enableTimings($a_status)
enable timings link
disableTitleLink($a_status)
addHeaderIcon($a_id, $a_img, $a_tooltip=null, $a_onclick=null, $a_status_text=null, $a_href=null)
addHeaderGlyph($a_id, $a_glyph, $a_onclick=null)
insertItemDetailLinks()
insert item detail links
static preloadCommonProperties($a_obj_ids, $a_context)
Preload common properties.
enablePreconditions($a_status)
En/disable preconditions.
enableTags($a_value)
Toogle tags action status.
getDescription()
getDescription overwritten in class.ilObjLinkResourceList.php
setPositionInputField($a_field_index, $a_position_value)
Set position input field.
getSubstitutionStatus()
Get substitution status.
enableCut($a_status)
En/disable cut.
setRelevance($a_rel)
set relevance
enableMultiDownload($a_value)
Toggles whether multiple objects can be downloaded at once or not.
enableExpand($a_status)
En/Dis-able expand/collapse link.
insertProgressInfo()
insert progress info
initItem($a_ref_id, $a_obj_id, $type, $a_title="", $a_description="")
inititialize new item (is called by getItemHTML())
insertDescription()
insert item description
setDescription($a_description)
enableProgressInfo($a_status)
enable progress info
insertPositionField()
Insert field for positioning.
insertSubscribeCommand()
insert subscribe command
$comments_settings_enabled
enableSubscribe($a_status)
En/disable subscribe.
appendRepositoryFrameParameter($a_link)
workaround: all links into the repository (from outside) must tell repository to setup the frameset
getCheckboxStatus()
Are checkboxes enabled?
getDownloadCheckboxState()
insertLinkCommand()
insert link command
isFileUploadAllowed()
Gets a value indicating whether file uploads to this object are allowed or not.
static $comments_activation
insertCommonSocialCommands($a_header_actions=false)
Insert common social commands (comments, notes, tagging)
setContainerObject($container_obj)
set the container object (e.g categorygui) Used for link, delete ... commands
enableRating($a_value, $a_text=null, $a_categories=false, array $a_ctrl_path=null)
Toogle rating action status.
checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id="")
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
modifySAHSlaunch($a_link, $wtarget)
workaround: SAHS in new javavasript-created window or iframe
insertCopyCommand($a_to_repository=false)
Insert copy command.
addCustomProperty( $a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
getCustomProperties($a_prop)
get custom properties
insertSubItems()
Insert subitems.
enableComments($a_value, $a_enable_comments_settings=true)
Toogle comments action status.
checkInfoPageOnAsynchronousRendering()
getCommandId()
get command id Normally the ref id.
enableInfoScreen($a_info_screen)
En/disable path.
getProgressInfoStatus()
get progress info status
insertIconsAndCheckboxes()
Insert icons and checkboxes.
setAdditionalInformation($a_val)
Set additional information.
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
getListItemHTML( $a_ref_id, $a_obj_id, $a_title, $a_description, $a_use_asynch=false, $a_get_asynch_commands=false, $a_asynch_url="")
Get all item information (title, commands, description) in HTML.
restrictToGoto($a_value)
Restrict all actions/links to goto.
$prevent_duplicate_commands
getDetailsLevel()
Get current details level.
getIconStatus()
Are icons enabled?
getSeparateCommands()
Get separate commands.
insertDeleteCommand()
insert cut command
insertCommands( $a_use_asynch=false, $a_get_asynch_commands=false, $a_asynch_url="", $a_header_actions=false)
insert all commands into html code
getExpandStatus()
Is expand/collapse enabled.
insertProperties()
insert properties
getRelevance()
get relevance
enableDelete($a_status)
En/disable delete.
insertCommand($a_href, $a_text, $a_frame="", $a_img="", $a_cmd="", $a_onclick="")
insert command button
getNoticePropertiesStatus()
static lookupTxtById($plugin_id, $lang_var)
const INFO_TAB_VISIBILITY
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
static _lookupType($a_id, $a_reference=false)
lookup object type
Creates a path for a start and endnode.
static hasPreview($a_obj_id, $a_type="")
Determines whether the object with the specified reference id has a preview.
static lookupRenderStatus($a_obj_id)
Gets the render status for the object with the specified id.
static getInstance()
Factory.
static hasRatingInListGUI($a_obj_id, $a_obj_type)
static _lookupAppointment($a_obj_id)
lookup appointment
static _appointmentToString($start, $end, $fulltime)
static getListTagsJSCall($a_hash, $a_update_code=null)
Get tagging js call.
static initJavascript($a_ajax_url, ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
static getTagsForUserAndObject( $a_obj_id, $a_obj_type, $a_sub_obj_id, $a_sub_obj_type, $a_user_id)
Get tags for a user and an object.
static _getListTagsForObjects(array $a_obj_ids, $a_user_id=null)
Get tags for given object ids.
static _countTags($a_obj_ids, $a_all_users=false)
Count all tags for repository objects.
special template class to simplify handling of ITX/PEAR
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilWebDAVLockBackend.
static maybeRenderWebDAVModalInGlobalTpl()
This is kind of a singleton pattern.
Access handler for personal workspace.
static getGotoLink($a_node_id, $a_obj_id, $a_additional=null)
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Interface for GUI classes (PDGUI, LuceneSearchGUI...) that have to handle administration commands (cu...
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
Class ChatMainBarProvider \MainMenu\Provider.