ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjectListGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4define("IL_LIST_AS_TRIGGER", "trigger");
5define("IL_LIST_FULL", "full");
6require_once('./Services/Repository/classes/class.ilObjectPlugin.php');
7
24{
28 protected $access;
29
33 protected $lng;
34
38 protected $user;
39
43 protected $obj_definition;
44
48 protected $tree;
49
53 protected $settings;
54
58 protected $tpl;
59
60 const DETAILS_MINIMAL = 10;
61 const DETAILS_SEARCH = 20 ;
62 const DETAILS_ALL = 30;
63
68 const CONTEXT_SEARCH = 6;
69
73
74 public $ctrl;
75 public $description_enabled = true;
77 public $properties_enabled = true;
79 public $commands_enabled = true;
80 public $cust_prop = array();
81 public $cust_commands = array();
82 public $info_screen_enabled = false;
83 public $condition_depth = 0;
84 public $std_cmd_only = false;
85 public $sub_item_html = array();
88
89 protected $obj_id;
90 protected $ref_id;
91 protected $type;
92 protected $sub_obj_id;
93 protected $sub_obj_type;
94
95 protected $substitutions = null;
96 protected $substitutions_enabled = false;
97
98 protected $icons_enabled = false;
99 protected $checkboxes_enabled = false;
100 protected $position_enabled = false;
101 protected $progress_enabled = false;
102 protected $item_detail_links_enabled = false;
103 protected $item_detail_links = array();
105
106 protected $search_fragments_enabled = false;
107 protected $search_fragment = '';
108 protected $path_linked = false;
109
110 protected $enabled_relevance = false;
111 protected $relevance = 0;
112
113 protected $expand_enabled = false;
114 protected $is_expanded = true;
115 protected $bold_title = false;
116
117 protected $copy_enabled = true;
118
120
121 protected $reference_ref_id = false;
122 protected $separate_commands = false;
123 protected $search_fragment_enabled = false;
124 protected $additional_information = false;
125 protected $static_link_enabled = false;
126
128 protected $shared = false;
129 protected $restrict_to_goto = false;
130
131 protected $comments_enabled = false;
132 protected $comments_settings_enabled = false;
133 protected $notes_enabled = false;
134 protected $tags_enabled = false;
135
136 protected $rating_enabled = false;
137 protected $rating_categories_enabled = false;
138 protected $rating_text = false;
139 protected $rating_ctrl_path = false;
140
141 protected $timings_enabled = true;
142 protected $force_visible_only = false;
143 protected $prevent_duplicate_commands = array();
144 protected $parent_ref_id;
145 protected $context;
146
147 protected static $cnt_notes = array();
148 protected static $cnt_tags = array();
149 protected static $tags = array();
150 protected static $comments_activation = array();
151 protected static $preload_done = false;
152
153 protected $title_link = '';
154 protected $title_link_disabled = false;
155
156 protected static $js_unique_id = 0;
157
158
159 protected static $tpl_file_name = "tpl.container_list_item.html";
160 protected static $tpl_component = "Services/Container";
161
165 protected $path_gui = null;
166
170 protected $ui;
171
176
180 protected $fav_manager;
181
186 public function __construct($a_context = self::CONTEXT_REPOSITORY)
187 {
188 global $DIC;
189 $this->access = $DIC->access();
190 $this->user = $DIC->user();
191 $this->obj_definition = $DIC["objDefinition"];
192 $this->tree = $DIC->repositoryTree();
193 $this->settings = $DIC->settings();
194
195 $this->ui = $DIC->ui();
196 $this->rbacsystem = $DIC->rbac()->system();
197 $this->ctrl = $DIC->ctrl();
198 $this->lng = $DIC->language();
199 $this->mode = IL_LIST_FULL;
200 $this->path_enabled = false;
201 $this->context = $a_context;
202
203 $this->object_service = $DIC->object();
204
205 $this->enableComments(false);
206 $this->enableNotes(false);
207 $this->enableTags(false);
208
209 // unique js-ids
210 $this->setParentRefId((int) $_REQUEST["ref_id"]);
211
212 //echo "list";
213 $this->init();
214
215 include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
216 $this->ldap_mapping = ilLDAPRoleGroupMapping::_getInstance();
217 $this->fav_manager = new ilFavouritesManager();
218
219 $this->lng->loadLanguageModule("obj");
220 $this->lng->loadLanguageModule("rep");
221 }
222
223
230 public function setContainerObject($container_obj)
231 {
232 $this->container_obj = $container_obj;
233 }
234
242 public function getContainerObject()
243 {
244 return $this->container_obj;
245 }
246
247
253 public function init()
254 {
255 // Create static links for default command (linked title) or not
256 $this->static_link_enabled = true;
257 $this->delete_enabled = true;
258 $this->cut_enabled = true;
259 $this->subscribe_enabled = true;
260 $this->link_enabled = false;
261 $this->copy_enabled = false;
262 $this->progress_enabled = false;
263 $this->notice_properties_enabled = true;
264 $this->info_screen_enabled = false;
265 $this->type = ""; // "cat", "course", ...
266 $this->gui_class_name = ""; // "ilobjcategorygui", "ilobjcoursegui", ...
267
268 // general commands array, e.g.
269 include_once('./Services/Object/classes/class.ilObjectAccess.php');
270 $this->commands = ilObjectAccess::_getCommands();
271 }
272
273 // Single get set methods
280 public function enableProperties($a_status)
281 {
282 $this->properties_enabled = $a_status;
283
284 return;
285 }
292 public function getPropertiesStatus()
293 {
295 }
302 public function enablePreconditions($a_status)
303 {
304 $this->preconditions_enabled = $a_status;
305
306 return;
307 }
308
310 {
312 }
313
320 public function enableNoticeProperties($a_status)
321 {
322 $this->notice_properties_enabled = $a_status;
323
324 return;
325 }
332 public function getPreconditionsStatus()
333 {
335 }
342 public function enableDescription($a_status)
343 {
344 $this->description_enabled = $a_status;
345
346 return;
347 }
354 public function getDescriptionStatus()
355 {
357 }
358
365 public function getSearchFragmentStatus()
366 {
368 }
369
376 public function enableSearchFragments($a_status)
377 {
378 $this->search_fragment_enabled = $a_status;
379
380 return;
381 }
382
388 public function enableLinkedPath($a_status)
389 {
390 $this->path_linked = $a_status;
391 }
392
397 public function enabledRelevance()
398 {
400 }
401
406 public function enableRelevance($a_status)
407 {
408 $this->enabled_relevance = $a_status;
409 }
410
416 public function setRelevance($a_rel)
417 {
418 $this->relevance = $a_rel;
419 }
420
426 public function getRelevance()
427 {
428 return $this->relevance;
429 }
430
436 public function enableIcon($a_status)
437 {
438 $this->icons_enabled = $a_status;
439 }
440
446 public function getIconStatus()
447 {
449 }
450
456 public function enableCheckbox($a_status)
457 {
458 $this->checkboxes_enabled = $a_status;
459 }
460
466 public function getCheckboxStatus()
467 {
469 }
470
476 public function enableExpand($a_status)
477 {
478 $this->expand_enabled = $a_status;
479 }
480
486 public function getExpandStatus()
487 {
489 }
490
491 public function setExpanded($a_status)
492 {
493 $this->is_expanded = $a_status;
494 }
495
496 public function isExpanded()
497 {
498 return $this->is_expanded;
499 }
506 public function setPositionInputField($a_field_index, $a_position_value)
507 {
508 $this->position_enabled = true;
509 $this->position_field_index = $a_field_index;
510 $this->position_value = $a_position_value;
511 }
512
519 public function enableDelete($a_status)
520 {
521 $this->delete_enabled = $a_status;
522
523 return;
524 }
531 public function getDeleteStatus()
532 {
533 return $this->delete_enabled;
534 }
535
542 public function enableCut($a_status)
543 {
544 $this->cut_enabled = $a_status;
545
546 return;
547 }
553 public function getCutStatus()
554 {
555 return $this->cut_enabled;
556 }
557
564 public function enableCopy($a_status)
565 {
566 $this->copy_enabled = $a_status;
567
568 return;
569 }
575 public function getCopyStatus()
576 {
577 return $this->copy_enabled;
578 }
579
586 public function enableSubscribe($a_status)
587 {
588 $this->subscribe_enabled = $a_status;
589
590 return;
591 }
597 public function getSubscribeStatus()
598 {
599 return $this->subscribe_enabled;
600 }
601
608 public function enableLink($a_status)
609 {
610 $this->link_enabled = $a_status;
611
612 return;
613 }
619 public function getLinkStatus()
620 {
621 return $this->link_enabled;
622 }
623
631 public function enablePath($a_path, $a_start_node = null, \ilPathGUI $path_gui = null)
632 {
633 $this->path_enabled = $a_path;
634 $this->path_start_node = (int) $a_start_node;
635 $this->path_gui = $path_gui;
636 }
637
643 public function getPathStatus()
644 {
645 return $this->path_enabled;
646 }
647
654 public function enableCommands($a_status, $a_std_only = false)
655 {
656 $this->commands_enabled = $a_status;
657 $this->std_cmd_only = $a_std_only;
658 }
664 public function getCommandsStatus()
665 {
667 }
668
675 public function enableInfoScreen($a_info_screen)
676 {
677 $this->info_screen_enabled = $a_info_screen;
678 }
679
685 public function addSubItemHTML($a_html)
686 {
687 $this->sub_item_html[] = $a_html;
688 }
689
695 public function getInfoScreenStatus()
696 {
698 }
699
707 public function enableProgressInfo($a_status)
708 {
709 $this->progress_enabled = $a_status;
710 }
711
719 public function getProgressInfoStatus()
720 {
722 }
723
731 public function enableSubstitutions($a_status)
732 {
733 $this->substitutions_enabled = $a_status;
734 }
735
742 public function getSubstitutionStatus()
743 {
745 }
746
755 public function enableItemDetailLinks($a_status)
756 {
757 $this->item_detail_links_enabled = $a_status;
758 }
759
766 public function getItemDetailLinkStatus()
767 {
769 }
770
778 public function setItemDetailLinks($a_detail_links, $a_intro_txt = '')
779 {
780 $this->item_detail_links = $a_detail_links;
781 $this->item_detail_links_intro = $a_intro_txt;
782 }
783
791 public function insertItemDetailLinks()
792 {
793 if (!count($this->item_detail_links)) {
794 return true;
795 }
796 if (strlen($this->item_detail_links_intro)) {
797 $this->tpl->setCurrentBlock('item_detail_intro');
798 $this->tpl->setVariable('ITEM_DETAIL_INTRO_TXT', $this->item_detail_links_intro);
799 $this->tpl->parseCurrentBlock();
800 }
801
802 foreach ($this->item_detail_links as $info) {
803 $this->tpl->setCurrentBlock('item_detail_link');
804 $this->tpl->setVariable('ITEM_DETAIL_LINK_TARGET', $info['target']);
805 $this->tpl->setVariable('ITEM_DETAIL_LINK_DESC', $info['desc']);
806 $this->tpl->setVariable('ITEM_DETAIL_LINK_HREF', $info['link']);
807 $this->tpl->setVariable('ITEM_DETAIL_LINK_NAME', $info['name']);
808 $this->tpl->parseCurrentBlock();
809 }
810 $this->tpl->setCurrentBlock('item_detail_links');
811 $this->tpl->parseCurrentBlock();
812 }
813
814
815
820 public function setTitle($a_title)
821 {
822 $this->title = $a_title;
823 }
824
830 public function getTitle()
831 {
832 return $this->title;
833 }
834
839 public function setDescription($a_description)
840 {
841 $this->description = $a_description;
842 }
843
849 public function getDescription()
850 {
851 return $this->description;
852 }
853
859 public function setSearchFragment($a_text)
860 {
861 $this->search_fragment = $a_text;
862 }
863
868 public function getSearchFragment()
869 {
871 }
872
878 public function setSeparateCommands($a_val)
879 {
880 $this->separate_commands = $a_val;
881 }
882
888 public function getSeparateCommands()
889 {
891 }
901 public function getCommandId()
902 {
903 return $this->ref_id;
904 }
905
911 public function setAdditionalInformation($a_val)
912 {
913 $this->additional_information = $a_val;
914 }
915
921 public function getAdditionalInformation()
922 {
924 }
925
933 public function setDetailsLevel($a_level)
934 {
935 $this->details_level = $a_level;
936 }
937
942 public function getDetailsLevel()
943 {
945 }
946
952 public function enableRepositoryTransfer($a_value)
953 {
954 $this->repository_transfer_enabled = (bool) $a_value;
955 }
956
962 public function restrictToGoto($a_value)
963 {
964 $this->restrict_to_goto = (bool) $a_value;
965 }
966
967
973 public function getDefaultCommand()
974 {
975 return $this->default_command;
976 }
977
983 public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
984 {
985 $ilAccess = $this->access;
986
987 // e.g: subitems should not be readable since their parent sesssion is readonly.
988 if ($a_permission != 'visible' and $this->isVisibleOnlyForced()) {
989 return false;
990 }
991
992 $cache_prefix = null;
993 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
994 $cache_prefix = "wsp";
995 if (!$this->ws_access) {
996 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
997 $this->ws_access = new ilWorkspaceAccessHandler();
998 }
999 }
1000
1001 if (isset($this->access_cache[$a_permission]["-" . $a_cmd][$cache_prefix . $a_ref_id])) {
1002 return $this->access_cache[$a_permission]["-" . $a_cmd][$cache_prefix . $a_ref_id];
1003 }
1004
1005 if ($this->context == self::CONTEXT_REPOSITORY) {
1006 $access = $ilAccess->checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
1007 if ($ilAccess->getPreventCachingLastResult()) {
1008 $this->prevent_access_caching = true;
1009 }
1010 } else {
1011 $access = $this->ws_access->checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type);
1012 }
1013
1014 $this->access_cache[$a_permission]["-" . $a_cmd][$cache_prefix . $a_ref_id] = $access;
1015 return $access;
1016 }
1017
1027 public function initItem($a_ref_id, $a_obj_id, $type, $a_title = "", $a_description = "")
1028 {
1029 $this->offline_mode = false;
1030 if ($this->type == "sahs") {
1031 include_once('Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
1032 $this->offline_mode = ilObjSAHSLearningModuleAccess::_lookupUserIsOfflineMode($a_obj_id);
1033 }
1034 $this->access_cache = array();
1035 $this->ref_id = $a_ref_id;
1036 $this->obj_id = $a_obj_id;
1037 $this->setTitle($a_title);
1038 $this->setDescription($a_description);
1039 #$this->description = $a_description;
1040
1041 // checks, whether any admin commands are included in the output
1042 $this->adm_commands_included = false;
1043 $this->prevent_access_caching = false;
1044
1045 // prepare ajax calls
1046 include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1047 if ($this->context == self::CONTEXT_REPOSITORY) {
1049 } else {
1051 }
1052 $this->setAjaxHash(ilCommonActionDispatcherGUI::buildAjaxHash($node_type, $a_ref_id, $type, $a_obj_id));
1053 }
1054
1055 public function setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
1056 {
1057 $this->condition_target = array(
1058 'ref_id' => $a_ref_id,
1059 'obj_id' => $a_obj_id,
1060 'target_type' => $a_target_type
1061 );
1062 }
1063
1064 public function resetConditionTarget()
1065 {
1066 $this->condition_target = array();
1067 }
1068
1069 public function disableTitleLink($a_status)
1070 {
1071 $this->title_link_disabled = $a_status;
1072 }
1073 // end-patch lok
1074
1075 public function setDefaultCommandParameters(array $a_params)
1076 {
1077 $this->default_command_params = $a_params;
1078 }
1079
1089 public function createDefaultCommand($command)
1090 {
1091 // begin-patch lok
1092 if ($this->static_link_enabled and !$this->default_command_params) {
1093 include_once('./Services/Link/classes/class.ilLink.php');
1094 if ($link = ilLink::_getStaticLink($this->ref_id, $this->type, false)) {
1095 $command['link'] = $link;
1096 $command['frame'] = '_top';
1097 }
1098 }
1099 if ($this->default_command_params) {
1100 $params = array();
1101 foreach ($this->default_command_params as $name => $value) {
1102 $params[] = $name . '=' . $value;
1103 }
1104 $params = implode('&', $params);
1105
1106 // #12370
1107 if (!stristr($command['link'], '?')) {
1108 $command['link'] .= '?' . $params;
1109 } else {
1110 $command['link'] .= '&' . $params;
1111 }
1112 }
1113 return $command;
1114 }
1115
1128 public function getCommandLink($a_cmd)
1129 {
1130 if ($this->context == self::CONTEXT_REPOSITORY) {
1131 // BEGIN WebDAV Get mount webfolder link.
1132 require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1133 if ($a_cmd == 'mount_webfolder' && ilDAVActivationChecker::_isActive()) {
1134 global $DIC;
1135 $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
1136 return $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
1137 }
1138 // END WebDAV Get mount webfolder link.
1139
1140 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getCommandId());
1141 $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
1142 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
1143 return $cmd_link;
1144
1145 /* separate method for this line
1146 $cmd_link = $this->ctrl->getLinkTargetByClass($this->gui_class_name,
1147 $a_cmd);
1148 return $cmd_link;
1149 */
1150 } else {
1151 $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", "");
1152 $this->ctrl->setParameterByClass($this->gui_class_name, "wsp_id", $this->ref_id);
1153 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1154 }
1155 }
1156
1157
1167 public function getCommandFrame($a_cmd)
1168 {
1169 // begin-patch fm
1170 if ($a_cmd == 'fileManagerLaunch') {
1171 return '_blank';
1172 }
1173 // end-patch fm
1174 return "";
1175 }
1176
1186 public function getCommandImage($a_cmd)
1187 {
1188 return "";
1189 }
1190
1202 public function getProperties()
1203 {
1204 $lng = $this->lng;
1206
1207 $props = array();
1208 // please list alert properties first
1209 // example (use $lng->txt instead of "Status"/"Offline" strings):
1210 // $props[] = array("alert" => true, "property" => "Status", "value" => "Offline");
1211 // $props[] = array("alert" => false, "property" => ..., "value" => ...);
1212 // ...
1213
1214 // #8280: WebDav is only supported in repository
1215 if ($this->context == self::CONTEXT_REPOSITORY) {
1216 // add centralized offline status
1217 if (ilObject::lookupOfflineStatus($this->obj_id)) {
1218 $props[] =
1219 [
1220 'alert' => true,
1221 'property' => $lng->txt("status"),
1222 'value' => $lng->txt("offline")
1223 ];
1224 }
1225
1226 // BEGIN WebDAV Display locking information
1227 require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1229 // Show lock info
1230 require_once('Services/WebDAV/classes/lock/class.ilWebDAVLockBackend.php');
1231 $webdav_lock_backend = new ilWebDAVLockBackend();
1232 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
1233 if ($lock = $webdav_lock_backend->getLocksOnObjectId($this->obj_id)) {
1234 $lock_user = new ilObjUser($lock->getIliasOwner());
1235
1236 $props[] = array(
1237 "alert" => false,
1238 "property" => $lng->txt("in_use_by"),
1239 "value" => $lock_user->getLogin(),
1240 "link" => "./ilias.php?user=" . $lock_user->getId() . '&cmd=showUserProfile&cmdClass=ildashboardgui&baseClass=ilDashboardGUI',
1241 );
1242 }
1243 }
1244 // END WebDAV Display locking information
1245
1246 if ($this->getDetailsLevel() == self::DETAILS_SEARCH) {
1247 return $props;
1248 }
1249 }
1250 // END WebDAV Display warning for invisible files and files with special characters
1251 }
1252
1253 return $props;
1254 }
1255
1259 public function addCustomProperty(
1260 $a_property = "",
1261 $a_value = "",
1262 $a_alert = false,
1263 $a_newline = false
1264 ) {
1265 $this->cust_prop[] = array("property" => $a_property, "value" => $a_value,
1266 "alert" => $a_alert, "newline" => $a_newline);
1267 }
1268
1272 public function getCustomProperties($a_prop)
1273 {
1274 if (is_array($this->cust_prop)) {
1275 foreach ($this->cust_prop as $prop) {
1276 $a_prop[] = $prop;
1277 }
1278 }
1279 return $a_prop;
1280 }
1281
1286 public function getAlertProperties()
1287 {
1288 $alert = array();
1289 foreach ((array) $this->getProperties() as $prop) {
1290 if ($prop['alert'] == true) {
1291 $alert[] = $prop;
1292 }
1293 }
1294 return $alert;
1295 }
1296
1300 public function getNoticeProperties()
1301 {
1302 $this->notice_prop = array();
1303 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id, true)) {
1304 foreach ($infos as $info) {
1305 $this->notice_prop[] = array('value' => $info);
1306 }
1307 }
1308 return $this->notice_prop ? $this->notice_prop : array();
1309 }
1313 public function addCustomCommand($a_link, $a_lang_var, $a_frame = "", $onclick = "")
1314 {
1315 $this->cust_commands[] =
1316 array("link" => $a_link, "lang_var" => $a_lang_var,
1317 "frame" => $a_frame, "onclick" => $onclick);
1318 }
1319
1324 public function forceVisibleOnly($a_stat)
1325 {
1326 $this->force_visible_only = $a_stat;
1327 }
1328
1333 public function isVisibleOnlyForced()
1334 {
1336 }
1337
1361 public function getCommands()
1362 {
1363 $ilAccess = $this->access;
1365
1366 $ref_commands = array();
1367 foreach ($this->commands as $command) {
1368 $permission = $command["permission"];
1369 $cmd = $command["cmd"];
1370 $lang_var = $command["lang_var"];
1371 $txt = "";
1372 $info_object = null;
1373
1374 if (isset($command["txt"])) {
1375 $txt = $command["txt"];
1376 }
1377
1378 // BEGIN WebDAV: Suppress commands that don't make sense for anonymous users.
1379 // Suppress commands that don't make sense for anonymous users
1380 if ($ilUser->getId() == ANONYMOUS_USER_ID &&
1381 $command['enable_anonymous'] == 'false') {
1382 continue;
1383 }
1384 // END WebDAV: Suppress commands that don't make sense for anonymous users.
1385
1386 // all access checking should be made within $ilAccess and
1387 // the checkAccess of the ilObj...Access classes
1388 //$access = $ilAccess->checkAccess($permission, $cmd, $this->ref_id, $this->type);
1389 $access = $this->checkCommandAccess($permission, $cmd, $this->ref_id, $this->type);
1390
1391 if ($access) {
1392 $cmd_link = $this->getCommandLink($command["cmd"]);
1393 $cmd_frame = $this->getCommandFrame($command["cmd"]);
1394 $cmd_image = $this->getCommandImage($command["cmd"]);
1395 $access_granted = true;
1396 } else {
1397 $access_granted = false;
1398 $info_object = $ilAccess->getInfo();
1399 }
1400
1401 if (!isset($command["default"])) {
1402 $command["default"] = "";
1403 }
1404 $ref_commands[] = array(
1405 "permission" => $permission,
1406 "cmd" => $cmd,
1407 "link" => $cmd_link,
1408 "frame" => $cmd_frame,
1409 "lang_var" => $lang_var,
1410 "txt" => $txt,
1411 "granted" => $access_granted,
1412 "access_info" => $info_object,
1413 "img" => $cmd_image,
1414 "default" => $command["default"]
1415 );
1416 }
1417
1418 return $ref_commands;
1419 }
1420
1421 // BEGIN WebDAV: Visualize object state in its icon.
1429 public function getIconImageType()
1430 {
1431 if ($this->type == "sahs" && $this->offline_mode) {
1432 return $this->type . "_offline";
1433 }
1434 return $this->type;
1435 }
1436 // END WebDAV: Visualize object state in its icon.
1437
1445 public function insertTitle()
1446 {
1447 if ($this->restrict_to_goto) {
1448 $this->default_command = array("frame" => "",
1449 "link" => $this->buildGotoLink());
1450 }
1451 // begin-patch lok
1452 if (
1453 !$this->default_command ||
1454 (!$this->getCommandsStatus() && !$this->restrict_to_goto) ||
1455 $this->title_link_disabled
1456 ) {
1457 // end-patch lok
1458 $this->tpl->setCurrentBlock("item_title");
1459 $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
1460 $this->tpl->parseCurrentBlock();
1461 } else {
1462 $this->default_command['link'] = $this->modifyTitleLink($this->default_command['link']);
1463
1464 $this->default_command["link"] =
1465 $this->modifySAHSlaunch($this->default_command["link"], $this->default_command["frame"]);
1466
1467 if ($this->default_command["frame"] != "") {
1468 $this->tpl->setCurrentBlock("title_linked_frame");
1469 $this->tpl->setVariable("TARGET_TITLE_LINKED", $this->default_command["frame"]);
1470 $this->tpl->parseCurrentBlock();
1471 }
1472
1473 // workaround for repository frameset
1474 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1475 $this->default_command["link"] =
1476 $this->appendRepositoryFrameParameter($this->default_command["link"]);
1477
1478 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1479
1480
1481 // the default command is linked with the title
1482 $this->tpl->setCurrentBlock("item_title_linked");
1483 $this->tpl->setVariable("TXT_TITLE_LINKED", $this->getTitle());
1484 $this->tpl->setVariable("HREF_TITLE_LINKED", $this->default_command["link"]);
1485
1486 // has preview?
1487 include_once("./Services/Preview/classes/class.ilPreview.php");
1488 if (ilPreview::hasPreview($this->obj_id, $this->type)) {
1489 include_once("./Services/Preview/classes/class.ilPreviewGUI.php");
1490
1491 // get context for access checks later on
1492 $access_handler = null;
1493 switch ($this->context) {
1497 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
1498 $access_handler = new ilWorkspaceAccessHandler();
1499 break;
1500
1501 default:
1502 $ilAccess = $this->access;
1504 $access_handler = $ilAccess;
1505 break;
1506 }
1507
1508 $preview = new ilPreviewGUI($this->ref_id, $context, $this->obj_id, $access_handler);
1509 $preview_status = ilPreview::lookupRenderStatus($this->obj_id);
1510 $preview_status_class = "";
1511 $preview_text_topic = "preview_show";
1512 if ($preview_status == ilPreview::RENDER_STATUS_NONE) {
1513 $preview_status_class = "ilPreviewStatusNone";
1514 $preview_text_topic = "preview_none";
1515 }
1516 $this->tpl->setCurrentBlock("item_title_linked");
1517 $this->tpl->setVariable("PREVIEW_STATUS_CLASS", $preview_status_class);
1518 $this->tpl->setVariable("SRC_PREVIEW_ICON", ilUtil::getImagePath("preview.png"));
1519 $this->tpl->setVariable("ALT_PREVIEW_ICON", $this->lng->txt($preview_text_topic));
1520 $this->tpl->setVariable("TXT_PREVIEW", $this->lng->txt($preview_text_topic));
1521 $this->tpl->setVariable("SCRIPT_PREVIEW_CLICK", $preview->getJSCall($this->getUniqueItemId(true)));
1522 $this->tpl->parseCurrentBlock();
1523 }
1524
1525 $this->tpl->parseCurrentBlock();
1526 }
1527
1528 if ($this->bold_title == true) {
1529 $this->tpl->touchBlock('bold_title_start');
1530 $this->tpl->touchBlock('bold_title_end');
1531 }
1532 }
1533
1534 protected function buildGotoLink()
1535 {
1536 switch ($this->context) {
1538 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1539 return ilWorkspaceAccessHandler::getGotoLink($this->ref_id, $this->obj_id);
1540
1541 default:
1542 // not implemented yet
1543 break;
1544 }
1545 }
1546
1553 public function insertSubstitutions()
1554 {
1555 $fields_shown = false;
1556 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as $data) {
1557 if ($data['bold']) {
1558 $data['name'] = '<strong>' . $data['name'] . '</strong>';
1559 $data['value'] = '<strong>' . $data['value'] . '</strong>';
1560 }
1561 $this->tpl->touchBlock("std_prop");
1562 $this->tpl->setCurrentBlock('item_property');
1563 if ($data['show_field']) {
1564 $this->tpl->setVariable('TXT_PROP', $data['name']);
1565 }
1566 $this->tpl->setVariable('VAL_PROP', $data['value']);
1567 $this->tpl->parseCurrentBlock();
1568
1569 if ($data['newline']) {
1570 $this->tpl->touchBlock('newline_prop');
1571 }
1572 $fields_shown = false;
1573 }
1574 if ($fields_shown) {
1575 $this->tpl->touchBlock('newline_prop');
1576 }
1577 }
1578
1579
1587 public function insertDescription()
1588 {
1589 if ($this->getSubstitutionStatus()) {
1590 $this->insertSubstitutions();
1591 if (!$this->substitutions->isDescriptionEnabled()) {
1592 return true;
1593 }
1594 }
1595
1596 // see bug #16519
1597 $d = $this->getDescription();
1598 $d = strip_tags($d, "<b>");
1599 $this->tpl->setCurrentBlock("item_description");
1600 $this->tpl->setVariable("TXT_DESC", $d);
1601 $this->tpl->parseCurrentBlock();
1602 }
1603
1608 public function insertSearchFragment()
1609 {
1610 if (strlen($this->getSearchFragment())) {
1611 $this->tpl->setCurrentBlock('search_fragment');
1612 $this->tpl->setVariable('TXT_SEARCH_FRAGMENT', $this->getSearchFragment() . ' ...');
1613 $this->tpl->parseCurrentBlock();
1614 }
1615 }
1616
1622 public function insertRelevance()
1623 {
1624 if (!$this->enabledRelevance() or !(int) $this->getRelevance()) {
1625 return false;
1626 }
1627
1628 include_once "Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
1630 $pbar->setCurrent($this->getRelevance());
1631
1632 $this->tpl->setCurrentBlock('relevance');
1633 $this->tpl->setVariable('REL_PBAR', $pbar->render());
1634 $this->tpl->parseCurrentBlock();
1635 }
1636
1642 public function setMode($a_mode)
1643 {
1644 $this->mode = $a_mode;
1645 }
1646
1652 public function getMode()
1653 {
1654 return $this->mode;
1655 }
1656
1660 public function setConditionDepth($a_depth)
1661 {
1662 $this->condition_depth = $a_depth;
1663 }
1664
1672 public function isMode($a_mode)
1673 {
1674 if ($a_mode == $this->mode) {
1675 return true;
1676 } else {
1677 return false;
1678 }
1679 }
1680
1685 public function determineProperties()
1686 {
1687 $ilAccess = $this->access;
1688 $lng = $this->lng;
1690
1691 $props = $this->getProperties();
1692 $props = $this->getCustomProperties($props);
1693
1694 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1695 // add learning progress custom property
1696 include_once "Services/Tracking/classes/class.ilLPStatus.php";
1697 $lp = ilLPStatus::getListGUIStatus($this->obj_id);
1698 if ($lp) {
1699 $props[] = array("alert" => false,
1700 "property" => $lng->txt("learning_progress"),
1701 "value" => $lp,
1702 "newline" => true);
1703 }
1704
1705 // add no item access note in public section
1706 // for items that are visible but not readable
1707 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
1708 if (!$ilAccess->checkAccess("read", "", $this->ref_id, $this->type, $this->obj_id)) {
1709 $props[] = array("alert" => true,
1710 "value" => $lng->txt("no_access_item_public"),
1711 "newline" => true);
1712 }
1713 }
1714 }
1715
1716 // reference objects have translated ids, revert to originals
1717 $note_ref_id = $this->ref_id;
1718 $note_obj_id = $this->obj_id;
1719 if ($this->reference_ref_id) {
1720 $note_ref_id = $this->reference_ref_id;
1721 $note_obj_id = $this->reference_obj_id;
1722 }
1723 $redraw_js = "il.Object.redrawListItem(" . $note_ref_id . ");";
1724
1725 // add common properties (comments, notes, tags)
1726 require_once 'Services/Notes/classes/class.ilNote.php';
1727 if ((self::$cnt_notes[$note_obj_id][IL_NOTE_PRIVATE] > 0 ||
1728 self::$cnt_notes[$note_obj_id][IL_NOTE_PUBLIC] > 0 ||
1729 self::$cnt_tags[$note_obj_id] > 0 ||
1730 is_array(self::$tags[$note_obj_id])) &&
1731 ($ilUser->getId() != ANONYMOUS_USER_ID)) {
1732 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
1733 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
1734
1735 $nl = true;
1736 if ($this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, false, false)
1737 && self::$cnt_notes[$note_obj_id][IL_NOTE_PUBLIC] > 0) {
1738 $props[] = array("alert" => false,
1739 "property" => $lng->txt("notes_comments"),
1740 "value" => "<a href='#' onclick=\"return " .
1741 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $redraw_js) . "\">" .
1742 self::$cnt_notes[$note_obj_id][IL_NOTE_PUBLIC] . "</a>",
1743 "newline" => $nl);
1744 $nl = false;
1745 }
1746
1747 if ($this->notes_enabled && self::$cnt_notes[$note_obj_id][IL_NOTE_PRIVATE] > 0) {
1748 $props[] = array("alert" => false,
1749 "property" => $lng->txt("notes"),
1750 "value" => "<a href='#' onclick=\"return " .
1751 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $redraw_js) . "\">" .
1752 self::$cnt_notes[$note_obj_id][IL_NOTE_PRIVATE] . "</a>",
1753 "newline" => $nl);
1754 $nl = false;
1755 }
1756 if ($this->tags_enabled &&
1757 (self::$cnt_tags[$note_obj_id] > 0 ||
1758 is_array(self::$tags[$note_obj_id]))) {
1759 $tags_set = new ilSetting("tags");
1760 if ($tags_set->get("enable")) {
1761 $tags_url = ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $redraw_js);
1762
1763 // list object tags
1764 if (is_array(self::$tags[$note_obj_id])) {
1765 $tags_tmp = array();
1766 foreach (self::$tags[$note_obj_id] as $tag => $is_tag_owner) {
1767 if ($is_tag_owner) {
1768 $tags_tmp[] = "<a class=\"ilTag ilTagRelHigh\" href='#' onclick=\"return " .
1769 $tags_url . "\">" . $tag . "</a>";
1770 } else {
1771 $tags_tmp[] = "<span class=\"ilTag ilTagRelMiddle\">" . $tag . "</span>";
1772 }
1773 }
1774 $tags_value = implode(" ", $tags_tmp);
1775 $nl = true;
1776 $prop_text = "";
1777 } // tags counter
1778 else {
1779 $tags_value = "<a href='#' onclick=\"return " . $tags_url . "\">" .
1780 self::$cnt_tags[$note_obj_id] . "</a>";
1781 $prop_text = $lng->txt("tagging_tags");
1782 }
1783 $props[] = array("alert" => false,
1784 "property" => $prop_text,
1785 "value" => $tags_value,
1786 "newline" => $nl);
1787 $nl = false;
1788 }
1789 }
1790 }
1791 if (!is_array($props)) {
1792 return [];
1793 }
1794 return $props;
1795 }
1796
1802 public function insertProperties()
1803 {
1804 $props = $this->determineProperties();
1805 $cnt = 1;
1806 if (is_array($props) && count($props) > 0) {
1807 foreach ($props as $prop) {
1808 // BEGIN WebDAV: Display a separator between properties.
1809 if ($cnt > 1) {
1810 $this->tpl->touchBlock("separator_prop");
1811 }
1812 // END WebDAV: Display a separator between properties.
1813
1814 if ($prop["alert"] == true) {
1815 $this->tpl->touchBlock("alert_prop");
1816 } else {
1817 $this->tpl->touchBlock("std_prop");
1818 }
1819 if ($prop["newline"] == true && $cnt > 1) {
1820 $this->tpl->touchBlock("newline_prop");
1821 }
1822 //BEGIN WebDAV: Support hidden property names.
1823 if (isset($prop["property"]) && $prop['propertyNameVisible'] !== false && $prop["property"] != "") {
1824 //END WebDAV: Support hidden property names.
1825 $this->tpl->setCurrentBlock("prop_name");
1826 $this->tpl->setVariable("TXT_PROP", $prop["property"]);
1827 $this->tpl->parseCurrentBlock();
1828 }
1829 $this->tpl->setCurrentBlock("item_property");
1830 //BEGIN WebDAV: Support links in property values.
1831 if ($prop['link']) {
1832 $this->tpl->setVariable("LINK_PROP", $prop['link']);
1833 $this->tpl->setVariable("LINK_VAL_PROP", $prop["value"]);
1834 } else {
1835 $this->tpl->setVariable("VAL_PROP", $prop["value"]);
1836 }
1837 //END WebDAV: Support links in property values.
1838 $this->tpl->parseCurrentBlock();
1839
1840 $cnt++;
1841 }
1842 $this->tpl->setCurrentBlock("item_properties");
1843 $this->tpl->parseCurrentBlock();
1844 }
1845 }
1846
1847 public function insertNoticeProperties()
1848 {
1849 $this->getNoticeProperties();
1850 foreach ($this->notice_prop as $property) {
1851 $this->tpl->setCurrentBlock('notice_item');
1852 $this->tpl->setVariable('NOTICE_ITEM_VALUE', $property['value']);
1853 $this->tpl->parseCurrentBlock();
1854 }
1855 $this->tpl->setCurrentBlock('notice_property');
1856 $this->tpl->parseCurrentBlock();
1857 }
1858
1859 protected function parseConditions($toggle_id, $conditions, $obligatory = true)
1860 {
1861 $lng = $this->lng;
1862 $objDefinition = $this->obj_definition;
1864
1865 $num_required = ilConditionHandler::calculateEffectiveRequiredTriggers($this->ref_id, $this->obj_id);
1866 $num_optional_required =
1867 $num_required - count($conditions) + count(ilConditionHandler::getEffectiveOptionalConditionsOfTarget($this->ref_id, $this->obj_id));
1868
1869 // Check if all conditions are fullfilled
1870 $visible_conditions = array();
1871 $passed_optional = 0;
1872 foreach ($conditions as $condition) {
1873 if ($obligatory and !$condition['obligatory']) {
1874 continue;
1875 }
1876 if (!$obligatory and $condition['obligatory']) {
1877 continue;
1878 }
1879
1880 if ($tree->isDeleted($condition['trigger_ref_id'])) {
1881 continue;
1882 }
1883
1884 include_once 'Services/Container/classes/class.ilMemberViewSettings.php';
1886 !ilMemberViewSettings::getInstance()->isActive();
1887
1888 if (!$ok) {
1889 $visible_conditions[] = $condition['id'];
1890 }
1891
1892 if (!$obligatory and $ok) {
1893 ++$passed_optional;
1894 // optional passed
1895 if ($passed_optional >= $num_optional_required) {
1896 return true;
1897 }
1898 }
1899 }
1900
1901 foreach ($conditions as $condition) {
1902 if (!in_array($condition['id'], $visible_conditions)) {
1903 continue;
1904 }
1905
1906 include_once './Services/Conditions/classes/class.ilConditionHandlerGUI.php';
1907 $cond_txt = ilConditionHandlerGUI::translateOperator($condition['trigger_obj_id'], $condition['operator']) . ' ' . $condition['value'];
1908
1909 // display trigger item
1910 $class = $objDefinition->getClassName($condition["trigger_type"]);
1911 $location = $objDefinition->getLocation($condition["trigger_type"]);
1912 if ($class == "" && $location == "") {
1913 continue;
1914 }
1915 $missing_cond_exist = true;
1916
1917 $full_class = "ilObj" . $class . "ListGUI";
1918 include_once($location . "/class." . $full_class . ".php");
1919 $item_list_gui = new $full_class($this);
1920 $item_list_gui->setMode(IL_LIST_AS_TRIGGER);
1921 $item_list_gui->enablePath(false);
1922 $item_list_gui->enableIcon(true);
1923 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1924 $item_list_gui->setParentRefId($this->getUniqueItemId()); // yes we can
1925 $item_list_gui->addCustomProperty($this->lng->txt("precondition_required_itemlist"), $cond_txt, false, true);
1926
1927 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1928 $item_list_gui->enableProperties($this->properties_enabled);
1929
1930 $trigger_html = $item_list_gui->getListItemHTML(
1931 $condition['trigger_ref_id'],
1932 $condition['trigger_obj_id'],
1933 ilObject::_lookupTitle($condition["trigger_obj_id"]),
1934 ""
1935 );
1936 $this->tpl->setCurrentBlock("precondition");
1937 if ($trigger_html == "") {
1938 $trigger_html = $this->lng->txt("precondition_not_accessible");
1939 }
1940 $this->tpl->setVariable("TXT_CONDITION", trim($cond_txt));
1941 $this->tpl->setVariable("TRIGGER_ITEM", $trigger_html);
1942 $this->tpl->parseCurrentBlock();
1943 }
1944
1945 if ($missing_cond_exist and $obligatory) {
1946 $this->tpl->setCurrentBlock("preconditions");
1947 $this->tpl->setVariable("CONDITION_TOGGLE_ID", "_obl_" . $toggle_id);
1948 $this->tpl->setVariable("TXT_PRECONDITIONS", $lng->txt("preconditions_obligatory_hint"));
1949 $this->tpl->parseCurrentBlock();
1950 } elseif ($missing_cond_exist and !$obligatory) {
1951 $this->tpl->setCurrentBlock("preconditions");
1952 $this->tpl->setVariable("CONDITION_TOGGLE_ID", "_opt_" . $toggle_id);
1953 $this->tpl->setVariable("TXT_PRECONDITIONS", sprintf($lng->txt("preconditions_optional_hint"), $num_optional_required));
1954 $this->tpl->parseCurrentBlock();
1955 }
1956
1957 return !$missing_cond_exist;
1958 }
1959
1963 public function insertPreconditions()
1964 {
1965 include_once("./Services/Conditions/classes/class.ilConditionHandler.php");
1966
1967 // do not show multi level conditions (messes up layout)
1968 if ($this->condition_depth > 0) {
1969 return;
1970 }
1971
1972 if ($this->condition_target) {
1973 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget(
1974 $this->condition_target['ref_id'],
1975 $this->condition_target['obj_id'],
1976 $this->condition_target['target_type']
1977 );
1978 } else {
1979 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget($this->ref_id, $this->obj_id);
1980 }
1981
1982 if (sizeof($conditions)) {
1983 for ($i = 0; $i < count($conditions); $i++) {
1984 $conditions[$i]['title'] = ilObject::_lookupTitle($conditions[$i]['trigger_obj_id']);
1985 }
1986 $conditions = ilUtil::sortArray($conditions, 'title', 'DESC');
1987
1989
1990 // Show obligatory and optional preconditions seperated
1991 $all_done_obl = $this->parseConditions(self::$js_unique_id, $conditions, true);
1992 $all_done_opt = $this->parseConditions(self::$js_unique_id, $conditions, false);
1993
1994 if (!$all_done_obl || !$all_done_opt) {
1995 $this->tpl->setCurrentBlock("preconditions_toggle");
1996 $this->tpl->setVariable("PRECONDITION_TOGGLE_INTRO", $this->lng->txt("precondition_toggle"));
1997 $this->tpl->setVariable("PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt("show"));
1998 $this->tpl->setVariable("PRECONDITION_TOGGLE_ID", self::$js_unique_id);
1999 $this->tpl->setVariable("TXT_PRECONDITION_SHOW", $this->lng->txt("show"));
2000 $this->tpl->setVariable("TXT_PRECONDITION_HIDE", $this->lng->txt("hide"));
2001 $this->tpl->parseCurrentBlock();
2002 }
2003 }
2004 }
2005
2014 public function insertCommand($a_href, $a_text, $a_frame = "", $a_img = "", $a_cmd = "", $a_onclick = "")
2015 {
2016 // #11099
2017 $chksum = md5($a_href . $a_text);
2018 if ($a_href == "#" ||
2019 !in_array($chksum, $this->prevent_duplicate_commands)) {
2020 if ($a_href != "#") {
2021 $this->prevent_duplicate_commands[] = $chksum;
2022 }
2023
2024 $prevent_background_click = false;
2025 if ($a_cmd == 'mount_webfolder') {
2026 $a_onclick = "triggerWebDAVModal('$a_href')";
2027 $a_href = "#";
2029 }
2030
2031 $this->current_selection_list->addItem(
2032 $a_text,
2033 "",
2034 $a_href,
2035 $a_img,
2036 $a_text,
2037 $a_frame,
2038 "",
2039 $prevent_background_click,
2040 $a_onclick
2041 );
2042 }
2043 }
2044
2052 public function insertDeleteCommand()
2053 {
2054 if ($this->std_cmd_only) {
2055 return;
2056 }
2057
2058 if (is_object($this->getContainerObject()) and
2060 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type)) {
2061 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2062 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "delete");
2063 $this->insertCommand($cmd_link, $this->lng->txt("delete"));
2064 $this->adm_commands_included = true;
2065 return true;
2066 }
2067 return false;
2068 }
2069
2070 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type)) {
2071 $this->ctrl->setParameter(
2072 $this->container_obj,
2073 "ref_id",
2074 $this->container_obj->object->getRefId()
2075 );
2076 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2077 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "delete");
2078 $this->insertCommand(
2079 $cmd_link,
2080 $this->lng->txt("delete"),
2081 "",
2082 ""
2083 );
2084 $this->adm_commands_included = true;
2085 }
2086 }
2087
2095 public function insertLinkCommand()
2096 {
2097 $objDefinition = $this->obj_definition;
2098
2099 if ($this->std_cmd_only) {
2100 return;
2101 }
2102
2103 // #17307
2104 if (!$this->checkCommandAccess('delete', '', $this->ref_id, $this->type) or
2105 !$objDefinition->allowLink($this->type)) {
2106 return false;
2107 }
2108
2109 // BEGIN PATCH Lucene search
2110
2111 if (is_object($this->getContainerObject()) and
2113 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2114 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "link");
2115 $this->insertCommand($cmd_link, $this->lng->txt("link"));
2116 $this->adm_commands_included = true;
2117 return true;
2118 }
2119 // END PATCH Lucene Search
2120
2121 // if the permission is changed here, it has
2122 // also to be changed in ilContainerGUI, admin command check
2123 $this->ctrl->setParameter(
2124 $this->container_obj,
2125 "ref_id",
2126 $this->container_obj->object->getRefId()
2127 );
2128 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2129 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "link");
2130 $this->insertCommand(
2131 $cmd_link,
2132 $this->lng->txt("link"),
2133 "",
2134 ""
2135 );
2136 $this->adm_commands_included = true;
2137 return true;
2138 }
2139
2146 public function insertCutCommand($a_to_repository = false)
2147 {
2148 if ($this->std_cmd_only) {
2149 return;
2150 }
2151 // BEGIN PATCH Lucene search
2152 if (is_object($this->getContainerObject()) and
2154 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type)) {
2155 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2156 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "cut");
2157 $this->insertCommand($cmd_link, $this->lng->txt("move"));
2158 $this->adm_commands_included = true;
2159 return true;
2160 }
2161 return false;
2162 }
2163 // END PATCH Lucene Search
2164
2165 // if the permission is changed here, it has
2166 // also to be changed in ilContainerContentGUI, determineAdminCommands
2167 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type) &&
2168 $this->container_obj->object) {
2169 $this->ctrl->setParameter(
2170 $this->container_obj,
2171 "ref_id",
2172 $this->container_obj->object->getRefId()
2173 );
2174 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2175
2176 if (!$a_to_repository) {
2177 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "cut");
2178 $this->insertCommand(
2179 $cmd_link,
2180 $this->lng->txt("move"),
2181 "",
2182 ""
2183 );
2184 } else {
2185 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "cut_for_repository");
2186 $this->insertCommand(
2187 $cmd_link,
2188 $this->lng->txt("wsp_move_to_repository"),
2189 "",
2190 ""
2191 );
2192 }
2193
2194 $this->adm_commands_included = true;
2195 }
2196 }
2197
2203 public function insertCopyCommand($a_to_repository = false)
2204 {
2205 $objDefinition = $this->obj_definition;
2206
2207 if ($this->std_cmd_only) {
2208 return;
2209 }
2210
2211 if ($this->checkCommandAccess('copy', 'copy', $this->ref_id, $this->type) &&
2212 $objDefinition->allowCopy($this->type)) {
2213 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
2214 $this->ctrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getCommandId());
2215 $cmd_copy = $this->ctrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
2216 $this->insertCommand($cmd_copy, $this->lng->txt('copy'));
2217 } else {
2218 $this->ctrl->setParameter(
2219 $this->container_obj,
2220 "ref_id",
2221 $this->container_obj->object->getRefId()
2222 );
2223 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2224
2225 if (!$a_to_repository) {
2226 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj, 'copy');
2227 $this->insertCommand($cmd_copy, $this->lng->txt('copy'));
2228 } else {
2229 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj, 'copy_to_repository');
2230 $this->insertCommand($cmd_copy, $this->lng->txt('wsp_copy_to_repository'));
2231 }
2232 }
2233
2234 $this->adm_commands_included = true;
2235 }
2236 return;
2237 }
2238
2239
2243 public function insertPasteCommand()
2244 {
2245 $objDefinition = $this->obj_definition;
2246
2247 if ($this->std_cmd_only) {
2248 return;
2249 }
2250
2251 if (!$objDefinition->isContainer(ilObject::_lookupType($this->obj_id))) {
2252 return false;
2253 }
2254
2255 if (is_object($this->getContainerObject()) and
2257 isset($_SESSION['clipboard'])) {
2258 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2259 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "paste");
2260 $this->insertCommand($cmd_link, $this->lng->txt("paste"));
2261 $this->adm_commands_included = true;
2262 return true;
2263 }
2264 return false;
2265 }
2266
2274 public function insertSubscribeCommand()
2275 {
2278
2279 if ($this->std_cmd_only) {
2280 return;
2281 }
2282
2283 // note: the setting disable_my_offers is used for
2284 // presenting the favourites in the main section of the dashboard
2285 // see also bug #32014
2286 //if ((int) $ilSetting->get('disable_my_offers')) {
2287 // return;
2288 //}
2289
2291
2292 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
2293 // #17467 - add ref_id to link (in repository only!)
2294 if (is_object($this->container_obj) &&
2295 !($this->container_obj instanceof ilAdministrationCommandHandling) &&
2296 is_object($this->container_obj->object)) {
2297 $this->ctrl->setParameter($this->container_obj, "ref_id", $this->container_obj->object->getRefId());
2298 }
2299
2300 if (!$this->fav_manager->ifIsFavourite($ilUser->getId(), $this->getCommandId())) {
2301 // Pass type and object ID to ilAccess to improve performance
2302 if ($this->checkCommandAccess("read", "", $this->ref_id, $this->type, $this->obj_id)) {
2303 if ($this->getContainerObject() instanceof ilDesktopItemHandling) {
2304 $this->ctrl->setParameter($this->container_obj, "type", $type);
2305 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2306 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "addToDesk");
2307 $this->insertCommand(
2308 $cmd_link,
2309 $this->lng->txt("rep_add_to_favourites"),
2310 "",
2311 ""
2312 );
2313 }
2314 }
2315 } else {
2316 if ($this->getContainerObject() instanceof ilDesktopItemHandling) {
2317 $this->ctrl->setParameter($this->container_obj, "type", $type);
2318 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2319 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "removeFromDesk");
2320 $this->insertCommand(
2321 $cmd_link,
2322 $this->lng->txt("rep_remove_from_favourites"),
2323 "",
2324 ""
2325 );
2326 }
2327 }
2328 }
2329 }
2330
2334 public function insertInfoScreenCommand()
2335 {
2336 if ($this->std_cmd_only) {
2337 return;
2338 }
2339 $cmd_link = $this->getCommandLink("infoScreen");
2340 $cmd_frame = $this->getCommandFrame("infoScreen");
2341 $this->insertCommand(
2342 $cmd_link,
2343 $this->lng->txt("info_short"),
2344 $cmd_frame,
2345 ilUtil::getImagePath("icon_info.svg")
2346 );
2347 }
2348
2355 public function insertCommonSocialCommands($a_header_actions = false)
2356 {
2357 $lng = $this->lng;
2359
2360 if ($this->std_cmd_only ||
2361 ($ilUser->getId() == ANONYMOUS_USER_ID)) {
2362 return;
2363 }
2364 $lng->loadLanguageModule("notes");
2365 $lng->loadLanguageModule("tagging");
2366 $cmd_frame = $this->getCommandFrame("infoScreen");
2367 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
2368
2369 // reference objects have translated ids, revert to originals
2370 $note_ref_id = $this->ref_id;
2371 if ($this->reference_ref_id) {
2372 $note_ref_id = $this->reference_ref_id;
2373 }
2374
2375 $js_updater = $a_header_actions
2376 ? "il.Object.redrawActionHeader();"
2377 : "il.Object.redrawListItem(" . $note_ref_id . ")";
2378
2379 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, $a_header_actions, true);
2380 if ($comments_enabled) {
2381 $this->insertCommand(
2382 "#",
2383 $this->lng->txt("notes_comments"),
2384 $cmd_frame,
2385 "",
2386 "",
2387 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $js_updater)
2388 );
2389 }
2390
2391 if ($this->notes_enabled) {
2392 $this->insertCommand(
2393 "#",
2394 $this->lng->txt("notes"),
2395 $cmd_frame,
2396 "",
2397 "",
2398 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $js_updater)
2399 );
2400 }
2401
2402 if ($this->tags_enabled) {
2403 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
2404 //$this->insertCommand($cmd_tag_link, $this->lng->txt("tagging_set_tag"), $cmd_frame);
2405 $this->insertCommand(
2406 "#",
2407 $this->lng->txt("tagging_set_tag"),
2408 $cmd_frame,
2409 "",
2410 "",
2411 ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $js_updater)
2412 );
2413 }
2414 }
2415
2421 public function insertTimingsCommand()
2422 {
2423 if ($this->std_cmd_only || !$this->container_obj->object) {
2424 return;
2425 }
2426
2427 $parent_ref_id = $this->container_obj->object->getRefId();
2428 $parent_type = $this->container_obj->object->getType();
2429
2430 // #18737
2431 if ($this->reference_ref_id) {
2432 $this->ctrl->setParameterByClass('ilobjectactivationgui', 'ref_id', $this->reference_ref_id);
2433 }
2434
2435 if ($this->checkCommandAccess('write', '', $parent_ref_id, $parent_type) ||
2436 $this->checkCommandAccess('write', '', $this->ref_id, $this->type)) {
2437 $this->ctrl->setParameterByClass(
2438 'ilobjectactivationgui',
2439 'cadh',
2440 $this->ajax_hash
2441 );
2442 $this->ctrl->setParameterByClass(
2443 'ilobjectactivationgui',
2444 'parent_id',
2446 );
2447 $cmd_lnk = $this->ctrl->getLinkTargetByClass(
2448 array($this->gui_class_name, 'ilcommonactiondispatchergui', 'ilobjectactivationgui'),
2449 'edit'
2450 );
2451
2452 $this->insertCommand($cmd_lnk, $this->lng->txt('obj_activation_list_gui'));
2453 }
2454
2455 if ($this->reference_ref_id) {
2456 $this->ctrl->setParameterByClass('ilobjectactivationgui', 'ref_id', $this->ref_id);
2457 }
2458 }
2459
2467 public function insertCommands(
2468 $a_use_asynch = false,
2469 $a_get_asynch_commands = false,
2470 $a_asynch_url = "",
2471 $a_header_actions = false
2472 ) {
2473 $lng = $this->lng;
2475
2476 if (!$this->getCommandsStatus()) {
2477 return;
2478 }
2479
2480 include_once("Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2481 $this->current_selection_list = new ilAdvancedSelectionListGUI();
2482 $this->current_selection_list->setAriaListTitle(
2483 sprintf(
2484 $this->lng->txt('actions_for'),
2485 htmlspecialchars(addslashes($this->getTitle()))
2486 )
2487 );
2488 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2489 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2490 if ($a_header_actions) {
2491 $this->current_selection_list->setListTitle("<span class='hidden-xs'>" . $lng->txt("actions") . "</span>");
2492 } else {
2493 $this->current_selection_list->setListTitle("");
2494 }
2495 $this->current_selection_list->setId("act_" . $this->getUniqueItemId(false));
2496 $this->current_selection_list->setSelectionHeaderClass("small");
2497 $this->current_selection_list->setItemLinkClass("xsmall");
2498 $this->current_selection_list->setLinksMode("il_ContainerItemCommand2");
2499 $this->current_selection_list->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
2500 $this->current_selection_list->setUseImages(false);
2501 $this->current_selection_list->setAdditionalToggleElement($this->getUniqueItemId(true), "ilContainerListItemOuterHighlight");
2502
2503 $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", $this->ref_id);
2504
2505 // only standard command?
2506 $only_default = false;
2507 if ($a_use_asynch && !$a_get_asynch_commands) {
2508 $only_default = true;
2509 }
2510
2511 $this->default_command = false;
2512 $this->prevent_duplicate_commands = array();
2513
2514 // we only allow the following commands inside the header actions
2515 $valid_header_commands = array("mount_webfolder");
2516
2517 $commands = $this->getCommands($this->ref_id, $this->obj_id);
2518 foreach ($commands as $command) {
2519 if ($a_header_actions && !in_array($command["cmd"], $valid_header_commands)) {
2520 continue;
2521 }
2522
2523 if ($command["granted"] == true) {
2524 if (!$command["default"] === true) {
2525 if (!$this->std_cmd_only && !$only_default) {
2526 // workaround for repository frameset
2527 $command["link"] =
2528 $this->appendRepositoryFrameParameter($command["link"]);
2529
2530 $cmd_link = $command["link"];
2531 $txt = ($command["lang_var"] == "")
2532 ? $command["txt"]
2533 : $this->lng->txt($command["lang_var"]);
2534 $this->insertCommand(
2535 $cmd_link,
2536 $txt,
2537 $command["frame"],
2538 $command["img"],
2539 $command["cmd"]
2540 );
2541 }
2542 } else {
2543 $this->default_command = $this->createDefaultCommand($command);
2544 //$this->default_command = $command;
2545 }
2546 }
2547 }
2548
2549 if (!$only_default) {
2550 // custom commands
2551 if (is_array($this->cust_commands)) {
2552 foreach ($this->cust_commands as $command) {
2553 $this->insertCommand(
2554 $command["link"],
2555 $this->lng->txt($command["lang_var"]),
2556 $command["frame"],
2557 "",
2558 $command["cmd"],
2559 $command["onclick"]
2560 );
2561 }
2562 }
2563
2564 // info screen commmand
2565 if ($this->getInfoScreenStatus()) {
2566 $this->insertInfoScreenCommand();
2567 }
2568
2569 if (!$this->isMode(IL_LIST_AS_TRIGGER)) {
2570 // edit timings
2571 if ($this->timings_enabled) {
2572 $this->insertTimingsCommand();
2573 }
2574
2575 // delete
2576 if ($this->delete_enabled) {
2577 $this->insertDeleteCommand();
2578 }
2579
2580 // link
2581 if ($this->link_enabled) {
2582 $this->insertLinkCommand();
2583 }
2584
2585 // cut
2586 if ($this->cut_enabled) {
2587 $this->insertCutCommand();
2588 }
2589
2590 // copy
2591 if ($this->copy_enabled) {
2592 $this->insertCopyCommand();
2593 }
2594
2595 // cut/copy from workspace to repository
2596 if ($this->repository_transfer_enabled) {
2597 $this->insertCutCommand(true);
2598 $this->insertCopyCommand(true);
2599 }
2600
2601 // subscribe
2602 if ($this->subscribe_enabled) {
2603 $this->insertSubscribeCommand();
2604 }
2605
2606 // multi download
2607 if ($this->multi_download_enabled && $a_header_actions) {
2609 }
2610
2611 // BEGIN PATCH Lucene search
2612 if ($this->cut_enabled or $this->link_enabled) {
2613 $this->insertPasteCommand();
2614 }
2615 // END PATCH Lucene Search
2616 }
2617 }
2618
2619 // common social commands (comment, notes, tags)
2620 if (!$only_default && !$this->isMode(IL_LIST_AS_TRIGGER)) {
2621 $this->insertCommonSocialCommands($a_header_actions);
2622 }
2623
2624 if (!$a_header_actions) {
2625 $this->ctrl->clearParametersByClass($this->gui_class_name);
2626 }
2627
2628 // fix bug #12417
2629 // there is one case, where no action menu should be displayed:
2630 // public area, category, no info tab
2631 // todo: make this faster and remove type specific implementation if possible
2632 if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions) {
2633 if ($ilUser->getId() == ANONYMOUS_USER_ID && $this->checkInfoPageOnAsynchronousRendering()) {
2634 include_once("./Services/Container/classes/class.ilContainer.php");
2635 include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
2637 $this->obj_id,
2639 true
2640 )) {
2641 return;
2642 }
2643 }
2644 }
2645
2646 if ($a_use_asynch && $a_get_asynch_commands) {
2647 return $this->current_selection_list->getHTML(true);
2648 }
2649
2650 return $this->current_selection_list->getHTML();
2651 }
2652
2658 public function enableComments($a_value, $a_enable_comments_settings = true)
2659 {
2661
2662 // global switch
2663 if ($ilSetting->get("disable_comments")) {
2664 $a_value = false;
2665 }
2666
2667 $this->comments_enabled = (bool) $a_value;
2668 $this->comments_settings_enabled = (bool) $a_enable_comments_settings;
2669 }
2670
2676 public function enableNotes($a_value)
2677 {
2679
2680 // global switch
2681 if ($ilSetting->get("disable_notes")) {
2682 $a_value = false;
2683 }
2684
2685 $this->notes_enabled = (bool) $a_value;
2686 }
2687
2693 public function enableTags($a_value)
2694 {
2695 $tags_set = new ilSetting("tags");
2696 if (!$tags_set->get("enable")) {
2697 $a_value = false;
2698 }
2699 $this->tags_enabled = (bool) $a_value;
2700 }
2701
2710 public function enableRating($a_value, $a_text = null, $a_categories = false, array $a_ctrl_path = null)
2711 {
2712 $this->rating_enabled = (bool) $a_value;
2713
2714 if ($this->rating_enabled) {
2715 $this->rating_categories_enabled = (bool) $a_categories;
2716 $this->rating_text = $a_text;
2717 $this->rating_ctrl_path = $a_ctrl_path;
2718 }
2719 }
2720
2726 public function enableMultiDownload($a_value)
2727 {
2728 $folder_set = new ilSetting("fold");
2729 if (!$folder_set->get("enable_multi_download")) {
2730 $a_value = false;
2731 }
2732 $this->multi_download_enabled = (bool) $a_value;
2733 }
2734
2736 {
2737 $objDefinition = $this->obj_definition;
2738
2739 if ($this->std_cmd_only) {
2740 return;
2741 }
2742
2743 if (!$objDefinition->isContainer(ilObject::_lookupType($this->obj_id))) {
2744 return false;
2745 }
2746
2747 if (is_object($this->getContainerObject()) &&
2748 $this->getContainerObject() instanceof ilContainerGUI) {
2749 $this->ctrl->setParameter($this->getContainerObject(), "type", "");
2750 $this->ctrl->setParameter($this->getContainerObject(), "item_ref_id", "");
2751 $this->ctrl->setParameter($this->getContainerObject(), "active_node", "");
2752 // bugfix mantis 24559
2753 // undoing an erroneous change inside mantis 23516 by adding "Download Multiple Objects"-functionality for non-admins
2754 // as they don't have the possibility to use the multi-download-capability of the manage-tab
2755 $user_id = $this->user->getId();
2756 $hasAdminAccess = $this->access->checkAccessOfUser($user_id, "crs_admin", $this->ctrl->getCmd(), $_GET['ref_id']);
2757 // to still prevent duplicate download functions for admins the following if-else statement keeps the redirection for admins
2758 // while letting other course members access the original multi-download functionality
2759 if ($hasAdminAccess) {
2760 $cmd = $_GET["cmd"] == "enableAdministrationPanel" ? "render" : "enableAdministrationPanel";
2761 } else {
2762 $cmd = $_GET["cmd"] == "enableMultiDownload" ? "render" : "enableMultiDownload";
2763 }
2764 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), $cmd);
2765 $this->insertCommand($cmd_link, $this->lng->txt("download_multiple_objects"));
2766 return true;
2767 }
2768
2769 return false;
2770 }
2771
2772 public function enableDownloadCheckbox($a_ref_id, $a_value)
2773 {
2774 $ilAccess = $this->access;
2775
2776 // TODO: delegate to list object class!
2777 if (!$this->getContainerObject()->isActiveAdministrationPanel() || $_SESSION["clipboard"]) {
2778 if (in_array($this->type, array("file", "fold")) &&
2779 $ilAccess->checkAccess("read", "", $a_ref_id, $this->type)) {
2780 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2781 } else {
2782 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2783 }
2784 } else {
2785 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2786 }
2787 }
2788
2790 {
2792 }
2793
2797 public static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl = null)
2798 {
2799 global $DIC;
2800
2801 $tpl = $DIC["tpl"];
2802
2803 if (is_null($a_tpl)) {
2804 $a_tpl = $tpl;
2805 }
2806
2807 if ($a_notes_url) {
2808 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
2809 ilNoteGUI::initJavascript($a_notes_url, IL_NOTE_PRIVATE, $a_tpl);
2810 }
2811
2812 if ($a_tags_url) {
2813 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
2814 ilTaggingGUI::initJavascript($a_tags_url, $a_tpl);
2815 }
2816
2817 if ($a_redraw_url) {
2818 $a_tpl->addOnLoadCode("il.Object.setRedrawAHUrl('" .
2819 $a_redraw_url . "');");
2820 }
2821 }
2822
2829 public function setHeaderSubObject($a_type, $a_id)
2830 {
2831 $this->sub_obj_type = $a_type;
2832 $this->sub_obj_id = (int) $a_id;
2833 }
2834
2844 public function addHeaderIcon($a_id, $a_img, $a_tooltip = null, $a_onclick = null, $a_status_text = null, $a_href = null)
2845 {
2846 $this->header_icons[$a_id] = array("img" => $a_img,
2847 "tooltip" => $a_tooltip,
2848 "onclick" => $a_onclick,
2849 "status_text" => $a_status_text,
2850 "href" => $a_href);
2851 }
2852
2858 public function addHeaderIconHTML($a_id, $a_html)
2859 {
2860 $this->header_icons[$a_id] = $a_html;
2861 }
2862
2868 public function addHeaderGlyph($a_id, $a_glyph, $a_onclick = null)
2869 {
2870 $this->header_icons[$a_id] = array("glyph" => $a_glyph, "onclick" => $a_onclick);
2871 }
2872
2873 public function setAjaxHash($a_hash)
2874 {
2875 $this->ajax_hash = $a_hash;
2876 }
2877
2883 public function getHeaderAction(ilGlobalTemplateInterface $a_main_tpl = null)
2884 {
2885 global $DIC;
2886
2888 $lng = $this->lng;
2889
2890 if ($a_main_tpl == null) {
2891 $main_tpl = $DIC["tpl"];
2892 } else {
2893 $main_tpl = $a_main_tpl;
2894 }
2895
2896 $htpl = new ilTemplate("tpl.header_action.html", true, true, "Services/Repository");
2897
2898 $redraw_js = "il.Object.redrawActionHeader();";
2899
2900 // tags
2901 if ($this->tags_enabled) {
2902 include_once("./Services/Tagging/classes/class.ilTagging.php");
2904 $this->obj_id,
2905 ilObject::_lookupType($this->obj_id),
2906 0,
2907 "",
2908 $ilUser->getId()
2909 );
2910 if (count($tags) > 0) {
2911 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
2912 $lng->loadLanguageModule("tagging");
2913 /*$this->addHeaderIcon("tags",
2914 ilUtil::getImagePath("icon_tag.svg"),
2915 $lng->txt("tagging_tags").": ".count($tags),
2916 ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $redraw_js),
2917 count($tags));*/
2918
2919 $f = $this->ui->factory();
2920 $this->addHeaderGlyph(
2921 "tags",
2922 $f->symbol()->glyph()->tag("#")
2923 ->withCounter($f->counter()->status((int) count($tags))),
2924 ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $redraw_js)
2925 );
2926 }
2927 }
2928
2929 // notes and comments
2930 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, true, false);
2931 if ($this->notes_enabled || $comments_enabled) {
2932 include_once("./Services/Notes/classes/class.ilNote.php");
2933 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
2934 $type = ($this->sub_obj_type == "")
2935 ? $this->type
2936 : $this->sub_obj_type;
2937 $cnt = ilNote::_countNotesAndComments($this->obj_id, $this->sub_obj_id, $type);
2938
2939 if ($this->notes_enabled && $cnt[$this->obj_id][IL_NOTE_PRIVATE] > 0) {
2940 /*$this->addHeaderIcon("notes",
2941 ilUtil::getImagePath("note_unlabeled.svg"),
2942 $lng->txt("private_notes").": ".$cnt[$this->obj_id][IL_NOTE_PRIVATE],
2943 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $redraw_js),
2944 $cnt[$this->obj_id][IL_NOTE_PRIVATE]
2945 );*/
2946
2947 $f = $this->ui->factory();
2948 $this->addHeaderGlyph(
2949 "notes",
2950 $f->symbol()->glyph()->note("#")
2951 ->withCounter($f->counter()->status((int) $cnt[$this->obj_id][IL_NOTE_PRIVATE])),
2952 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $redraw_js)
2953 );
2954 }
2955
2956 if ($comments_enabled && $cnt[$this->obj_id][IL_NOTE_PUBLIC] > 0) {
2957 $lng->loadLanguageModule("notes");
2958
2959 /*$this->addHeaderIcon("comments",
2960 ilUtil::getImagePath("comment_unlabeled.svg"),
2961 $lng->txt("notes_public_comments").": ".$cnt[$this->obj_id][IL_NOTE_PUBLIC],
2962 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $redraw_js),
2963 $cnt[$this->obj_id][IL_NOTE_PUBLIC]);*/
2964
2965 $f = $this->ui->factory();
2966 $this->addHeaderGlyph(
2967 "comments",
2968 $f->symbol()->glyph()->comment("#")
2969 ->withCounter($f->counter()->status((int) $cnt[$this->obj_id][IL_NOTE_PUBLIC])),
2970 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $redraw_js)
2971 );
2972 }
2973 }
2974
2975 // rating
2976 if ($this->rating_enabled) {
2977 include_once("./Services/Rating/classes/class.ilRatingGUI.php");
2978 $rating_gui = new ilRatingGUI();
2979 $rating_gui->enableCategories($this->rating_categories_enabled);
2980 // never rate sub objects from header action!
2981 $rating_gui->setObject($this->obj_id, $this->type);
2982 if ($this->rating_text) {
2983 $rating_gui->setYourRatingText($this->rating_text);
2984 }
2985
2986 $this->ctrl->setParameterByClass("ilRatingGUI", "cadh", $this->ajax_hash);
2987 $this->ctrl->setParameterByClass("ilRatingGUI", "rnsb", true);
2988 if ($this->rating_ctrl_path) {
2989 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2990 $ajax_url = $this->ctrl->getLinkTargetByClass($this->rating_ctrl_path, "saveRating", "", true, false);
2991 } else {
2992 // ???
2993 $ajax_url = $this->ctrl->getLinkTargetByClass("ilRatingGUI", "saveRating", "", true, false);
2994 }
2995 $main_tpl->addOnLoadCode("il.Object.setRatingUrl('" . $ajax_url . "');");
2996 $this->addHeaderIconHTML(
2997 "rating",
2998 $rating_gui->getHtml(
2999 true,
3000 $this->checkCommandAccess("read", "", $this->ref_id, $this->type),
3001 "il.Object.saveRating(%rating%);"
3002 )
3003 );
3004 }
3005
3006 if ($this->header_icons) {
3007 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
3008
3009 $chunks = array();
3010 foreach ($this->header_icons as $id => $attr) {
3011 $id = "headp_" . $id;
3012
3013 if (is_array($attr)) {
3014 if ($attr["glyph"]) {
3015 if ($attr["onclick"]) {
3016 $htpl->setCurrentBlock("prop_glyph_oc");
3017 $htpl->setVariable("GLYPH_ONCLICK", $attr["onclick"]);
3018 $htpl->parseCurrentBlock();
3019 }
3020 $renderer = $this->ui->renderer();
3021 $html = $renderer->render($attr["glyph"]);
3022 $htpl->setCurrentBlock("prop_glyph");
3023 $htpl->setVariable("GLYPH", $html);
3024 $htpl->parseCurrentBlock();
3025 } else {
3026 if ($attr["onclick"]) {
3027 $htpl->setCurrentBlock("onclick");
3028 $htpl->setVariable("PROP_ONCLICK", $attr["onclick"]);
3029 $htpl->parseCurrentBlock();
3030 }
3031
3032 if ($attr["status_text"]) {
3033 $htpl->setCurrentBlock("status");
3034 $htpl->setVariable("PROP_TXT", $attr["status_text"]);
3035 $htpl->parseCurrentBlock();
3036 }
3037
3038
3039 $htpl->setCurrentBlock("prop");
3040 if ($attr["href"] || $attr["onclick"]) {
3041 $htpl->setVariable("TAG", "a");
3042 } else {
3043 $htpl->setVariable("TAG", "span");
3044 }
3045 $htpl->setVariable("PROP_ID", $id);
3046 $htpl->setVariable("IMG", ilUtil::img($attr["img"], $attr["tooltip"]));
3047 if ($attr["href"] != "") {
3048 $htpl->setVariable("PROP_HREF", ' href="' . $attr["href"] . '" ');
3049 }
3050 $htpl->parseCurrentBlock();
3051
3052 if ($attr["tooltip"]) {
3053 ilTooltipGUI::addTooltip($id, $attr["tooltip"]);
3054 }
3055 }
3056 } else {
3057 $chunks[] = $attr;
3058 }
3059 }
3060
3061 if (sizeof($chunks)) {
3062 $htpl->setVariable(
3063 "PROP_CHUNKS",
3064 implode("&nbsp;&nbsp;&nbsp;", $chunks) . "&nbsp;&nbsp;&nbsp;"
3065 );
3066 }
3067 }
3068
3069 $this->title = ilObject::_lookupTitle($this->obj_id);
3070 $htpl->setVariable(
3071 "ACTION_DROP_DOWN",
3072 $this->insertCommands(false, false, "", true)
3073 );
3074
3075 return $htpl->get();
3076 }
3077
3078
3083 public function appendRepositoryFrameParameter($a_link)
3084 {
3085 // we should get rid of this nonsense with 4.4 (alex)
3086 if ((strtolower($_GET["baseClass"]) != "ilrepositorygui") &&
3087 is_int(strpos($a_link, "baseClass=ilRepositoryGUI"))) {
3088 if ($this->type != "frm") {
3089 $a_link =
3090 ilUtil::appendUrlParameterString($a_link, "rep_frame=1");
3091 }
3092 }
3093
3094 return $a_link;
3095 }
3096
3097 protected function modifyTitleLink($a_default_link)
3098 {
3099 if ($this->default_command_params) {
3100 $params = array();
3101 foreach ($this->default_command_params as $name => $value) {
3102 $params[] = $name . '=' . $value;
3103 }
3104 $params = implode('&', $params);
3105
3106
3107 // #12370
3108 if (!stristr($a_default_link, '?')) {
3109 $a_default_link = ($a_default_link . '?' . $params);
3110 } else {
3111 $a_default_link = ($a_default_link . '&' . $params);
3112 }
3113 }
3114 return $a_default_link;
3115 }
3116
3120 public function modifySAHSlaunch($a_link, $wtarget)
3121 {
3122 global $DIC;
3123
3124 if (strstr($a_link, 'ilSAHSPresentationGUI') && !$this->offline_mode) {
3125 include_once 'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
3126 $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
3127 $om = $sahs_obj->getOpenMode();
3128 $width = $sahs_obj->getWidth();
3129 $height = $sahs_obj->getHeight();
3130 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
3131 $om++;
3132 }
3133 if ($om != 0 && !$DIC['ilBrowser']->isMobile()) {
3134 $this->default_command["frame"] = "";
3135 $a_link = "javascript:void(0); onclick=startSAHS('" . $a_link . "','" . $wtarget . "'," . $om . "," . $width . "," . $height . ");";
3136 }
3137 }
3138 return $a_link;
3139 }
3140
3144 public function insertPath()
3145 {
3146 $lng = $this->lng;
3147
3148 if ($this->getPathStatus() != false) {
3149 if (!$this->path_gui instanceof \ilPathGUI) {
3150 $path_gui = new \ilPathGUI();
3151 } else {
3153 }
3154
3155 $path_gui->enableTextOnly(!$this->path_linked);
3156 $path_gui->setUseImages(false);
3157
3158 $start_node = $this->path_start_node
3159 ? $this->path_start_node
3160 : ROOT_FOLDER_ID;
3161
3162 $this->tpl->setCurrentBlock("path_item");
3163 $this->tpl->setVariable('PATH_ITEM', $path_gui->getPath($start_node, $this->ref_id));
3164 $this->tpl->parseCurrentBlock();
3165
3166 $this->tpl->setCurrentBlock("path");
3167 $this->tpl->setVariable("TXT_LOCATION", $lng->txt("locator"));
3168 $this->tpl->parseCurrentBlock();
3169 return true;
3170 }
3171 }
3172
3179 public function insertProgressInfo()
3180 {
3181 return true;
3182 }
3183
3184
3189 {
3190 $lng = $this->lng;
3191 $objDefinition = $this->obj_definition;
3192
3193 $cnt = 0;
3194 if ($this->getCheckboxStatus()) {
3195 $this->tpl->setCurrentBlock("check");
3196 $this->tpl->setVariable("VAL_ID", $this->getCommandId());
3197 $this->tpl->parseCurrentBlock();
3198 $cnt += 1;
3199 } elseif ($this->getDownloadCheckboxState() != self::DOWNLOAD_CHECKBOX_NONE) {
3200 $this->tpl->setCurrentBlock("check_download");
3201 if ($this->getDownloadCheckboxState() == self::DOWNLOAD_CHECKBOX_ENABLED) {
3202 $this->tpl->setVariable("VAL_ID", $this->getCommandId());
3203 } else {
3204 $this->tpl->setVariable("VAL_VISIBILITY", "visibility: hidden;\" disabled=\"disabled");
3205 }
3206 $this->tpl->parseCurrentBlock();
3207 $cnt += 1;
3208 } elseif ($this->getExpandStatus()) {
3209 $this->tpl->setCurrentBlock('expand');
3210
3211 if ($this->isExpanded()) {
3212 $this->ctrl->setParameter($this->container_obj, 'expand', -1 * $this->obj_id);
3213 // "view" added, see #19922
3214 $this->tpl->setVariable('EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj, 'view', $this->getUniqueItemId(true)));
3215 $this->ctrl->clearParameters($this->container_obj);
3216 $this->tpl->setVariable('EXP_IMG', ilUtil::getImagePath('tree_exp.svg'));
3217 $this->tpl->setVariable('EXP_ALT', $this->lng->txt('collapse'));
3218 } else {
3219 $this->ctrl->setParameter($this->container_obj, 'expand', $this->obj_id);
3220 // "view" added, see #19922
3221 $this->tpl->setVariable('EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj, 'view', $this->getUniqueItemId(true)));
3222 $this->ctrl->clearParameters($this->container_obj);
3223 $this->tpl->setVariable('EXP_IMG', ilUtil::getImagePath('tree_col.svg'));
3224 $this->tpl->setVariable('EXP_ALT', $this->lng->txt('expand'));
3225 }
3226
3227 $this->tpl->parseCurrentBlock();
3228 $cnt += 1;
3229 }
3230
3231 if ($this->getIconStatus()) {
3232 if ($cnt == 1) {
3233 $this->tpl->touchBlock("i_1"); // indent
3234 }
3235
3236 // icon link
3237 if ($this->title_link_disabled || !$this->default_command || (!$this->getCommandsStatus() && !$this->restrict_to_goto)) {
3238 } else {
3239 /* see #28926
3240 $this->tpl->setCurrentBlock("icon_link_s");
3241
3242 if ($this->default_command["frame"] != "") {
3243 $this->tpl->setVariable("ICON_TAR", "target='" . $this->default_command["frame"] . "'");
3244 }
3245
3246 $this->tpl->setVariable(
3247 "ICON_HREF",
3248 $this->default_command["link"]
3249 );
3250 $this->tpl->parseCurrentBlock();
3251 $this->tpl->touchBlock("icon_link_e");
3252 */
3253 }
3254
3255 $this->tpl->setCurrentBlock("icon");
3256 if (!$objDefinition->isPlugin($this->getIconImageType())) {
3257 $this->tpl->setVariable("ALT_ICON", $lng->txt("obj_" . $this->getIconImageType()));
3258 } else {
3259 include_once("Services/Component/classes/class.ilPlugin.php");
3260 $this->tpl->setVariable("ALT_ICON",
3262 }
3263
3264 $this->tpl->setVariable(
3265 "SRC_ICON",
3266 $this->getTypeIcon()
3267 );
3268 $this->tpl->parseCurrentBlock();
3269 $cnt += 1;
3270 }
3271
3272 $this->tpl->touchBlock("d_" . $cnt); // indent main div
3273 }
3274
3279 public function getTypeIcon()
3280 {
3281 return ilObject::_getIcon(
3282 $this->obj_id,
3283 'small',
3284 $this->getIconImageType()
3285 );
3286 }
3287
3291 public function insertSubItems()
3292 {
3293 foreach ($this->sub_item_html as $sub_html) {
3294 $this->tpl->setCurrentBlock("subitem");
3295 $this->tpl->setVariable("SUBITEM", $sub_html);
3296 $this->tpl->parseCurrentBlock();
3297 }
3298 }
3299
3303 public function insertPositionField()
3304 {
3305 if ($this->position_enabled) {
3306 $this->tpl->setCurrentBlock("position");
3307 $this->tpl->setVariable("POS_ID", $this->position_field_index);
3308 $this->tpl->setVariable("POS_VAL", $this->position_value);
3309 $this->tpl->parseCurrentBlock();
3310 }
3311 }
3312
3317 public function adminCommandsIncluded()
3318 {
3319 return $this->adm_commands_included;
3320 }
3321
3325 public function storeAccessCache()
3326 {
3328 if ($this->acache->getLastAccessStatus() == "miss" &&
3329 !$this->prevent_access_caching) {
3330 $this->acache->storeEntry(
3331 $ilUser->getId() . ":" . $this->ref_id,
3332 serialize($this->access_cache),
3333 $this->ref_id
3334 );
3335 }
3336 }
3337
3352 public function getListItemHTML(
3353 $a_ref_id,
3354 $a_obj_id,
3355 $a_title,
3356 $a_description,
3357 $a_use_asynch = false,
3358 $a_get_asynch_commands = false,
3359 $a_asynch_url = ""
3360 ) {
3362
3363 // this variable stores wheter any admin commands
3364 // are included in the output
3365 $this->adm_commands_included = false;
3366
3367 // only for permformance exploration
3368 $type = ilObject::_lookupType($a_obj_id);
3369
3370 // initialization
3371 $this->initItem($a_ref_id, $a_obj_id, $type, $a_title, $a_description);
3372
3373 if ($a_use_asynch && $a_get_asynch_commands) {
3374 return $this->insertCommands(true, true);
3375 }
3376
3377 if ($this->rating_enabled) {
3378 if (ilRating::hasRatingInListGUI($this->obj_id, $this->type)) {
3379 $may_rate = $this->checkCommandAccess("read", "", $this->ref_id, $this->type);
3380
3381 $rating = new ilRatingGUI();
3382 $rating->setObject($this->obj_id, $this->type);
3383 /* $this->addCustomProperty(
3384 $this->lng->txt("rating_average_rating"),
3385 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3386 false,
3387 true
3388 );*/
3389 $this->addCustomProperty(
3390 "",
3391 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3392 false,
3393 true
3394 );
3395 }
3396 }
3397
3398 // read from cache
3399 include_once("Services/Object/classes/class.ilListItemAccessCache.php");
3400 $this->acache = new ilListItemAccessCache();
3401 $cres = $this->acache->getEntry($ilUser->getId() . ":" . $a_ref_id);
3402 if ($this->acache->getLastAccessStatus() == "hit") {
3403 $this->access_cache = unserialize($cres);
3404 } else {
3405 // write to cache
3406 $this->storeAccessCache();
3407 }
3408
3409 // visible check
3410 if (!$this->checkCommandAccess("visible", "", $a_ref_id, "", $a_obj_id)) {
3411 $this->resetCustomData();
3412 return "";
3413 }
3414
3415 // BEGIN WEBDAV
3416 if ($type == 'file' and ilObjFileAccess::_isFileHidden($a_title)) {
3417 $this->resetCustomData();
3418 return "";
3419 }
3420 // END WEBDAV
3421
3422
3423 $this->tpl = new ilTemplate(
3424 static::$tpl_file_name,
3425 true,
3426 true,
3427 static::$tpl_component,
3428 "DEFAULT",
3429 false,
3430 true
3431 );
3432
3433 if ($this->getCommandsStatus()) {
3434 if (!$this->getSeparateCommands()) {
3435 $this->tpl->setVariable(
3436 "COMMAND_SELECTION_LIST",
3437 $this->insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url)
3438 );
3439 }
3440 }
3441
3442 if ($this->getProgressInfoStatus()) {
3443 $this->insertProgressInfo();
3444 }
3445
3446 // insert title and describtion
3447 $this->insertTitle();
3448 if (!$this->isMode(IL_LIST_AS_TRIGGER)) {
3449 if ($this->getDescriptionStatus()) {
3450 $this->insertDescription();
3451 }
3452 }
3453
3454 if ($this->getSearchFragmentStatus()) {
3455 $this->insertSearchFragment();
3456 }
3457 if ($this->enabledRelevance()) {
3458 $this->insertRelevance();
3459 }
3460
3461 // properties
3462 if ($this->getPropertiesStatus()) {
3463 $this->insertProperties();
3464 }
3465
3466 // notice properties
3467 if ($this->getNoticePropertiesStatus()) {
3468 $this->insertNoticeProperties();
3469 }
3470
3471 // preconditions
3472 if ($this->getPreconditionsStatus()) {
3473 $this->insertPreconditions();
3474 }
3475
3476 // path
3477 $this->insertPath();
3478
3479 if ($this->getItemDetailLinkStatus()) {
3480 $this->insertItemDetailLinks();
3481 }
3482
3483 // icons and checkboxes
3484 $this->insertIconsAndCheckboxes();
3485
3486 // input field for position
3487 $this->insertPositionField();
3488
3489 // subitems
3490 $this->insertSubItems();
3491
3492 // file upload
3493 if ($this->isFileUploadAllowed()) {
3494 $this->insertFileUpload();
3495 }
3496
3497 $this->resetCustomData();
3498
3499 $this->tpl->setVariable("DIV_CLASS", 'ilContainerListItemOuter');
3500 $this->tpl->setVariable("DIV_ID", 'data-list-item-id="' . $this->getUniqueItemId(true) . '" id = "' . $this->getUniqueItemId(true) . '"');
3501 $this->tpl->setVariable("ADDITIONAL", $this->getAdditionalInformation());
3502
3503 if (is_object($this->getContainerObject())) {
3504 // #11554 - make sure that internal ids are reset
3505 $this->ctrl->setParameter($this->getContainerObject(), "item_ref_id", "");
3506 }
3507
3508 return $this->tpl->get();
3509 }
3510
3514 protected function resetCustomData()
3515 {
3516 // #15747
3517 $this->cust_prop = array();
3518 $this->cust_commands = array();
3519 $this->sub_item_html = array();
3520 $this->position_enabled = false;
3521 }
3522
3528 public function setParentRefId($a_ref_id)
3529 {
3530 $this->parent_ref_id = $a_ref_id;
3531 }
3532
3539 public function getUniqueItemId($a_as_div = false)
3540 {
3541 // use correct id for references
3542 $id_ref = ($this->reference_ref_id > 0)
3543 ? $this->reference_ref_id
3544 : $this->ref_id;
3545
3546 // add unique identifier for preconditions (objects can appear twice in same container)
3547 if ($this->condition_depth) {
3548 $id_ref .= "_pc" . $this->condition_depth;
3549 }
3550
3551 // unique
3552 $id_ref .= "_pref_" . $this->parent_ref_id;
3553
3554 if (!$a_as_div) {
3555 return $id_ref;
3556 } else {
3557 // action menu [yellow] toggle
3558 return "lg_div_" . $id_ref;
3559 }
3560 }
3561
3565 public function getCommandsHTML()
3566 {
3567 return $this->insertCommands();
3568 }
3569
3573 public function isSideBlock()
3574 {
3575 return false;
3576 }
3577
3583 public function setBoldTitle($a_bold_title)
3584 {
3585 $this->bold_title = $a_bold_title;
3586 }
3587
3593 public function isTitleBold()
3594 {
3595 return $this->bold_title;
3596 }
3597
3604 public static function preloadCommonProperties($a_obj_ids, $a_context)
3605 {
3606 global $DIC;
3607 $lng = $DIC->language();
3608 $ilSetting = $DIC->settings();
3609 $ilUser = $DIC->user();
3610 if ($a_context == self::CONTEXT_REPOSITORY) {
3611 $active_notes = !$ilSetting->get("disable_notes");
3612 $active_comments = !$ilSetting->get("disable_comments");
3613
3614 if ($active_notes || $active_comments) {
3615 include_once("./Services/Notes/classes/class.ilNote.php");
3616 }
3617
3618 if ($active_comments) {
3619 // needed for action
3620 self::$comments_activation = ilNote::getRepObjActivation($a_obj_ids);
3621 }
3622
3623 // properties are optional
3624 if ($ilSetting->get('comments_tagging_in_lists')) {
3625 if ($active_notes || $active_comments) {
3626 self::$cnt_notes = ilNote::_countNotesAndCommentsMultiple($a_obj_ids, true);
3627
3628 $lng->loadLanguageModule("notes");
3629 }
3630
3631 $tags_set = new ilSetting("tags");
3632 if ($tags_set->get("enable")) {
3633 $all_users = $tags_set->get("enable_all_users");
3634
3635 include_once("./Services/Tagging/classes/class.ilTagging.php");
3636 if (!$ilSetting->get('comments_tagging_in_lists_tags')) {
3637 self::$cnt_tags = ilTagging::_countTags($a_obj_ids, $all_users);
3638 } else {
3639 $tag_user_id = null;
3640 if (!$all_users) {
3641 $tag_user_id = $ilUser->getId();
3642 }
3643 self::$tags = ilTagging::_getListTagsForObjects($a_obj_ids, $tag_user_id);
3644 }
3645
3646 $lng->loadLanguageModule("tagging");
3647 }
3648 }
3649
3650 $lng->loadLanguageModule("rating");
3651 }
3652
3653 self::$preload_done = true;
3654 }
3655
3666 protected function isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access = true)
3667 {
3668 if ($this->comments_enabled) {
3669 if (!$this->comments_settings_enabled) {
3670 return true;
3671 }
3672 if ($a_check_write_access && $this->checkCommandAccess('write', '', $a_ref_id, $a_type)) {
3673 return true;
3674 }
3675 // fallback to single object check if no preloaded data
3676 // only the repository does preloadCommonProperties() yet
3677 if (!$a_header_actions && self::$preload_done) {
3678 if (self::$comments_activation[$a_obj_id][$a_type]) {
3679 return true;
3680 }
3681 } else {
3682 include_once("./Services/Notes/classes/class.ilNote.php");
3683 if (ilNote::commentsActivated($a_obj_id, 0, $a_type)) {
3684 return true;
3685 }
3686 }
3687 }
3688 return false;
3689 }
3690
3698 public function enableTimings($a_status)
3699 {
3700 $this->timings_enabled = (bool) $a_status;
3701 }
3702
3708 public function isFileUploadAllowed()
3709 {
3710 // check if file upload allowed
3711 include_once("./Services/FileUpload/classes/class.ilFileUploadUtil.php");
3712 return ilFileUploadUtil::isUploadAllowed($this->ref_id, $this->type);
3713 }
3714
3718 public function insertFileUpload()
3719 {
3720 include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
3722
3723 $upload = new ilFileUploadGUI($this->getUniqueItemId(true), $this->ref_id);
3724
3725 $this->tpl->setCurrentBlock("fileupload");
3726 $this->tpl->setVariable("FILE_UPLOAD", $upload->getHTML());
3727 $this->tpl->parseCurrentBlock();
3728 }
3729
3740 public function getAsListItem(
3741 int $ref_id,
3742 int $obj_id,
3743 string $type,
3744 string $title,
3745 string $description
3746 ) : ?\ILIAS\UI\Component\Item\Item {
3747 $ui = $this->ui;
3748
3749 $this->initItem(
3750 $ref_id,
3751 $obj_id,
3752 $type,
3753 $title,
3754 $description
3755 );
3756
3757 $this->enableCommands(true);
3758
3759 // actions
3760 $this->insertCommands();
3761 $actions = [];
3762 foreach ($this->current_selection_list->getItems() as $action_item) {
3763 $action = $ui->factory()
3764 ->button()
3765 ->shy($action_item['title'], $action_item['link']);
3766
3767 // Dirty hack to remain the "onclick" action of action items
3768 if ($action_item['onclick'] != null && $action_item['onclick'] != '') {
3769 $action = $action->withAdditionalOnLoadCode(function ($id) use ($action_item) {
3770 return "$('#$id').click(function(){" . $action_item['onclick'] . ";});";
3771 });
3772 }
3773
3774 $actions[] = $action;
3775 }
3776
3777 $dropdown = $ui->factory()
3778 ->dropdown()
3779 ->standard($actions)
3780 ->withAriaLabel(sprintf(
3781 $this->lng->txt('actions_for'),
3782 htmlspecialchars(addslashes($title))
3783 ));
3784
3785 $def_command = $this->getDefaultCommand();
3786
3787 $icon = $this->ui->factory()
3788 ->symbol()
3789 ->icon()
3790 ->custom(ilObject::_getIcon($obj_id), $this->lng->txt("icon") . " " . $this->lng->txt('obj_' . $type))
3791 ->withSize('medium');
3792
3793
3794 if ($def_command['link']) {
3795 $def_command['link'] = $this->modifySAHSlaunch($def_command['link'], $def_command['frame']);
3796 $new_viewport = !in_array($this->getDefaultCommand()['frame'], ['', '_top', '_self', '_parent'], true); // Cannot use $def_command['frame']. $this->default_command has been edited.
3797 $link = $this->ui->factory()
3798 ->link()
3799 ->standard($this->getTitle(), $def_command['link'])
3800 ->withOpenInNewViewport($new_viewport);
3801 $list_item = $ui->factory()->item()->standard($link);
3802 } else {
3803 $list_item = $ui->factory()->item()->standard($this->getTitle());
3804 }
3805
3806 if ($description != "") {
3807 $list_item = $list_item->withDescription($description);
3808 }
3809 $list_item = $list_item->withActions($dropdown)->withLeadIcon($icon);
3810
3811
3812 $l = [];
3813 $this->enableComments(true);
3814 $this->enableNotes(true);
3815 $this->enableTags(true);
3816 $this->enableRating(true);
3817
3818 foreach ($this->determineProperties() as $p) {
3819 //if ($p['property'] !== $this->lng->txt('learning_progress')) {
3820 $l[(string) $p['property']] = (string) $p['value'];
3821 //}
3822 }
3823 if (count($l) > 0) {
3824 $list_item = $list_item->withProperties($l);
3825 }
3826
3827 // @todo: learning progress
3828
3829
3830 /*
3831 $lp = ilLPStatus::getListGUIStatus($item['obj_id'], false);
3832 if (is_array($lp) && array_key_exists('status', $lp)) {
3833 $percentage = (int)ilLPStatus::_lookupPercentage($item['obj_id'], $this->user->getId());
3834 if ($lp['status'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
3835 $percentage = 100;
3836 }
3837
3838 $card = $card->withProgress(
3839 $this->uiFactory
3840 ->chart()
3841 ->progressMeter()
3842 ->mini(100, $percentage)
3843 );
3844 }*/
3845
3846 return $list_item;
3847 }
3848
3859 public function getAsCard(
3860 int $ref_id,
3861 int $obj_id,
3862 string $type,
3863 string $title,
3864 string $description
3865 ) : ?\ILIAS\UI\Component\Card\Card
3866 {
3867 $ui = $this->ui;
3868
3869 $this->initItem(
3870 $ref_id,
3871 $obj_id,
3872 $type,
3873 $title,
3874 $description
3875 );
3876
3877 $user = $this->user;
3878 $access = $this->access;
3879
3880 $this->enableCommands(true);
3881
3882 $sections = [];
3883
3884 // description, @todo: move to new ks element
3885 if ($description != "") {
3886 $sections[] = $ui->factory()->legacy("<div class='il-multi-line-cap-3'>" . $description . "</div>");
3887 }
3888
3889 $this->insertCommands();
3890 $actions = [];
3891
3892 foreach ($this->current_selection_list->getItems() as $item) {
3893 if (!isset($item["onclick"]) || $item["onclick"] == "") {
3894 $actions[] =
3895 $ui->factory()->button()->shy($item["title"], $item["link"]);
3896 } else {
3897 $actions[] =
3898 $ui->factory()->button()->shy($item["title"], "")->withAdditionalOnLoadCode(function ($id) use ($item) {
3899 return
3900 "$('#$id').click(function(e) { " . $item["onclick"] . "});";
3901 });
3902 }
3903 }
3904
3905 $def_command = $this->getDefaultCommand();
3906
3907 if ($def_command["frame"] != "") {
3908 /* this seems to be introduced due to #25624, but does not fix it
3909 removed with ##30732
3910 $button =
3911 $ui->factory()->button()->shy("Open", "")->withAdditionalOnLoadCode(function ($id) use ($def_command) {
3912 return
3913 "$('#$id').click(function(e) { window.open('" . str_replace("&amp;", "&",
3914 $def_command["link"]) . "', '" . $def_command["frame"] . "');});";
3915 });
3916 $actions[] = $button;*/
3917 }
3918 $dropdown = $ui->factory()->dropdown()->standard($actions)
3919 ->withAriaLabel(sprintf(
3920 $this->lng->txt('actions_for'),
3921 htmlspecialchars(addslashes($title))
3922 ));
3923
3924 $img = $this->object_service->commonSettings()->tileImage()->getByObjId((int) $obj_id);
3925 if ($img->exists()) {
3926 $path = $img->getFullPath();
3927 } else {
3928 $path = ilUtil::getImagePath('cont_tile/cont_tile_default_' . $type . '.svg');
3929 if (!is_file($path)) {
3930 $path = ilUtil::getImagePath('cont_tile/cont_tile_default.svg');
3931 }
3932 }
3933
3934 // workaround for #26205
3935 // we should get rid of _top links completely and gifure our how
3936 // to manage scorm links better
3937 if ($def_command["frame"] == "_top") {
3938 $def_command["frame"] = "";
3939 }
3940
3941 // workaround for scorm
3942 $modified_link =
3943 $this->modifySAHSlaunch($def_command["link"], $def_command["frame"]);
3944
3945 $image = $this->ui->factory()
3946 ->image()
3947 ->responsive($path, '');
3948 if ($def_command['link'] != '') { // #24256
3949 if ($def_command["frame"] != "" && ($modified_link == $def_command["link"])) {
3950 $image = $image->withAdditionalOnLoadCode(function ($id) use ($def_command) {
3951 return
3952 "$('#$id').click(function(e) { window.open('" . str_replace("&amp;", "&",
3953 $def_command["link"]) . "', '" . $def_command["frame"] . "');});";
3954 });
3955
3956 $button =
3957 $ui->factory()->button()->shy($title, "")->withAdditionalOnLoadCode(function ($id) use (
3958 $def_command
3959 ) {
3960 return
3961 "$('#$id').click(function(e) { window.open('" . str_replace("&amp;", "&",
3962 $def_command["link"]) . "', '" . $def_command["frame"] . "');});";
3963 });
3964 $title = $ui->renderer()->render($button);
3965 } else {
3966 $image = $image->withAction($modified_link);
3967 }
3968 }
3969
3970 if ($type == 'sess') {
3971 if ($title != "") {
3972 $title = ": " . $title;
3973 }
3974 $app_info = ilSessionAppointment::_lookupAppointment($obj_id);
3976 $app_info['start'],
3977 $app_info['end'],
3978 $app_info['fullday']
3979 ) . $title;
3980 }
3981
3982 $icon = $this->ui->factory()
3983 ->symbol()
3984 ->icon()
3985 ->standard($type, $this->lng->txt('obj_' . $type))
3986 ->withIsOutlined(true);
3987
3988 // card title action
3989 $card_title_action = "";
3990 if ($def_command["link"] != "" && ($def_command["frame"] == "" || $modified_link != $def_command["link"])) { // #24256
3991 $card_title_action = $modified_link;
3992 } else {
3993 if ($def_command['link'] == "" &&
3994 $this->getInfoScreenStatus() &&
3995 $access->checkAccessOfUser(
3996 $user->getId(),
3997 "visible",
3998 "",
3999 $ref_id
4000 )) {
4001 $card_title_action = ilLink::_getLink($ref_id);
4002 if ($image->getAction() == "") {
4003 $image = $image->withAction($card_title_action);
4004 }
4005 }
4006 }
4007
4008 $card = $ui->factory()->card()->repositoryObject(
4009 $title . '<span data-list-item-id="' . $this->getUniqueItemId(true) . '"></span>',
4010 $image
4011 )->withObjectIcon(
4012 $icon
4013 )->withActions(
4014 $dropdown
4015 );
4016
4017 if ($card_title_action != "") {
4018 $card = $card->withTitleAction($card_title_action);
4019 }
4020
4021 $l = [];
4022 foreach ($this->determineProperties() as $p) {
4023 if ($p["alert"] && $p['property'] !== $this->lng->txt('learning_progress')) {
4024 $l[(string) $p['property']] = (string) $p['value'];
4025 }
4026 }
4027 if (count($l) > 0) {
4028 $prop_list = $ui->factory()->listing()->descriptive($l);
4029 $sections[] = $prop_list;
4030 }
4031 if (count($sections) > 0) {
4032 $card = $card->withSections($sections);
4033 }
4034
4035 $lp = ilLPStatus::getListGUIStatus($obj_id, false);
4036 if (is_array($lp) && array_key_exists('status', $lp)) {
4037 $percentage = (int) ilLPStatus::_lookupPercentage($obj_id, $this->user->getId());
4038 if ($lp['status'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
4039 $percentage = 100;
4040 }
4041
4042 $card = $card->withProgress(
4043 $ui->factory()
4044 ->chart()
4045 ->progressMeter()
4046 ->mini(100, $percentage)
4047 );
4048 }
4049
4050 return $card;
4051 }
4052
4057 {
4058 return false;
4059 }
4060}
user()
Definition: user.php:4
$location
Definition: buildRTE.php:44
$_GET["client_id"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
const IL_NOTE_PRIVATE
Definition: class.ilNote.php:5
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:6
const IL_LIST_AS_TRIGGER
const IL_LIST_FULL
User interface class for advanced drop-down selection lists.
static buildAjaxHash( $a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null, $a_news_id=0)
Build ajax hash.
static translateOperator($a_obj_id, $a_operator)
Translate operator.
static _checkCondition($condition, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static getEffectiveOptionalConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_obj_type='')
Get optional conditions.
static calculateEffectiveRequiredTriggers($a_target_ref_id, $a_target_obj_id, $a_target_obj_type='')
calculate number of obligatory items
Class ilContainerGUI.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
Manages favourites, currently the interface for other components, needs discussion.
static initFileUpload()
Initializes the file upload and loads the needed javascripts and styles.
static isUploadAllowed($a_ref_id, $a_type="")
Determines whether files can be uploaded to the object with the specified reference id.
static _getInstance()
Get singleton instance of this class.
const LP_STATUS_COMPLETED_NUM
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
static getListGUIStatus($a_obj_id, $a_image_only=true)
Caches (check) access information on list items.
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
static getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
static _countNotesAndComments( $a_rep_obj_id, $a_sub_obj_id=null, $a_obj_type="", $a_news_id=0)
Get all notes related to a specific object.
static _countNotesAndCommentsMultiple($a_rep_obj_ids, $a_no_sub_objs=false)
Get all notes related to multiple objcts.
static getRepObjActivation($a_rep_obj_ids)
Get activation for repository objects.
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
Class ilObjSCORMLearningModule.
static _getCommands()
get commands
Class ilObjectListGUI.
getProperties()
Get item properties.
enableDescription($a_status)
En/disable description.
getAdditionalInformation()
Get additional information.
enabledRelevance()
enabled relevance
getContainerObject()
get container object
setHeaderSubObject($a_type, $a_id)
Set sub object identifier.
getAsListItem(int $ref_id, int $obj_id, string $type, string $title, string $description)
Get list item ui object.
getTitle()
getTitle overwritten in class.ilObjLinkResourceList.php
isTitleBold()
@access public
setBoldTitle($a_bold_title)
@access public @params boolean $a_bold_title set the item title bold
addHeaderIconHTML($a_id, $a_html)
getMode()
get output mode
setSearchFragment($a_text)
set search fragment
setMode($a_mode)
set output mode
determineProperties()
Determine properties.
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
getAlertProperties()
get all alert properties
enableLinkedPath($a_status)
Enable linked path.
storeAccessCache()
Store access cache.
modifyTitleLink($a_default_link)
adminCommandsIncluded()
returns whether any admin commands (link, delete, cut) are included in the output
insertTitle()
insert item title
setDetailsLevel($a_level)
Details level Currently used in Search which shows only limited properties of forums Currently used f...
enableDownloadCheckbox($a_ref_id, $a_value)
enableCommands($a_status, $a_std_only=false)
En/disable commands.
getDefaultCommand()
Get default command.
setDefaultCommandParameters(array $a_params)
getCommandLink($a_cmd)
Get command link url.
enableRepositoryTransfer($a_value)
Enable copy/move to repository (from personal workspace)
getCommands()
get all current commands for a specific ref id (in the permission context of the current user)
insertRelevance()
insert relevance
insertSubstitutions()
Insert substitutions.
enableProperties($a_status)
En/disable properties.
getIconImageType()
Returns the icon image type.
setSeparateCommands($a_val)
Set separate commands.
insertFileUpload()
Inserts a file upload component.
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
getHeaderAction(ilGlobalTemplateInterface $a_main_tpl=null)
Get header action.
insertPreconditions()
insert all missing preconditions
isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access=true)
Check comments status against comments settings and context.
enableRelevance($a_status)
enable relevance
parseConditions($toggle_id, $conditions, $obligatory=true)
enablePath($a_path, $a_start_node=null, \ilPathGUI $path_gui=null)
En/disable path.
addCustomCommand($a_link, $a_lang_var, $a_frame="", $onclick="")
add a custom command
isMode($a_mode)
check current output mode
insertPasteCommand()
Insert paste command.
getAsCard(int $ref_id, int $obj_id, string $type, string $title, string $description)
Get card object.
enableLink($a_status)
En/disable link.
getSearchFragmentStatus()
Show hide search result fragments.
enableSubstitutions($a_status)
Enable substitutions.
isSideBlock()
Returns whether current item is a block in a side column or not.
isVisibleOnlyForced()
Force unreadable.
enableCheckbox($a_status)
En/Dis-able checkboxes.
getCommandsHTML()
Get commands HTML (must be called after get list item html)
setConditionDepth($a_depth)
set depth for precondition output (stops at level 5)
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
getItemDetailLinkStatus()
get item detail link status
resetCustomData()
reset properties and commands
forceVisibleOnly($a_stat)
Force visible access only.
addSubItemHTML($a_html)
Add HTML for subitem (used for sessions)
getCommandFrame($a_cmd)
Get command target frame.
getNoticeProperties()
get notice properties
getTypeIcon()
Get object type specific type icon.
enableNotes($a_value)
Toogle notes action status.
insertTimingsCommand()
insert edit timings command
insertInfoScreenCommand()
insert info screen command
enableNoticeProperties($a_status)
En/disable notices.
getUniqueItemId($a_as_div=false)
Get unique item identifier (for js-actions)
getCommandImage($a_cmd)
Get command icon image.
setParentRefId($a_ref_id)
Set current parent ref id to enable unique js-ids (sessions, etc.)
enableIcon($a_status)
En/Dis-able icons.
getSearchFragment()
get search fragment
insertSearchFragment()
Insert highlighted search fragment.
insertCutCommand($a_to_repository=false)
insert cut command
createDefaultCommand($command)
Get default command link Overwritten for e.g categories,courses => they return a goto link If search ...
enableSearchFragments($a_status)
En/disable description.
enableCopy($a_status)
En/disable copy.
enableTimings($a_status)
enable timings link
addHeaderIcon($a_id, $a_img, $a_tooltip=null, $a_onclick=null, $a_status_text=null, $a_href=null)
addHeaderGlyph($a_id, $a_glyph, $a_onclick=null)
insertItemDetailLinks()
insert item detail links
static preloadCommonProperties($a_obj_ids, $a_context)
Preload common properties.
enablePreconditions($a_status)
En/disable preconditions.
enableTags($a_value)
Toogle tags action status.
getDescription()
getDescription overwritten in class.ilObjLinkResourceList.php
setPositionInputField($a_field_index, $a_position_value)
Set position input field.
getSubstitutionStatus()
Get substitution status.
enableCut($a_status)
En/disable cut.
setRelevance($a_rel)
set relevance
enableMultiDownload($a_value)
Toggles whether multiple objects can be downloaded at once or not.
enableExpand($a_status)
En/Dis-able expand/collapse link.
insertProgressInfo()
insert progress info
initItem($a_ref_id, $a_obj_id, $type, $a_title="", $a_description="")
inititialize new item (is called by getItemHTML())
insertDescription()
insert item description
setDescription($a_description)
enableProgressInfo($a_status)
enable progress info
insertPositionField()
Insert field for positioning.
insertSubscribeCommand()
insert subscribe command
enableSubscribe($a_status)
En/disable subscribe.
appendRepositoryFrameParameter($a_link)
workaround: all links into the repository (from outside) must tell repository to setup the frameset
getCheckboxStatus()
Are checkboxes enabled?
insertLinkCommand()
insert link command
isFileUploadAllowed()
Gets a value indicating whether file uploads to this object are allowed or not.
insertCommonSocialCommands($a_header_actions=false)
Insert common social commands (comments, notes, tagging)
setContainerObject($container_obj)
set the container object (e.g categorygui) Used for link, delete ... commands
enableRating($a_value, $a_text=null, $a_categories=false, array $a_ctrl_path=null)
Toogle rating action status.
checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id="")
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
modifySAHSlaunch($a_link, $wtarget)
workaround: SAHS in new javavasript-created window or iframe
insertCopyCommand($a_to_repository=false)
Insert copy command.
addCustomProperty( $a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
getCustomProperties($a_prop)
get custom properties
insertSubItems()
Insert subitems.
enableComments($a_value, $a_enable_comments_settings=true)
Toogle comments action status.
getCommandId()
get command id Normally the ref id.
enableInfoScreen($a_info_screen)
En/disable path.
getProgressInfoStatus()
get progress info status
insertIconsAndCheckboxes()
Insert icons and checkboxes.
setAdditionalInformation($a_val)
Set additional information.
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
getListItemHTML( $a_ref_id, $a_obj_id, $a_title, $a_description, $a_use_asynch=false, $a_get_asynch_commands=false, $a_asynch_url="")
Get all item information (title, commands, description) in HTML.
restrictToGoto($a_value)
Restrict all actions/links to goto.
getDetailsLevel()
Get current details level.
getIconStatus()
Are icons enabled?
getSeparateCommands()
Get separate commands.
insertDeleteCommand()
insert cut command
insertCommands( $a_use_asynch=false, $a_get_asynch_commands=false, $a_asynch_url="", $a_header_actions=false)
insert all commands into html code
getExpandStatus()
Is expand/collapse enabled.
insertProperties()
insert properties
getRelevance()
get relevance
enableDelete($a_status)
En/disable delete.
insertCommand($a_href, $a_text, $a_frame="", $a_img="", $a_cmd="", $a_onclick="")
insert command button
static lookupTxtById($plugin_id, $lang_var)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
static _lookupType($a_id, $a_reference=false)
lookup object type
Creates a path for a start and endnode.
static hasPreview($a_obj_id, $a_type="")
Determines whether the object with the specified reference id has a preview.
const RENDER_STATUS_NONE
static lookupRenderStatus($a_obj_id)
Gets the render status for the object with the specified id.
static getInstance()
Factory.
Class ilRatingGUI.
static hasRatingInListGUI($a_obj_id, $a_obj_type)
static _lookupAppointment($a_obj_id)
lookup appointment
static _appointmentToString($start, $end, $fulltime)
ILIAS Setting Class.
static getListTagsJSCall($a_hash, $a_update_code=null)
Get tagging js call.
static initJavascript($a_ajax_url, ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
static getTagsForUserAndObject( $a_obj_id, $a_obj_type, $a_sub_obj_id, $a_sub_obj_type, $a_user_id)
Get tags for a user and an object.
static _getListTagsForObjects(array $a_obj_ids, $a_user_id=null)
Get tags for given object ids.
static _countTags($a_obj_ids, $a_all_users=false)
Count all tags for repository objects.
special template class to simplify handling of ITX/PEAR
static addTooltip( $a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
Adds a tooltip to an HTML element.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilWebDAVLockBackend.
static maybeRenderWebDAVModalInGlobalTpl()
This is kind of a singleton pattern.
Access handler for personal workspace.
static getGotoLink($a_node_id, $a_obj_id, $a_additional=null)
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$txt
Definition: error.php:13
Interface for GUI classes (PDGUI, LuceneSearchGUI...) that have to handle administration commands (cu...
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
if($format !==null) $name
Definition: metadata.php:230
$i
Definition: metadata.php:24
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
global $ilSetting
Definition: privfeed.php:17
$type
settings()
Definition: settings.php:2
$data
Definition: storeScorm.php:23
$preview
$ilUser
Definition: imgupload.php:18
ui()
Definition: ui.php:5
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46