4 define (
"IL_LIST_AS_TRIGGER",
"trigger");
5 define (
"IL_LIST_FULL",
"full");
6 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
140 $this->ui = $DIC->ui();
141 $this->rbacsystem = $DIC->rbac()->system();
142 $this->
ilias = $ilias;
143 $this->ctrl = $DIC->ctrl();
144 $this->lng = $DIC->language();
146 $this->path_enabled =
false;
147 $this->context = $a_context;
159 include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
162 $this->lng->loadLanguageModule(
"obj");
174 $this->container_obj = $container_obj;
186 return $this->container_obj;
198 $this->static_link_enabled =
true;
199 $this->delete_enabled =
true;
200 $this->cut_enabled =
true;
201 $this->subscribe_enabled =
true;
202 $this->link_enabled =
false;
203 $this->copy_enabled =
false;
204 $this->progress_enabled =
false;
205 $this->notice_properties_enabled =
true;
206 $this->info_screen_enabled =
false;
208 $this->gui_class_name =
"";
211 include_once(
'./Services/Object/classes/class.ilObjectAccess.php');
224 $this->properties_enabled = $a_status;
246 $this->preconditions_enabled = $a_status;
264 $this->notice_properties_enabled = $a_status;
286 $this->description_enabled = $a_status;
320 $this->search_fragment_enabled = $a_status;
332 $this->path_linked = $a_status;
350 $this->enabled_relevance = $a_status;
360 $this->relevance = $a_rel;
380 $this->icons_enabled = $a_status;
400 $this->checkboxes_enabled = $a_status;
420 $this->expand_enabled = $a_status;
435 $this->is_expanded = $a_status;
450 $this->position_enabled =
true;
451 $this->position_field_index = $a_field_index;
452 $this->position_value = $a_position_value;
463 $this->delete_enabled = $a_status;
475 return $this->delete_enabled;
486 $this->cut_enabled = $a_status;
497 return $this->cut_enabled;
508 $this->copy_enabled = $a_status;
530 $this->subscribe_enabled = $a_status;
541 return $this->subscribe_enabled;
552 $this->link_enabled = $a_status;
563 return $this->link_enabled;
575 $this->path_enabled = $a_path;
576 $this->path_start_node = (int)$a_start_node;
586 return $this->path_enabled;
597 $this->commands_enabled = $a_status;
598 $this->std_cmd_only = $a_std_only;
618 $this->info_screen_enabled = $a_info_screen;
628 $this->sub_item_html[] = $a_html;
650 $this->progress_enabled = $a_status;
674 $this->substitutions_enabled = $a_status;
698 $this->item_detail_links_enabled = $a_status;
721 $this->item_detail_links = $a_detail_links;
722 $this->item_detail_links_intro = $a_intro_txt;
734 if(!count($this->item_detail_links))
738 if(strlen($this->item_detail_links_intro))
740 $this->tpl->setCurrentBlock(
'item_detail_intro');
741 $this->tpl->setVariable(
'ITEM_DETAIL_INTRO_TXT',$this->item_detail_links_intro);
742 $this->tpl->parseCurrentBlock();
745 foreach($this->item_detail_links as
$info)
747 $this->tpl->setCurrentBlock(
'item_detail_link');
748 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_TARGET',$info[
'target']);
749 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_DESC',$info[
'desc']);
750 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_HREF',$info[
'link']);
751 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_NAME',$info[
'name']);
752 $this->tpl->parseCurrentBlock();
754 $this->tpl->setCurrentBlock(
'item_detail_links');
755 $this->tpl->parseCurrentBlock();
766 $this->title = $a_title;
785 $this->description = $a_description;
795 return $this->description;
805 $this->search_fragment = $a_text;
824 $this->separate_commands = $a_val;
857 $this->additional_information = $a_val;
879 $this->details_level = $a_level;
898 $this->repository_transfer_enabled = (bool)$a_value;
908 $this->restrict_to_goto = (bool)$a_value;
926 $cache_prefix = null;
927 if($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING)
929 $cache_prefix =
"wsp";
930 if(!$this->ws_access)
932 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
937 if (isset($this->access_cache[$a_permission][
"-".$a_cmd][$cache_prefix.$a_ref_id]))
939 return $this->access_cache[$a_permission][
"-".$a_cmd][$cache_prefix.$a_ref_id];
942 if($this->context == self::CONTEXT_REPOSITORY)
944 $access = $ilAccess->checkAccess($a_permission,$a_cmd,$a_ref_id,
$a_type,$a_obj_id);
945 if ($ilAccess->getPreventCachingLastResult())
947 $this->prevent_access_caching =
true;
952 $access = $this->ws_access->checkAccess($a_permission,$a_cmd,$a_ref_id,
$a_type);
955 $this->access_cache[$a_permission][
"-".$a_cmd][$cache_prefix.$a_ref_id] = $access;
968 function initItem($a_ref_id, $a_obj_id, $a_title =
"", $a_description =
"")
970 $this->offline_mode =
false;
971 if ($this->type ==
"sahs") {
972 include_once(
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
975 $this->access_cache =
array();
976 $this->ref_id = $a_ref_id;
977 $this->obj_id = $a_obj_id;
980 #$this->description = $a_description; 983 $this->adm_commands_included =
false;
984 $this->prevent_access_caching =
false;
990 $this->condition_target =
array(
991 'ref_id' => $a_ref_id,
992 'obj_id' => $a_obj_id,
993 'target_type' => $a_target_type
999 $this->condition_target =
array();
1004 $this->title_link_disabled = $a_status;
1010 $this->default_command_params = $a_params;
1025 if($this->static_link_enabled
and !$this->default_command_params)
1027 include_once(
'./Services/Link/classes/class.ilLink.php');
1030 $command[
'link'] = $link;
1031 $command[
'frame'] =
'_top';
1034 if($this->default_command_params)
1037 foreach($this->default_command_params as $name => $value)
1044 if(!stristr($command[
'link'],
'?'))
1046 $command[
'link'] .=
'?'.$params;
1050 $command[
'link'] .=
'&'.$params;
1070 if($this->context == self::CONTEXT_REPOSITORY)
1073 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1076 require_once (
'Services/WebDAV/classes/class.ilDAVServer.php');
1083 return $davServer->getMountURI($this->ref_id).
1084 '" folder="'.$davServer->getFolderURI($this->ref_id);
1088 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
getCommandId());
1089 $cmd_link = $this->ctrl->getLinkTargetByClass(
"ilrepositorygui", $a_cmd);
1090 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1101 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id",
"");
1102 $this->ctrl->setParameterByClass($this->gui_class_name,
"wsp_id", $this->ref_id);
1103 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1120 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1126 if($a_cmd ==
'fileManagerLaunch')
1161 global $objDefinition;
1171 if($this->context == self::CONTEXT_REPOSITORY)
1174 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1177 require_once (
'Services/WebDAV/classes/class.ilDAVServer.php');
1178 global $ilias,
$lng;
1181 require_once(
'Services/WebDAV/classes/class.ilDAVLocks.php');
1183 if ($ilias->account->getId() != ANONYMOUS_USER_ID)
1185 $locks =& $davLocks->getLocksOnObjectObj($this->obj_id);
1186 if (count($locks) > 0)
1188 $lockUser =
new ilObjUser($locks[0][
'ilias_owner']);
1192 "property" => $lng->txt(
"in_use_by"),
1193 "value" => $lockUser->getLogin(),
1194 "link" =>
"./ilias.php?user=".$locks[0][
'ilias_owner'].
'&cmd=showUserProfile&cmdClass=ilpersonaldesktopgui&cmdNode=1&baseClass=ilPersonalDesktopGUI',
1206 if (preg_match(
'/^(\\.|\\.\\.)$/', $this->title))
1208 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1209 "value" => $lng->txt(
"filename_special_filename"),
1210 'propertyNameVisible' =>
false);
1212 else if (preg_match(
'/^\\./', $this->title))
1214 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_visibility"),
1215 "value" => $lng->txt(
"filename_hidden_unix_file"),
1216 'propertyNameVisible' =>
false);
1218 else if (preg_match(
'/~$/', $this->title))
1220 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_visibility"),
1221 "value" => $lng->txt(
"filename_hidden_backup_file"),
1222 'propertyNameVisible' =>
false);
1224 else if (preg_match(
'/[\\/]/', $this->title))
1226 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1227 "value" => $lng->txt(
"filename_special_characters"),
1228 'propertyNameVisible' =>
false);
1230 else if (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);
1236 else if (preg_match(
'/\\.$/', $this->title))
1238 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1239 "value" => $lng->txt(
"filename_windows_empty_extension"),
1240 'propertyNameVisible' =>
false);
1242 else if (preg_match(
'/^(\\.|\\.\\.)$/', $this->title))
1244 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1245 "value" => $lng->txt(
"filename_special_filename"),
1246 'propertyNameVisible' =>
false);
1248 else if (preg_match(
'/#/', $this->title))
1250 $props[] =
array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1251 "value" => $lng->txt(
"filename_windows_webdav_issue"),
1252 'propertyNameVisible' =>
false);
1265 $a_alert =
false, $a_newline =
false)
1267 $this->cust_prop[] =
array(
"property" => $a_property,
"value" => $a_value,
1268 "alert" => $a_alert,
"newline" => $a_newline);
1276 if (is_array($this->cust_prop))
1278 foreach($this->cust_prop as $prop)
1295 if($prop[
'alert'] ==
true)
1308 $this->notice_prop =
array();
1309 if($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true))
1311 foreach($infos as
$info)
1313 $this->notice_prop[] =
array(
'value' => $info);
1316 return $this->notice_prop ? $this->notice_prop :
array();
1323 $this->cust_commands[] =
1324 array(
"link" => $a_link,
"lang_var" => $a_lang_var,
1325 "frame" => $a_frame,
"onclick" => $onclick);
1334 $this->force_visible_only = $a_stat;
1373 $ref_commands =
array();
1374 foreach($this->commands as $command)
1376 $permission = $command[
"permission"];
1377 $cmd = $command[
"cmd"];
1378 $lang_var = $command[
"lang_var"];
1380 $info_object = null;
1382 if (isset($command[
"txt"]))
1384 $txt = $command[
"txt"];
1390 if ($ilias->account->getId() == ANONYMOUS_USER_ID &&
1391 $command[
'enable_anonymous'] ==
'false')
1399 $ilBench->start(
"ilObjectListGUI",
"4110_get_commands_check_access");
1402 $ilBench->stop(
"ilObjectListGUI",
"4110_get_commands_check_access");
1409 $access_granted =
true;
1413 $access_granted =
false;
1414 $info_object = $ilAccess->getInfo();
1417 if (!isset($command[
"default"]))
1419 $command[
"default"] =
"";
1421 $ref_commands[] =
array(
1422 "permission" => $permission,
1424 "link" => $cmd_link,
1425 "frame" => $cmd_frame,
1426 "lang_var" => $lang_var,
1428 "granted" => $access_granted,
1429 "access_info" => $info_object,
1430 "img" => $cmd_image,
1431 "default" => $command[
"default"]
1435 return $ref_commands;
1448 if ($this->type ==
"sahs" && $this->offline_mode) {
1449 return $this->type .
"_offline";
1464 if($this->restrict_to_goto)
1466 $this->default_command =
array(
"frame" =>
"",
1471 !$this->default_command ||
1473 $this->title_link_disabled
1477 $this->tpl->setCurrentBlock(
"item_title");
1478 $this->tpl->setVariable(
"TXT_TITLE", $this->
getTitle());
1479 $this->tpl->parseCurrentBlock();
1483 $this->default_command[
'link'] = $this->
modifyTitleLink($this->default_command[
'link']);
1485 $this->default_command[
"link"] =
1486 $this->
modifySAHSlaunch($this->default_command[
"link"],$this->default_command[
"frame"]);
1488 if ($this->default_command[
"frame"] !=
"")
1490 $this->tpl->setCurrentBlock(
"title_linked_frame");
1491 $this->tpl->setVariable(
"TARGET_TITLE_LINKED", $this->default_command[
"frame"]);
1492 $this->tpl->parseCurrentBlock();
1496 #var_dump("<pre>",$this->default_command['link'],"</pre>"); 1497 $this->default_command[
"link"] =
1500 #var_dump("<pre>",$this->default_command['link'],"</pre>"); 1504 $this->tpl->setCurrentBlock(
"item_title_linked");
1505 $this->tpl->setVariable(
"TXT_TITLE_LINKED", $this->
getTitle());
1506 $this->tpl->setVariable(
"HREF_TITLE_LINKED", $this->default_command[
"link"]);
1509 include_once(
"./Services/Preview/classes/class.ilPreview.php");
1512 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
1515 $access_handler = null;
1517 switch ($this->context)
1519 case self::CONTEXT_WORKSPACE:
1520 case self::CONTEXT_WORKSPACE_SHARING:
1522 include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
1529 $access_handler = $ilAccess;
1535 $preview_status_class =
"";
1536 $preview_text_topic =
"preview_show";
1539 $preview_status_class =
"ilPreviewStatusNone";
1540 $preview_text_topic =
"preview_none";
1542 $this->tpl->setCurrentBlock(
"item_title_linked");
1543 $this->tpl->setVariable(
"PREVIEW_STATUS_CLASS", $preview_status_class);
1544 $this->tpl->setVariable(
"SRC_PREVIEW_ICON",
ilUtil::getImagePath(
"preview.png",
"Services/Preview"));
1545 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt($preview_text_topic));
1546 $this->tpl->setVariable(
"SCRIPT_PREVIEW_CLICK",
$preview->getJSCall($this->getUniqueItemId(
true)));
1547 $this->tpl->parseCurrentBlock();
1550 $this->tpl->parseCurrentBlock();
1553 if ($this->bold_title ==
true)
1555 $this->tpl->touchBlock(
'bold_title_start');
1556 $this->tpl->touchBlock(
'bold_title_end');
1562 switch($this->context)
1564 case self::CONTEXT_WORKSPACE_SHARING:
1565 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1582 $fields_shown =
false;
1583 foreach($this->substitutions->getParsedSubstitutions($this->ref_id,$this->obj_id) as
$data)
1587 $data[
'name'] =
'<strong>'.$data[
'name'].
'</strong>';
1588 $data[
'value'] =
'<strong>'.$data[
'value'].
'</strong>';
1590 $this->tpl->touchBlock(
"std_prop");
1591 $this->tpl->setCurrentBlock(
'item_property');
1592 if(
$data[
'show_field'])
1594 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1596 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1597 $this->tpl->parseCurrentBlock();
1599 if(
$data[
'newline'])
1601 $this->tpl->touchBlock(
'newline_prop');
1603 $fields_shown =
false;
1608 $this->tpl->touchBlock(
'newline_prop');
1625 if(!$this->substitutions->isDescriptionEnabled())
1633 $d = strip_tags(
$d,
"<b>");
1634 $this->tpl->setCurrentBlock(
"item_description");
1635 $this->tpl->setVariable(
"TXT_DESC",
$d);
1636 $this->tpl->parseCurrentBlock();
1647 $this->tpl->setCurrentBlock(
'search_fragment');
1648 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT',$this->
getSearchFragment().
' ...');
1649 $this->tpl->parseCurrentBlock();
1667 include_once
"Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
1671 $this->tpl->setCurrentBlock(
'relevance');
1672 $this->tpl->setVariable(
'REL_PBAR', $pbar->render());
1673 $this->tpl->parseCurrentBlock();
1683 $this->mode = $a_mode;
1701 $this->condition_depth = $a_depth;
1713 if ($a_mode == $this->mode)
1735 if($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING)
1738 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
1742 $props[] =
array(
"alert" =>
false,
1743 "property" => $lng->txt(
"learning_progress"),
1750 if ($this->
ilias->account->getId() == ANONYMOUS_USER_ID)
1752 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id))
1754 $props[] =
array(
"alert" =>
true,
1755 "value" => $lng->txt(
"no_access_item_public"),
1764 if($this->reference_ref_id)
1767 $note_obj_id = $this->reference_obj_id;
1770 $redraw_js =
"il.Object.redrawListItem(".$note_ref_id.
");";
1775 self::$cnt_tags[$note_obj_id] > 0 ||
1776 is_array(self::$tags[$note_obj_id])) &&
1777 ($ilUser->getId() != ANONYMOUS_USER_ID))
1779 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
1780 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
1786 $props[] =
array(
"alert" =>
false,
1787 "property" => $lng->txt(
"notes_comments"),
1788 "value" =>
"<a href='#' onclick=\"return ".
1795 if ($this->notes_enabled && self::$cnt_notes[$note_obj_id][
IL_NOTE_PRIVATE] > 0)
1797 $props[] =
array(
"alert" =>
false,
1798 "property" => $lng->txt(
"notes"),
1799 "value" =>
"<a href='#' onclick=\"return ".
1805 if ($this->tags_enabled &&
1806 (self::$cnt_tags[$note_obj_id] > 0 ||
1807 is_array(self::$tags[$note_obj_id])))
1810 if ($tags_set->get(
"enable"))
1815 if(is_array(self::$tags[$note_obj_id]))
1817 $tags_tmp =
array();
1818 foreach(self::$tags[$note_obj_id] as $tag => $is_tag_owner)
1822 $tags_tmp[] =
"<a class=\"ilTag ilTagRelHigh\" href='#' onclick=\"return ".
1823 $tags_url.
"\">".$tag.
"</a>";
1827 $tags_tmp[] =
"<span class=\"ilTag ilTagRelMiddle\">".$tag.
"</span>";
1830 $tags_value = implode(
" ", $tags_tmp);
1837 $tags_value =
"<a href='#' onclick=\"return ".$tags_url.
"\">".
1838 self::$cnt_tags[$note_obj_id].
"</a>";
1839 $prop_text = $lng->txt(
"tagging_tags");
1841 $props[] =
array(
"alert" =>
false,
1842 "property" => $prop_text,
1843 "value" => $tags_value,
1851 if (is_array($props) && count($props) > 0)
1853 foreach($props as $prop)
1858 $this->tpl->touchBlock(
"separator_prop");
1862 if ($prop[
"alert"] ==
true)
1864 $this->tpl->touchBlock(
"alert_prop");
1868 $this->tpl->touchBlock(
"std_prop");
1870 if ($prop[
"newline"] ==
true && $cnt > 1)
1872 $this->tpl->touchBlock(
"newline_prop");
1875 if (isset($prop[
"property"]) && $prop[
'propertyNameVisible'] !==
false && $prop[
"property"] !=
"")
1878 $this->tpl->setCurrentBlock(
"prop_name");
1879 $this->tpl->setVariable(
"TXT_PROP", $prop[
"property"]);
1880 $this->tpl->parseCurrentBlock();
1882 $this->tpl->setCurrentBlock(
"item_property");
1886 $this->tpl->setVariable(
"LINK_PROP", $prop[
'link']);
1887 $this->tpl->setVariable(
"LINK_VAL_PROP", $prop[
"value"]);
1891 $this->tpl->setVariable(
"VAL_PROP", $prop[
"value"]);
1894 $this->tpl->parseCurrentBlock();
1898 $this->tpl->setCurrentBlock(
"item_properties");
1899 $this->tpl->parseCurrentBlock();
1906 foreach($this->notice_prop as $property)
1908 $this->tpl->setCurrentBlock(
'notice_item');
1909 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE',$property[
'value']);
1910 $this->tpl->parseCurrentBlock();
1912 $this->tpl->setCurrentBlock(
'notice_property');
1913 $this->tpl->parseCurrentBlock();
1918 global $ilAccess,
$lng, $objDefinition,$tree;
1921 $num_optional_required =
1925 $visible_conditions =
array();
1926 $passed_optional = 0;
1927 foreach($conditions as $condition)
1929 if($obligatory
and !$condition[
'obligatory'])
1933 if(!$obligatory
and $condition[
'obligatory'])
1938 if($tree->isDeleted($condition[
'trigger_ref_id']))
1943 include_once
'Services/Container/classes/class.ilMemberViewSettings.php';
1949 $visible_conditions[] = $condition[
'id'];
1956 if($passed_optional >= $num_optional_required)
1963 foreach($conditions as $condition)
1965 if(!in_array($condition[
'id'], $visible_conditions))
1970 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
1974 $class = $objDefinition->getClassName($condition[
"trigger_type"]);
1975 $location = $objDefinition->getLocation($condition[
"trigger_type"]);
1980 $missing_cond_exist =
true;
1982 $full_class =
"ilObj".$class.
"ListGUI";
1983 include_once(
$location.
"/class.".$full_class.
".php");
1984 $item_list_gui =
new $full_class($this);
1986 $item_list_gui->enablePath(
false);
1987 $item_list_gui->enableIcon(
true);
1988 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1990 $item_list_gui->addCustomProperty($this->lng->txt(
"precondition_required_itemlist"), $cond_txt,
false,
true);
1992 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1993 $item_list_gui->enableProperties($this->properties_enabled);
1995 $trigger_html = $item_list_gui->getListItemHTML($condition[
'trigger_ref_id'],
1998 $this->tpl->setCurrentBlock(
"precondition");
1999 if ($trigger_html ==
"")
2001 $trigger_html = $this->lng->txt(
"precondition_not_accessible");
2003 $this->tpl->setVariable(
"TXT_CONDITION", trim($cond_txt));
2004 $this->tpl->setVariable(
"TRIGGER_ITEM", $trigger_html);
2005 $this->tpl->parseCurrentBlock();
2008 if ($missing_cond_exist
and $obligatory)
2010 $this->tpl->setCurrentBlock(
"preconditions");
2011 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_obl_".$toggle_id);
2012 $this->tpl->setVariable(
"TXT_PRECONDITIONS", $lng->txt(
"preconditions_obligatory_hint"));
2013 $this->tpl->parseCurrentBlock();
2016 elseif($missing_cond_exist
and !$obligatory)
2018 $this->tpl->setCurrentBlock(
"preconditions");
2019 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_opt_".$toggle_id);
2020 $this->tpl->setVariable(
"TXT_PRECONDITIONS", sprintf($lng->txt(
"preconditions_optional_hint"),$num_optional_required));
2021 $this->tpl->parseCurrentBlock();
2024 return !$missing_cond_exist;
2032 global $ilAccess,
$lng, $objDefinition,$tree;
2034 include_once(
"./Services/AccessControl/classes/class.ilConditionHandler.php");
2036 $missing_cond_exist =
false;
2039 if ($this->condition_depth > 0)
2052 if($this->condition_target)
2055 $this->condition_target[
'ref_id'],
2056 $this->condition_target[
'obj_id'],
2057 $this->condition_target[
'target_type']
2065 if(
sizeof($conditions))
2067 for($i = 0; $i < count($conditions); $i++)
2073 ++self::$js_unique_id;
2076 $all_done_obl = $this->
parseConditions(self::$js_unique_id,$conditions,
true);
2077 $all_done_opt = $this->
parseConditions(self::$js_unique_id,$conditions,
false);
2079 if(!$all_done_obl || !$all_done_opt)
2081 $this->tpl->setCurrentBlock(
"preconditions_toggle");
2082 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_INTRO", $this->lng->txt(
"precondition_toggle"));
2083 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt(
"show"));
2084 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_ID", self::$js_unique_id);
2085 $this->tpl->setVariable(
"TXT_PRECONDITION_SHOW", $this->lng->txt(
"show"));
2086 $this->tpl->setVariable(
"TXT_PRECONDITION_HIDE", $this->lng->txt(
"hide"));
2087 $this->tpl->parseCurrentBlock();
2100 function insertCommand($a_href, $a_text, $a_frame =
"", $a_img =
"", $a_cmd =
"", $a_onclick =
"")
2103 $chksum = md5($a_href.$a_text);
2104 if($a_href ==
"#" ||
2105 !in_array($chksum, $this->prevent_duplicate_commands))
2109 $this->prevent_duplicate_commands[] = $chksum;
2112 $prevent_background_click =
false;
2113 if ($a_cmd ==
'mount_webfolder')
2115 $prevent_background_click =
true;
2118 if ($a_cmd ==
"downloadFolder")
2120 include_once
"Services/BackgroundTask/classes/class.ilFolderDownloadBackgroundTaskHandler.php";
2128 $this->current_selection_list->addItem($a_text,
"", $a_href, $a_img, $a_text, $a_frame,
2129 "", $prevent_background_click, $a_onclick);
2142 if ($this->std_cmd_only)
2155 $this->adm_commands_included =
true;
2163 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2164 $this->container_obj->object->getRefId());
2165 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2166 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"delete");
2167 $this->
insertCommand($cmd_link, $this->lng->txt(
"delete"),
"",
2169 $this->adm_commands_included =
true;
2182 global $objDefinition;
2184 if ($this->std_cmd_only)
2191 !$objDefinition->allowLink($this->type))
2204 $this->adm_commands_included =
true;
2211 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2212 $this->container_obj->object->getRefId());
2213 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2214 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"link");
2215 $this->
insertCommand($cmd_link, $this->lng->txt(
"link"),
"",
2217 $this->adm_commands_included =
true;
2231 if ($this->std_cmd_only)
2244 $this->adm_commands_included =
true;
2254 $this->container_obj->object)
2256 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2257 $this->container_obj->object->getRefId());
2258 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2260 if(!$a_to_repository)
2262 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut");
2263 $this->
insertCommand($cmd_link, $this->lng->txt(
"move"),
"",
2268 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut_for_repository");
2269 $this->
insertCommand($cmd_link, $this->lng->txt(
"wsp_move_to_repository"),
"",
2273 $this->adm_commands_included =
true;
2284 global $objDefinition;
2286 if($this->std_cmd_only)
2292 $objDefinition->allowCopy($this->type))
2294 if($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING)
2296 $this->ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id',$this->
getCommandId());
2297 $cmd_copy = $this->ctrl->getLinkTargetByClass(
'ilobjectcopygui',
'initTargetSelection');
2302 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2303 $this->container_obj->object->getRefId());
2304 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2306 if(!$a_to_repository)
2308 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy');
2313 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
2314 $this->
insertCommand($cmd_copy, $this->lng->txt(
'wsp_copy_to_repository'));
2318 $this->adm_commands_included =
true;
2329 global $ilAccess, $objDefinition;
2331 if ($this->std_cmd_only)
2348 $this->adm_commands_included =
true;
2365 if ($this->std_cmd_only)
2370 if((
int)$ilSetting->get(
'disable_my_offers'))
2377 if ($ilUser->getId() != ANONYMOUS_USER_ID)
2380 if(is_object($this->container_obj) &&
2382 is_object($this->container_obj->object))
2384 $this->ctrl->setParameter($this->container_obj,
"ref_id", $this->container_obj->object->getRefId());
2387 if (!$ilUser->isDesktopItem($this->getCommandId(),
$type))
2391 if ($this->
checkCommandAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id))
2395 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2396 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2397 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"addToDesk");
2398 $this->
insertCommand($cmd_link, $this->lng->txt(
"to_desktop"),
"",
2407 $this->ctrl->setParameter($this->container_obj,
"type",
$type);
2408 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2409 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"removeFromDesk");
2410 $this->
insertCommand($cmd_link, $this->lng->txt(
"unsubscribe"),
"",
2422 if ($this->std_cmd_only)
2428 $this->
insertCommand($cmd_link, $this->lng->txt(
"info_short"), $cmd_frame,
2442 if ($this->std_cmd_only ||
2443 ($ilUser->getId() == ANONYMOUS_USER_ID))
2447 $lng->loadLanguageModule(
"notes");
2448 $lng->loadLanguageModule(
"tagging");
2452 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2456 if($this->reference_ref_id)
2461 $js_updater = $a_header_actions
2462 ?
"il.Object.redrawActionHeader();" 2463 :
"il.Object.redrawListItem(".$note_ref_id.
")";
2468 $this->
insertCommand(
"#", $this->lng->txt(
"notes_comments"), $cmd_frame,
2472 if($this->notes_enabled)
2474 $this->
insertCommand(
"#", $this->lng->txt(
"notes"), $cmd_frame,
2478 if ($this->tags_enabled)
2480 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2482 $this->
insertCommand(
"#", $this->lng->txt(
"tagging_set_tag"), $cmd_frame,
2494 if ($this->std_cmd_only || !$this->container_obj->object)
2500 $parent_type = $this->container_obj->object->getType();
2503 if($this->reference_ref_id)
2505 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->reference_ref_id);
2511 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'cadh',
2513 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'parent_id',
2515 $cmd_lnk = $this->ctrl->getLinkTargetByClass(
array($this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui'),
2518 $this->
insertCommand($cmd_lnk, $this->lng->txt(
'obj_activation_list_gui'));
2521 if($this->reference_ref_id)
2523 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'ref_id', $this->ref_id);
2535 $a_asynch_url =
"", $a_header_actions =
false)
2544 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2546 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2547 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2548 if ($a_header_actions)
2550 $this->current_selection_list->setListTitle(
"<span class='hidden-xs'>".$lng->txt(
"actions").
"</span>");
2554 $this->current_selection_list->setListTitle(
"");
2556 $this->current_selection_list->setId(
"act_".$this->
getUniqueItemId(
false));
2557 $this->current_selection_list->setSelectionHeaderClass(
"small");
2558 $this->current_selection_list->setItemLinkClass(
"xsmall");
2559 $this->current_selection_list->setLinksMode(
"il_ContainerItemCommand2");
2561 $this->current_selection_list->setUseImages(
false);
2562 $this->current_selection_list->setAdditionalToggleElement($this->
getUniqueItemId(
true),
"ilContainerListItemOuterHighlight");
2564 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id", $this->ref_id);
2567 $only_default =
false;
2568 if ($a_use_asynch && !$a_get_asynch_commands)
2570 $only_default =
true;
2573 $this->default_command =
false;
2574 $this->prevent_duplicate_commands =
array();
2577 $valid_header_commands =
array(
"mount_webfolder");
2579 $commands = $this->
getCommands($this->ref_id, $this->obj_id);
2580 foreach($commands as $command)
2582 if($a_header_actions && !in_array($command[
"cmd"], $valid_header_commands))
2587 if ($command[
"granted"] ==
true )
2589 if (!$command[
"default"] ===
true)
2591 if (!$this->std_cmd_only && !$only_default)
2597 $cmd_link = $command[
"link"];
2598 $txt = ($command[
"lang_var"] ==
"")
2600 : $this->lng->txt($command[
"lang_var"]);
2602 $command[
"frame"], $command[
"img"], $command[
"cmd"]);
2611 elseif($command[
"default"] ===
true)
2613 $items =& $command[
"access_info"];
2614 foreach ($items as $item)
2629 if (is_array($this->cust_commands))
2631 foreach ($this->cust_commands as $command)
2633 $this->
insertCommand($command[
"link"], $this->lng->txt($command[
"lang_var"]),
2634 $command[
"frame"],
"", $command[
"cmd"], $command[
"onclick"]);
2647 if($this->timings_enabled)
2653 if ($this->delete_enabled)
2659 if ($this->link_enabled)
2665 if ($this->cut_enabled)
2671 if ($this->copy_enabled)
2677 if ($this->repository_transfer_enabled)
2684 if ($this->subscribe_enabled)
2690 if ($this->multi_download_enabled && $a_header_actions)
2696 if($this->cut_enabled
or $this->link_enabled)
2710 if(!$a_header_actions)
2712 $this->ctrl->clearParametersByClass($this->gui_class_name);
2719 if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions)
2721 if ($ilUser->getId() == ANONYMOUS_USER_ID && $this->type ==
"cat")
2723 include_once(
"./Services/Container/classes/class.ilContainer.php");
2724 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
2735 if ($a_use_asynch && $a_get_asynch_commands)
2737 return $this->current_selection_list->getHTML(
true);
2740 return $this->current_selection_list->getHTML();
2753 if($ilSetting->get(
"disable_comments"))
2758 $this->comments_enabled = (bool)$a_value;
2759 $this->comments_settings_enabled = (bool)$a_enable_comments_settings;
2772 if($ilSetting->get(
"disable_notes"))
2777 $this->notes_enabled = (bool)$a_value;
2788 if (!$tags_set->get(
"enable"))
2792 $this->tags_enabled = (bool)$a_value;
2805 $this->rating_enabled = (bool)$a_value;
2807 if($this->rating_enabled)
2809 $this->rating_categories_enabled = (bool)$a_categories;
2810 $this->rating_text = $a_text;
2811 $this->rating_ctrl_path = $a_ctrl_path;
2823 if (!$folder_set->get(
"enable_multi_download"))
2827 $this->multi_download_enabled = (bool)$a_value;
2832 global $ilAccess, $objDefinition;
2834 if ($this->std_cmd_only)
2846 $cmd =
$_GET[
"cmd"] ==
"enableMultiDownload" ?
"render" :
"enableMultiDownload";
2848 $this->
insertCommand($cmd_link, $this->lng->txt(
"download_multiple_objects"));
2862 if (in_array($this->type,
array(
"file",
"fold")) &&
2863 $ilAccess->checkAccess(
"read",
"", $a_ref_id, $this->type))
2865 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2869 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2874 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2886 static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl = null)
2890 if (is_null($a_tpl))
2897 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2903 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2909 $a_tpl->addOnLoadCode(
"il.Object.setRedrawAHUrl('".
2910 $a_redraw_url.
"');");
2922 $this->sub_obj_type =
$a_type;
2923 $this->sub_obj_id = (int)$a_id;
2935 function addHeaderIcon($a_id, $a_img, $a_tooltip = null, $a_onclick = null, $a_status_text = null, $a_href = null)
2937 $this->header_icons[$a_id] =
array(
"img" => $a_img,
2938 "tooltip" => $a_tooltip,
2939 "onclick" => $a_onclick,
2940 "status_text" => $a_status_text,
2951 $this->header_icons[$a_id] = $a_html;
2961 $this->header_icons[$a_id] =
array(
"glyph" => $a_glyph,
"onclick" => $a_onclick);
2966 $this->ajax_hash = $a_hash;
2978 $htpl =
new ilTemplate(
"tpl.header_action.html",
true,
true,
"Services/Repository");
2980 $redraw_js =
"il.Object.redrawActionHeader();";
2983 if($this->tags_enabled)
2985 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
2988 if (count(
$tags) > 0)
2990 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2991 $lng->loadLanguageModule(
"tagging");
2998 $f = $this->ui->factory();
3000 ->withCounter($f->counter()->status((
int) count(
$tags))),
3008 if($this->notes_enabled || $comments_enabled)
3010 include_once(
"./Services/Notes/classes/class.ilNote.php");
3011 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
3023 $f = $this->ui->factory();
3025 ->withCounter($f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PRIVATE])),
3032 $lng->loadLanguageModule(
"notes");
3040 $f = $this->ui->factory();
3042 ->withCounter($f->counter()->status((
int) $cnt[$this->obj_id][
IL_NOTE_PUBLIC])),
3049 if($this->rating_enabled)
3051 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
3053 $rating_gui->enableCategories($this->rating_categories_enabled);
3055 $rating_gui->setObject($this->obj_id, $this->type);
3056 if($this->rating_text)
3058 $rating_gui->setYourRatingText($this->rating_text);
3061 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"cadh", $this->ajax_hash);
3062 $this->ctrl->setParameterByClass(
"ilRatingGUI",
"rnsb",
true);
3063 if($this->rating_ctrl_path)
3065 $rating_gui->setCtrlPath($this->rating_ctrl_path);
3066 $ajax_url = $this->ctrl->getLinkTargetByClass($this->rating_ctrl_path,
"saveRating",
"",
true,
false);
3071 $ajax_url = $this->ctrl->getLinkTargetByClass(
"ilRatingGUI",
"saveRating",
"",
true,
false);
3073 $tpl->addOnLoadCode(
"il.Object.setRatingUrl('".$ajax_url.
"');");
3076 $rating_gui->getHtml(
true,
3077 $this->checkCommandAccess(
"read",
"", $this->ref_id, $this->type),
3078 "il.Object.saveRating(%rating%);"));
3081 if($this->header_icons)
3083 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
3086 foreach($this->header_icons as $id => $attr)
3094 if ($attr[
"onclick"])
3096 $htpl->setCurrentBlock(
"prop_glyph_oc");
3097 $htpl->setVariable(
"GLYPH_ONCLICK", $attr[
"onclick"]);
3098 $htpl->parseCurrentBlock();
3100 $renderer = $this->ui->renderer();
3101 $html = $renderer->render($attr[
"glyph"]);
3102 $htpl->setCurrentBlock(
"prop_glyph");
3103 $htpl->setVariable(
"GLYPH",
$html);
3104 $htpl->parseCurrentBlock();
3108 if ($attr[
"onclick"])
3110 $htpl->setCurrentBlock(
"onclick");
3111 $htpl->setVariable(
"PROP_ONCLICK", $attr[
"onclick"]);
3112 $htpl->parseCurrentBlock();
3115 if ($attr[
"status_text"])
3117 $htpl->setCurrentBlock(
"status");
3118 $htpl->setVariable(
"PROP_TXT", $attr[
"status_text"]);
3119 $htpl->parseCurrentBlock();
3124 $attr[
"href"] =
"#";
3127 $htpl->setCurrentBlock(
"prop");
3128 $htpl->setVariable(
"PROP_ID", $id);
3129 $htpl->setVariable(
"IMG",
ilUtil::img($attr[
"img"]));
3130 $htpl->setVariable(
"PROP_HREF", $attr[
"href"]);
3131 $htpl->parseCurrentBlock();
3133 if ($attr[
"tooltip"])
3147 $htpl->setVariable(
"PROP_CHUNKS",
3148 implode(
" ", $chunks).
" ");
3152 $htpl->setVariable(
"ACTION_DROP_DOWN",
3155 return $htpl->get();
3165 $script = substr(strrchr(
$_SERVER[
"PHP_SELF"],
"/"),1);
3168 if ((strtolower(
$_GET[
"baseClass"]) !=
"ilrepositorygui") &&
3169 is_int(strpos($a_link,
"baseClass=ilRepositoryGUI")))
3171 if ($this->type !=
"frm")
3183 if($this->default_command_params)
3186 foreach($this->default_command_params as $name => $value)
3194 if(!stristr($a_default_link,
'?'))
3196 $a_default_link = ($a_default_link.
'?'.
$params);
3200 $a_default_link = ($a_default_link.
'&'.
$params);
3203 return $a_default_link;
3213 if (strstr($a_link,
'ilSAHSPresentationGUI') && !$this->offline_mode)
3215 include_once
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
3217 $om = $sahs_obj->getOpenMode();
3218 $width = $sahs_obj->getWidth();
3219 $height = $sahs_obj->getHeight();
3220 if ( ($om == 5 || $om == 1) && $width > 0 && $height > 0) $om++;
3221 if ($om != 0 && !$DIC[
'ilBrowser']->isMobile())
3223 $this->default_command[
"frame"]=
"";
3224 $a_link =
"javascript:void(0); onclick=startSAHS('".$a_link.
"','".$wtarget.
"',".$om.
",".$width.
",".$height.
");";
3239 include_once
'Services/Tree/classes/class.ilPathGUI.php';
3241 $path_gui->enableTextOnly(!$this->path_linked);
3242 $path_gui->setUseImages(
false);
3244 $start_node = $this->path_start_node
3245 ? $this->path_start_node
3248 $this->tpl->setCurrentBlock(
"path_item");
3249 $this->tpl->setVariable(
'PATH_ITEM',$path_gui->getPath($start_node,$this->ref_id));
3250 $this->tpl->parseCurrentBlock();
3252 $this->tpl->setCurrentBlock(
"path");
3253 $this->tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"locator"));
3254 $this->tpl->parseCurrentBlock();
3276 global
$lng, $objDefinition;
3281 $this->tpl->setCurrentBlock(
"check");
3282 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3283 $this->tpl->parseCurrentBlock();
3288 $this->tpl->setCurrentBlock(
"check_download");
3290 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3292 $this->tpl->setVariable(
"VAL_VISIBILITY",
"visibility: hidden;\" disabled=\"disabled");
3293 $this->tpl->parseCurrentBlock();
3298 $this->tpl->setCurrentBlock(
'expand');
3302 $this->ctrl->setParameter($this->container_obj,
'expand',-1 * $this->obj_id);
3304 $this->tpl->setVariable(
'EXP_HREF',$this->ctrl->getLinkTarget($this->container_obj,
'view',$this->getUniqueItemId(
true)));
3305 $this->ctrl->clearParameters($this->container_obj);
3307 $this->tpl->setVariable(
'EXP_ALT',$this->lng->txt(
'collapse'));
3311 $this->ctrl->setParameter($this->container_obj,
'expand',$this->obj_id);
3313 $this->tpl->setVariable(
'EXP_HREF',$this->ctrl->getLinkTarget($this->container_obj,
'view',$this->getUniqueItemId(
true)));
3314 $this->ctrl->clearParameters($this->container_obj);
3316 $this->tpl->setVariable(
'EXP_ALT',$this->lng->txt(
'expand'));
3319 $this->tpl->parseCurrentBlock();
3327 $this->tpl->touchBlock(
"i_1");
3331 if ($this->title_link_disabled || !$this->default_command || (!$this->
getCommandsStatus() && !$this->restrict_to_goto))
3336 $this->tpl->setCurrentBlock(
"icon_link_s");
3338 if ($this->default_command[
"frame"] !=
"")
3340 $this->tpl->setVariable(
"ICON_TAR",
"target='".$this->default_command[
"frame"].
"'");
3343 $this->tpl->setVariable(
"ICON_HREF",
3344 $this->default_command[
"link"]);
3345 $this->tpl->parseCurrentBlock();
3346 $this->tpl->touchBlock(
"icon_link_e");
3349 $this->tpl->setCurrentBlock(
"icon");
3350 if (!$objDefinition->isPlugin($this->getIconImageType()))
3352 $this->tpl->setVariable(
"ALT_ICON", $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$this->
getIconImageType()));
3356 include_once(
"Services/Component/classes/class.ilPlugin.php");
3357 $this->tpl->setVariable(
"ALT_ICON", $lng->txt(
"icon").
" ".
3361 $this->tpl->setVariable(
"SRC_ICON",
3363 $this->tpl->parseCurrentBlock();
3367 $this->tpl->touchBlock(
"d_".$cnt);
3375 foreach ($this->sub_item_html as $sub_html)
3377 $this->tpl->setCurrentBlock(
"subitem");
3378 $this->tpl->setVariable(
"SUBITEM", $sub_html);
3379 $this->tpl->parseCurrentBlock();
3388 if ($this->position_enabled)
3390 $this->tpl->setCurrentBlock(
"position");
3391 $this->tpl->setVariable(
"POS_ID", $this->position_field_index);
3392 $this->tpl->setVariable(
"POS_VAL", $this->position_value);
3393 $this->tpl->parseCurrentBlock();
3403 return $this->adm_commands_included;
3412 if($this->acache->getLastAccessStatus() ==
"miss" &&
3413 !$this->prevent_access_caching)
3415 $this->acache->storeEntry($ilUser->getId().
":".
$this->ref_id,
3435 $a_use_asynch =
false, $a_get_asynch_commands =
false, $a_asynch_url =
"")
3441 $this->adm_commands_included =
false;
3447 $ilBench->start(
"ilObjectListGUI",
"1000_getListHTML_init$type");
3448 $this->
initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
3449 $ilBench->stop(
"ilObjectListGUI",
"1000_getListHTML_init$type");
3452 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
3453 if($this->context == self::CONTEXT_REPOSITORY)
3463 if ($a_use_asynch && $a_get_asynch_commands)
3468 if($this->rating_enabled)
3475 $rating->setObject($this->obj_id, $this->type);
3484 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3492 include_once(
"Services/Object/classes/class.ilListItemAccessCache.php");
3494 $cres = $this->acache->getEntry($ilUser->getId().
":".$a_ref_id);
3495 if($this->acache->getLastAccessStatus() ==
"hit")
3497 $this->access_cache = unserialize($cres);
3508 $ilBench->stop(
"ilObjectListGUI",
"2000_getListHTML_check_visible");
3522 $this->tpl =
new ilTemplate(static::$tpl_file_name,
true,
true,
3523 static::$tpl_component,
"DEFAULT",
false,
true);
3529 $this->tpl->setVariable(
"COMMAND_SELECTION_LIST",
3530 $this->
insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url));
3559 $ilBench->start(
"ilObjectListGUI",
"6000_insert_properties$type");
3564 $ilBench->stop(
"ilObjectListGUI",
"6000_insert_properties$type");
3567 $ilBench->start(
"ilObjectListGUI",
"6500_insert_notice_properties$type");
3572 $ilBench->stop(
"ilObjectListGUI",
"6500_insert_notice_properties$type");
3575 $ilBench->start(
"ilObjectListGUI",
"7000_insert_preconditions");
3580 $ilBench->stop(
"ilObjectListGUI",
"7000_insert_preconditions");
3583 $ilBench->start(
"ilObjectListGUI",
"8000_insert_path");
3585 $ilBench->stop(
"ilObjectListGUI",
"8000_insert_path");
3587 $ilBench->start(
"ilObjectListGUI",
"8500_item_detail_links");
3592 $ilBench->stop(
"ilObjectListGUI",
"8500_item_detail_links");
3611 $this->tpl->setVariable(
"DIV_CLASS",
'ilContainerListItemOuter');
3612 $this->tpl->setVariable(
"DIV_ID",
'id = "'.$this->
getUniqueItemId(
true).
'"');
3618 return $this->tpl->get();
3627 $this->cust_prop =
array();
3628 $this->cust_commands =
array();
3629 $this->sub_item_html =
array();
3630 $this->position_enabled =
false;
3640 $this->parent_ref_id = $a_ref_id;
3652 $id_ref = ($this->reference_ref_id > 0)
3653 ? $this->reference_ref_id
3657 if($this->condition_depth)
3659 $id_ref .=
"_pc".$this->condition_depth;
3663 $id_ref .=
"_pref_".$this->parent_ref_id;
3672 return "lg_div_".$id_ref;
3699 $this->bold_title = $a_bold_title;
3723 if($a_context == self::CONTEXT_REPOSITORY)
3725 $active_notes = !$ilSetting->get(
"disable_notes");
3726 $active_comments = !$ilSetting->get(
"disable_comments");
3728 if($active_notes || $active_comments)
3730 include_once(
"./Services/Notes/classes/class.ilNote.php");
3733 if($active_comments)
3740 if($ilSetting->get(
'comments_tagging_in_lists'))
3742 if($active_notes || $active_comments)
3746 $lng->loadLanguageModule(
"notes");
3750 if($tags_set->get(
"enable"))
3752 $all_users = $tags_set->get(
"enable_all_users");
3754 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
3755 if(!$ilSetting->get(
'comments_tagging_in_lists_tags'))
3761 $tag_user_id = null;
3764 $tag_user_id = $ilUser->getId();
3769 $lng->loadLanguageModule(
"tagging");
3773 $lng->loadLanguageModule(
"rating");
3776 self::$preload_done =
true;
3791 if($this->comments_enabled)
3793 if(!$this->comments_settings_enabled)
3803 if(!$a_header_actions && self::$preload_done)
3805 if(self::$comments_activation[$a_obj_id][
$a_type])
3812 include_once(
"./Services/Notes/classes/class.ilNote.php");
3831 $this->timings_enabled = (bool)$a_status;
3842 include_once(
"./Services/FileUpload/classes/class.ilFileUploadUtil.php");
3851 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
3856 $this->tpl->setCurrentBlock(
"fileupload");
3857 $this->tpl->setVariable(
"FILE_UPLOAD", $upload->getHTML());
3858 $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 _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.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$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
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
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.
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)
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
const DOWNLOAD_CHECKBOX_NONE
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. ...
addCustomCommand($a_link, $a_lang_var, $a_frame="", $onclick="")
add a custom command
resetCustomData()
reset properties and commands
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 getListGUIStatus($a_obj_id)
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 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 _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 sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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)
for($col=0; $col< 50; $col++) $d
static $comments_activation
insertDeleteCommand()
insert cut command
static getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
static initJavascript($a_ajax_url)
Init javascript.
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.
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 initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE)
Init javascript.
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
redirection script todo: (a better solution should control the processing via a xml file) ...
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...
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
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
addCustomProperty($a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
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
$notice_properties_enabled
insertCommands($a_use_asynch=false, $a_get_asynch_commands=false, $a_asynch_url="", $a_header_actions=false)
insert all commands into html code
getAlertProperties()
get all alert properties
static getObjectListAction($a_ref_id)
Get object list action.
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.
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
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)
getHeaderAction()
Get header action.
enableTimings($a_status)
enable timings link
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.
insertCutCommand($a_to_repository=false)
insert cut command
insertSubstitutions()
Insert substitutions.