4 define(
"IL_LIST_AS_TRIGGER",
"trigger");
5 define(
"IL_LIST_FULL",
"full");
6 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
171 public function __construct($a_context = self::CONTEXT_REPOSITORY)
174 $this->access = $DIC->access();
175 $this->
user = $DIC->user();
176 $this->obj_definition = $DIC[
"objDefinition"];
177 $this->tree = $DIC->repositoryTree();
180 $this->ui = $DIC->ui();
181 $this->rbacsystem = $DIC->rbac()->system();
182 $this->ctrl = $DIC->ctrl();
183 $this->lng = $DIC->language();
185 $this->path_enabled =
false;
186 $this->context = $a_context;
198 include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
201 $this->lng->loadLanguageModule(
"obj");
213 $this->container_obj = $container_obj;
225 return $this->container_obj;
237 $this->static_link_enabled =
true;
238 $this->delete_enabled =
true;
239 $this->cut_enabled =
true;
240 $this->subscribe_enabled =
true;
241 $this->link_enabled =
false;
242 $this->copy_enabled =
false;
243 $this->progress_enabled =
false;
244 $this->notice_properties_enabled =
true;
245 $this->info_screen_enabled =
false;
247 $this->gui_class_name =
"";
250 include_once(
'./Services/Object/classes/class.ilObjectAccess.php');
263 $this->properties_enabled = $a_status;
285 $this->preconditions_enabled = $a_status;
303 $this->notice_properties_enabled = $a_status;
325 $this->description_enabled = $a_status;
359 $this->search_fragment_enabled = $a_status;
371 $this->path_linked = $a_status;
389 $this->enabled_relevance = $a_status;
399 $this->relevance = $a_rel;
419 $this->icons_enabled = $a_status;
439 $this->checkboxes_enabled = $a_status;
459 $this->expand_enabled = $a_status;
474 $this->is_expanded = $a_status;
489 $this->position_enabled =
true;
490 $this->position_field_index = $a_field_index;
491 $this->position_value = $a_position_value;
502 $this->delete_enabled = $a_status;
514 return $this->delete_enabled;
525 $this->cut_enabled = $a_status;
536 return $this->cut_enabled;
547 $this->copy_enabled = $a_status;
569 $this->subscribe_enabled = $a_status;
580 return $this->subscribe_enabled;
591 $this->link_enabled = $a_status;
602 return $this->link_enabled;
614 $this->path_enabled = $a_path;
615 $this->path_start_node = (int) $a_start_node;
625 return $this->path_enabled;
636 $this->commands_enabled = $a_status;
637 $this->std_cmd_only = $a_std_only;
657 $this->info_screen_enabled = $a_info_screen;
667 $this->sub_item_html[] = $a_html;
689 $this->progress_enabled = $a_status;
713 $this->substitutions_enabled = $a_status;
737 $this->item_detail_links_enabled = $a_status;
760 $this->item_detail_links = $a_detail_links;
761 $this->item_detail_links_intro = $a_intro_txt;
773 if (!count($this->item_detail_links)) {
776 if (strlen($this->item_detail_links_intro)) {
777 $this->tpl->setCurrentBlock(
'item_detail_intro');
778 $this->tpl->setVariable(
'ITEM_DETAIL_INTRO_TXT', $this->item_detail_links_intro);
779 $this->tpl->parseCurrentBlock();
782 foreach ($this->item_detail_links as
$info) {
783 $this->tpl->setCurrentBlock(
'item_detail_link');
784 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_TARGET', $info[
'target']);
785 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_DESC', $info[
'desc']);
786 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_HREF', $info[
'link']);
787 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_NAME', $info[
'name']);
788 $this->tpl->parseCurrentBlock();
790 $this->tpl->setCurrentBlock(
'item_detail_links');
791 $this->tpl->parseCurrentBlock();
802 $this->title = $a_title;
821 $this->description = $a_description;
841 $this->search_fragment = $a_text;
860 $this->separate_commands = $a_val;
893 $this->additional_information = $a_val;
915 $this->details_level = $a_level;
934 $this->repository_transfer_enabled = (bool) $a_value;
944 $this->restrict_to_goto = (bool) $a_value;
961 $cache_prefix = null;
962 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
963 $cache_prefix =
"wsp";
964 if (!$this->ws_access) {
965 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
970 if (isset($this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id])) {
971 return $this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id];
974 if ($this->context == self::CONTEXT_REPOSITORY) {
975 $access = $ilAccess->checkAccess($a_permission, $a_cmd, $a_ref_id,
$a_type, $a_obj_id);
976 if ($ilAccess->getPreventCachingLastResult()) {
977 $this->prevent_access_caching =
true;
980 $access = $this->ws_access->checkAccess($a_permission, $a_cmd, $a_ref_id,
$a_type);
983 $this->access_cache[$a_permission][
"-" . $a_cmd][$cache_prefix . $a_ref_id] =
$access;
996 public function initItem($a_ref_id, $a_obj_id, $a_title =
"", $a_description =
"")
998 $this->offline_mode =
false;
999 if ($this->type ==
"sahs") {
1000 include_once(
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
1003 $this->access_cache =
array();
1004 $this->ref_id = $a_ref_id;
1005 $this->obj_id = $a_obj_id;
1008 #$this->description = $a_description; 1011 $this->adm_commands_included =
false;
1012 $this->prevent_access_caching =
false;
1017 $this->condition_target =
array(
1018 'ref_id' => $a_ref_id,
1019 'obj_id' => $a_obj_id,
1020 'target_type' => $a_target_type
1026 $this->condition_target =
array();
1031 $this->title_link_disabled = $a_status;
1037 $this->default_command_params = $a_params;
1052 if ($this->static_link_enabled and !$this->default_command_params) {
1053 include_once(
'./Services/Link/classes/class.ilLink.php');
1055 $command[
'link'] = $link;
1056 $command[
'frame'] =
'_top';
1059 if ($this->default_command_params) {
1061 foreach ($this->default_command_params as
$name => $value) {
1067 if (!stristr($command[
'link'],
'?')) {
1068 $command[
'link'] .=
'?' .
$params;
1070 $command[
'link'] .=
'&' .
$params;
1090 if ($this->context == self::CONTEXT_REPOSITORY) {
1092 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1094 require_once(
'Services/WebDAV/classes/class.ilDAVServer.php');
1101 return $davServer->getMountURI($this->ref_id) .
1102 '" folder="' . $davServer->getFolderURI($this->ref_id);
1106 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
getCommandId());
1107 $cmd_link = $this->ctrl->getLinkTargetByClass(
"ilrepositorygui", $a_cmd);
1108 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1117 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id",
"");
1118 $this->ctrl->setParameterByClass($this->gui_class_name,
"wsp_id", $this->ref_id);
1119 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1136 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1141 if ($a_cmd ==
'fileManagerLaunch') {
1186 if ($this->context == self::CONTEXT_REPOSITORY) {
1188 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1190 require_once(
'Services/WebDAV/classes/class.ilDAVServer.php');
1193 require_once(
'Services/WebDAV/classes/class.ilDAVLocks.php');
1195 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
1196 $locks =&$davLocks->getLocksOnObjectObj($this->obj_id);
1197 if (count($locks) > 0) {
1198 $lockUser =
new ilObjUser($locks[0][
'ilias_owner']);
1202 "property" =>
$lng->txt(
"in_use_by"),
1203 "value" => $lockUser->getLogin(),
1204 "link" =>
"./ilias.php?user=" . $locks[0][
'ilias_owner'] .
'&cmd=showUserProfile&cmdClass=ilpersonaldesktopgui&cmdNode=1&baseClass=ilPersonalDesktopGUI',
1215 if (preg_match(
'/^(\\.|\\.\\.)$/', $this->title)) {
1216 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_interoperability"),
1217 "value" =>
$lng->txt(
"filename_special_filename"),
1218 'propertyNameVisible' =>
false);
1219 } elseif (preg_match(
'/^\\./', $this->title)) {
1220 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_visibility"),
1221 "value" =>
$lng->txt(
"filename_hidden_unix_file"),
1222 'propertyNameVisible' =>
false);
1223 } elseif (preg_match(
'/~$/', $this->title)) {
1224 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_visibility"),
1225 "value" =>
$lng->txt(
"filename_hidden_backup_file"),
1226 'propertyNameVisible' =>
false);
1227 } elseif (preg_match(
'/[\\/]/', $this->title)) {
1228 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_interoperability"),
1229 "value" =>
$lng->txt(
"filename_special_characters"),
1230 'propertyNameVisible' =>
false);
1231 } elseif (preg_match(
'/[\\\\\\/:*?"<>|]/', $this->title)) {
1232 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_interoperability"),
1233 "value" =>
$lng->txt(
"filename_windows_special_characters"),
1234 'propertyNameVisible' =>
false);
1235 } elseif (preg_match(
'/\\.$/', $this->title)) {
1236 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_interoperability"),
1237 "value" =>
$lng->txt(
"filename_windows_empty_extension"),
1238 'propertyNameVisible' =>
false);
1239 } elseif (preg_match(
'/^(\\.|\\.\\.)$/', $this->title)) {
1240 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_interoperability"),
1241 "value" =>
$lng->txt(
"filename_special_filename"),
1242 'propertyNameVisible' =>
false);
1243 } elseif (preg_match(
'/#/', $this->title)) {
1244 $props[] =
array(
"alert" =>
false,
"property" =>
$lng->txt(
"filename_interoperability"),
1245 "value" =>
$lng->txt(
"filename_windows_webdav_issue"),
1246 'propertyNameVisible' =>
false);
1264 $this->cust_prop[] =
array(
"property" => $a_property,
"value" => $a_value,
1265 "alert" => $a_alert,
"newline" => $a_newline);
1273 if (is_array($this->cust_prop)) {
1274 foreach ($this->cust_prop as $prop) {
1289 if ($prop[
'alert'] ==
true) {
1301 $this->notice_prop =
array();
1302 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true)) {
1303 foreach ($infos as
$info) {
1304 $this->notice_prop[] =
array(
'value' => $info);
1307 return $this->notice_prop ? $this->notice_prop :
array();
1314 $this->cust_commands[] =
1315 array(
"link" => $a_link,
"lang_var" => $a_lang_var,
1316 "frame" => $a_frame,
"onclick" => $onclick);
1325 $this->force_visible_only = $a_stat;
1365 $ref_commands =
array();
1366 foreach ($this->commands as $command) {
1367 $permission = $command[
"permission"];
1368 $cmd = $command[
"cmd"];
1369 $lang_var = $command[
"lang_var"];
1371 $info_object = null;
1373 if (isset($command[
"txt"])) {
1374 $txt = $command[
"txt"];
1379 if (
$ilUser->getId() == ANONYMOUS_USER_ID &&
1380 $command[
'enable_anonymous'] ==
'false') {
1394 $access_granted =
true;
1396 $access_granted =
false;
1397 $info_object = $ilAccess->getInfo();
1400 if (!isset($command[
"default"])) {
1401 $command[
"default"] =
"";
1403 $ref_commands[] =
array(
1404 "permission" => $permission,
1406 "link" => $cmd_link,
1407 "frame" => $cmd_frame,
1408 "lang_var" => $lang_var,
1410 "granted" => $access_granted,
1411 "access_info" => $info_object,
1412 "img" => $cmd_image,
1413 "default" => $command[
"default"]
1417 return $ref_commands;
1430 if ($this->type ==
"sahs" && $this->offline_mode) {
1431 return $this->type .
"_offline";
1446 if ($this->restrict_to_goto) {
1447 $this->default_command =
array(
"frame" =>
"",
1452 !$this->default_command ||
1454 $this->title_link_disabled
1457 $this->tpl->setCurrentBlock(
"item_title");
1458 $this->tpl->setVariable(
"TXT_TITLE", $this->
getTitle());
1459 $this->tpl->parseCurrentBlock();
1461 $this->default_command[
'link'] = $this->
modifyTitleLink($this->default_command[
'link']);
1463 $this->default_command[
"link"] =
1464 $this->
modifySAHSlaunch($this->default_command[
"link"], $this->default_command[
"frame"]);
1466 if ($this->default_command[
"frame"] !=
"") {
1467 $this->tpl->setCurrentBlock(
"title_linked_frame");
1468 $this->tpl->setVariable(
"TARGET_TITLE_LINKED", $this->default_command[
"frame"]);
1469 $this->tpl->parseCurrentBlock();
1473 #var_dump("<pre>",$this->default_command['link'],"</pre>"); 1474 $this->default_command[
"link"] =
1477 #var_dump("<pre>",$this->default_command['link'],"</pre>"); 1481 $this->tpl->setCurrentBlock(
"item_title_linked");
1482 $this->tpl->setVariable(
"TXT_TITLE_LINKED", $this->
getTitle());
1483 $this->tpl->setVariable(
"HREF_TITLE_LINKED", $this->default_command[
"link"]);
1486 include_once(
"./Services/Preview/classes/class.ilPreview.php");
1488 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
1491 $access_handler = null;
1492 switch ($this->context) {
1493 case self::CONTEXT_WORKSPACE:
1494 case self::CONTEXT_WORKSPACE_SHARING:
1496 include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
1503 $access_handler = $ilAccess;
1509 $preview_status_class =
"";
1510 $preview_text_topic =
"preview_show";
1512 $preview_status_class =
"ilPreviewStatusNone";
1513 $preview_text_topic =
"preview_none";
1515 $this->tpl->setCurrentBlock(
"item_title_linked");
1516 $this->tpl->setVariable(
"PREVIEW_STATUS_CLASS", $preview_status_class);
1517 $this->tpl->setVariable(
"SRC_PREVIEW_ICON",
ilUtil::getImagePath(
"preview.png",
"Services/Preview"));
1518 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt($preview_text_topic));
1519 $this->tpl->setVariable(
"SCRIPT_PREVIEW_CLICK",
$preview->getJSCall($this->getUniqueItemId(
true)));
1520 $this->tpl->parseCurrentBlock();
1523 $this->tpl->parseCurrentBlock();
1526 if ($this->bold_title ==
true) {
1527 $this->tpl->touchBlock(
'bold_title_start');
1528 $this->tpl->touchBlock(
'bold_title_end');
1534 switch ($this->context) {
1535 case self::CONTEXT_WORKSPACE_SHARING:
1536 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1553 $fields_shown =
false;
1554 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as
$data) {
1555 if (
$data[
'bold']) {
1556 $data[
'name'] =
'<strong>' .
$data[
'name'] .
'</strong>';
1557 $data[
'value'] =
'<strong>' .
$data[
'value'] .
'</strong>';
1559 $this->tpl->touchBlock(
"std_prop");
1560 $this->tpl->setCurrentBlock(
'item_property');
1561 if (
$data[
'show_field']) {
1562 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1564 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1565 $this->tpl->parseCurrentBlock();
1567 if (
$data[
'newline']) {
1568 $this->tpl->touchBlock(
'newline_prop');
1570 $fields_shown =
false;
1572 if ($fields_shown) {
1573 $this->tpl->touchBlock(
'newline_prop');
1589 if (!$this->substitutions->isDescriptionEnabled()) {
1596 $d = strip_tags(
$d,
"<b>");
1597 $this->tpl->setCurrentBlock(
"item_description");
1598 $this->tpl->setVariable(
"TXT_DESC",
$d);
1599 $this->tpl->parseCurrentBlock();
1609 $this->tpl->setCurrentBlock(
'search_fragment');
1610 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT', $this->
getSearchFragment() .
' ...');
1611 $this->tpl->parseCurrentBlock();
1626 include_once
"Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
1630 $this->tpl->setCurrentBlock(
'relevance');
1631 $this->tpl->setVariable(
'REL_PBAR', $pbar->render());
1632 $this->tpl->parseCurrentBlock();
1642 $this->mode = $a_mode;
1660 $this->condition_depth = $a_depth;
1672 if ($a_mode == $this->mode) {
1693 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1695 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
1698 $props[] =
array(
"alert" =>
false,
1699 "property" =>
$lng->txt(
"learning_progress"),
1706 if (
$ilUser->getId() == ANONYMOUS_USER_ID) {
1707 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id)) {
1708 $props[] =
array(
"alert" =>
true,
1709 "value" =>
$lng->txt(
"no_access_item_public"),
1718 if ($this->reference_ref_id) {
1720 $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 ||
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 ||
1760 if ($tags_set->get(
"enable")) {
1765 $tags_tmp =
array();
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);
1780 $tags_value =
"<a href='#' onclick=\"return " . $tags_url .
"\">" .
1781 self::$cnt_tags[$note_obj_id] .
"</a>";
1782 $prop_text =
$lng->txt(
"tagging_tags");
1784 $props[] =
array(
"alert" =>
false,
1785 "property" => $prop_text,
1786 "value" => $tags_value,
1794 if (is_array($props) && count($props) > 0) {
1795 foreach ($props as $prop) {
1798 $this->tpl->touchBlock(
"separator_prop");
1802 if ($prop[
"alert"] ==
true) {
1803 $this->tpl->touchBlock(
"alert_prop");
1805 $this->tpl->touchBlock(
"std_prop");
1807 if ($prop[
"newline"] ==
true && $cnt > 1) {
1808 $this->tpl->touchBlock(
"newline_prop");
1811 if (isset($prop[
"property"]) && $prop[
'propertyNameVisible'] !==
false && $prop[
"property"] !=
"") {
1813 $this->tpl->setCurrentBlock(
"prop_name");
1814 $this->tpl->setVariable(
"TXT_PROP", $prop[
"property"]);
1815 $this->tpl->parseCurrentBlock();
1817 $this->tpl->setCurrentBlock(
"item_property");
1819 if ($prop[
'link']) {
1820 $this->tpl->setVariable(
"LINK_PROP", $prop[
'link']);
1821 $this->tpl->setVariable(
"LINK_VAL_PROP", $prop[
"value"]);
1823 $this->tpl->setVariable(
"VAL_PROP", $prop[
"value"]);
1826 $this->tpl->parseCurrentBlock();
1830 $this->tpl->setCurrentBlock(
"item_properties");
1831 $this->tpl->parseCurrentBlock();
1838 foreach ($this->notice_prop as $property) {
1839 $this->tpl->setCurrentBlock(
'notice_item');
1840 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE', $property[
'value']);
1841 $this->tpl->parseCurrentBlock();
1843 $this->tpl->setCurrentBlock(
'notice_property');
1844 $this->tpl->parseCurrentBlock();
1854 $num_optional_required =
1858 $visible_conditions =
array();
1859 $passed_optional = 0;
1860 foreach ($conditions as $condition) {
1861 if ($obligatory and !$condition[
'obligatory']) {
1864 if (!$obligatory and $condition[
'obligatory']) {
1868 if (
$tree->isDeleted($condition[
'trigger_ref_id'])) {
1872 include_once
'Services/Container/classes/class.ilMemberViewSettings.php';
1877 $visible_conditions[] = $condition[
'id'];
1880 if (!$obligatory and
$ok) {
1883 if ($passed_optional >= $num_optional_required) {
1889 foreach ($conditions as $condition) {
1890 if (!in_array($condition[
'id'], $visible_conditions)) {
1894 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
1898 $class = $objDefinition->getClassName($condition[
"trigger_type"]);
1899 $location = $objDefinition->getLocation($condition[
"trigger_type"]);
1903 $missing_cond_exist =
true;
1905 $full_class =
"ilObj" . $class .
"ListGUI";
1906 include_once(
$location .
"/class." . $full_class .
".php");
1907 $item_list_gui =
new $full_class($this);
1909 $item_list_gui->enablePath(
false);
1910 $item_list_gui->enableIcon(
true);
1911 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1913 $item_list_gui->addCustomProperty($this->lng->txt(
"precondition_required_itemlist"), $cond_txt,
false,
true);
1915 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1916 $item_list_gui->enableProperties($this->properties_enabled);
1918 $trigger_html = $item_list_gui->getListItemHTML(
1919 $condition[
'trigger_ref_id'],
1920 $condition[
'trigger_obj_id'],
1924 $this->tpl->setCurrentBlock(
"precondition");
1925 if ($trigger_html ==
"") {
1926 $trigger_html = $this->lng->txt(
"precondition_not_accessible");
1928 $this->tpl->setVariable(
"TXT_CONDITION", trim($cond_txt));
1929 $this->tpl->setVariable(
"TRIGGER_ITEM", $trigger_html);
1930 $this->tpl->parseCurrentBlock();
1933 if ($missing_cond_exist and $obligatory) {
1934 $this->tpl->setCurrentBlock(
"preconditions");
1935 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_obl_" . $toggle_id);
1936 $this->tpl->setVariable(
"TXT_PRECONDITIONS",
$lng->txt(
"preconditions_obligatory_hint"));
1937 $this->tpl->parseCurrentBlock();
1938 } elseif ($missing_cond_exist and !$obligatory) {
1939 $this->tpl->setCurrentBlock(
"preconditions");
1940 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_opt_" . $toggle_id);
1941 $this->tpl->setVariable(
"TXT_PRECONDITIONS", sprintf(
$lng->txt(
"preconditions_optional_hint"), $num_optional_required));
1942 $this->tpl->parseCurrentBlock();
1945 return !$missing_cond_exist;
1953 include_once(
"./Services/AccessControl/classes/class.ilConditionHandler.php");
1956 if ($this->condition_depth > 0) {
1960 if ($this->condition_target) {
1962 $this->condition_target[
'ref_id'],
1963 $this->condition_target[
'obj_id'],
1964 $this->condition_target[
'target_type']
1970 if (
sizeof($conditions)) {
1971 for (
$i = 0;
$i < count($conditions);
$i++) {
1976 ++self::$js_unique_id;
1979 $all_done_obl = $this->
parseConditions(self::$js_unique_id, $conditions,
true);
1980 $all_done_opt = $this->
parseConditions(self::$js_unique_id, $conditions,
false);
1982 if (!$all_done_obl || !$all_done_opt) {
1983 $this->tpl->setCurrentBlock(
"preconditions_toggle");
1984 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_INTRO", $this->lng->txt(
"precondition_toggle"));
1985 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt(
"show"));
1986 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_ID", self::$js_unique_id);
1987 $this->tpl->setVariable(
"TXT_PRECONDITION_SHOW", $this->lng->txt(
"show"));
1988 $this->tpl->setVariable(
"TXT_PRECONDITION_HIDE", $this->lng->txt(
"hide"));
1989 $this->tpl->parseCurrentBlock();
2002 public function insertCommand($a_href, $a_text, $a_frame =
"", $a_img =
"", $a_cmd =
"", $a_onclick =
"")
2005 $chksum = md5($a_href . $a_text);
2006 if ($a_href ==
"#" ||
2007 !in_array($chksum, $this->prevent_duplicate_commands)) {
2008 if ($a_href !=
"#") {
2009 $this->prevent_duplicate_commands[] = $chksum;
2012 $prevent_background_click =
false;
2013 if ($a_cmd ==
'mount_webfolder') {
2014 $prevent_background_click =
true;
2017 if ($a_cmd ==
"downloadFolder") {
2018 include_once
"Services/BackgroundTask/classes/class.ilFolderDownloadBackgroundTaskHandler.php";
2025 $this->current_selection_list->addItem(
2033 $prevent_background_click,
2048 if ($this->std_cmd_only) {
2058 $this->adm_commands_included =
true;
2065 $this->ctrl->setParameter(
2066 $this->container_obj,
2068 $this->container_obj->object->getRefId()
2070 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2071 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"delete");
2074 $this->lng->txt(
"delete"),
2078 $this->adm_commands_included =
true;
2093 if ($this->std_cmd_only) {
2099 !$objDefinition->allowLink($this->type)) {
2110 $this->adm_commands_included =
true;
2117 $this->ctrl->setParameter(
2118 $this->container_obj,
2120 $this->container_obj->object->getRefId()
2122 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2123 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"link");
2126 $this->lng->txt(
"link"),
2130 $this->adm_commands_included =
true;
2142 if ($this->std_cmd_only) {
2152 $this->adm_commands_included =
true;
2162 $this->container_obj->object) {
2163 $this->ctrl->setParameter(
2164 $this->container_obj,
2166 $this->container_obj->object->getRefId()
2168 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2170 if (!$a_to_repository) {
2171 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut");
2174 $this->lng->txt(
"move"),
2179 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut_for_repository");
2182 $this->lng->txt(
"wsp_move_to_repository"),
2188 $this->adm_commands_included =
true;
2201 if ($this->std_cmd_only) {
2206 $objDefinition->allowCopy($this->type)) {
2207 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
2208 $this->ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id', $this->
getCommandId());
2209 $cmd_copy = $this->ctrl->getLinkTargetByClass(
'ilobjectcopygui',
'initTargetSelection');
2212 $this->ctrl->setParameter(
2213 $this->container_obj,
2215 $this->container_obj->object->getRefId()
2217 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2219 if (!$a_to_repository) {
2220 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy');
2223 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
2224 $this->
insertCommand($cmd_copy, $this->lng->txt(
'wsp_copy_to_repository'));
2228 $this->adm_commands_included =
true;
2241 if ($this->std_cmd_only) {
2255 $this->adm_commands_included =
true;
2273 if ($this->std_cmd_only) {
2277 if ((
int)
$ilSetting->get(
'disable_my_offers')) {
2283 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
2285 if (is_object($this->container_obj) &&
2287 is_object($this->container_obj->object)) {
2288 $this->ctrl->setParameter($this->container_obj,
"ref_id", $this->container_obj->object->getRefId());
2291 if (!
$ilUser->isDesktopItem($this->getCommandId(),
$type)) {
2293 if ($this->
checkCommandAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id)) {
2295 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2296 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2297 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"addToDesk");
2300 $this->lng->txt(
"to_desktop"),
2308 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2309 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2310 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"removeFromDesk");
2313 $this->lng->txt(
"unsubscribe"),
2327 if ($this->std_cmd_only) {
2334 $this->lng->txt(
"info_short"),
2351 if ($this->std_cmd_only ||
2352 (
$ilUser->getId() == ANONYMOUS_USER_ID)) {
2355 $lng->loadLanguageModule(
"notes");
2356 $lng->loadLanguageModule(
"tagging");
2358 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2362 if ($this->reference_ref_id) {
2366 $js_updater = $a_header_actions
2367 ?
"il.Object.redrawActionHeader();" 2368 :
"il.Object.redrawListItem(" . $note_ref_id .
")";
2374 $this->lng->txt(
"notes_comments"),
2382 if ($this->notes_enabled) {
2385 $this->lng->txt(
"notes"),
2393 if ($this->tags_enabled) {
2394 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2398 $this->lng->txt(
"tagging_set_tag"),
2414 if ($this->std_cmd_only || !$this->container_obj->object) {
2419 $parent_type = $this->container_obj->object->getType();
2422 if ($this->reference_ref_id) {
2423 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->reference_ref_id);
2428 $this->ctrl->setParameterByClass(
2429 'ilobjectactivationgui',
2433 $this->ctrl->setParameterByClass(
2434 'ilobjectactivationgui',
2438 $cmd_lnk = $this->ctrl->getLinkTargetByClass(
2439 array($this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui'),
2443 $this->
insertCommand($cmd_lnk, $this->lng->txt(
'obj_activation_list_gui'));
2446 if ($this->reference_ref_id) {
2447 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->ref_id);
2459 $a_use_asynch =
false,
2460 $a_get_asynch_commands =
false,
2462 $a_header_actions =
false 2471 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2473 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2474 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2475 if ($a_header_actions) {
2476 $this->current_selection_list->setListTitle(
"<span class='hidden-xs'>" .
$lng->txt(
"actions") .
"</span>");
2478 $this->current_selection_list->setListTitle(
"");
2480 $this->current_selection_list->setId(
"act_" . $this->
getUniqueItemId(
false));
2481 $this->current_selection_list->setSelectionHeaderClass(
"small");
2482 $this->current_selection_list->setItemLinkClass(
"xsmall");
2483 $this->current_selection_list->setLinksMode(
"il_ContainerItemCommand2");
2485 $this->current_selection_list->setUseImages(
false);
2486 $this->current_selection_list->setAdditionalToggleElement($this->
getUniqueItemId(
true),
"ilContainerListItemOuterHighlight");
2488 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id", $this->ref_id);
2491 $only_default =
false;
2492 if ($a_use_asynch && !$a_get_asynch_commands) {
2493 $only_default =
true;
2496 $this->default_command =
false;
2497 $this->prevent_duplicate_commands =
array();
2500 $valid_header_commands =
array(
"mount_webfolder");
2502 $commands = $this->
getCommands($this->ref_id, $this->obj_id);
2503 foreach ($commands as $command) {
2504 if ($a_header_actions && !in_array($command[
"cmd"], $valid_header_commands)) {
2508 if ($command[
"granted"] ==
true) {
2509 if (!$command[
"default"] ===
true) {
2510 if (!$this->std_cmd_only && !$only_default) {
2515 $cmd_link = $command[
"link"];
2516 $txt = ($command[
"lang_var"] ==
"")
2518 : $this->lng->txt($command[
"lang_var"]);
2531 } elseif ($command[
"default"] ===
true) {
2532 $items =&$command[
"access_info"];
2533 foreach ($items as $item) {
2534 if (
defined(
'IL_NO_LICENSE') && $item[
"type"] == IL_NO_LICENSE) {
2543 if (!$only_default) {
2545 if (is_array($this->cust_commands)) {
2546 foreach ($this->cust_commands as $command) {
2549 $this->lng->txt($command[
"lang_var"]),
2565 if ($this->timings_enabled) {
2570 if ($this->delete_enabled) {
2575 if ($this->link_enabled) {
2580 if ($this->cut_enabled) {
2585 if ($this->copy_enabled) {
2590 if ($this->repository_transfer_enabled) {
2596 if ($this->subscribe_enabled) {
2601 if ($this->multi_download_enabled && $a_header_actions) {
2606 if ($this->cut_enabled or $this->link_enabled) {
2618 if (!$a_header_actions) {
2619 $this->ctrl->clearParametersByClass($this->gui_class_name);
2626 if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions) {
2627 if (
$ilUser->getId() == ANONYMOUS_USER_ID && $this->type ==
"cat") {
2628 include_once(
"./Services/Container/classes/class.ilContainer.php");
2629 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
2640 if ($a_use_asynch && $a_get_asynch_commands) {
2641 return $this->current_selection_list->getHTML(
true);
2644 return $this->current_selection_list->getHTML();
2661 $this->comments_enabled = (bool) $a_value;
2662 $this->comments_settings_enabled = (bool) $a_enable_comments_settings;
2679 $this->notes_enabled = (bool) $a_value;
2690 if (!$tags_set->get(
"enable")) {
2693 $this->tags_enabled = (bool) $a_value;
2704 public function enableRating($a_value, $a_text = null, $a_categories =
false,
array $a_ctrl_path = null)
2706 $this->rating_enabled = (bool) $a_value;
2708 if ($this->rating_enabled) {
2709 $this->rating_categories_enabled = (bool) $a_categories;
2710 $this->rating_text = $a_text;
2711 $this->rating_ctrl_path = $a_ctrl_path;
2723 if (!$folder_set->get(
"enable_multi_download")) {
2726 $this->multi_download_enabled = (bool) $a_value;
2733 if ($this->std_cmd_only) {
2749 $user_id = $this->
user->getId();
2750 $hasAdminAccess = $this->access->checkAccessOfUser($user_id,
"crs_admin", $this->ctrl->getCmd(),
$_GET[
'ref_id']);
2753 if ($hasAdminAccess) {
2754 $cmd =
$_GET[
"cmd"] ==
"enableAdministrationPanel" ?
"render" :
"enableAdministrationPanel";
2756 $cmd =
$_GET[
"cmd"] ==
"enableMultiDownload" ?
"render" :
"enableMultiDownload";
2759 $this->
insertCommand($cmd_link, $this->lng->txt(
"download_multiple_objects"));
2772 if (in_array($this->type,
array(
"file",
"fold")) &&
2773 $ilAccess->checkAccess(
"read",
"", $a_ref_id, $this->type)) {
2774 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2776 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2779 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2791 public static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl = null)
2797 if (is_null($a_tpl)) {
2802 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2807 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2811 if ($a_redraw_url) {
2812 $a_tpl->addOnLoadCode(
"il.Object.setRedrawAHUrl('" .
2813 $a_redraw_url .
"');");
2825 $this->sub_obj_type =
$a_type;
2826 $this->sub_obj_id = (int) $a_id;
2838 public function addHeaderIcon($a_id, $a_img, $a_tooltip = null, $a_onclick = null, $a_status_text = null, $a_href = null)
2840 $this->header_icons[$a_id] =
array(
"img" => $a_img,
2841 "tooltip" => $a_tooltip,
2842 "onclick" => $a_onclick,
2843 "status_text" => $a_status_text,
2854 $this->header_icons[$a_id] = $a_html;
2864 $this->header_icons[$a_id] =
array(
"glyph" => $a_glyph,
"onclick" => $a_onclick);
2869 $this->ajax_hash = $a_hash;
2884 if ($a_main_tpl == null) {
2885 $main_tpl = $DIC[
"tpl"];
2887 $main_tpl = $a_main_tpl;
2890 $htpl =
new ilTemplate(
"tpl.header_action.html",
true,
true,
"Services/Repository");
2892 $redraw_js =
"il.Object.redrawActionHeader();";
2895 if ($this->tags_enabled) {
2896 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
2904 if (count(
$tags) > 0) {
2905 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2906 $lng->loadLanguageModule(
"tagging");
2913 $f = $this->ui->factory();
2916 $f->glyph()->tag(
"#")
2917 ->withCounter($f->counter()->status((
int) count(
$tags))),
2925 if ($this->notes_enabled || $comments_enabled) {
2926 include_once(
"./Services/Notes/classes/class.ilNote.php");
2927 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2930 if ($this->notes_enabled && $cnt[$this->obj_id][
IL_NOTE_PRIVATE] > 0) {
2938 $f = $this->ui->factory();
2941 $f->glyph()->note(
"#")
2942 ->withCounter($f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PRIVATE])),
2947 if ($comments_enabled && $cnt[$this->obj_id][
IL_NOTE_PUBLIC] > 0) {
2948 $lng->loadLanguageModule(
"notes");
2956 $f = $this->ui->factory();
2959 $f->glyph()->comment(
"#")
2960 ->withCounter($f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PUBLIC])),
2967 if ($this->rating_enabled) {
2968 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
2970 $rating_gui->enableCategories($this->rating_categories_enabled);
2972 $rating_gui->setObject($this->obj_id, $this->type);
2973 if ($this->rating_text) {
2974 $rating_gui->setYourRatingText($this->rating_text);
2977 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"cadh", $this->ajax_hash);
2978 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"rnsb",
true);
2979 if ($this->rating_ctrl_path) {
2980 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2981 $ajax_url = $this->ctrl->getLinkTargetByClass($this->rating_ctrl_path,
"saveRating",
"",
true,
false);
2984 $ajax_url = $this->ctrl->getLinkTargetByClass(
"ilRatingGUI",
"saveRating",
"",
true,
false);
2986 $main_tpl->addOnLoadCode(
"il.Object.setRatingUrl('" . $ajax_url .
"');");
2989 $rating_gui->getHtml(
2991 $this->checkCommandAccess(
"read",
"", $this->ref_id, $this->type),
2992 "il.Object.saveRating(%rating%);" 2997 if ($this->header_icons) {
2998 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
3001 foreach ($this->header_icons as
$id => $attr) {
3004 if (is_array($attr)) {
3005 if ($attr[
"glyph"]) {
3006 if ($attr[
"onclick"]) {
3007 $htpl->setCurrentBlock(
"prop_glyph_oc");
3008 $htpl->setVariable(
"GLYPH_ONCLICK", $attr[
"onclick"]);
3009 $htpl->parseCurrentBlock();
3011 $renderer = $this->ui->renderer();
3012 $html = $renderer->render($attr[
"glyph"]);
3013 $htpl->setCurrentBlock(
"prop_glyph");
3014 $htpl->setVariable(
"GLYPH",
$html);
3015 $htpl->parseCurrentBlock();
3017 if ($attr[
"onclick"]) {
3018 $htpl->setCurrentBlock(
"onclick");
3019 $htpl->setVariable(
"PROP_ONCLICK", $attr[
"onclick"]);
3020 $htpl->parseCurrentBlock();
3023 if ($attr[
"status_text"]) {
3024 $htpl->setCurrentBlock(
"status");
3025 $htpl->setVariable(
"PROP_TXT", $attr[
"status_text"]);
3026 $htpl->parseCurrentBlock();
3030 $htpl->setCurrentBlock(
"prop");
3031 if ($attr[
"href"] || $attr[
"onclick"]) {
3032 $htpl->setVariable(
"TAG",
"a");
3034 $htpl->setVariable(
"TAG",
"span");
3036 $htpl->setVariable(
"PROP_ID",
$id);
3037 $htpl->setVariable(
"IMG",
ilUtil::img($attr[
"img"]));
3038 if ($attr[
"href"] !=
"") {
3039 $htpl->setVariable(
"PROP_HREF",
' href="' . $attr[
"href"] .
'" ');
3041 $htpl->parseCurrentBlock();
3043 if ($attr[
"tooltip"]) {
3052 if (
sizeof($chunks)) {
3055 implode(
" ", $chunks) .
" " 3065 return $htpl->get();
3076 if ((strtolower(
$_GET[
"baseClass"]) !=
"ilrepositorygui") &&
3077 is_int(strpos($a_link,
"baseClass=ilRepositoryGUI"))) {
3078 if ($this->type !=
"frm") {
3089 if ($this->default_command_params) {
3091 foreach ($this->default_command_params as
$name => $value) {
3098 if (!stristr($a_default_link,
'?')) {
3099 $a_default_link = ($a_default_link .
'?' .
$params);
3101 $a_default_link = ($a_default_link .
'&' .
$params);
3104 return $a_default_link;
3114 if (strstr($a_link,
'ilSAHSPresentationGUI') && !$this->offline_mode) {
3115 include_once
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
3117 $om = $sahs_obj->getOpenMode();
3118 $width = $sahs_obj->getWidth();
3119 $height = $sahs_obj->getHeight();
3120 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
3123 if ($om != 0 && !$DIC[
'ilBrowser']->isMobile()) {
3124 $this->default_command[
"frame"]=
"";
3125 $a_link =
"javascript:void(0); onclick=startSAHS('" . $a_link .
"','" . $wtarget .
"'," . $om .
"," . $width .
"," . $height .
");";
3139 include_once
'Services/Tree/classes/class.ilPathGUI.php';
3141 $path_gui->enableTextOnly(!$this->path_linked);
3142 $path_gui->setUseImages(
false);
3144 $start_node = $this->path_start_node
3145 ? $this->path_start_node
3148 $this->tpl->setCurrentBlock(
"path_item");
3149 $this->tpl->setVariable(
'PATH_ITEM', $path_gui->getPath($start_node, $this->ref_id));
3150 $this->tpl->parseCurrentBlock();
3152 $this->tpl->setCurrentBlock(
"path");
3153 $this->tpl->setVariable(
"TXT_LOCATION",
$lng->txt(
"locator"));
3154 $this->tpl->parseCurrentBlock();
3181 $this->tpl->setCurrentBlock(
"check");
3182 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3183 $this->tpl->parseCurrentBlock();
3186 $this->tpl->setCurrentBlock(
"check_download");
3188 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3190 $this->tpl->setVariable(
"VAL_VISIBILITY",
"visibility: hidden;\" disabled=\"disabled");
3192 $this->tpl->parseCurrentBlock();
3195 $this->tpl->setCurrentBlock(
'expand');
3198 $this->ctrl->setParameter($this->container_obj,
'expand', -1 * $this->obj_id);
3200 $this->tpl->setVariable(
'EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj,
'view', $this->getUniqueItemId(
true)));
3201 $this->ctrl->clearParameters($this->container_obj);
3203 $this->tpl->setVariable(
'EXP_ALT', $this->lng->txt(
'collapse'));
3205 $this->ctrl->setParameter($this->container_obj,
'expand', $this->obj_id);
3207 $this->tpl->setVariable(
'EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj,
'view', $this->getUniqueItemId(
true)));
3208 $this->ctrl->clearParameters($this->container_obj);
3210 $this->tpl->setVariable(
'EXP_ALT', $this->lng->txt(
'expand'));
3213 $this->tpl->parseCurrentBlock();
3219 $this->tpl->touchBlock(
"i_1");
3223 if ($this->title_link_disabled || !$this->default_command || (!$this->
getCommandsStatus() && !$this->restrict_to_goto)) {
3225 $this->tpl->setCurrentBlock(
"icon_link_s");
3227 if ($this->default_command[
"frame"] !=
"") {
3228 $this->tpl->setVariable(
"ICON_TAR",
"target='" . $this->default_command[
"frame"] .
"'");
3231 $this->tpl->setVariable(
3233 $this->default_command[
"link"]
3235 $this->tpl->parseCurrentBlock();
3236 $this->tpl->touchBlock(
"icon_link_e");
3239 $this->tpl->setCurrentBlock(
"icon");
3240 if (!$objDefinition->isPlugin($this->getIconImageType())) {
3243 include_once(
"Services/Component/classes/class.ilPlugin.php");
3244 $this->tpl->setVariable(
"ALT_ICON",
$lng->txt(
"icon") .
" " .
3248 $this->tpl->setVariable(
3252 $this->tpl->parseCurrentBlock();
3256 $this->tpl->touchBlock(
"d_" . $cnt);
3264 foreach ($this->sub_item_html as $sub_html) {
3265 $this->tpl->setCurrentBlock(
"subitem");
3266 $this->tpl->setVariable(
"SUBITEM", $sub_html);
3267 $this->tpl->parseCurrentBlock();
3276 if ($this->position_enabled) {
3277 $this->tpl->setCurrentBlock(
"position");
3278 $this->tpl->setVariable(
"POS_ID", $this->position_field_index);
3279 $this->tpl->setVariable(
"POS_VAL", $this->position_value);
3280 $this->tpl->parseCurrentBlock();
3290 return $this->adm_commands_included;
3299 if ($this->acache->getLastAccessStatus() ==
"miss" &&
3300 !$this->prevent_access_caching) {
3301 $this->acache->storeEntry(
3303 serialize($this->access_cache),
3328 $a_use_asynch =
false,
3329 $a_get_asynch_commands =
false,
3336 $this->adm_commands_included =
false;
3342 $this->
initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
3345 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
3346 if ($this->context == self::CONTEXT_REPOSITORY) {
3353 if ($a_use_asynch && $a_get_asynch_commands) {
3357 if ($this->rating_enabled) {
3362 $rating->setObject($this->obj_id, $this->type);
3371 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3379 include_once(
"Services/Object/classes/class.ilListItemAccessCache.php");
3381 $cres = $this->acache->getEntry(
$ilUser->getId() .
":" . $a_ref_id);
3382 if ($this->acache->getLastAccessStatus() ==
"hit") {
3383 $this->access_cache = unserialize($cres);
3404 static::$tpl_file_name,
3407 static::$tpl_component,
3415 $this->tpl->setVariable(
3416 "COMMAND_SELECTION_LIST",
3417 $this->
insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url)
3479 $this->tpl->setVariable(
"DIV_CLASS",
'ilContainerListItemOuter');
3480 $this->tpl->setVariable(
"DIV_ID",
'id = "' . $this->
getUniqueItemId(
true) .
'"');
3488 return $this->tpl->get();
3497 $this->cust_prop =
array();
3498 $this->cust_commands =
array();
3499 $this->sub_item_html =
array();
3500 $this->position_enabled =
false;
3510 $this->parent_ref_id = $a_ref_id;
3522 $id_ref = ($this->reference_ref_id > 0)
3523 ? $this->reference_ref_id
3527 if ($this->condition_depth) {
3538 return "lg_div_" . $id_ref;
3565 $this->bold_title = $a_bold_title;
3588 $lng = $DIC->language();
3592 if ($a_context == self::CONTEXT_REPOSITORY) {
3593 $active_notes = !
$ilSetting->get(
"disable_notes");
3594 $active_comments = !
$ilSetting->get(
"disable_comments");
3596 if ($active_notes || $active_comments) {
3597 include_once(
"./Services/Notes/classes/class.ilNote.php");
3600 if ($active_comments) {
3606 if (
$ilSetting->get(
'comments_tagging_in_lists')) {
3607 if ($active_notes || $active_comments) {
3610 $lng->loadLanguageModule(
"notes");
3614 if ($tags_set->get(
"enable")) {
3615 $all_users = $tags_set->get(
"enable_all_users");
3617 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
3618 if (!
$ilSetting->get(
'comments_tagging_in_lists_tags')) {
3621 $tag_user_id = null;
3623 $tag_user_id =
$ilUser->getId();
3628 $lng->loadLanguageModule(
"tagging");
3632 $lng->loadLanguageModule(
"rating");
3635 self::$preload_done =
true;
3650 if ($this->comments_enabled) {
3651 if (!$this->comments_settings_enabled) {
3659 if (!$a_header_actions && self::$preload_done) {
3660 if (self::$comments_activation[$a_obj_id][
$a_type]) {
3664 include_once(
"./Services/Notes/classes/class.ilNote.php");
3682 $this->timings_enabled = (bool) $a_status;
3693 include_once(
"./Services/FileUpload/classes/class.ilFileUploadUtil.php");
3702 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
3707 $this->tpl->setCurrentBlock(
"fileupload");
3708 $this->tpl->setVariable(
"FILE_UPLOAD", $upload->getHTML());
3709 $this->tpl->parseCurrentBlock();
parseConditions($toggle_id, $conditions, $obligatory=true)
getCommands()
get all current commands for a specific ref id (in the permission context of the current user) ...
getProgressInfoStatus()
get progress info status
static initFileUpload()
Initializes the file upload and loads the needed javascripts and styles.
insertTitle()
insert item title
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
Creates a path for a start and endnode.
insertIconsAndCheckboxes()
Insert icons and checkboxes.
const CONTEXT_WORKSPACE_SHARING
enableInfoScreen($a_info_screen)
En/disable path.
$repository_transfer_enabled
insertSearchFragment()
Insert highlighted search fragment.
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
getDescription()
getDescription overwritten in class.ilObjLinkResourceList.php
isMode($a_mode)
check current output mode
getContainerObject()
get container object
insertLinkCommand()
insert link command
insertMultiDownloadCommand()
storeAccessCache()
Store access cache.
getIconStatus()
Are icons enabled?
getCommandLink($a_cmd)
Get command link url.
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
static lookupTxtById($plugin_id, $lang_var)
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
disableTitleLink($a_status)
enableNotes($a_value)
Toogle notes action status.
static initJavascript($a_ajax_url, ilTemplate $a_main_tpl=null)
Init javascript.
enableDelete($a_status)
En/disable delete.
insertCopyCommand($a_to_repository=false)
Insert copy command.
getCheckboxStatus()
Are checkboxes enabled?
addHeaderIcon($a_id, $a_img, $a_tooltip=null, $a_onclick=null, $a_status_text=null, $a_href=null)
const DOWNLOAD_CHECKBOX_NONE
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilTemplate $a_main_tpl=null)
Init javascript.
insertPreconditions()
insert all missing preconditions
static translateOperator($a_obj_id, $a_operator)
Translate operator.
enableProperties($a_status)
En/disable properties.
static _countNotesAndComments($a_rep_obj_id, $a_sub_obj_id=null)
Get all notes related to a specific object.
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
addCustomCommand($a_link, $a_lang_var, $a_frame="", $onclick="")
add a custom command
getHeaderAction(ilTemplate $a_main_tpl=null)
Get header action.
resetCustomData()
reset properties and commands
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.
if(!array_key_exists('StateId', $_REQUEST)) $id
enableCut($a_status)
En/disable cut.
getAdditionalInformation()
Get additional information.
const DOWNLOAD_CHECKBOX_ENABLED
insertPasteCommand()
Insert paste command.
Access handler for personal workspace.
getItemDetailLinkStatus()
get item detail link status
getCommandsHTML()
Get commands HTML (must be called after get list item html)
static _lookupTitle($a_id)
lookup object title
createDefaultCommand($command)
Get default command link Overwritten for e.g categories,courses => they return a goto link If search ...
setBoldTitle($a_bold_title)
public boolean $a_bold_title set the item title bold
insertCommand($a_href, $a_text, $a_frame="", $a_img="", $a_cmd="", $a_onclick="")
insert command button
getSubstitutionStatus()
Get substitution status.
static _isActive()
Static getter.
enableSubstitutions($a_status)
Enable substitutions.
enableSearchFragments($a_status)
En/disable description.
enableMultiDownload($a_value)
Toggles whether multiple objects can be downloaded at once or not.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
insertSubscribeCommand()
insert subscribe command
setContainerObject($container_obj)
set the container object (e.g categorygui) Used for link, delete ...
static preloadCommonProperties($a_obj_ids, $a_context)
Preload common properties.
$rating_categories_enabled
static calculateRequiredTriggers($a_target_ref_id, $a_target_obj_id, $a_target_obj_type='', $a_force_update=false)
calculate number of obligatory items
static hasRatingInListGUI($a_obj_id, $a_obj_type)
static $comments_activation
insertDeleteCommand()
insert cut command
static getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
static lookupRenderStatus($a_obj_id)
Gets the render status for the object with the specified id.
isVisibleOnlyForced()
Force unreadable.
checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id="")
setDescription($a_description)
restrictToGoto($a_value)
Restrict all actions/links to goto.
enableLinkedPath($a_status)
Enable linked path.
getCommandFrame($a_cmd)
Get command target frame.
static _getInstance()
Get singleton instance of this class.
enableRepositoryTransfer($a_value)
Enable copy/move to repository (from personal workspace)
insertPositionField()
Insert field for positioning.
addCustomProperty( $a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
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.
enablePath($a_path, $a_start_node=null)
En/disable path.
setPositionInputField($a_field_index, $a_position_value)
Set position input field.
enableRating($a_value, $a_text=null, $a_categories=false, array $a_ctrl_path=null)
Toogle rating action status.
modifySAHSlaunch($a_link, $wtarget)
workaround: SAHS in new javavasript-created window or iframe
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static _getCommands()
get commands
getProperties()
Get item properties.
isFileUploadAllowed()
Gets a value indicating whether file uploads to this object are allowed or not.
getNoticeProperties()
get notice properties
static getInstance()
Factory.
enableSubscribe($a_status)
En/disable subscribe.
static hasPreview($a_obj_id, $a_type="")
Determines whether the object with the specified reference id has a preview.
getCommandId()
get command id Normally the ref id.
static getGotoLink($a_node_id, $a_obj_id, $a_additional=null)
const CONTEXT_PERSONAL_DESKTOP
static buildAjaxHash($a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null)
Build ajax hash.
getDownloadCheckboxState()
insertProgressInfo()
insert progress info
enablePreconditions($a_status)
En/disable preconditions.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
enableDownloadCheckbox($a_ref_id, $a_value)
insertProperties()
insert properties
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
enableDescription($a_status)
En/disable description.
insertSubItems()
Insert subitems.
static _lookupObjId($a_id)
enabledRelevance()
enabled relevance
setAdditionalInformation($a_val)
Set additional information.
special template class to simplify handling of ITX/PEAR
setSearchFragment($a_text)
set search fragment
static getListTagsJSCall($a_hash, $a_update_code=null)
Get tagging js call.
static getOptionalConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_obj_type='')
Get optional conditions.
static getRepObjActivation($a_rep_obj_ids)
Get activation for repository objects.
insertInfoScreenCommand()
insert info screen command
getSearchFragment()
get search fragment
static isActive()
Is folder background download active?
enableProgressInfo($a_status)
enable progress info
getDetailsLevel()
Get current details level.
enableNoticeProperties($a_status)
En/disable notices.
getSearchFragmentStatus()
Show hide search result fragments.
getCommandImage($a_cmd)
Get command icon image.
getIconImageType()
Returns the icon image type.
static getInstance()
Get singelton instance.
insertItemDetailLinks()
insert item detail links
forceVisibleOnly($a_stat)
Force visible access only.
enableCommands($a_status, $a_std_only=false)
En/disable commands.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
enableCopy($a_status)
En/disable copy.
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
setDetailsLevel($a_level)
Details level Currently used in Search which shows only limited properties of forums Currently used f...
Caches (check) access information on list items.
enableComments($a_value, $a_enable_comments_settings=true)
Toogle comments action status.
appendRepositoryFrameParameter($a_link)
workaround: all links into the repository (from outside) must tell repository to setup the frameset ...
getTitle()
getTitle overwritten in class.ilObjLinkResourceList.php
enableExpand($a_status)
En/Dis-able expand/collapse link.
User interface class for advanced drop-down selection lists.
setDefaultCommandParameters(array $a_params)
enableIcon($a_status)
En/Dis-able icons.
static _countTags($a_obj_ids, $a_all_users=false)
Count all tags for repository objects.
$prevent_duplicate_commands
setRelevance($a_rel)
set relevance
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
modifyTitleLink($a_default_link)
enableCheckbox($a_status)
En/Dis-able checkboxes.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
setParentRefId($a_ref_id)
Set current parent ref id to enable unique js-ids (sessions, etc.)
addHeaderIconHTML($a_id, $a_html)
setConditionDepth($a_depth)
set depth for precondition output (stops at level 5)
getNoticePropertiesStatus()
getRelevance()
get relevance
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
enableTags($a_value)
Toogle tags action status.
static isUploadAllowed($a_ref_id, $a_type="")
Determines whether files can be uploaded to the object with the specified reference id...
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.
insertTimingsCommand()
insert edit timings command
isSideBlock()
Returns whether current item is a block in a side column or not.
static getInstance()
Get instance.
getUniqueItemId($a_as_div=false)
Get unique item identifier (for js-actions)
setSeparateCommands($a_val)
Set separate commands.
enableLink($a_status)
En/disable link.
setMode($a_mode)
set output mode
addHeaderGlyph($a_id, $a_glyph, $a_onclick=null)
getSeparateCommands()
Get separate commands.
const INFO_TAB_VISIBILITY
$item_detail_links_enabled
insertCommands( $a_use_asynch=false, $a_get_asynch_commands=false, $a_asynch_url="", $a_header_actions=false)
insert all commands into html code
$notice_properties_enabled
getAlertProperties()
get all alert properties
static getObjectListAction($a_ref_id)
Get object list action.
static getListGUIStatus($a_obj_id, $a_image_only=false)
insertCommonSocialCommands($a_header_actions=false)
Insert common social commands (comments, notes, tagging)
Interface for GUI classes (PDGUI, LuceneSearchGUI...) that have to handle administration commands (cu...
getExpandStatus()
Is expand/collapse enabled.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
setHeaderSubObject($a_type, $a_id)
Set sub object identifier.
$comments_settings_enabled
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item (is called by getItemHTML())
static _getListTagsForObjects(array $a_obj_ids, $a_user_id=null)
Get tags for given object ids.
$search_fragments_enabled
insertDescription()
insert item description
insertFileUpload()
Inserts a file upload component.
insertRelevance()
insert relevance
getCustomProperties($a_prop)
get custom properties
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
Class ilObjSCORMLearningModule.
const DOWNLOAD_CHECKBOX_DISABLED
static _countNotesAndCommentsMultiple($a_rep_obj_ids, $a_no_sub_objs=false)
Get all notes related to multiple objcts.
enableRelevance($a_status)
enable relevance
adminCommandsIncluded()
returns whether any admin commands (link, delete, cut) are included in the output ...
addSubItemHTML($a_html)
Add HTML for subitem (used for sessions)
enableTimings($a_status)
enable timings link
insertCutCommand($a_to_repository=false)
insert cut command
insertSubstitutions()
Insert substitutions.