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 = $a_title;
841 $this->description = $a_description;
851 return $this->description;
861 $this->search_fragment = $a_text;
880 $this->separate_commands = $a_val;
913 $this->additional_information = $a_val;
935 $this->details_level = $a_level;
954 $this->repository_transfer_enabled = (bool) $a_value;
964 $this->restrict_to_goto = (bool) $a_value;
975 return $this->default_command;
992 $cache_prefix =
null;
993 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
994 $cache_prefix =
"wsp";
995 if (!$this->ws_access) {
996 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1001 if (isset($this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id])) {
1002 return $this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id];
1005 if ($this->context == self::CONTEXT_REPOSITORY) {
1006 $access = $ilAccess->checkAccess($a_permission, $a_cmd, $a_ref_id,
$a_type, $a_obj_id);
1007 if ($ilAccess->getPreventCachingLastResult()) {
1008 $this->prevent_access_caching =
true;
1011 $access = $this->ws_access->checkAccess($a_permission, $a_cmd, $a_ref_id,
$a_type);
1014 $this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id] =
$access;
1027 public function initItem($a_ref_id, $a_obj_id,
$type, $a_title =
"", $a_description =
"")
1029 $this->offline_mode =
false;
1030 if ($this->type ==
"sahs") {
1031 include_once(
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
1034 $this->access_cache = array();
1035 $this->ref_id = $a_ref_id;
1036 $this->obj_id = $a_obj_id;
1039 #$this->description = $a_description;
1042 $this->adm_commands_included =
false;
1043 $this->prevent_access_caching =
false;
1046 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1047 if ($this->context == self::CONTEXT_REPOSITORY) {
1057 $this->condition_target = array(
1058 'ref_id' => $a_ref_id,
1059 'obj_id' => $a_obj_id,
1060 'target_type' => $a_target_type
1066 $this->condition_target = array();
1071 $this->title_link_disabled = $a_status;
1077 $this->default_command_params = $a_params;
1092 if ($this->static_link_enabled and !$this->default_command_params) {
1093 include_once(
'./Services/Link/classes/class.ilLink.php');
1095 $command[
'link'] = $link;
1096 $command[
'frame'] =
'_top';
1099 if ($this->default_command_params) {
1101 foreach ($this->default_command_params as
$name => $value) {
1102 $params[] =
$name .
'=' . $value;
1104 $params = implode(
'&', $params);
1107 if (!stristr($command[
'link'],
'?')) {
1108 $command[
'link'] .=
'?' . $params;
1110 $command[
'link'] .=
'&' . $params;
1130 if ($this->context == self::CONTEXT_REPOSITORY) {
1132 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1136 return $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
1140 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
getCommandId());
1141 $cmd_link = $this->ctrl->getLinkTargetByClass(
"ilrepositorygui", $a_cmd);
1142 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1151 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id",
"");
1152 $this->ctrl->setParameterByClass($this->gui_class_name,
"wsp_id", $this->ref_id);
1153 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1170 if ($a_cmd ==
'fileManagerLaunch') {
1215 if ($this->context == self::CONTEXT_REPOSITORY) {
1221 'property' =>
$lng->txt(
"status"),
1222 'value' =>
$lng->txt(
"offline")
1227 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1230 require_once(
'Services/WebDAV/classes/lock/class.ilWebDAVLockBackend.php');
1232 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
1233 if ($lock = $webdav_lock_backend->getLocksOnObjectId($this->obj_id)) {
1234 $lock_user =
new ilObjUser($lock->getIliasOwner());
1238 "property" =>
$lng->txt(
"in_use_by"),
1239 "value" => $lock_user->getLogin(),
1240 "link" =>
"./ilias.php?user=" . $lock_user->getId() .
'&cmd=showUserProfile&cmdClass=ildashboardgui&baseClass=ilDashboardGUI',
1265 $this->cust_prop[] = array(
"property" => $a_property,
"value" => $a_value,
1266 "alert" => $a_alert,
"newline" => $a_newline);
1274 if (is_array($this->cust_prop)) {
1275 foreach ($this->cust_prop as $prop) {
1290 if ($prop[
'alert'] ==
true) {
1302 $this->notice_prop = array();
1303 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true)) {
1304 foreach ($infos as $info) {
1305 $this->notice_prop[] = array(
'value' => $info);
1308 return $this->notice_prop ? $this->notice_prop : array();
1315 $this->cust_commands[] =
1316 array(
"link" => $a_link,
"lang_var" => $a_lang_var,
1317 "frame" => $a_frame,
"onclick" => $onclick);
1326 $this->force_visible_only = $a_stat;
1366 $ref_commands = array();
1367 foreach ($this->commands as $command) {
1368 $permission = $command[
"permission"];
1369 $cmd = $command[
"cmd"];
1370 $lang_var = $command[
"lang_var"];
1372 $info_object =
null;
1374 if (isset($command[
"txt"])) {
1375 $txt = $command[
"txt"];
1380 if (
$ilUser->getId() == ANONYMOUS_USER_ID &&
1381 $command[
'enable_anonymous'] ==
'false') {
1395 $access_granted =
true;
1397 $access_granted =
false;
1398 $info_object = $ilAccess->getInfo();
1401 if (!isset($command[
"default"])) {
1402 $command[
"default"] =
"";
1404 $ref_commands[] = array(
1405 "permission" => $permission,
1407 "link" => $cmd_link,
1408 "frame" => $cmd_frame,
1409 "lang_var" => $lang_var,
1411 "granted" => $access_granted,
1412 "access_info" => $info_object,
1413 "img" => $cmd_image,
1414 "default" => $command[
"default"]
1418 return $ref_commands;
1431 if ($this->type ==
"sahs" && $this->offline_mode) {
1432 return $this->type .
"_offline";
1447 if ($this->restrict_to_goto) {
1448 $this->default_command = array(
"frame" =>
"",
1453 !$this->default_command ||
1455 $this->title_link_disabled
1458 $this->tpl->setCurrentBlock(
"item_title");
1459 $this->tpl->setVariable(
"TXT_TITLE", $this->
getTitle());
1460 $this->tpl->parseCurrentBlock();
1462 $this->default_command[
'link'] = $this->
modifyTitleLink($this->default_command[
'link']);
1464 $this->default_command[
"link"] =
1465 $this->
modifySAHSlaunch($this->default_command[
"link"], $this->default_command[
"frame"]);
1467 if ($this->default_command[
"frame"] !=
"") {
1468 $this->tpl->setCurrentBlock(
"title_linked_frame");
1469 $this->tpl->setVariable(
"TARGET_TITLE_LINKED", $this->default_command[
"frame"]);
1470 $this->tpl->parseCurrentBlock();
1474 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1475 $this->default_command[
"link"] =
1478 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1482 $this->tpl->setCurrentBlock(
"item_title_linked");
1483 $this->tpl->setVariable(
"TXT_TITLE_LINKED", $this->
getTitle());
1484 $this->tpl->setVariable(
"HREF_TITLE_LINKED", $this->default_command[
"link"]);
1487 include_once(
"./Services/Preview/classes/class.ilPreview.php");
1489 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
1492 $access_handler =
null;
1493 switch ($this->context) {
1497 include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
1504 $access_handler = $ilAccess;
1510 $preview_status_class =
"";
1511 $preview_text_topic =
"preview_show";
1513 $preview_status_class =
"ilPreviewStatusNone";
1514 $preview_text_topic =
"preview_none";
1516 $this->tpl->setCurrentBlock(
"item_title_linked");
1517 $this->tpl->setVariable(
"PREVIEW_STATUS_CLASS", $preview_status_class);
1519 $this->tpl->setVariable(
"ALT_PREVIEW_ICON", $this->lng->txt($preview_text_topic));
1520 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt($preview_text_topic));
1521 $this->tpl->setVariable(
"SCRIPT_PREVIEW_CLICK",
$preview->getJSCall($this->getUniqueItemId(
true)));
1522 $this->tpl->parseCurrentBlock();
1525 $this->tpl->parseCurrentBlock();
1528 if ($this->bold_title ==
true) {
1529 $this->tpl->touchBlock(
'bold_title_start');
1530 $this->tpl->touchBlock(
'bold_title_end');
1536 switch ($this->context) {
1538 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1555 $fields_shown =
false;
1556 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as
$data) {
1557 if (
$data[
'bold']) {
1558 $data[
'name'] =
'<strong>' .
$data[
'name'] .
'</strong>';
1559 $data[
'value'] =
'<strong>' .
$data[
'value'] .
'</strong>';
1561 $this->tpl->touchBlock(
"std_prop");
1562 $this->tpl->setCurrentBlock(
'item_property');
1563 if (
$data[
'show_field']) {
1564 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1566 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1567 $this->tpl->parseCurrentBlock();
1569 if (
$data[
'newline']) {
1570 $this->tpl->touchBlock(
'newline_prop');
1572 $fields_shown =
false;
1574 if ($fields_shown) {
1575 $this->tpl->touchBlock(
'newline_prop');
1591 if (!$this->substitutions->isDescriptionEnabled()) {
1598 $d = strip_tags(
$d,
"<b>");
1599 $this->tpl->setCurrentBlock(
"item_description");
1600 $this->tpl->setVariable(
"TXT_DESC",
$d);
1601 $this->tpl->parseCurrentBlock();
1611 $this->tpl->setCurrentBlock(
'search_fragment');
1612 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT', $this->
getSearchFragment() .
' ...');
1613 $this->tpl->parseCurrentBlock();
1628 include_once
"Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
1632 $this->tpl->setCurrentBlock(
'relevance');
1633 $this->tpl->setVariable(
'REL_PBAR', $pbar->render());
1634 $this->tpl->parseCurrentBlock();
1644 $this->mode = $a_mode;
1662 $this->condition_depth = $a_depth;
1674 if ($a_mode == $this->mode) {
1694 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1696 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
1699 $props[] = array(
"alert" =>
false,
1700 "property" =>
$lng->txt(
"learning_progress"),
1707 if (
$ilUser->getId() == ANONYMOUS_USER_ID) {
1708 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id)) {
1709 $props[] = array(
"alert" =>
true,
1710 "value" =>
$lng->txt(
"no_access_item_public"),
1719 if ($this->reference_ref_id) {
1721 $note_obj_id = $this->reference_obj_id;
1723 $redraw_js =
"il.Object.redrawListItem(" . $note_ref_id .
");";
1726 require_once
'Services/Notes/classes/class.ilNote.php';
1729 self::$cnt_tags[$note_obj_id] > 0 ||
1730 is_array(self::$tags[$note_obj_id])) &&
1731 (
$ilUser->getId() != ANONYMOUS_USER_ID)) {
1732 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
1733 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
1738 $props[] = array(
"alert" =>
false,
1739 "property" =>
$lng->txt(
"notes_comments"),
1740 "value" =>
"<a href='#' onclick=\"return " .
1747 if ($this->notes_enabled && self::$cnt_notes[$note_obj_id][
IL_NOTE_PRIVATE] > 0) {
1748 $props[] = array(
"alert" =>
false,
1749 "property" =>
$lng->txt(
"notes"),
1750 "value" =>
"<a href='#' onclick=\"return " .
1756 if ($this->tags_enabled &&
1757 (self::$cnt_tags[$note_obj_id] > 0 ||
1758 is_array(self::$tags[$note_obj_id]))) {
1760 if ($tags_set->get(
"enable")) {
1764 if (is_array(self::$tags[$note_obj_id])) {
1765 $tags_tmp = array();
1766 foreach (self::$tags[$note_obj_id] as $tag => $is_tag_owner) {
1767 if ($is_tag_owner) {
1768 $tags_tmp[] =
"<a class=\"ilTag ilTagRelHigh\" href='#' onclick=\"return " .
1769 $tags_url .
"\">" . $tag .
"</a>";
1771 $tags_tmp[] =
"<span class=\"ilTag ilTagRelMiddle\">" . $tag .
"</span>";
1774 $tags_value = implode(
" ", $tags_tmp);
1779 $tags_value =
"<a href='#' onclick=\"return " . $tags_url .
"\">" .
1780 self::$cnt_tags[$note_obj_id] .
"</a>";
1781 $prop_text =
$lng->txt(
"tagging_tags");
1783 $props[] = array(
"alert" =>
false,
1784 "property" => $prop_text,
1785 "value" => $tags_value,
1791 if (!is_array($props)) {
1806 if (is_array($props) && count($props) > 0) {
1807 foreach ($props as $prop) {
1810 $this->tpl->touchBlock(
"separator_prop");
1814 if ($prop[
"alert"] ==
true) {
1815 $this->tpl->touchBlock(
"alert_prop");
1817 $this->tpl->touchBlock(
"std_prop");
1819 if ($prop[
"newline"] ==
true && $cnt > 1) {
1820 $this->tpl->touchBlock(
"newline_prop");
1823 if (isset($prop[
"property"]) && $prop[
'propertyNameVisible'] !==
false && $prop[
"property"] !=
"") {
1825 $this->tpl->setCurrentBlock(
"prop_name");
1826 $this->tpl->setVariable(
"TXT_PROP", $prop[
"property"]);
1827 $this->tpl->parseCurrentBlock();
1829 $this->tpl->setCurrentBlock(
"item_property");
1831 if ($prop[
'link']) {
1832 $this->tpl->setVariable(
"LINK_PROP", $prop[
'link']);
1833 $this->tpl->setVariable(
"LINK_VAL_PROP", $prop[
"value"]);
1835 $this->tpl->setVariable(
"VAL_PROP", $prop[
"value"]);
1838 $this->tpl->parseCurrentBlock();
1842 $this->tpl->setCurrentBlock(
"item_properties");
1843 $this->tpl->parseCurrentBlock();
1850 foreach ($this->notice_prop as $property) {
1851 $this->tpl->setCurrentBlock(
'notice_item');
1852 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE', $property[
'value']);
1853 $this->tpl->parseCurrentBlock();
1855 $this->tpl->setCurrentBlock(
'notice_property');
1856 $this->tpl->parseCurrentBlock();
1866 $num_optional_required =
1870 $visible_conditions = array();
1871 $passed_optional = 0;
1872 foreach ($conditions as $condition) {
1873 if ($obligatory and !$condition[
'obligatory']) {
1876 if (!$obligatory and $condition[
'obligatory']) {
1880 if (
$tree->isDeleted($condition[
'trigger_ref_id'])) {
1884 include_once
'Services/Container/classes/class.ilMemberViewSettings.php';
1889 $visible_conditions[] = $condition[
'id'];
1892 if (!$obligatory and
$ok) {
1895 if ($passed_optional >= $num_optional_required) {
1901 foreach ($conditions as $condition) {
1902 if (!in_array($condition[
'id'], $visible_conditions)) {
1906 include_once
'./Services/Conditions/classes/class.ilConditionHandlerGUI.php';
1910 $class = $objDefinition->getClassName($condition[
"trigger_type"]);
1911 $location = $objDefinition->getLocation($condition[
"trigger_type"]);
1915 $missing_cond_exist =
true;
1917 $full_class =
"ilObj" . $class .
"ListGUI";
1918 include_once(
$location .
"/class." . $full_class .
".php");
1919 $item_list_gui =
new $full_class($this);
1921 $item_list_gui->enablePath(
false);
1922 $item_list_gui->enableIcon(
true);
1923 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1925 $item_list_gui->addCustomProperty($this->lng->txt(
"precondition_required_itemlist"), $cond_txt,
false,
true);
1927 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1928 $item_list_gui->enableProperties($this->properties_enabled);
1930 $trigger_html = $item_list_gui->getListItemHTML(
1931 $condition[
'trigger_ref_id'],
1932 $condition[
'trigger_obj_id'],
1936 $this->tpl->setCurrentBlock(
"precondition");
1937 if ($trigger_html ==
"") {
1938 $trigger_html = $this->lng->txt(
"precondition_not_accessible");
1940 $this->tpl->setVariable(
"TXT_CONDITION", trim($cond_txt));
1941 $this->tpl->setVariable(
"TRIGGER_ITEM", $trigger_html);
1942 $this->tpl->parseCurrentBlock();
1945 if ($missing_cond_exist and $obligatory) {
1946 $this->tpl->setCurrentBlock(
"preconditions");
1947 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_obl_" . $toggle_id);
1948 $this->tpl->setVariable(
"TXT_PRECONDITIONS",
$lng->txt(
"preconditions_obligatory_hint"));
1949 $this->tpl->parseCurrentBlock();
1950 } elseif ($missing_cond_exist and !$obligatory) {
1951 $this->tpl->setCurrentBlock(
"preconditions");
1952 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_opt_" . $toggle_id);
1953 $this->tpl->setVariable(
"TXT_PRECONDITIONS", sprintf(
$lng->txt(
"preconditions_optional_hint"), $num_optional_required));
1954 $this->tpl->parseCurrentBlock();
1957 return !$missing_cond_exist;
1965 include_once(
"./Services/Conditions/classes/class.ilConditionHandler.php");
1968 if ($this->condition_depth > 0) {
1972 if ($this->condition_target) {
1973 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget(
1974 $this->condition_target[
'ref_id'],
1975 $this->condition_target[
'obj_id'],
1976 $this->condition_target[
'target_type']
1979 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget($this->ref_id, $this->obj_id);
1982 if (
sizeof($conditions)) {
1983 for (
$i = 0;
$i < count($conditions);
$i++) {
1991 $all_done_obl = $this->
parseConditions(self::$js_unique_id, $conditions,
true);
1992 $all_done_opt = $this->
parseConditions(self::$js_unique_id, $conditions,
false);
1994 if (!$all_done_obl || !$all_done_opt) {
1995 $this->tpl->setCurrentBlock(
"preconditions_toggle");
1996 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_INTRO", $this->lng->txt(
"precondition_toggle"));
1997 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt(
"show"));
1998 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_ID", self::$js_unique_id);
1999 $this->tpl->setVariable(
"TXT_PRECONDITION_SHOW", $this->lng->txt(
"show"));
2000 $this->tpl->setVariable(
"TXT_PRECONDITION_HIDE", $this->lng->txt(
"hide"));
2001 $this->tpl->parseCurrentBlock();
2014 public function insertCommand($a_href, $a_text, $a_frame =
"", $a_img =
"", $a_cmd =
"", $a_onclick =
"")
2017 $chksum = md5($a_href . $a_text);
2018 if ($a_href ==
"#" ||
2019 !in_array($chksum, $this->prevent_duplicate_commands)) {
2020 if ($a_href !=
"#") {
2021 $this->prevent_duplicate_commands[] = $chksum;
2024 $prevent_background_click =
false;
2025 if ($a_cmd ==
'mount_webfolder') {
2026 $a_onclick =
"triggerWebDAVModal('$a_href')";
2031 $this->current_selection_list->addItem(
2039 $prevent_background_click,
2054 if ($this->std_cmd_only) {
2064 $this->adm_commands_included =
true;
2071 $this->ctrl->setParameter(
2072 $this->container_obj,
2074 $this->container_obj->object->getRefId()
2076 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2077 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"delete");
2080 $this->lng->txt(
"delete"),
2084 $this->adm_commands_included =
true;
2099 if ($this->std_cmd_only) {
2105 !$objDefinition->allowLink($this->type)) {
2116 $this->adm_commands_included =
true;
2123 $this->ctrl->setParameter(
2124 $this->container_obj,
2126 $this->container_obj->object->getRefId()
2128 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2129 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"link");
2132 $this->lng->txt(
"link"),
2136 $this->adm_commands_included =
true;
2148 if ($this->std_cmd_only) {
2158 $this->adm_commands_included =
true;
2168 $this->container_obj->object) {
2169 $this->ctrl->setParameter(
2170 $this->container_obj,
2172 $this->container_obj->object->getRefId()
2174 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2176 if (!$a_to_repository) {
2177 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut");
2180 $this->lng->txt(
"move"),
2185 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut_for_repository");
2188 $this->lng->txt(
"wsp_move_to_repository"),
2194 $this->adm_commands_included =
true;
2207 if ($this->std_cmd_only) {
2212 $objDefinition->allowCopy($this->type)) {
2213 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
2214 $this->ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id', $this->
getCommandId());
2215 $cmd_copy = $this->ctrl->getLinkTargetByClass(
'ilobjectcopygui',
'initTargetSelection');
2218 $this->ctrl->setParameter(
2219 $this->container_obj,
2221 $this->container_obj->object->getRefId()
2223 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2225 if (!$a_to_repository) {
2226 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy');
2229 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
2230 $this->
insertCommand($cmd_copy, $this->lng->txt(
'wsp_copy_to_repository'));
2234 $this->adm_commands_included =
true;
2247 if ($this->std_cmd_only) {
2261 $this->adm_commands_included =
true;
2279 if ($this->std_cmd_only) {
2292 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
2294 if (is_object($this->container_obj) &&
2296 is_object($this->container_obj->object)) {
2297 $this->ctrl->setParameter($this->container_obj,
"ref_id", $this->container_obj->object->getRefId());
2300 if (!$this->fav_manager->ifIsFavourite(
$ilUser->getId(), $this->getCommandId())) {
2302 if ($this->
checkCommandAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id)) {
2304 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2305 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2306 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"addToDesk");
2309 $this->lng->txt(
"rep_add_to_favourites"),
2317 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2318 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2319 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"removeFromDesk");
2322 $this->lng->txt(
"rep_remove_from_favourites"),
2336 if ($this->std_cmd_only) {
2343 $this->lng->txt(
"info_short"),
2360 if ($this->std_cmd_only ||
2361 (
$ilUser->getId() == ANONYMOUS_USER_ID)) {
2364 $lng->loadLanguageModule(
"notes");
2365 $lng->loadLanguageModule(
"tagging");
2367 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2371 if ($this->reference_ref_id) {
2375 $js_updater = $a_header_actions
2376 ?
"il.Object.redrawActionHeader();"
2377 :
"il.Object.redrawListItem(" . $note_ref_id .
")";
2383 $this->lng->txt(
"notes_comments"),
2391 if ($this->notes_enabled) {
2394 $this->lng->txt(
"notes"),
2402 if ($this->tags_enabled) {
2403 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2407 $this->lng->txt(
"tagging_set_tag"),
2423 if ($this->std_cmd_only || !$this->container_obj->object) {
2428 $parent_type = $this->container_obj->object->getType();
2431 if ($this->reference_ref_id) {
2432 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->reference_ref_id);
2437 $this->ctrl->setParameterByClass(
2438 'ilobjectactivationgui',
2442 $this->ctrl->setParameterByClass(
2443 'ilobjectactivationgui',
2447 $cmd_lnk = $this->ctrl->getLinkTargetByClass(
2448 array($this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui'),
2452 $this->
insertCommand($cmd_lnk, $this->lng->txt(
'obj_activation_list_gui'));
2455 if ($this->reference_ref_id) {
2456 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->ref_id);
2468 $a_use_asynch =
false,
2469 $a_get_asynch_commands =
false,
2471 $a_header_actions =
false
2480 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2482 $this->current_selection_list->setAriaListTitle(
2484 $this->lng->txt(
'actions_for'),
2485 htmlspecialchars(addslashes($this->
getTitle()))
2488 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2489 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2490 if ($a_header_actions) {
2491 $this->current_selection_list->setListTitle(
"<span class='hidden-xs'>" .
$lng->txt(
"actions") .
"</span>");
2493 $this->current_selection_list->setListTitle(
"");
2495 $this->current_selection_list->setId(
"act_" . $this->
getUniqueItemId(
false));
2496 $this->current_selection_list->setSelectionHeaderClass(
"small");
2497 $this->current_selection_list->setItemLinkClass(
"xsmall");
2498 $this->current_selection_list->setLinksMode(
"il_ContainerItemCommand2");
2500 $this->current_selection_list->setUseImages(
false);
2501 $this->current_selection_list->setAdditionalToggleElement($this->
getUniqueItemId(
true),
"ilContainerListItemOuterHighlight");
2503 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id", $this->ref_id);
2506 $only_default =
false;
2507 if ($a_use_asynch && !$a_get_asynch_commands) {
2508 $only_default =
true;
2511 $this->default_command =
false;
2512 $this->prevent_duplicate_commands = array();
2515 $valid_header_commands = array(
"mount_webfolder");
2517 $commands = $this->
getCommands($this->ref_id, $this->obj_id);
2518 foreach ($commands as $command) {
2519 if ($a_header_actions && !in_array($command[
"cmd"], $valid_header_commands)) {
2523 if ($command[
"granted"] ==
true) {
2524 if (!$command[
"default"] ===
true) {
2525 if (!$this->std_cmd_only && !$only_default) {
2530 $cmd_link = $command[
"link"];
2531 $txt = ($command[
"lang_var"] ==
"")
2533 : $this->lng->txt($command[
"lang_var"]);
2549 if (!$only_default) {
2551 if (is_array($this->cust_commands)) {
2552 foreach ($this->cust_commands as $command) {
2555 $this->lng->txt($command[
"lang_var"]),
2571 if ($this->timings_enabled) {
2576 if ($this->delete_enabled) {
2581 if ($this->link_enabled) {
2586 if ($this->cut_enabled) {
2591 if ($this->copy_enabled) {
2596 if ($this->repository_transfer_enabled) {
2602 if ($this->subscribe_enabled) {
2607 if ($this->multi_download_enabled && $a_header_actions) {
2612 if ($this->cut_enabled or $this->link_enabled) {
2624 if (!$a_header_actions) {
2625 $this->ctrl->clearParametersByClass($this->gui_class_name);
2632 if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions) {
2633 if (
$ilUser->getId() == ANONYMOUS_USER_ID && $this->checkInfoPageOnAsynchronousRendering()) {
2634 include_once(
"./Services/Container/classes/class.ilContainer.php");
2635 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
2646 if ($a_use_asynch && $a_get_asynch_commands) {
2647 return $this->current_selection_list->getHTML(
true);
2650 return $this->current_selection_list->getHTML();
2667 $this->comments_enabled = (bool) $a_value;
2668 $this->comments_settings_enabled = (bool) $a_enable_comments_settings;
2685 $this->notes_enabled = (bool) $a_value;
2696 if (!$tags_set->get(
"enable")) {
2699 $this->tags_enabled = (bool) $a_value;
2710 public function enableRating($a_value, $a_text =
null, $a_categories =
false, array $a_ctrl_path =
null)
2712 $this->rating_enabled = (bool) $a_value;
2714 if ($this->rating_enabled) {
2715 $this->rating_categories_enabled = (bool) $a_categories;
2716 $this->rating_text = $a_text;
2717 $this->rating_ctrl_path = $a_ctrl_path;
2729 if (!$folder_set->get(
"enable_multi_download")) {
2732 $this->multi_download_enabled = (bool) $a_value;
2739 if ($this->std_cmd_only) {
2755 $user_id = $this->
user->getId();
2756 $hasAdminAccess = $this->access->checkAccessOfUser($user_id,
"crs_admin", $this->ctrl->getCmd(),
$_GET[
'ref_id']);
2759 if ($hasAdminAccess) {
2760 $cmd =
$_GET[
"cmd"] ==
"enableAdministrationPanel" ?
"render" :
"enableAdministrationPanel";
2762 $cmd =
$_GET[
"cmd"] ==
"enableMultiDownload" ?
"render" :
"enableMultiDownload";
2765 $this->
insertCommand($cmd_link, $this->lng->txt(
"download_multiple_objects"));
2778 if (in_array($this->type, array(
"file",
"fold")) &&
2779 $ilAccess->checkAccess(
"read",
"", $a_ref_id, $this->type)) {
2797 public static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl =
null)
2803 if (is_null($a_tpl)) {
2808 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2813 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2817 if ($a_redraw_url) {
2818 $a_tpl->addOnLoadCode(
"il.Object.setRedrawAHUrl('" .
2819 $a_redraw_url .
"');");
2831 $this->sub_obj_type =
$a_type;
2832 $this->sub_obj_id = (int) $a_id;
2844 public function addHeaderIcon($a_id, $a_img, $a_tooltip =
null, $a_onclick =
null, $a_status_text =
null, $a_href =
null)
2846 $this->header_icons[$a_id] = array(
"img" => $a_img,
2847 "tooltip" => $a_tooltip,
2848 "onclick" => $a_onclick,
2849 "status_text" => $a_status_text,
2860 $this->header_icons[$a_id] = $a_html;
2870 $this->header_icons[$a_id] = array(
"glyph" => $a_glyph,
"onclick" => $a_onclick);
2875 $this->ajax_hash = $a_hash;
2890 if ($a_main_tpl ==
null) {
2891 $main_tpl =
$DIC[
"tpl"];
2893 $main_tpl = $a_main_tpl;
2896 $htpl =
new ilTemplate(
"tpl.header_action.html",
true,
true,
"Services/Repository");
2898 $redraw_js =
"il.Object.redrawActionHeader();";
2901 if ($this->tags_enabled) {
2902 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
2910 if (count(
$tags) > 0) {
2911 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2912 $lng->loadLanguageModule(
"tagging");
2919 $f = $this->
ui->factory();
2922 $f->symbol()->glyph()->tag(
"#")
2923 ->withCounter(
$f->counter()->status((
int) count(
$tags))),
2932 include_once(
"./Services/Notes/classes/class.ilNote.php");
2933 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2934 $type = ($this->sub_obj_type ==
"")
2936 : $this->sub_obj_type;
2939 if ($this->notes_enabled && $cnt[$this->obj_id][
IL_NOTE_PRIVATE] > 0) {
2947 $f = $this->
ui->factory();
2950 $f->symbol()->glyph()->note(
"#")
2951 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PRIVATE])),
2957 $lng->loadLanguageModule(
"notes");
2965 $f = $this->
ui->factory();
2968 $f->symbol()->glyph()->comment(
"#")
2969 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PUBLIC])),
2976 if ($this->rating_enabled) {
2977 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
2979 $rating_gui->enableCategories($this->rating_categories_enabled);
2981 $rating_gui->setObject($this->obj_id, $this->type);
2982 if ($this->rating_text) {
2983 $rating_gui->setYourRatingText($this->rating_text);
2986 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"cadh", $this->ajax_hash);
2987 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"rnsb",
true);
2988 if ($this->rating_ctrl_path) {
2989 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2990 $ajax_url = $this->ctrl->getLinkTargetByClass($this->rating_ctrl_path,
"saveRating",
"",
true,
false);
2993 $ajax_url = $this->ctrl->getLinkTargetByClass(
"ilRatingGUI",
"saveRating",
"",
true,
false);
2995 $main_tpl->addOnLoadCode(
"il.Object.setRatingUrl('" . $ajax_url .
"');");
2998 $rating_gui->getHtml(
3000 $this->checkCommandAccess(
"read",
"", $this->ref_id, $this->type),
3001 "il.Object.saveRating(%rating%);"
3006 if ($this->header_icons) {
3007 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
3010 foreach ($this->header_icons as $id => $attr) {
3011 $id =
"headp_" . $id;
3013 if (is_array($attr)) {
3014 if ($attr[
"glyph"]) {
3015 if ($attr[
"onclick"]) {
3016 $htpl->setCurrentBlock(
"prop_glyph_oc");
3017 $htpl->setVariable(
"GLYPH_ONCLICK", $attr[
"onclick"]);
3018 $htpl->parseCurrentBlock();
3020 $renderer = $this->
ui->renderer();
3021 $html = $renderer->render($attr[
"glyph"]);
3022 $htpl->setCurrentBlock(
"prop_glyph");
3023 $htpl->setVariable(
"GLYPH", $html);
3024 $htpl->parseCurrentBlock();
3026 if ($attr[
"onclick"]) {
3027 $htpl->setCurrentBlock(
"onclick");
3028 $htpl->setVariable(
"PROP_ONCLICK", $attr[
"onclick"]);
3029 $htpl->parseCurrentBlock();
3032 if ($attr[
"status_text"]) {
3033 $htpl->setCurrentBlock(
"status");
3034 $htpl->setVariable(
"PROP_TXT", $attr[
"status_text"]);
3035 $htpl->parseCurrentBlock();
3039 $htpl->setCurrentBlock(
"prop");
3040 if ($attr[
"href"] || $attr[
"onclick"]) {
3041 $htpl->setVariable(
"TAG",
"a");
3043 $htpl->setVariable(
"TAG",
"span");
3045 $htpl->setVariable(
"PROP_ID", $id);
3046 $htpl->setVariable(
"IMG",
ilUtil::img($attr[
"img"], $attr[
"tooltip"]));
3047 if ($attr[
"href"] !=
"") {
3048 $htpl->setVariable(
"PROP_HREF",
' href="' . $attr[
"href"] .
'" ');
3050 $htpl->parseCurrentBlock();
3052 if ($attr[
"tooltip"]) {
3061 if (
sizeof($chunks)) {
3064 implode(
" ", $chunks) .
" "
3075 return $htpl->get();
3086 if ((strtolower(
$_GET[
"baseClass"]) !=
"ilrepositorygui") &&
3087 is_int(strpos($a_link,
"baseClass=ilRepositoryGUI"))) {
3088 if ($this->type !=
"frm") {
3099 if ($this->default_command_params) {
3101 foreach ($this->default_command_params as
$name => $value) {
3102 $params[] =
$name .
'=' . $value;
3104 $params = implode(
'&', $params);
3108 if (!stristr($a_default_link,
'?')) {
3109 $a_default_link = ($a_default_link .
'?' . $params);
3111 $a_default_link = ($a_default_link .
'&' . $params);
3114 return $a_default_link;
3124 if (strstr($a_link,
'ilSAHSPresentationGUI') && !$this->offline_mode) {
3125 include_once
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
3127 $om = $sahs_obj->getOpenMode();
3128 $width = $sahs_obj->getWidth();
3129 $height = $sahs_obj->getHeight();
3130 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
3133 if ($om != 0 && !
$DIC[
'ilBrowser']->isMobile()) {
3134 $this->default_command[
"frame"] =
"";
3135 $a_link =
"javascript:void(0); onclick=startSAHS('" . $a_link .
"','" . $wtarget .
"'," . $om .
"," . $width .
"," . $height .
");";
3149 if (!$this->path_gui instanceof \
ilPathGUI) {
3155 $path_gui->enableTextOnly(!$this->path_linked);
3158 $start_node = $this->path_start_node
3159 ? $this->path_start_node
3162 $this->tpl->setCurrentBlock(
"path_item");
3163 $this->tpl->setVariable(
'PATH_ITEM',
$path_gui->getPath($start_node, $this->ref_id));
3164 $this->tpl->parseCurrentBlock();
3166 $this->tpl->setCurrentBlock(
"path");
3167 $this->tpl->setVariable(
"TXT_LOCATION",
$lng->txt(
"locator"));
3168 $this->tpl->parseCurrentBlock();
3195 $this->tpl->setCurrentBlock(
"check");
3196 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3197 $this->tpl->parseCurrentBlock();
3200 $this->tpl->setCurrentBlock(
"check_download");
3202 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3204 $this->tpl->setVariable(
"VAL_VISIBILITY",
"visibility: hidden;\" disabled=\"disabled");
3206 $this->tpl->parseCurrentBlock();
3209 $this->tpl->setCurrentBlock(
'expand');
3212 $this->ctrl->setParameter($this->container_obj,
'expand', -1 * $this->obj_id);
3214 $this->tpl->setVariable(
'EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj,
'view', $this->getUniqueItemId(
true)));
3215 $this->ctrl->clearParameters($this->container_obj);
3217 $this->tpl->setVariable(
'EXP_ALT', $this->lng->txt(
'collapse'));
3219 $this->ctrl->setParameter($this->container_obj,
'expand', $this->obj_id);
3221 $this->tpl->setVariable(
'EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj,
'view', $this->getUniqueItemId(
true)));
3222 $this->ctrl->clearParameters($this->container_obj);
3224 $this->tpl->setVariable(
'EXP_ALT', $this->lng->txt(
'expand'));
3227 $this->tpl->parseCurrentBlock();
3233 $this->tpl->touchBlock(
"i_1");
3237 if ($this->title_link_disabled || !$this->default_command || (!$this->
getCommandsStatus() && !$this->restrict_to_goto)) {
3255 $this->tpl->setCurrentBlock(
"icon");
3256 if (!$objDefinition->isPlugin($this->getIconImageType())) {
3257 $this->tpl->setVariable(
"ALT_ICON",
$lng->txt(
"obj_" . $this->getIconImageType()));
3259 include_once(
"Services/Component/classes/class.ilPlugin.php");
3260 $this->tpl->setVariable(
"ALT_ICON",
3264 $this->tpl->setVariable(
3268 $this->tpl->parseCurrentBlock();
3272 $this->tpl->touchBlock(
"d_" . $cnt);
3281 return ilObject::_getIcon(
3293 foreach ($this->sub_item_html as $sub_html) {
3294 $this->tpl->setCurrentBlock(
"subitem");
3295 $this->tpl->setVariable(
"SUBITEM", $sub_html);
3296 $this->tpl->parseCurrentBlock();
3305 if ($this->position_enabled) {
3306 $this->tpl->setCurrentBlock(
"position");
3307 $this->tpl->setVariable(
"POS_ID", $this->position_field_index);
3308 $this->tpl->setVariable(
"POS_VAL", $this->position_value);
3309 $this->tpl->parseCurrentBlock();
3319 return $this->adm_commands_included;
3328 if ($this->acache->getLastAccessStatus() ==
"miss" &&
3329 !$this->prevent_access_caching) {
3330 $this->acache->storeEntry(
3331 $ilUser->getId() .
":" . $this->ref_id,
3332 serialize($this->access_cache),
3357 $a_use_asynch =
false,
3358 $a_get_asynch_commands =
false,
3365 $this->adm_commands_included =
false;
3371 $this->
initItem($a_ref_id, $a_obj_id,
$type, $a_title, $a_description);
3373 if ($a_use_asynch && $a_get_asynch_commands) {
3377 if ($this->rating_enabled) {
3382 $rating->setObject($this->obj_id, $this->type);
3391 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3399 include_once(
"Services/Object/classes/class.ilListItemAccessCache.php");
3401 $cres = $this->acache->getEntry(
$ilUser->getId() .
":" . $a_ref_id);
3402 if ($this->acache->getLastAccessStatus() ==
"hit") {
3403 $this->access_cache = unserialize($cres);
3424 static::$tpl_file_name,
3427 static::$tpl_component,
3435 $this->tpl->setVariable(
3436 "COMMAND_SELECTION_LIST",
3437 $this->
insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url)
3499 $this->tpl->setVariable(
"DIV_CLASS",
'ilContainerListItemOuter');
3508 return $this->tpl->get();
3517 $this->cust_prop = array();
3518 $this->cust_commands = array();
3519 $this->sub_item_html = array();
3520 $this->position_enabled =
false;
3530 $this->parent_ref_id = $a_ref_id;
3542 $id_ref = ($this->reference_ref_id > 0)
3543 ? $this->reference_ref_id
3547 if ($this->condition_depth) {
3558 return "lg_div_" . $id_ref;
3585 $this->bold_title = $a_bold_title;
3610 if ($a_context == self::CONTEXT_REPOSITORY) {
3611 $active_notes = !
$ilSetting->get(
"disable_notes");
3612 $active_comments = !
$ilSetting->get(
"disable_comments");
3614 if ($active_notes || $active_comments) {
3615 include_once(
"./Services/Notes/classes/class.ilNote.php");
3618 if ($active_comments) {
3624 if (
$ilSetting->get(
'comments_tagging_in_lists')) {
3625 if ($active_notes || $active_comments) {
3628 $lng->loadLanguageModule(
"notes");
3632 if ($tags_set->get(
"enable")) {
3633 $all_users = $tags_set->get(
"enable_all_users");
3635 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
3636 if (!
$ilSetting->get(
'comments_tagging_in_lists_tags')) {
3639 $tag_user_id =
null;
3641 $tag_user_id =
$ilUser->getId();
3646 $lng->loadLanguageModule(
"tagging");
3650 $lng->loadLanguageModule(
"rating");
3653 self::$preload_done =
true;
3668 if ($this->comments_enabled) {
3669 if (!$this->comments_settings_enabled) {
3677 if (!$a_header_actions && self::$preload_done) {
3678 if (self::$comments_activation[$a_obj_id][
$a_type]) {
3682 include_once(
"./Services/Notes/classes/class.ilNote.php");
3700 $this->timings_enabled = (bool) $a_status;
3711 include_once(
"./Services/FileUpload/classes/class.ilFileUploadUtil.php");
3720 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
3725 $this->tpl->setCurrentBlock(
"fileupload");
3726 $this->tpl->setVariable(
"FILE_UPLOAD", $upload->getHTML());
3727 $this->tpl->parseCurrentBlock();
3746 ) : ?\
ILIAS\
UI\Component\Item\Item {
3762 foreach ($this->current_selection_list->getItems() as $action_item) {
3763 $action =
$ui->factory()
3765 ->shy($action_item[
'title'], $action_item[
'link']);
3768 if ($action_item[
'onclick'] !=
null && $action_item[
'onclick'] !=
'') {
3769 $action = $action->withAdditionalOnLoadCode(
function ($id) use ($action_item) {
3770 return "$('#$id').click(function(){" . $action_item[
'onclick'] .
";});";
3774 $actions[] = $action;
3777 $dropdown =
$ui->factory()
3779 ->standard($actions)
3780 ->withAriaLabel(sprintf(
3781 $this->lng->txt(
'actions_for'),
3782 htmlspecialchars(addslashes($title))
3787 $icon = $this->
ui->factory()
3790 ->custom(ilObject::_getIcon(
$obj_id), $this->lng->txt(
"icon") .
" " . $this->lng->txt(
'obj_' .
$type))
3791 ->withSize(
'medium');
3794 if ($def_command[
'link']) {
3795 $def_command[
'link'] = $this->
modifySAHSlaunch($def_command[
'link'], $def_command[
'frame']);
3796 $new_viewport = !in_array($this->
getDefaultCommand()[
'frame'], [
'',
'_top',
'_self',
'_parent'],
true);
3797 $link = $this->
ui->factory()
3799 ->standard($this->
getTitle(), $def_command[
'link'])
3800 ->withOpenInNewViewport($new_viewport);
3801 $list_item =
$ui->factory()->item()->standard($link);
3803 $list_item =
$ui->factory()->item()->standard($this->
getTitle());
3806 if ($description !=
"") {
3807 $list_item = $list_item->withDescription($description);
3809 $list_item = $list_item->withActions($dropdown)->withLeadIcon($icon);
3820 $l[(string) $p[
'property']] = (
string) $p[
'value'];
3823 if (count($l) > 0) {
3824 $list_item = $list_item->withProperties($l);
3865 ) : ?\
ILIAS\
UI\Component\Card\Card
3877 $user = $this->user;
3878 $access = $this->access;
3880 $this->enableCommands(
true);
3885 if ($description !=
"") {
3886 $sections[] = $ui->factory()->legacy(
"<div class='il-multi-line-cap-3'>" . $description .
"</div>");
3889 $this->insertCommands();
3892 foreach ($this->current_selection_list->getItems() as $item) {
3893 if (!isset($item[
"onclick"]) || $item[
"onclick"] ==
"") {
3895 $ui->factory()->button()->shy($item[
"title"], $item[
"link"]);
3898 $ui->factory()->button()->shy($item[
"title"],
"")->withAdditionalOnLoadCode(
function ($id) use ($item) {
3900 "$('#$id').click(function(e) { " . $item[
"onclick"] .
"});";
3905 $def_command = $this->getDefaultCommand();
3907 if ($def_command[
"frame"] !=
"") {
3918 $dropdown = $ui->factory()->dropdown()->standard($actions)
3919 ->withAriaLabel(sprintf(
3920 $this->lng->txt(
'actions_for'),
3921 htmlspecialchars(addslashes($title))
3924 $img = $this->object_service->commonSettings()->tileImage()->getByObjId((
int) $obj_id);
3925 if (
$img->exists()) {
3926 $path =
$img->getFullPath();
3929 if (!is_file($path)) {
3937 if ($def_command[
"frame"] ==
"_top") {
3938 $def_command[
"frame"] =
"";
3943 $this->modifySAHSlaunch($def_command[
"link"], $def_command[
"frame"]);
3945 $image = $this->
ui->factory()
3947 ->responsive($path,
'');
3948 if ($def_command[
'link'] !=
'') {
3949 if ($def_command[
"frame"] !=
"" && ($modified_link == $def_command[
"link"])) {
3950 $image = $image->withAdditionalOnLoadCode(
function ($id) use ($def_command) {
3952 "$('#$id').click(function(e) { window.open('" . str_replace(
"&",
"&",
3953 $def_command[
"link"]) .
"', '" . $def_command[
"frame"] .
"');});";
3957 $ui->factory()->button()->shy($title,
"")->withAdditionalOnLoadCode(
function ($id) use (
3961 "$('#$id').click(function(e) { window.open('" . str_replace(
"&",
"&",
3962 $def_command[
"link"]) .
"', '" . $def_command[
"frame"] .
"');});";
3964 $title = $ui->renderer()->render($button);
3966 $image = $image->withAction($modified_link);
3970 if (
$type ==
'sess') {
3972 $title =
": " . $title;
3978 $app_info[
'fullday']
3982 $icon = $this->
ui->factory()
3985 ->standard($type, $this->lng->txt(
'obj_' .
$type))
3986 ->withIsOutlined(
true);
3989 $card_title_action =
"";
3990 if ($def_command[
"link"] !=
"" && ($def_command[
"frame"] ==
"" || $modified_link != $def_command[
"link"])) {
3991 $card_title_action = $modified_link;
3993 if ($def_command[
'link'] ==
"" &&
3994 $this->getInfoScreenStatus() &&
3995 $access->checkAccessOfUser(
4002 if ($image->getAction() ==
"") {
4003 $image = $image->withAction($card_title_action);
4008 $card = $ui->factory()->card()->repositoryObject(
4009 $title .
'<span data-list-item-id="' . $this->getUniqueItemId(
true) .
'"></span>',
4017 if ($card_title_action !=
"") {
4018 $card = $card->withTitleAction($card_title_action);
4022 foreach ($this->determineProperties() as $p) {
4023 if ($p[
"alert"] && $p[
'property'] !== $this->lng->txt(
'learning_progress')) {
4024 $l[(string) $p[
'property']] = (
string) $p[
'value'];
4027 if (count($l) > 0) {
4028 $prop_list = $ui->factory()->listing()->descriptive($l);
4029 $sections[] = $prop_list;
4031 if (count($sections) > 0) {
4032 $card = $card->withSections($sections);
4036 if (is_array($lp) && array_key_exists(
'status', $lp)) {
4042 $card = $card->withProgress(
4046 ->mini(100, $percentage)
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
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 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.