4 define (
"IL_LIST_AS_TRIGGER",
"trigger");
5 define (
"IL_LIST_FULL",
"full");
106 $this->rbacsystem = $rbacsystem;
107 $this->ilias = $ilias;
111 $this->path_enabled =
false;
120 include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
123 $lng->loadLanguageModule(
"obj");
135 $this->container_obj =& $container_obj;
147 return $this->container_obj;
159 $this->static_link_enabled =
true;
160 $this->delete_enabled =
true;
161 $this->cut_enabled =
true;
162 $this->subscribe_enabled =
true;
163 $this->link_enabled =
false;
164 $this->copy_enabled =
false;
165 $this->payment_enabled =
false;
166 $this->progress_enabled =
false;
167 $this->notice_properties_enabled =
true;
168 $this->info_screen_enabled =
false;
170 $this->gui_class_name =
"";
173 include_once(
'./Services/Object/classes/class.ilObjectAccess.php');
186 $this->properties_enabled = $a_status;
208 $this->preconditions_enabled = $a_status;
226 $this->notice_properties_enabled = $a_status;
248 $this->description_enabled = $a_status;
282 $this->search_fragment_enabled = $a_status;
294 $this->path_linked = $a_status;
312 $this->enabled_relevance = $a_status;
322 $this->relevance = $a_rel;
342 $this->icons_enabled = $a_status;
362 $this->checkboxes_enabled = $a_status;
382 $this->expand_enabled = $a_status;
397 $this->is_expanded = $a_status;
412 $this->position_enabled =
true;
413 $this->position_field_index = $a_field_index;
414 $this->position_value = $a_position_value;
425 $this->delete_enabled = $a_status;
437 return $this->delete_enabled;
448 $this->cut_enabled = $a_status;
459 return $this->cut_enabled;
470 $this->copy_enabled = $a_status;
492 $this->subscribe_enabled = $a_status;
503 return $this->subscribe_enabled;
513 $this->payment_enabled = $a_status;
524 return $this->payment_enabled;
534 $this->link_enabled = $a_status;
545 return $this->link_enabled;
556 $this->path_enabled = $a_path;
566 return $this->path_enabled;
577 $this->commands_enabled = $a_status;
578 $this->std_cmd_only = $a_std_only;
598 $this->info_screen_enabled = $a_info_screen;
608 $this->sub_item_html[] = $a_html;
630 $this->progress_enabled = $a_status;
654 $this->substitutions_enabled = $a_status;
678 $this->item_detail_links_enabled = $a_status;
701 $this->item_detail_links = $a_detail_links;
702 $this->item_detail_links_intro = $a_intro_txt;
714 if(!count($this->item_detail_links))
718 if(strlen($this->item_detail_links_intro))
720 $this->tpl->setCurrentBlock(
'item_detail_intro');
721 $this->tpl->setVariable(
'ITEM_DETAIL_INTRO_TXT',$this->item_detail_links_intro);
722 $this->tpl->parseCurrentBlock();
725 foreach($this->item_detail_links as $info)
727 $this->tpl->setCurrentBlock(
'item_detail_link');
728 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_TARGET',$info[
'target']);
729 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_DESC',$info[
'desc']);
730 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_HREF',$info[
'link']);
731 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_NAME',$info[
'name']);
732 $this->tpl->parseCurrentBlock();
734 $this->tpl->setCurrentBlock(
'item_detail_links');
735 $this->tpl->parseCurrentBlock();
746 $this->title = $a_title;
765 $this->description = $a_description;
775 return $this->description;
785 $this->search_fragment = $a_text;
804 $this->separate_commands = $a_val;
837 $this->additional_information = $a_val;
859 $this->details_level = $a_level;
878 $this->repository_transfer_enabled = (bool)$a_value;
888 $this->restrict_to_goto = (bool)$a_value;
906 $cache_prefix = null;
907 if($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING)
909 $cache_prefix =
"wsp";
910 if(!$this->ws_access)
912 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
917 if (isset($this->access_cache[$a_permission][
"-".$a_cmd][$cache_prefix.$a_ref_id]))
919 return $this->access_cache[$a_permission][
"-".$a_cmd][$cache_prefix.$a_ref_id];
922 if($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SHOP)
924 $access = $ilAccess->checkAccess($a_permission,$a_cmd,$a_ref_id,$a_type,$a_obj_id);
925 if ($ilAccess->getPreventCachingLastResult())
927 $this->prevent_access_caching =
true;
932 $access = $this->ws_access->checkAccess($a_permission,$a_cmd,$a_ref_id,$a_type);
935 $this->access_cache[$a_permission][
"-".$a_cmd][$cache_prefix.$a_ref_id] = $access;
948 function initItem($a_ref_id, $a_obj_id, $a_title =
"", $a_description =
"", $a_context = self::CONTEXT_REPOSITORY)
950 $this->access_cache = array();
951 $this->ref_id = $a_ref_id;
952 $this->obj_id = $a_obj_id;
953 $this->context = $a_context;
956 #$this->description = $a_description;
959 $this->adm_commands_included =
false;
960 $this->prevent_access_caching =
false;
974 if($this->static_link_enabled)
976 include_once(
'./Services/Link/classes/class.ilLink.php');
979 $command[
'link'] = $link;
980 $command[
'frame'] =
'_top';
1001 if($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SHOP)
1004 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1007 require_once (
'Services/WebDAV/classes/class.ilDAVServer.php');
1014 return $davServer->getMountURI($this->ref_id).
1015 '" folder="'.$davServer->getFolderURI($this->ref_id);
1019 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
getCommandId());
1020 $cmd_link = $this->ctrl->getLinkTargetByClass(
"ilrepositorygui", $a_cmd);
1021 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1032 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id",
"");
1033 $this->ctrl->setParameterByClass($this->gui_class_name,
"wsp_id", $this->ref_id);
1034 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1051 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1057 if($a_cmd ==
'fileManagerLaunch')
1092 global $objDefinition;
1102 if($this->context == self::CONTEXT_REPOSITORY)
1105 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1108 require_once (
'Services/WebDAV/classes/class.ilDAVServer.php');
1109 global $ilias,
$lng;
1112 require_once(
'Services/WebDAV/classes/class.ilDAVLocks.php');
1114 if ($ilias->account->getId() != ANONYMOUS_USER_ID)
1116 $locks =& $davLocks->getLocksOnObjectObj($this->obj_id);
1117 if (count($locks) > 0)
1119 $lockUser =
new ilObjUser($locks[0][
'ilias_owner']);
1123 "property" => $lng->txt(
"in_use_by"),
1124 "value" => $lockUser->getLogin(),
1125 "link" =>
"./ilias.php?user=".$locks[0][
'ilias_owner'].
'&cmd=showUserProfile&cmdClass=ilpersonaldesktopgui&cmdNode=1&baseClass=ilPersonalDesktopGUI',
1137 if (preg_match(
'/^(\\.|\\.\\.)$/', $this->title))
1139 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1140 "value" => $lng->txt(
"filename_special_filename"),
1141 'propertyNameVisible' =>
false);
1143 else if (preg_match(
'/^\\./', $this->title))
1145 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_visibility"),
1146 "value" => $lng->txt(
"filename_hidden_unix_file"),
1147 'propertyNameVisible' =>
false);
1149 else if (preg_match(
'/~$/', $this->title))
1151 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_visibility"),
1152 "value" => $lng->txt(
"filename_hidden_backup_file"),
1153 'propertyNameVisible' =>
false);
1155 else if (preg_match(
'/[\\/]/', $this->title))
1157 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1158 "value" => $lng->txt(
"filename_special_characters"),
1159 'propertyNameVisible' =>
false);
1161 else if (preg_match(
'/[\\\\\\/:*?"<>|]/', $this->title))
1163 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1164 "value" => $lng->txt(
"filename_windows_special_characters"),
1165 'propertyNameVisible' =>
false);
1167 else if (preg_match(
'/\\.$/', $this->title))
1169 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1170 "value" => $lng->txt(
"filename_windows_empty_extension"),
1171 'propertyNameVisible' =>
false);
1173 else if (preg_match(
'/^(\\.|\\.\\.)$/', $this->title))
1175 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1176 "value" => $lng->txt(
"filename_special_filename"),
1177 'propertyNameVisible' =>
false);
1179 else if (preg_match(
'/#/', $this->title))
1181 $props[] = array(
"alert" =>
false,
"property" => $lng->txt(
"filename_interoperability"),
1182 "value" => $lng->txt(
"filename_windows_webdav_issue"),
1183 'propertyNameVisible' =>
false);
1189 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1193 if ($ilias->account->getId() != ANONYMOUS_USER_ID)
1199 $isContainer = in_array($this->type, array(
'cat',
'fold',
'crs',
'grp'));
1207 "value" => $lng->txt(
'state_changed_inside'),
1208 'propertyNameVisible' =>
false);
1216 elseif($this->type ==
"file")
1223 "value" => $lng->txt(($state == 1) ?
'state_unread' :
'state_changed'),
1224 'propertyNameVisible' =>
false);
1239 $a_alert =
false, $a_newline =
false)
1241 $this->cust_prop[] = array(
"property" => $a_property,
"value" => $a_value,
1242 "alert" => $a_alert,
"newline" => $a_newline);
1250 if (is_array($this->cust_prop))
1252 foreach($this->cust_prop as $prop)
1269 if($prop[
'alert'] ==
true)
1282 $this->notice_prop = array();
1283 if($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true))
1285 foreach($infos as $info)
1287 $this->notice_prop[] = array(
'value' => $info);
1290 return $this->notice_prop ? $this->notice_prop : array();
1297 $this->cust_commands[] =
1298 array(
"link" => $a_link,
"lang_var" => $a_lang_var,
1299 "frame" => $a_frame,
"onclick" => $onclick);
1308 $this->force_visible_only = $a_stat;
1347 $ref_commands = array();
1348 foreach($this->commands as $command)
1350 $permission = $command[
"permission"];
1351 $cmd = $command[
"cmd"];
1352 $lang_var = $command[
"lang_var"];
1354 $info_object = null;
1356 if (isset($command[
"txt"]))
1358 $txt = $command[
"txt"];
1364 if ($ilias->account->getId() == ANONYMOUS_USER_ID &&
1365 $command[
'enable_anonymous'] ==
'false')
1373 $ilBench->start(
"ilObjectListGUI",
"4110_get_commands_check_access");
1376 $ilBench->stop(
"ilObjectListGUI",
"4110_get_commands_check_access");
1383 $access_granted =
true;
1387 $access_granted =
false;
1388 $info_object = $ilAccess->getInfo();
1391 if (!isset($command[
"default"]))
1393 $command[
"default"] =
"";
1395 $ref_commands[] = array(
1396 "permission" => $permission,
1398 "link" => $cmd_link,
1399 "frame" => $cmd_frame,
1400 "lang_var" => $lang_var,
1402 "granted" => $access_granted,
1403 "access_info" => $info_object,
1404 "img" => $cmd_image,
1405 "default" => $command[
"default"]
1409 return $ref_commands;
1435 if($this->restrict_to_goto)
1437 $this->default_command = array(
"frame" =>
"",
1441 if (!$this->default_command || (!$this->
getCommandsStatus() && !$this->restrict_to_goto))
1443 $this->tpl->setCurrentBlock(
"item_title");
1444 $this->tpl->setVariable(
"TXT_TITLE", $this->
getTitle());
1445 $this->tpl->parseCurrentBlock();
1449 $this->default_command[
"link"] =
1450 $this->
modifySAHSlaunch($this->default_command[
"link"],$this->default_command[
"frame"]);
1452 if ($this->default_command[
"frame"] !=
"")
1454 $this->tpl->setCurrentBlock(
"title_linked_frame");
1455 $this->tpl->setVariable(
"TARGET_TITLE_LINKED", $this->default_command[
"frame"]);
1456 $this->tpl->parseCurrentBlock();
1460 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1461 $this->default_command[
"link"] =
1464 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1468 $this->tpl->setCurrentBlock(
"item_title_linked");
1469 $this->tpl->setVariable(
"TXT_TITLE_LINKED", $this->
getTitle());
1470 $this->tpl->setVariable(
"HREF_TITLE_LINKED", $this->default_command[
"link"]);
1471 $this->tpl->parseCurrentBlock();
1474 if ($this->bold_title ==
true)
1476 $this->tpl->touchBlock(
'bold_title_start');
1477 $this->tpl->touchBlock(
'bold_title_end');
1483 switch($this->context)
1485 case self::CONTEXT_WORKSPACE_SHARING:
1486 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1503 $fields_shown =
false;
1504 foreach($this->substitutions->getParsedSubstitutions($this->ref_id,$this->obj_id) as
$data)
1508 $data[
'name'] =
'<strong>'.$data[
'name'].
'</strong>';
1509 $data[
'value'] =
'<strong>'.$data[
'value'].
'</strong>';
1511 $this->tpl->touchBlock(
"std_prop");
1512 $this->tpl->setCurrentBlock(
'item_property');
1513 if(
$data[
'show_field'])
1515 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1517 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1518 $this->tpl->parseCurrentBlock();
1520 if(
$data[
'newline'])
1522 $this->tpl->touchBlock(
'newline_prop');
1524 $fields_shown =
false;
1529 $this->tpl->touchBlock(
'newline_prop');
1546 if(!$this->substitutions->isDescriptionEnabled())
1552 $this->tpl->setCurrentBlock(
"item_description");
1554 $this->tpl->parseCurrentBlock();
1565 $this->tpl->setCurrentBlock(
'search_fragment');
1566 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT',$this->
getSearchFragment().
' ...');
1567 $this->tpl->parseCurrentBlock();
1586 $width2 = (int) (100 - $width1);
1588 $this->tpl->setCurrentBlock(
'relevance');
1589 #$this->tpl->setVariable('TXT_RELEVANCE',$lng->txt('search_relevance'));
1590 $this->tpl->setVariable(
'VAL_REL',sprintf(
"%.02f %%",$this->
getRelevance()));
1591 $this->tpl->setVariable(
'WIDTH_A',$width1);
1592 $this->tpl->setVariable(
'WIDTH_B',$width2);
1595 $this->tpl->parseCurrentBlock();
1606 $this->mode = $a_mode;
1624 $this->condition_depth = $a_depth;
1636 if ($a_mode == $this->mode)
1660 if ($this->ilias->account->getId() == ANONYMOUS_USER_ID)
1662 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id))
1664 $props[] = array(
"alert" =>
true,
1665 "value" => $lng->txt(
"no_access_item_public"),
1672 $note_obj_id = $this->obj_id;
1673 if($this->reference_ref_id)
1676 $note_obj_id = $this->reference_obj_id;
1679 $redraw_js =
"il.Object.redrawListItem(".$note_ref_id.
");";
1684 self::$cnt_tags[$note_obj_id] > 0) &&
1685 ($ilUser->getId() != ANONYMOUS_USER_ID))
1687 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
1688 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
1694 $props[] = array(
"alert" =>
false,
1695 "property" => $lng->txt(
"notes_comments"),
1696 "value" =>
"<a href='#' onclick=\"return ".
1703 if ($this->notes_enabled && self::$cnt_notes[$note_obj_id][
IL_NOTE_PRIVATE] > 0)
1705 $props[] = array(
"alert" =>
false,
1706 "property" => $lng->txt(
"notes"),
1707 "value" =>
"<a href='#' onclick=\"return ".
1713 if ($this->tags_enabled && self::$cnt_tags[$note_obj_id] > 0)
1716 if ($tags_set->get(
"enable"))
1718 $props[] = array(
"alert" =>
false,
1719 "property" => $lng->txt(
"tagging_tags"),
1720 "value" =>
"<a href='#' onclick=\"return ".
1722 self::$cnt_tags[$note_obj_id].
"</a>",
1730 if (is_array($props) && count($props) > 0)
1732 foreach($props as $prop)
1737 $this->tpl->touchBlock(
"separator_prop");
1741 if ($prop[
"alert"] ==
true)
1743 $this->tpl->touchBlock(
"alert_prop");
1747 $this->tpl->touchBlock(
"std_prop");
1749 if ($prop[
"newline"] ==
true && $cnt > 1)
1751 $this->tpl->touchBlock(
"newline_prop");
1754 if (isset($prop[
"property"]) && $prop[
'propertyNameVisible'] !==
false)
1757 $this->tpl->setCurrentBlock(
"prop_name");
1758 $this->tpl->setVariable(
"TXT_PROP", $prop[
"property"]);
1759 $this->tpl->parseCurrentBlock();
1761 $this->tpl->setCurrentBlock(
"item_property");
1765 $this->tpl->setVariable(
"LINK_PROP", $prop[
'link']);
1766 $this->tpl->setVariable(
"LINK_VAL_PROP", $prop[
"value"]);
1770 $this->tpl->setVariable(
"VAL_PROP", $prop[
"value"]);
1773 $this->tpl->parseCurrentBlock();
1777 $this->tpl->setCurrentBlock(
"item_properties");
1778 $this->tpl->parseCurrentBlock();
1785 foreach($this->notice_prop as $property)
1787 $this->tpl->setCurrentBlock(
'notice_item');
1788 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE',$property[
'value']);
1789 $this->tpl->parseCurrentBlock();
1791 $this->tpl->setCurrentBlock(
'notice_property');
1792 $this->tpl->parseCurrentBlock();
1803 global $ilAccess,$ilObjDataCache,
$ilUser;
1805 if(IS_PAYMENT_ENABLED && $this->payment_enabled)
1807 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
1808 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
1810 if(ilPaymentobject::_requiresPurchaseToAccess($this->ref_id))
1816 $order_infos = array();
1819 if(count($order_infos) > 0)
1823 $pay_lang->loadLanguageModule(
'payment');
1826 $a_property = $pay_lang->txt(
'object_purchased_date');
1833 $a_property = $this->lng->txt(
'object_duration');
1834 if($order_infos[
'duration'] == 0)
1835 $a_value = $pay_lang->txt(
'unlimited_duration');
1837 $a_value = $order_infos[
'duration'] .
' '.$this->lng->txt(
'months');
1844 $has_extension_prices =
true;
1853 $this->ctpl =
new ilTemplate(
"tpl.container_list_item_commands.html",
true,
true,
1854 "Services/Container",
"DEFAULT",
false,
true);
1855 $this->ctpl->setCurrentBlock(
'payment');
1857 $this->ctpl->setVariable(
'PAYMENT_ALT_IMG', $this->lng->txt(
'payment_system') .
': ' . $this->lng->txt(
'payment_buyable'));
1858 $this->ctpl->parseCurrentBlock();
1868 $commands = $this->
getCommands($this->ref_id, $this->obj_id);
1869 foreach($commands as $command)
1871 if($command[
'default'] ===
true)
1879 $command[
'link'] =
'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.$this->ref_id;
1883 $command[
'link'] =
'ilias.php?baseClass=ilLMPresentationGUI&ref_id='.$this->ref_id;
1887 $command[
'link'] =
'ilias.php?baseClass=ilShopController&cmdClass=ilshoppurchasegui&ref_id='.$this->ref_id;
1892 $type = $this->type;
1893 if(strpos($command[
'link'],
'_'.$type.
'_') !==
false)
1895 $demo_link = str_replace(
'_'.$type.
'_',
'_'.$type.
'purchasetypedemo_', $command[
'link']);
1896 $buy_link = str_replace(
'_'.$type.
'_',
'_'.$type.
'purchasetypebuy_', $command[
'link']);
1900 $demo_link = $command[
'link'].(strpos($command[
'link'],
'?') ===
false ?
'?' :
'&').
'purchasetype=demo';
1901 $buy_link = $command[
'link'].(strpos($command[
'link'],
'?') ===
false ?
'?' :
'&').
'purchasetype=buy';
1904 $this->current_selection_list->addItem($this->lng->txt(
'payment_demo'),
"", $demo_link, $a_img, $this->lng->txt(
'payment_demo'), $command[
'frame']);
1905 if($has_extension_prices ==
true)
1907 $this->current_selection_list->addItem($this->lng->txt(
'buy_extension'),
"", $buy_link, $a_img, $this->lng->txt(
'buy_extension'), $command[
'frame']);
1910 $this->current_selection_list->addItem($this->lng->txt(
'buy'),
"", $buy_link, $a_img, $this->lng->txt(
'buy'), $command[
'frame']);
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'];
1952 if(!$obligatory and
$ok)
1956 if($passed_optional >= $num_optional_required)
1963 foreach($conditions as $condition)
1965 if(!in_array($condition[
'id'], $visible_conditions))
1970 $cond_txt = $lng->txt(
"condition_".$condition[
"operator"]).
" ".
1971 $condition[
"value"];
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);
1989 $item_list_gui->addCustomProperty($this->lng->txt(
"precondition_required_itemlist"), $cond_txt,
false,
true);
1990 $trigger_html = $item_list_gui->getListItemHTML($condition[
'trigger_ref_id'],
1993 $this->tpl->setCurrentBlock(
"precondition");
1994 if ($trigger_html ==
"")
1996 $trigger_html = $this->lng->txt(
"precondition_not_accessible");
1998 $this->tpl->setVariable(
"TXT_CONDITION", trim($cond_txt));
1999 $this->tpl->setVariable(
"TRIGGER_ITEM", $trigger_html);
2000 $this->tpl->parseCurrentBlock();
2003 if ($missing_cond_exist and $obligatory)
2005 $this->tpl->setCurrentBlock(
"preconditions");
2006 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_obl_".$toggle_id);
2007 $this->tpl->setVariable(
"TXT_PRECONDITIONS", $lng->txt(
"preconditions_obligatory_hint"));
2008 $this->tpl->parseCurrentBlock();
2011 elseif($missing_cond_exist and !$obligatory)
2013 $this->tpl->setCurrentBlock(
"preconditions");
2014 $this->tpl->setVariable(
"CONDITION_TOGGLE_ID",
"_opt_".$toggle_id);
2015 $this->tpl->setVariable(
"TXT_PRECONDITIONS", sprintf($lng->txt(
"preconditions_optional_hint"),$num_optional_required));
2016 $this->tpl->parseCurrentBlock();
2019 return !$missing_cond_exist;
2027 global $ilAccess,
$lng, $objDefinition,$tree;
2029 include_once(
"./Services/AccessControl/classes/class.ilConditionHandler.php");
2031 $missing_cond_exist =
false;
2034 if ($this->condition_depth > 0)
2048 if(
sizeof($conditions))
2050 for($i = 0; $i < count($conditions); $i++)
2067 if(!$all_done_obl || !$all_done_opt)
2069 $this->tpl->setCurrentBlock(
"preconditions_toggle");
2070 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_INTRO", $this->lng->txt(
"precondition_toggle"));
2071 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt(
"show"));
2072 $this->tpl->setVariable(
"PRECONDITION_TOGGLE_ID", $div_id);
2073 $this->tpl->setVariable(
"TXT_PRECONDITION_SHOW", $this->lng->txt(
"show"));
2074 $this->tpl->setVariable(
"TXT_PRECONDITION_HIDE", $this->lng->txt(
"hide"));
2075 $this->tpl->parseCurrentBlock();
2088 function insertCommand($a_href, $a_text, $a_frame =
"", $a_img =
"", $a_cmd =
"", $a_onclick =
"")
2090 $prevent_background_click =
false;
2091 if ($a_cmd ==
'mount_webfolder')
2093 $prevent_background_click =
true;
2095 $this->current_selection_list->addItem($a_text,
"", $a_href, $a_img, $a_text, $a_frame,
2096 "", $prevent_background_click, $a_onclick);
2108 if ($this->std_cmd_only)
2121 $this->adm_commands_included =
true;
2129 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2130 $this->container_obj->object->getRefId());
2131 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2132 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"delete");
2133 $this->
insertCommand($cmd_link, $this->lng->txt(
"delete"),
"",
2135 $this->adm_commands_included =
true;
2150 if ($this->std_cmd_only)
2159 global $objDefinition;
2167 $this->adm_commands_included =
true;
2178 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2179 $this->container_obj->object->getRefId());
2180 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2181 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"link");
2182 $this->
insertCommand($cmd_link, $this->lng->txt(
"link"),
"",
2184 $this->adm_commands_included =
true;
2198 if ($this->std_cmd_only)
2211 $this->adm_commands_included =
true;
2221 $this->container_obj->object)
2223 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2224 $this->container_obj->object->getRefId());
2225 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2227 if(!$a_to_repository)
2229 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut");
2230 $this->
insertCommand($cmd_link, $this->lng->txt(
"move"),
"",
2235 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"cut_for_repository");
2236 $this->
insertCommand($cmd_link, $this->lng->txt(
"wsp_move_to_repository"),
"",
2240 $this->adm_commands_included =
true;
2251 if($this->std_cmd_only)
2258 if($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING)
2260 $this->ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id',$this->
getCommandId());
2261 $cmd_copy = $this->ctrl->getLinkTargetByClass(
'ilobjectcopygui',
'initTargetSelection');
2266 $this->ctrl->setParameter($this->container_obj,
"ref_id",
2267 $this->container_obj->object->getRefId());
2268 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2270 if(!$a_to_repository)
2272 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy');
2277 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
2278 $this->
insertCommand($cmd_copy, $this->lng->txt(
'wsp_copy_to_repository'));
2282 $this->adm_commands_included =
true;
2293 global $ilAccess, $objDefinition;
2295 if ($this->std_cmd_only)
2312 $this->adm_commands_included =
true;
2329 if ($this->std_cmd_only)
2334 if((
int)$ilSetting->get(
'disable_my_offers'))
2341 if ($this->ilias->account->getId() != ANONYMOUS_USER_ID)
2370 if (!$this->ilias->account->isDesktopItem($this->getCommandId(), $type))
2374 if ($this->
checkCommandAccess(
"read",
"", $this->ref_id, $this->type, $this->obj_id))
2378 $this->ctrl->setParameter($this->container_obj,
"type", $type);
2379 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2380 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"addToDesk");
2381 $this->
insertCommand($cmd_link, $this->lng->txt(
"to_desktop"),
"",
2390 $this->ctrl->setParameter($this->container_obj,
"type", $type);
2391 $this->ctrl->setParameter($this->container_obj,
"item_ref_id", $this->
getCommandId());
2392 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj,
"removeFromDesk");
2393 $this->
insertCommand($cmd_link, $this->lng->txt(
"unsubscribe"),
"",
2405 if ($this->std_cmd_only)
2411 $this->
insertCommand($cmd_link, $this->lng->txt(
"info_short"), $cmd_frame,
2425 if ($this->std_cmd_only ||
2426 ($ilUser->getId() == ANONYMOUS_USER_ID))
2430 $lng->loadLanguageModule(
"notes");
2431 $lng->loadLanguageModule(
"tagging");
2435 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2439 if($this->reference_ref_id)
2444 $js_updater = $a_header_actions
2445 ?
"il.Object.redrawActionHeader();"
2446 :
"il.Object.redrawListItem(".$note_ref_id.
")";
2451 $this->
insertCommand(
"#", $this->lng->txt(
"notes_comments"), $cmd_frame,
2455 if($this->notes_enabled)
2457 $this->
insertCommand(
"#", $this->lng->txt(
"notes"), $cmd_frame,
2461 if ($this->tags_enabled)
2463 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2465 $this->
insertCommand(
"#", $this->lng->txt(
"tagging_set_tag"), $cmd_frame,
2477 if ($this->std_cmd_only || !$this->container_obj->object)
2482 $parent_ref_id = $this->container_obj->object->getRefId();
2483 $parent_type = $this->container_obj->object->getType();
2488 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'cadh',
2490 $this->ctrl->setParameterByClass(
'ilobjectactivationgui',
'parent_id',
2492 $cmd_lnk = $this->ctrl->getLinkTargetByClass(array($this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui'),
2495 $this->
insertCommand($cmd_lnk, $this->lng->txt(
'activation'));
2507 $a_asynch_url =
"", $a_header_actions =
false)
2516 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2518 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2519 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2520 $this->current_selection_list->setListTitle($lng->txt(
"actions"));
2521 $this->current_selection_list->setId(
"act_".$this->
getUniqueItemId());
2522 $this->current_selection_list->setSelectionHeaderClass(
"small");
2523 $this->current_selection_list->setItemLinkClass(
"xsmall");
2524 $this->current_selection_list->setLinksMode(
"il_ContainerItemCommand2");
2526 $this->current_selection_list->setUseImages(
false);
2527 $this->current_selection_list->setAdditionalToggleElement($this->
getUniqueItemId(
true),
"ilContainerListItemOuterHighlight");
2529 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
2531 $this->ctrl->setParameterByClass($this->gui_class_name,
"ref_id", $this->ref_id);
2534 $only_default =
false;
2535 if ($a_use_asynch && !$a_get_asynch_commands)
2537 $only_default =
true;
2540 $this->default_command =
false;
2543 $valid_header_commands = array(
"mount_webfolder");
2545 $commands = $this->
getCommands($this->ref_id, $this->obj_id);
2546 foreach($commands as $command)
2548 if($a_header_actions && !in_array($command[
"cmd"], $valid_header_commands))
2553 if ($command[
"granted"] ==
true )
2555 if (!$command[
"default"] ===
true)
2557 if (!$this->std_cmd_only && !$only_default)
2564 if ($command[
"lang_var"] ==
"edit" && $command[
"img"] ==
"")
2569 $cmd_link = $command[
"link"];
2570 $txt = ($command[
"lang_var"] ==
"")
2572 : $this->lng->txt($command[
"lang_var"]);
2574 $command[
"frame"], $command[
"img"], $command[
"cmd"]);
2583 elseif($command[
"default"] ===
true)
2585 $items =& $command[
"access_info"];
2586 foreach ($items as $item)
2601 if (is_array($this->cust_commands))
2603 foreach ($this->cust_commands as $command)
2605 $this->
insertCommand($command[
"link"], $this->lng->txt($command[
"lang_var"]),
2606 $command[
"frame"],
"", $command[
"cmd"], $command[
"onclick"]);
2619 if($this->timings_enabled)
2625 if ($this->delete_enabled)
2631 if ($this->link_enabled)
2637 if ($this->cut_enabled)
2643 if ($this->copy_enabled)
2649 if ($this->repository_transfer_enabled)
2656 if ($this->subscribe_enabled)
2662 if($this->cut_enabled or $this->link_enabled)
2668 if(IS_PAYMENT_ENABLED)
2681 if(!$a_header_actions)
2683 $this->ctrl->clearParametersByClass($this->gui_class_name);
2686 if ($a_use_asynch && $a_get_asynch_commands)
2688 return $this->current_selection_list->getHTML(
true);
2691 return $this->current_selection_list->getHTML();
2704 if($ilSetting->get(
"disable_comments"))
2709 $this->comments_enabled = (bool)$a_value;
2710 $this->comments_settings_enabled = (bool)$a_enable_comments_settings;
2723 if($ilSetting->get(
"disable_notes"))
2728 $this->notes_enabled = (bool)$a_value;
2739 if (!$tags_set->get(
"enable"))
2743 $this->tags_enabled = (bool)$a_value;
2749 static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl = null)
2753 if (is_null($a_tpl))
2760 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2766 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2772 $a_tpl->addOnLoadCode(
"il.Object.setRedrawAHUrl('".
2773 $a_redraw_url.
"');");
2785 $this->sub_obj_type = $a_type;
2786 $this->sub_obj_id = (int)$a_id;
2798 function addHeaderIcon($a_id, $a_img, $a_tooltip = null, $a_onclick = null, $a_status_text = null, $a_href = null)
2800 $this->header_icons[$a_id] = array(
"img" => $a_img,
2801 "tooltip" => $a_tooltip,
2802 "onclick" => $a_onclick,
2803 "status_text" => $a_status_text,
2814 $this->header_icons[$a_id] = $a_html;
2819 $this->ajax_hash = $a_hash;
2831 $htpl =
new ilTemplate(
"tpl.header_action.html",
true,
true,
"Services/Repository");
2833 $redraw_js =
"il.Object.redrawActionHeader();";
2836 if($this->tags_enabled)
2838 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
2841 if (count($tags) > 0)
2843 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
2844 $lng->loadLanguageModule(
"tagging");
2847 $lng->txt(
"tagging_tags").
": ".count($tags),
2857 include_once(
"./Services/Notes/classes/class.ilNote.php");
2858 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
2873 $lng->loadLanguageModule(
"notes");
2877 $lng->txt(
"notes_public_comments").
": ".$cnt[$this->obj_id][
IL_NOTE_PUBLIC],
2883 if($this->header_icons)
2885 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
2888 foreach($this->header_icons as $id => $attr)
2894 if($attr[
"onclick"])
2896 $htpl->setCurrentBlock(
"onclick");
2897 $htpl->setVariable(
"PROP_ONCLICK", $attr[
"onclick"]);
2898 $htpl->parseCurrentBlock();
2901 if($attr[
"status_text"])
2903 $htpl->setCurrentBlock(
"status");
2904 $htpl->setVariable(
"PROP_TXT", $attr[
"status_text"]);
2905 $htpl->parseCurrentBlock();
2910 $attr[
"href"] =
"#";
2913 $htpl->setCurrentBlock(
"prop");
2914 $htpl->setVariable(
"PROP_ID", $id);
2915 $htpl->setVariable(
"IMG",
ilUtil::img($attr[
"img"]));
2916 $htpl->setVariable(
"PROP_HREF", $attr[
"href"]);
2917 $htpl->parseCurrentBlock();
2919 if($attr[
"tooltip"])
2932 $htpl->setVariable(
"PROP_CHUNKS",
2933 implode(
" ", $chunks).
" ");
2937 $htpl->setVariable(
"ACTION_DROP_DOWN",
2940 return $htpl->get();
2950 $script = substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1);
2953 if ((strtolower(
$_GET[
"baseClass"]) !=
"ilrepositorygui") &&
2954 is_int(strpos($a_link,
"baseClass=ilRepositoryGUI")))
2956 if ($this->type !=
"frm")
2971 if (strstr($a_link,
'ilSAHSPresentationGUI'))
2973 include_once
'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
2975 $om = $sahs_obj->getOpenMode();
2976 $width = $sahs_obj->getWidth();
2977 $height = $sahs_obj->getHeight();
2980 $this->default_command[
"frame"]=
"";
2981 $a_link =
"javascript:void(0); onclick=startSAHS('".$a_link.
"','".$wtarget.
"',".$om.
",".$width.
",".$height.
");";
2996 include_once
'Services/Tree/classes/class.ilPathGUI.php';
2998 $path_gui->enableTextOnly(!$this->path_linked);
2999 $path_gui->setUseImages(
false);
3001 $this->tpl->setCurrentBlock(
"path_item");
3002 $this->tpl->setVariable(
'PATH_ITEM',$path_gui->getPath(ROOT_FOLDER_ID,$this->ref_id));
3003 $this->tpl->parseCurrentBlock();
3005 $this->tpl->setCurrentBlock(
"path");
3006 $this->tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"locator"));
3007 $this->tpl->parseCurrentBlock();
3029 global
$lng, $objDefinition;
3034 $this->tpl->setCurrentBlock(
"check");
3035 $this->tpl->setVariable(
"VAL_ID", $this->
getCommandId());
3036 $this->tpl->parseCurrentBlock();
3041 $this->tpl->setCurrentBlock(
'expand');
3045 $this->ctrl->setParameter($this->container_obj,
'expand',-1 * $this->obj_id);
3046 $this->tpl->setVariable(
'EXP_HREF',$this->ctrl->getLinkTarget($this->container_obj,
'',$this->getUniqueItemId(
true)));
3047 $this->ctrl->clearParameters($this->container_obj);
3048 #$this->tpl->setVariable('EXP_IMG',ilUtil::getImagePath('browser/minus.png'));
3050 $this->tpl->setVariable(
'EXP_ALT',$this->lng->txt(
'collapse'));
3054 $this->ctrl->setParameter($this->container_obj,
'expand',$this->obj_id);
3055 $this->tpl->setVariable(
'EXP_HREF',$this->ctrl->getLinkTarget($this->container_obj,
'',$this->getUniqueItemId(
true)));
3056 $this->ctrl->clearParameters($this->container_obj);
3057 #$this->tpl->setVariable('EXP_IMG',ilUtil::getImagePath('browser/plus.png'));
3059 $this->tpl->setVariable(
'EXP_ALT',$this->lng->txt(
'expand'));
3062 $this->tpl->parseCurrentBlock();
3070 $this->tpl->touchBlock(
"i_1");
3074 if (!$this->default_command || (!$this->
getCommandsStatus() && !$this->restrict_to_goto))
3079 $this->tpl->setCurrentBlock(
"icon_link_s");
3081 if ($this->default_command[
"frame"] !=
"")
3083 $this->tpl->setVariable(
"ICON_TAR",
"target='".$this->default_command[
"frame"].
"'");
3086 $this->tpl->setVariable(
"ICON_HREF",
3087 $this->default_command[
"link"]);
3088 $this->tpl->parseCurrentBlock();
3089 $this->tpl->touchBlock(
"icon_link_e");
3092 $this->tpl->setCurrentBlock(
"icon");
3093 if (!$objDefinition->isPlugin($this->getIconImageType()))
3095 $this->tpl->setVariable(
"ALT_ICON", $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$this->
getIconImageType()));
3099 include_once(
"Services/Component/classes/class.ilPlugin.php");
3100 $this->tpl->setVariable(
"ALT_ICON", $lng->txt(
"icon").
" ".
3104 $this->tpl->setVariable(
"SRC_ICON",
3106 $this->tpl->parseCurrentBlock();
3110 $this->tpl->touchBlock(
"d_".$cnt);
3118 foreach ($this->sub_item_html as $sub_html)
3120 $this->tpl->setCurrentBlock(
"subitem");
3121 $this->tpl->setVariable(
"SUBITEM", $sub_html);
3122 $this->tpl->parseCurrentBlock();
3131 if ($this->position_enabled)
3133 $this->tpl->setCurrentBlock(
"position");
3134 $this->tpl->setVariable(
"POS_ID", $this->position_field_index);
3135 $this->tpl->setVariable(
"POS_VAL", $this->position_value);
3136 $this->tpl->parseCurrentBlock();
3146 return $this->adm_commands_included;
3155 if($this->acache->getLastAccessStatus() ==
"miss" &&
3156 !$this->prevent_access_caching)
3158 $this->acache->storeEntry($ilUser->getId().
":".
$this->ref_id,
3178 $a_use_asynch =
false, $a_get_asynch_commands =
false, $a_asynch_url =
"", $a_context = self::CONTEXT_REPOSITORY)
3184 $this->adm_commands_included =
false;
3190 $ilBench->start(
"ilObjectListGUI",
"1000_getListHTML_init$type");
3191 $this->
initItem($a_ref_id, $a_obj_id, $a_title, $a_description, $a_context);
3192 $ilBench->stop(
"ilObjectListGUI",
"1000_getListHTML_init$type");
3195 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
3196 if($a_context == self::CONTEXT_REPOSITORY)
3206 if ($a_use_asynch && $a_get_asynch_commands)
3212 include_once(
"Services/Object/classes/class.ilListItemAccessCache.php");
3214 $cres = $this->acache->getEntry($ilUser->getId().
":".$a_ref_id);
3215 if($this->acache->getLastAccessStatus() ==
"hit")
3217 $this->access_cache = unserialize($cres);
3228 $ilBench->stop(
"ilObjectListGUI",
"2000_getListHTML_check_visible");
3240 $this->tpl =
new ilTemplate(
"tpl.container_list_item.html",
true,
true,
3241 "Services/Container",
"DEFAULT",
false,
true);
3244 ($this->payment_enabled && IS_PAYMENT_ENABLED))
3248 $this->tpl->setVariable(
"COMMAND_SELECTION_LIST",
3249 $this->
insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url));
3278 $ilBench->start(
"ilObjectListGUI",
"6000_insert_properties$type");
3283 $ilBench->stop(
"ilObjectListGUI",
"6000_insert_properties$type");
3286 $ilBench->start(
"ilObjectListGUI",
"6500_insert_notice_properties$type");
3291 $ilBench->stop(
"ilObjectListGUI",
"6500_insert_notice_properties$type");
3294 $ilBench->start(
"ilObjectListGUI",
"7000_insert_preconditions");
3299 $ilBench->stop(
"ilObjectListGUI",
"7000_insert_preconditions");
3302 $ilBench->start(
"ilObjectListGUI",
"8000_insert_path");
3304 $ilBench->stop(
"ilObjectListGUI",
"8000_insert_path");
3306 $ilBench->start(
"ilObjectListGUI",
"8500_item_detail_links");
3311 $ilBench->stop(
"ilObjectListGUI",
"8500_item_detail_links");
3323 $this->cust_prop = array();
3324 $this->cust_commands = array();
3325 $this->sub_item_html = array();
3326 $this->position_enabled =
false;
3328 $this->tpl->setVariable(
"DIV_CLASS",
'ilContainerListItemOuter');
3329 $this->tpl->setVariable(
"DIV_ID",
'id = "'.$this->
getUniqueItemId(
true).
'"');
3332 return $this->tpl->get();
3344 $id_ref = ($this->reference_ref_id > 0)
3345 ? $this->reference_ref_id
3349 if($this->condition_depth)
3351 $id_ref .=
"_pc".$this->condition_depth;
3361 return "lg_div_".$id_ref;
3388 $this->bold_title = $a_bold_title;
3412 $lng->loadLanguageModule(
"notes");
3413 $lng->loadLanguageModule(
"tagging");
3415 include_once(
"./Services/Tagging/classes/class.ilTagging.php");
3418 include_once(
"./Services/Notes/classes/class.ilNote.php");
3422 self::$preload_done =
true;
3435 protected function isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access =
true)
3437 if($this->comments_enabled)
3439 if(!$this->comments_settings_enabled)
3443 if($a_check_write_access && $this->
checkCommandAccess(
'write',
'', $a_ref_id, $a_type))
3449 if(!$a_header_actions && self::$preload_done)
3451 if(self::$comments_activation[$a_obj_id][$a_type])
3458 include_once(
"./Services/Notes/classes/class.ilNote.php");
3477 $this->timings_enabled = (bool)$a_status;