ILIAS  release_7 Revision v7.30-3-g800a261c036
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 = strip_tags(
823 $a_title,
825 );
826 }
827
833 public function getTitle()
834 {
835 return $this->title;
836 }
837
842 public function setDescription($a_description)
843 {
844 $this->description = strip_tags(
845 $a_description,
847 );
848 }
849
855 public function getDescription()
856 {
857 return $this->description;
858 }
859
865 public function setSearchFragment($a_text)
866 {
867 $this->search_fragment = $a_text;
868 }
869
874 public function getSearchFragment()
875 {
877 }
878
884 public function setSeparateCommands($a_val)
885 {
886 $this->separate_commands = $a_val;
887 }
888
894 public function getSeparateCommands()
895 {
897 }
907 public function getCommandId()
908 {
909 return $this->ref_id;
910 }
911
917 public function setAdditionalInformation($a_val)
918 {
919 $this->additional_information = $a_val;
920 }
921
927 public function getAdditionalInformation()
928 {
930 }
931
939 public function setDetailsLevel($a_level)
940 {
941 $this->details_level = $a_level;
942 }
943
948 public function getDetailsLevel()
949 {
951 }
952
958 public function enableRepositoryTransfer($a_value)
959 {
960 $this->repository_transfer_enabled = (bool) $a_value;
961 }
962
968 public function restrictToGoto($a_value)
969 {
970 $this->restrict_to_goto = (bool) $a_value;
971 }
972
973
979 public function getDefaultCommand()
980 {
981 return $this->default_command;
982 }
983
989 public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
990 {
991 $ilAccess = $this->access;
992
993 // e.g: subitems should not be readable since their parent sesssion is readonly.
994 if ($a_permission != 'visible' and $this->isVisibleOnlyForced()) {
995 return false;
996 }
997
998 $cache_prefix = null;
999 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
1000 $cache_prefix = "wsp";
1001 if (!$this->ws_access) {
1002 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1003 $this->ws_access = new ilWorkspaceAccessHandler();
1004 }
1005 }
1006
1007 if (isset($this->access_cache[$a_permission]["-" . $a_cmd][$cache_prefix . $a_ref_id])) {
1008 return $this->access_cache[$a_permission]["-" . $a_cmd][$cache_prefix . $a_ref_id];
1009 }
1010
1011 if ($this->context == self::CONTEXT_REPOSITORY) {
1012 $access = $ilAccess->checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
1013 if ($ilAccess->getPreventCachingLastResult()) {
1014 $this->prevent_access_caching = true;
1015 }
1016 } else {
1017 $access = $this->ws_access->checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type);
1018 }
1019
1020 $this->access_cache[$a_permission]["-" . $a_cmd][$cache_prefix . $a_ref_id] = $access;
1021 return $access;
1022 }
1023
1033 public function initItem($a_ref_id, $a_obj_id, $type, $a_title = "", $a_description = "")
1034 {
1035 $this->offline_mode = false;
1036 if ($this->type == "sahs") {
1037 include_once('Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
1038 $this->offline_mode = ilObjSAHSLearningModuleAccess::_lookupUserIsOfflineMode($a_obj_id);
1039 }
1040 $this->access_cache = array();
1041 $this->ref_id = $a_ref_id;
1042 $this->obj_id = $a_obj_id;
1043 $this->setTitle($a_title);
1044 $this->setDescription($a_description);
1045 #$this->description = $a_description;
1046
1047 // checks, whether any admin commands are included in the output
1048 $this->adm_commands_included = false;
1049 $this->prevent_access_caching = false;
1050
1051 // prepare ajax calls
1052 include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1053 if ($this->context == self::CONTEXT_REPOSITORY) {
1055 } else {
1057 }
1058 $this->setAjaxHash(ilCommonActionDispatcherGUI::buildAjaxHash($node_type, $a_ref_id, $type, $a_obj_id));
1059 }
1060
1061 public function setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
1062 {
1063 $this->condition_target = array(
1064 'ref_id' => $a_ref_id,
1065 'obj_id' => $a_obj_id,
1066 'target_type' => $a_target_type
1067 );
1068 }
1069
1070 public function resetConditionTarget()
1071 {
1072 $this->condition_target = array();
1073 }
1074
1075 public function disableTitleLink($a_status)
1076 {
1077 $this->title_link_disabled = $a_status;
1078 }
1079 // end-patch lok
1080
1081 public function setDefaultCommandParameters(array $a_params)
1082 {
1083 $this->default_command_params = $a_params;
1084 }
1085
1095 public function createDefaultCommand($command)
1096 {
1097 // begin-patch lok
1098 if ($this->static_link_enabled and !$this->default_command_params) {
1099 include_once('./Services/Link/classes/class.ilLink.php');
1100 if ($link = ilLink::_getStaticLink($this->ref_id, $this->type, false)) {
1101 $command['link'] = $link;
1102 $command['frame'] = '_top';
1103 }
1104 }
1105 if ($this->default_command_params) {
1106 $params = array();
1107 foreach ($this->default_command_params as $name => $value) {
1108 $params[] = $name . '=' . $value;
1109 }
1110 $params = implode('&', $params);
1111
1112 // #12370
1113 if (!stristr($command['link'], '?')) {
1114 $command['link'] .= '?' . $params;
1115 } else {
1116 $command['link'] .= '&' . $params;
1117 }
1118 }
1119 return $command;
1120 }
1121
1134 public function getCommandLink($a_cmd)
1135 {
1136 if ($this->context == self::CONTEXT_REPOSITORY) {
1137 // BEGIN WebDAV Get mount webfolder link.
1138 require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1139 if ($a_cmd == 'mount_webfolder' && ilDAVActivationChecker::_isActive()) {
1140 global $DIC;
1141 $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
1142 return $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
1143 }
1144 // END WebDAV Get mount webfolder link.
1145
1146 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getCommandId());
1147 $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
1148 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
1149 return $cmd_link;
1150
1151 /* separate method for this line
1152 $cmd_link = $this->ctrl->getLinkTargetByClass($this->gui_class_name,
1153 $a_cmd);
1154 return $cmd_link;
1155 */
1156 } else {
1157 $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", "");
1158 $this->ctrl->setParameterByClass($this->gui_class_name, "wsp_id", $this->ref_id);
1159 return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
1160 }
1161 }
1162
1163
1173 public function getCommandFrame($a_cmd)
1174 {
1175 // begin-patch fm
1176 if ($a_cmd == 'fileManagerLaunch') {
1177 return '_blank';
1178 }
1179 // end-patch fm
1180 return "";
1181 }
1182
1192 public function getCommandImage($a_cmd)
1193 {
1194 return "";
1195 }
1196
1208 public function getProperties()
1209 {
1210 $lng = $this->lng;
1212
1213 $props = array();
1214 // please list alert properties first
1215 // example (use $lng->txt instead of "Status"/"Offline" strings):
1216 // $props[] = array("alert" => true, "property" => "Status", "value" => "Offline");
1217 // $props[] = array("alert" => false, "property" => ..., "value" => ...);
1218 // ...
1219
1220 // #8280: WebDav is only supported in repository
1221 if ($this->context == self::CONTEXT_REPOSITORY) {
1222 // add centralized offline status
1223 if (ilObject::lookupOfflineStatus($this->obj_id)) {
1224 $props[] =
1225 [
1226 'alert' => true,
1227 'property' => $lng->txt("status"),
1228 'value' => $lng->txt("offline")
1229 ];
1230 }
1231
1232 // BEGIN WebDAV Display locking information
1233 require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
1235 // Show lock info
1236 require_once('Services/WebDAV/classes/lock/class.ilWebDAVLockBackend.php');
1237 $webdav_lock_backend = new ilWebDAVLockBackend();
1238 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
1239 if ($lock = $webdav_lock_backend->getLocksOnObjectId($this->obj_id)) {
1240 $lock_user = new ilObjUser($lock->getIliasOwner());
1241
1242 $props[] = array(
1243 "alert" => false,
1244 "property" => $lng->txt("in_use_by"),
1245 "value" => $lock_user->getLogin(),
1246 "link" => "./ilias.php?user=" . $lock_user->getId() . '&cmd=showUserProfile&cmdClass=ildashboardgui&baseClass=ilDashboardGUI',
1247 );
1248 }
1249 }
1250 // END WebDAV Display locking information
1251
1252 if ($this->getDetailsLevel() == self::DETAILS_SEARCH) {
1253 return $props;
1254 }
1255 }
1256 // END WebDAV Display warning for invisible files and files with special characters
1257 }
1258
1259 return $props;
1260 }
1261
1265 public function addCustomProperty(
1266 $a_property = "",
1267 $a_value = "",
1268 $a_alert = false,
1269 $a_newline = false
1270 ) {
1271 $this->cust_prop[] = array("property" => $a_property, "value" => $a_value,
1272 "alert" => $a_alert, "newline" => $a_newline);
1273 }
1274
1278 public function getCustomProperties($a_prop)
1279 {
1280 if (is_array($this->cust_prop)) {
1281 foreach ($this->cust_prop as $prop) {
1282 $a_prop[] = $prop;
1283 }
1284 }
1285 return $a_prop;
1286 }
1287
1292 public function getAlertProperties()
1293 {
1294 $alert = array();
1295 foreach ((array) $this->getProperties() as $prop) {
1296 if ($prop['alert'] == true) {
1297 $alert[] = $prop;
1298 }
1299 }
1300 return $alert;
1301 }
1302
1306 public function getNoticeProperties()
1307 {
1308 $this->notice_prop = array();
1309 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id, true)) {
1310 foreach ($infos as $info) {
1311 $this->notice_prop[] = array('value' => $info);
1312 }
1313 }
1314 return $this->notice_prop ? $this->notice_prop : array();
1315 }
1319 public function addCustomCommand($a_link, $a_lang_var, $a_frame = "", $onclick = "")
1320 {
1321 $this->cust_commands[] =
1322 array("link" => $a_link, "lang_var" => $a_lang_var,
1323 "frame" => $a_frame, "onclick" => $onclick);
1324 }
1325
1330 public function forceVisibleOnly($a_stat)
1331 {
1332 $this->force_visible_only = $a_stat;
1333 }
1334
1339 public function isVisibleOnlyForced()
1340 {
1342 }
1343
1367 public function getCommands()
1368 {
1369 $ilAccess = $this->access;
1371
1372 $ref_commands = array();
1373 foreach ($this->commands as $command) {
1374 $permission = $command["permission"];
1375 $cmd = $command["cmd"];
1376 $lang_var = $command["lang_var"];
1377 $txt = "";
1378 $info_object = null;
1379
1380 if (isset($command["txt"])) {
1381 $txt = $command["txt"];
1382 }
1383
1384 // Suppress commands that don't make sense for anonymous users
1385 if ($ilUser->getId() == ANONYMOUS_USER_ID &&
1386 $command['enable_anonymous'] == 'false') {
1387 continue;
1388 }
1389
1390 // all access checking should be made within $ilAccess and
1391 // the checkAccess of the ilObj...Access classes
1392 //$access = $ilAccess->checkAccess($permission, $cmd, $this->ref_id, $this->type);
1393 $access = $this->checkCommandAccess($permission, $cmd, $this->ref_id, $this->type);
1394
1395 if ($access) {
1396 $cmd_link = $this->getCommandLink($command["cmd"]);
1397 $cmd_frame = $this->getCommandFrame($command["cmd"]);
1398 $cmd_image = $this->getCommandImage($command["cmd"]);
1399 $access_granted = true;
1400 } else {
1401 $access_granted = false;
1402 $info_object = $ilAccess->getInfo();
1403 }
1404
1405 if (!isset($command["default"])) {
1406 $command["default"] = "";
1407 }
1408 $ref_commands[] = array(
1409 "permission" => $permission,
1410 "cmd" => $cmd,
1411 "link" => $cmd_link,
1412 "frame" => $cmd_frame,
1413 "lang_var" => $lang_var,
1414 "txt" => $txt,
1415 "granted" => $access_granted,
1416 "access_info" => $info_object,
1417 "img" => $cmd_image,
1418 "default" => $command["default"]
1419 );
1420 }
1421
1422 return $ref_commands;
1423 }
1424
1432 public function getIconImageType()
1433 {
1434 if ($this->type == "sahs" && $this->offline_mode) {
1435 return $this->type . "_offline";
1436 }
1437 return $this->type;
1438 }
1439
1447 public function insertTitle()
1448 {
1449 if ($this->restrict_to_goto) {
1450 $this->default_command = array("frame" => "",
1451 "link" => $this->buildGotoLink());
1452 }
1453 // begin-patch lok
1454 if (
1455 !$this->default_command ||
1456 (!$this->getCommandsStatus() && !$this->restrict_to_goto) ||
1457 $this->title_link_disabled
1458 ) {
1459 // end-patch lok
1460 $this->tpl->setCurrentBlock("item_title");
1461 $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
1462 $this->tpl->parseCurrentBlock();
1463 } else {
1464 $this->default_command['link'] = $this->modifyTitleLink($this->default_command['link']);
1465
1466 $this->default_command["link"] =
1467 $this->modifySAHSlaunch($this->default_command["link"], $this->default_command["frame"]);
1468
1469 if ($this->default_command["frame"] != "") {
1470 $this->tpl->setCurrentBlock("title_linked_frame");
1471 $this->tpl->setVariable("TARGET_TITLE_LINKED", $this->default_command["frame"]);
1472 $this->tpl->parseCurrentBlock();
1473 }
1474
1475 // workaround for repository frameset
1476 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1477 $this->default_command["link"] =
1478 $this->appendRepositoryFrameParameter($this->default_command["link"]);
1479
1480 #var_dump("<pre>",$this->default_command['link'],"</pre>");
1481
1482
1483 // the default command is linked with the title
1484 $this->tpl->setCurrentBlock("item_title_linked");
1485 $this->tpl->setVariable("TXT_TITLE_LINKED", $this->getTitle());
1486 $this->tpl->setVariable("HREF_TITLE_LINKED", $this->default_command["link"]);
1487
1488 // has preview?
1489 include_once("./Services/Preview/classes/class.ilPreview.php");
1490 if (ilPreview::hasPreview($this->obj_id, $this->type)) {
1491 include_once("./Services/Preview/classes/class.ilPreviewGUI.php");
1492
1493 // get context for access checks later on
1494 $access_handler = null;
1495 switch ($this->context) {
1499 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
1500 $access_handler = new ilWorkspaceAccessHandler();
1501 break;
1502
1503 default:
1504 $ilAccess = $this->access;
1506 $access_handler = $ilAccess;
1507 break;
1508 }
1509
1510 $preview = new ilPreviewGUI($this->ref_id, $context, $this->obj_id, $access_handler);
1511 $preview_status = ilPreview::lookupRenderStatus($this->obj_id);
1512 $preview_status_class = "";
1513 $preview_text_topic = "preview_show";
1514 if ($preview_status == ilPreview::RENDER_STATUS_NONE) {
1515 $preview_status_class = "ilPreviewStatusNone";
1516 $preview_text_topic = "preview_none";
1517 }
1518 $this->tpl->setCurrentBlock("item_title_linked");
1519 $this->tpl->setVariable("PREVIEW_STATUS_CLASS", $preview_status_class);
1520 $this->tpl->setVariable("SRC_PREVIEW_ICON", ilUtil::getImagePath("preview.png"));
1521 $this->tpl->setVariable("ALT_PREVIEW_ICON", $this->lng->txt($preview_text_topic));
1522 $this->tpl->setVariable("TXT_PREVIEW", $this->lng->txt($preview_text_topic));
1523 $this->tpl->setVariable("SCRIPT_PREVIEW_CLICK", $preview->getJSCall($this->getUniqueItemId(true)));
1524 $this->tpl->parseCurrentBlock();
1525 }
1526
1527 $this->tpl->parseCurrentBlock();
1528 }
1529
1530 if ($this->bold_title == true) {
1531 $this->tpl->touchBlock('bold_title_start');
1532 $this->tpl->touchBlock('bold_title_end');
1533 }
1534 }
1535
1536 protected function buildGotoLink()
1537 {
1538 switch ($this->context) {
1540 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1541 return ilWorkspaceAccessHandler::getGotoLink($this->ref_id, $this->obj_id);
1542
1543 default:
1544 // not implemented yet
1545 break;
1546 }
1547 }
1548
1555 public function insertSubstitutions()
1556 {
1557 $fields_shown = false;
1558 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as $data) {
1559 if ($data['bold']) {
1560 $data['name'] = '<strong>' . $data['name'] . '</strong>';
1561 $data['value'] = '<strong>' . $data['value'] . '</strong>';
1562 }
1563 $this->tpl->touchBlock("std_prop");
1564 $this->tpl->setCurrentBlock('item_property');
1565 if ($data['show_field']) {
1566 $this->tpl->setVariable('TXT_PROP', $data['name']);
1567 }
1568 $this->tpl->setVariable('VAL_PROP', $data['value']);
1569 $this->tpl->parseCurrentBlock();
1570
1571 if ($data['newline']) {
1572 $this->tpl->touchBlock('newline_prop');
1573 }
1574 $fields_shown = false;
1575 }
1576 if ($fields_shown) {
1577 $this->tpl->touchBlock('newline_prop');
1578 }
1579 }
1580
1581
1589 public function insertDescription()
1590 {
1591 if ($this->getSubstitutionStatus()) {
1592 $this->insertSubstitutions();
1593 if (!$this->substitutions->isDescriptionEnabled()) {
1594 return true;
1595 }
1596 }
1597
1598 // see bug #16519
1599 $d = $this->getDescription();
1600 // even b tag produced bugs, see #32304
1601 $d = strip_tags($d);
1602 $this->tpl->setCurrentBlock("item_description");
1603 $this->tpl->setVariable("TXT_DESC", $d);
1604 $this->tpl->parseCurrentBlock();
1605 }
1606
1611 public function insertSearchFragment()
1612 {
1613 if (strlen($this->getSearchFragment())) {
1614 $this->tpl->setCurrentBlock('search_fragment');
1615 $this->tpl->setVariable('TXT_SEARCH_FRAGMENT', $this->getSearchFragment() . ' ...');
1616 $this->tpl->parseCurrentBlock();
1617 }
1618 }
1619
1625 public function insertRelevance()
1626 {
1627 if (!$this->enabledRelevance() or !(int) $this->getRelevance()) {
1628 return false;
1629 }
1630
1631 include_once "Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
1633 $pbar->setCurrent($this->getRelevance());
1634
1635 $this->tpl->setCurrentBlock('relevance');
1636 $this->tpl->setVariable('REL_PBAR', $pbar->render());
1637 $this->tpl->parseCurrentBlock();
1638 }
1639
1645 public function setMode($a_mode)
1646 {
1647 $this->mode = $a_mode;
1648 }
1649
1655 public function getMode()
1656 {
1657 return $this->mode;
1658 }
1659
1663 public function setConditionDepth($a_depth)
1664 {
1665 $this->condition_depth = $a_depth;
1666 }
1667
1675 public function isMode($a_mode)
1676 {
1677 if ($a_mode == $this->mode) {
1678 return true;
1679 } else {
1680 return false;
1681 }
1682 }
1683
1688 public function determineProperties()
1689 {
1690 $ilAccess = $this->access;
1691 $lng = $this->lng;
1693
1694 $props = $this->getProperties();
1695 $props = $this->getCustomProperties($props);
1696
1697 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1698 // add learning progress custom property
1699 include_once "Services/Tracking/classes/class.ilLPStatus.php";
1700 $lp = ilLPStatus::getListGUIStatus($this->obj_id);
1701 if ($lp) {
1702 $props[] = array("alert" => false,
1703 "property" => $lng->txt("learning_progress"),
1704 "value" => $lp,
1705 "newline" => true);
1706 }
1707
1708 // add no item access note in public section
1709 // for items that are visible but not readable
1710 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
1711 if (!$ilAccess->checkAccess("read", "", $this->ref_id, $this->type, $this->obj_id)) {
1712 $props[] = array("alert" => true,
1713 "value" => $lng->txt("no_access_item_public"),
1714 "newline" => true);
1715 }
1716 }
1717 }
1718
1719 // reference objects have translated ids, revert to originals
1720 $note_ref_id = $this->ref_id;
1721 $note_obj_id = $this->obj_id;
1722 if ($this->reference_ref_id) {
1723 $note_ref_id = $this->reference_ref_id;
1724 $note_obj_id = $this->reference_obj_id;
1725 }
1726 $redraw_js = "il.Object.redrawListItem(" . $note_ref_id . ");";
1727
1728 // add common properties (comments, notes, tags)
1729 require_once 'Services/Notes/classes/class.ilNote.php';
1730 if ((self::$cnt_notes[$note_obj_id][IL_NOTE_PRIVATE] > 0 ||
1731 self::$cnt_notes[$note_obj_id][IL_NOTE_PUBLIC] > 0 ||
1732 self::$cnt_tags[$note_obj_id] > 0 ||
1733 is_array(self::$tags[$note_obj_id])) &&
1734 ($ilUser->getId() != ANONYMOUS_USER_ID)) {
1735 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
1736 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
1737
1738 $nl = true;
1739 if ($this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, false, false)
1740 && self::$cnt_notes[$note_obj_id][IL_NOTE_PUBLIC] > 0) {
1741 $props[] = array("alert" => false,
1742 "property" => $lng->txt("notes_comments"),
1743 "value" => "<a href='#' onclick=\"return " .
1744 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $redraw_js) . "\">" .
1745 self::$cnt_notes[$note_obj_id][IL_NOTE_PUBLIC] . "</a>",
1746 "newline" => $nl);
1747 $nl = false;
1748 }
1749
1750 if ($this->notes_enabled && self::$cnt_notes[$note_obj_id][IL_NOTE_PRIVATE] > 0) {
1751 $props[] = array("alert" => false,
1752 "property" => $lng->txt("notes"),
1753 "value" => "<a href='#' onclick=\"return " .
1754 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $redraw_js) . "\">" .
1755 self::$cnt_notes[$note_obj_id][IL_NOTE_PRIVATE] . "</a>",
1756 "newline" => $nl);
1757 $nl = false;
1758 }
1759 if ($this->tags_enabled &&
1760 (self::$cnt_tags[$note_obj_id] > 0 ||
1761 is_array(self::$tags[$note_obj_id]))) {
1762 $tags_set = new ilSetting("tags");
1763 if ($tags_set->get("enable")) {
1764 $tags_url = ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $redraw_js);
1765
1766 // list object tags
1767 if (is_array(self::$tags[$note_obj_id])) {
1768 $tags_tmp = array();
1769 foreach (self::$tags[$note_obj_id] as $tag => $is_tag_owner) {
1770 if ($is_tag_owner) {
1771 $tags_tmp[] = "<a class=\"ilTag ilTagRelHigh\" href='#' onclick=\"return " .
1772 $tags_url . "\">" . $tag . "</a>";
1773 } else {
1774 $tags_tmp[] = "<span class=\"ilTag ilTagRelMiddle\">" . $tag . "</span>";
1775 }
1776 }
1777 $tags_value = implode(" ", $tags_tmp);
1778 $nl = true;
1779 $prop_text = "";
1780 } // tags counter
1781 else {
1782 $tags_value = "<a href='#' onclick=\"return " . $tags_url . "\">" .
1783 self::$cnt_tags[$note_obj_id] . "</a>";
1784 $prop_text = $lng->txt("tagging_tags");
1785 }
1786 $props[] = array("alert" => false,
1787 "property" => $prop_text,
1788 "value" => $tags_value,
1789 "newline" => $nl);
1790 $nl = false;
1791 }
1792 }
1793 }
1794 if (!is_array($props)) {
1795 return [];
1796 }
1797 return $props;
1798 }
1799
1805 public function insertProperties()
1806 {
1807 $props = $this->determineProperties();
1808 $cnt = 1;
1809 if (is_array($props) && count($props) > 0) {
1810 foreach ($props as $prop) {
1811 if ($cnt > 1) {
1812 $this->tpl->touchBlock("separator_prop");
1813 }
1814
1815 if ($prop["alert"] == true) {
1816 $this->tpl->touchBlock("alert_prop");
1817 } else {
1818 $this->tpl->touchBlock("std_prop");
1819 }
1820 if ($prop["newline"] == true && $cnt > 1) {
1821 $this->tpl->touchBlock("newline_prop");
1822 }
1823 //BEGIN WebDAV: Support hidden property names.
1824 if (isset($prop["property"]) && $prop['propertyNameVisible'] !== false && $prop["property"] != "") {
1825 //END WebDAV: Support hidden property names.
1826 $this->tpl->setCurrentBlock("prop_name");
1827 $this->tpl->setVariable("TXT_PROP", $prop["property"]);
1828 $this->tpl->parseCurrentBlock();
1829 }
1830 $this->tpl->setCurrentBlock("item_property");
1831 //BEGIN WebDAV: Support links in property values.
1832 if ($prop['link']) {
1833 $this->tpl->setVariable("LINK_PROP", $prop['link']);
1834 $this->tpl->setVariable("LINK_VAL_PROP", $prop["value"]);
1835 } else {
1836 $this->tpl->setVariable("VAL_PROP", $prop["value"]);
1837 }
1838 //END WebDAV: Support links in property values.
1839 $this->tpl->parseCurrentBlock();
1840
1841 $cnt++;
1842 }
1843 $this->tpl->setCurrentBlock("item_properties");
1844 $this->tpl->parseCurrentBlock();
1845 }
1846 }
1847
1848 public function insertNoticeProperties()
1849 {
1850 $this->getNoticeProperties();
1851 foreach ($this->notice_prop as $property) {
1852 $this->tpl->setCurrentBlock('notice_item');
1853 $this->tpl->setVariable('NOTICE_ITEM_VALUE', $property['value']);
1854 $this->tpl->parseCurrentBlock();
1855 }
1856 $this->tpl->setCurrentBlock('notice_property');
1857 $this->tpl->parseCurrentBlock();
1858 }
1859
1860 protected function parseConditions($toggle_id, $conditions, $obligatory = true)
1861 {
1862 $lng = $this->lng;
1863 $objDefinition = $this->obj_definition;
1865
1866 $num_required = ilConditionHandler::calculateEffectiveRequiredTriggers($this->ref_id, $this->obj_id);
1867 $num_optional_required =
1868 $num_required - count($conditions) + count(ilConditionHandler::getEffectiveOptionalConditionsOfTarget($this->ref_id, $this->obj_id));
1869
1870 // Check if all conditions are fullfilled
1871 $visible_conditions = array();
1872 $passed_optional = 0;
1873 foreach ($conditions as $condition) {
1874 if ($obligatory and !$condition['obligatory']) {
1875 continue;
1876 }
1877 if (!$obligatory and $condition['obligatory']) {
1878 continue;
1879 }
1880
1881 if ($tree->isDeleted($condition['trigger_ref_id'])) {
1882 continue;
1883 }
1884
1885 include_once 'Services/Container/classes/class.ilMemberViewSettings.php';
1887 !ilMemberViewSettings::getInstance()->isActive();
1888
1889 if (!$ok) {
1890 $visible_conditions[] = $condition['id'];
1891 }
1892
1893 if (!$obligatory and $ok) {
1894 ++$passed_optional;
1895 // optional passed
1896 if ($passed_optional >= $num_optional_required) {
1897 return true;
1898 }
1899 }
1900 }
1901
1902 foreach ($conditions as $condition) {
1903 if (!in_array($condition['id'], $visible_conditions)) {
1904 continue;
1905 }
1906
1907 include_once './Services/Conditions/classes/class.ilConditionHandlerGUI.php';
1908 $cond_txt = ilConditionHandlerGUI::translateOperator($condition['trigger_obj_id'], $condition['operator']) . ' ' . $condition['value'];
1909
1910 // display trigger item
1911 $class = $objDefinition->getClassName($condition["trigger_type"]);
1912 $location = $objDefinition->getLocation($condition["trigger_type"]);
1913 if ($class == "" && $location == "") {
1914 continue;
1915 }
1916 $missing_cond_exist = true;
1917
1918 $full_class = "ilObj" . $class . "ListGUI";
1919 include_once($location . "/class." . $full_class . ".php");
1920 $item_list_gui = new $full_class($this);
1921 $item_list_gui->setMode(IL_LIST_AS_TRIGGER);
1922 $item_list_gui->enablePath(false);
1923 $item_list_gui->enableIcon(true);
1924 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1925 $item_list_gui->setParentRefId($this->getUniqueItemId()); // yes we can
1926 $item_list_gui->addCustomProperty($this->lng->txt("precondition_required_itemlist"), $cond_txt, false, true);
1927
1928 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1929 $item_list_gui->enableProperties($this->properties_enabled);
1930
1931 $trigger_html = $item_list_gui->getListItemHTML(
1932 $condition['trigger_ref_id'],
1933 $condition['trigger_obj_id'],
1934 ilObject::_lookupTitle($condition["trigger_obj_id"]),
1935 ""
1936 );
1937 $this->tpl->setCurrentBlock("precondition");
1938 if ($trigger_html == "") {
1939 $trigger_html = $this->lng->txt("precondition_not_accessible");
1940 }
1941 $this->tpl->setVariable("TXT_CONDITION", trim($cond_txt));
1942 $this->tpl->setVariable("TRIGGER_ITEM", $trigger_html);
1943 $this->tpl->parseCurrentBlock();
1944 }
1945
1946 if ($missing_cond_exist and $obligatory) {
1947 $this->tpl->setCurrentBlock("preconditions");
1948 $this->tpl->setVariable("CONDITION_TOGGLE_ID", "_obl_" . $toggle_id);
1949 $this->tpl->setVariable("TXT_PRECONDITIONS", $lng->txt("preconditions_obligatory_hint"));
1950 $this->tpl->parseCurrentBlock();
1951 } elseif ($missing_cond_exist and !$obligatory) {
1952 $this->tpl->setCurrentBlock("preconditions");
1953 $this->tpl->setVariable("CONDITION_TOGGLE_ID", "_opt_" . $toggle_id);
1954 $this->tpl->setVariable("TXT_PRECONDITIONS", sprintf($lng->txt("preconditions_optional_hint"), $num_optional_required));
1955 $this->tpl->parseCurrentBlock();
1956 }
1957
1958 return !$missing_cond_exist;
1959 }
1960
1964 public function insertPreconditions()
1965 {
1966 include_once("./Services/Conditions/classes/class.ilConditionHandler.php");
1967
1968 // do not show multi level conditions (messes up layout)
1969 if ($this->condition_depth > 0) {
1970 return;
1971 }
1972
1973 if ($this->condition_target) {
1974 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget(
1975 $this->condition_target['ref_id'],
1976 $this->condition_target['obj_id'],
1977 $this->condition_target['target_type']
1978 );
1979 } else {
1980 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget($this->ref_id, $this->obj_id);
1981 }
1982
1983 if (sizeof($conditions)) {
1984 for ($i = 0; $i < count($conditions); $i++) {
1985 $conditions[$i]['title'] = ilObject::_lookupTitle($conditions[$i]['trigger_obj_id']);
1986 }
1987 $conditions = ilUtil::sortArray($conditions, 'title', 'DESC');
1988
1990
1991 // Show obligatory and optional preconditions seperated
1992 $all_done_obl = $this->parseConditions(self::$js_unique_id, $conditions, true);
1993 $all_done_opt = $this->parseConditions(self::$js_unique_id, $conditions, false);
1994
1995 if (!$all_done_obl || !$all_done_opt) {
1996 $this->tpl->setCurrentBlock("preconditions_toggle");
1997 $this->tpl->setVariable("PRECONDITION_TOGGLE_INTRO", $this->lng->txt("precondition_toggle"));
1998 $this->tpl->setVariable("PRECONDITION_TOGGLE_TRIGGER", $this->lng->txt("show"));
1999 $this->tpl->setVariable("PRECONDITION_TOGGLE_ID", self::$js_unique_id);
2000 $this->tpl->setVariable("TXT_PRECONDITION_SHOW", $this->lng->txt("show"));
2001 $this->tpl->setVariable("TXT_PRECONDITION_HIDE", $this->lng->txt("hide"));
2002 $this->tpl->parseCurrentBlock();
2003 }
2004 }
2005 }
2006
2015 public function insertCommand($a_href, $a_text, $a_frame = "", $a_img = "", $a_cmd = "", $a_onclick = "")
2016 {
2017 // #11099
2018 $chksum = md5($a_href . $a_text);
2019 if ($a_href == "#" ||
2020 !in_array($chksum, $this->prevent_duplicate_commands)) {
2021 if ($a_href != "#") {
2022 $this->prevent_duplicate_commands[] = $chksum;
2023 }
2024
2025 $prevent_background_click = false;
2026 if ($a_cmd == 'mount_webfolder') {
2027 $a_onclick = "triggerWebDAVModal('$a_href')";
2028 $a_href = "#";
2030 }
2031
2032 $this->current_selection_list->addItem(
2033 $a_text,
2034 "",
2035 $a_href,
2036 $a_img,
2037 $a_text,
2038 $a_frame,
2039 "",
2040 $prevent_background_click,
2041 $a_onclick
2042 );
2043 }
2044 }
2045
2053 public function insertDeleteCommand()
2054 {
2055 if ($this->std_cmd_only) {
2056 return;
2057 }
2058
2059 if (is_object($this->getContainerObject()) and
2061 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type)) {
2062 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2063 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "delete");
2064 $this->insertCommand($cmd_link, $this->lng->txt("delete"));
2065 $this->adm_commands_included = true;
2066 return true;
2067 }
2068 return false;
2069 }
2070
2071 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type)) {
2072 $this->ctrl->setParameter(
2073 $this->container_obj,
2074 "ref_id",
2075 $this->container_obj->object->getRefId()
2076 );
2077 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2078 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "delete");
2079 $this->insertCommand(
2080 $cmd_link,
2081 $this->lng->txt("delete"),
2082 "",
2083 ""
2084 );
2085 $this->adm_commands_included = true;
2086 }
2087 }
2088
2096 public function insertLinkCommand()
2097 {
2098 $objDefinition = $this->obj_definition;
2099
2100 if ($this->std_cmd_only) {
2101 return;
2102 }
2103
2104 // #17307
2105 if (!$this->checkCommandAccess('delete', '', $this->ref_id, $this->type) or
2106 !$objDefinition->allowLink($this->type)) {
2107 return false;
2108 }
2109
2110 // BEGIN PATCH Lucene search
2111
2112 if (is_object($this->getContainerObject()) and
2114 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2115 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "link");
2116 $this->insertCommand($cmd_link, $this->lng->txt("link"));
2117 $this->adm_commands_included = true;
2118 return true;
2119 }
2120 // END PATCH Lucene Search
2121
2122 // if the permission is changed here, it has
2123 // also to be changed in ilContainerGUI, admin command check
2124 $this->ctrl->setParameter(
2125 $this->container_obj,
2126 "ref_id",
2127 $this->container_obj->object->getRefId()
2128 );
2129 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2130 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "link");
2131 $this->insertCommand(
2132 $cmd_link,
2133 $this->lng->txt("link"),
2134 "",
2135 ""
2136 );
2137 $this->adm_commands_included = true;
2138 return true;
2139 }
2140
2147 public function insertCutCommand($a_to_repository = false)
2148 {
2149 if ($this->std_cmd_only) {
2150 return;
2151 }
2152 // BEGIN PATCH Lucene search
2153 if (is_object($this->getContainerObject()) and
2155 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type)) {
2156 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2157 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "cut");
2158 $this->insertCommand($cmd_link, $this->lng->txt("move"));
2159 $this->adm_commands_included = true;
2160 return true;
2161 }
2162 return false;
2163 }
2164 // END PATCH Lucene Search
2165
2166 // if the permission is changed here, it has
2167 // also to be changed in ilContainerContentGUI, determineAdminCommands
2168 if ($this->checkCommandAccess('delete', '', $this->ref_id, $this->type) &&
2169 $this->container_obj->object) {
2170 $this->ctrl->setParameter(
2171 $this->container_obj,
2172 "ref_id",
2173 $this->container_obj->object->getRefId()
2174 );
2175 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2176
2177 if (!$a_to_repository) {
2178 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "cut");
2179 $this->insertCommand(
2180 $cmd_link,
2181 $this->lng->txt("move"),
2182 "",
2183 ""
2184 );
2185 } else {
2186 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "cut_for_repository");
2187 $this->insertCommand(
2188 $cmd_link,
2189 $this->lng->txt("wsp_move_to_repository"),
2190 "",
2191 ""
2192 );
2193 }
2194
2195 $this->adm_commands_included = true;
2196 }
2197 }
2198
2204 public function insertCopyCommand($a_to_repository = false)
2205 {
2206 $objDefinition = $this->obj_definition;
2207
2208 if ($this->std_cmd_only) {
2209 return;
2210 }
2211
2212 if ($this->checkCommandAccess('copy', 'copy', $this->ref_id, $this->type) &&
2213 $objDefinition->allowCopy($this->type)) {
2214 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
2215 $this->ctrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getCommandId());
2216 $cmd_copy = $this->ctrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
2217 $this->insertCommand($cmd_copy, $this->lng->txt('copy'));
2218 } else {
2219 $this->ctrl->setParameter(
2220 $this->container_obj,
2221 "ref_id",
2222 $this->container_obj->object->getRefId()
2223 );
2224 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2225
2226 if (!$a_to_repository) {
2227 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj, 'copy');
2228 $this->insertCommand($cmd_copy, $this->lng->txt('copy'));
2229 } else {
2230 $cmd_copy = $this->ctrl->getLinkTarget($this->container_obj, 'copy_to_repository');
2231 $this->insertCommand($cmd_copy, $this->lng->txt('wsp_copy_to_repository'));
2232 }
2233 }
2234
2235 $this->adm_commands_included = true;
2236 }
2237 return;
2238 }
2239
2240
2244 public function insertPasteCommand()
2245 {
2246 $objDefinition = $this->obj_definition;
2247
2248 if ($this->std_cmd_only) {
2249 return;
2250 }
2251
2252 if (!$objDefinition->isContainer(ilObject::_lookupType($this->obj_id))) {
2253 return false;
2254 }
2255
2256 if (is_object($this->getContainerObject()) and
2258 isset($_SESSION['clipboard'])) {
2259 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id', $this->getCommandId());
2260 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), "paste");
2261 $this->insertCommand($cmd_link, $this->lng->txt("paste"));
2262 $this->adm_commands_included = true;
2263 return true;
2264 }
2265 return false;
2266 }
2267
2275 public function insertSubscribeCommand()
2276 {
2279
2280 if ($this->std_cmd_only) {
2281 return;
2282 }
2283
2284 // note: the setting disable_my_offers is used for
2285 // presenting the favourites in the main section of the dashboard
2286 // see also bug #32014
2287 if (!(bool) $ilSetting->get('rep_favourites', "0")) {
2288 return;
2289 }
2290
2292
2293 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
2294 // #17467 - add ref_id to link (in repository only!)
2295 if (is_object($this->container_obj) &&
2296 !($this->container_obj instanceof ilAdministrationCommandHandling) &&
2297 is_object($this->container_obj->object)) {
2298 $this->ctrl->setParameter($this->container_obj, "ref_id", $this->container_obj->object->getRefId());
2299 }
2300
2301 if (!$this->fav_manager->ifIsFavourite($ilUser->getId(), $this->getCommandId())) {
2302 // Pass type and object ID to ilAccess to improve performance
2303 if ($this->checkCommandAccess("read", "", $this->ref_id, $this->type, $this->obj_id)) {
2304 if ($this->getContainerObject() instanceof ilDesktopItemHandling) {
2305 $this->ctrl->setParameter($this->container_obj, "type", $type);
2306 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2307 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "addToDesk");
2308 $this->insertCommand(
2309 $cmd_link,
2310 $this->lng->txt("rep_add_to_favourites"),
2311 "",
2312 ""
2313 );
2314 }
2315 }
2316 } else {
2317 if ($this->getContainerObject() instanceof ilDesktopItemHandling) {
2318 $this->ctrl->setParameter($this->container_obj, "type", $type);
2319 $this->ctrl->setParameter($this->container_obj, "item_ref_id", $this->getCommandId());
2320 $cmd_link = $this->ctrl->getLinkTarget($this->container_obj, "removeFromDesk");
2321 $this->insertCommand(
2322 $cmd_link,
2323 $this->lng->txt("rep_remove_from_favourites"),
2324 "",
2325 ""
2326 );
2327 }
2328 }
2329 }
2330 }
2331
2335 public function insertInfoScreenCommand()
2336 {
2337 if ($this->std_cmd_only) {
2338 return;
2339 }
2340 $cmd_link = $this->getCommandLink("infoScreen");
2341 $cmd_frame = $this->getCommandFrame("infoScreen");
2342 $this->insertCommand(
2343 $cmd_link,
2344 $this->lng->txt("info_short"),
2345 $cmd_frame,
2346 ilUtil::getImagePath("icon_info.svg")
2347 );
2348 }
2349
2356 public function insertCommonSocialCommands($a_header_actions = false)
2357 {
2358 $lng = $this->lng;
2360
2361 if ($this->std_cmd_only ||
2362 ($ilUser->getId() == ANONYMOUS_USER_ID)) {
2363 return;
2364 }
2365 $lng->loadLanguageModule("notes");
2366 $lng->loadLanguageModule("tagging");
2367 $cmd_frame = $this->getCommandFrame("infoScreen");
2368 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
2369
2370 // reference objects have translated ids, revert to originals
2371 $note_ref_id = $this->ref_id;
2372 if ($this->reference_ref_id) {
2373 $note_ref_id = $this->reference_ref_id;
2374 }
2375
2376 $js_updater = $a_header_actions
2377 ? "il.Object.redrawActionHeader();"
2378 : "il.Object.redrawListItem(" . $note_ref_id . ")";
2379
2380 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, $a_header_actions, true);
2381 if ($comments_enabled) {
2382 $this->insertCommand(
2383 "#",
2384 $this->lng->txt("notes_comments"),
2385 $cmd_frame,
2386 "",
2387 "",
2388 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $js_updater)
2389 );
2390 }
2391
2392 if ($this->notes_enabled) {
2393 $this->insertCommand(
2394 "#",
2395 $this->lng->txt("notes"),
2396 $cmd_frame,
2397 "",
2398 "",
2399 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $js_updater)
2400 );
2401 }
2402
2403 if ($this->tags_enabled) {
2404 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
2405 //$this->insertCommand($cmd_tag_link, $this->lng->txt("tagging_set_tag"), $cmd_frame);
2406 $this->insertCommand(
2407 "#",
2408 $this->lng->txt("tagging_set_tag"),
2409 $cmd_frame,
2410 "",
2411 "",
2412 ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $js_updater)
2413 );
2414 }
2415 }
2416
2422 public function insertTimingsCommand()
2423 {
2424 if ($this->std_cmd_only || !$this->container_obj->object) {
2425 return;
2426 }
2427
2428 $parent_ref_id = $this->container_obj->object->getRefId();
2429 $parent_type = $this->container_obj->object->getType();
2430
2431 // #18737
2432 if ($this->reference_ref_id) {
2433 $this->ctrl->setParameterByClass('ilobjectactivationgui', 'ref_id', $this->reference_ref_id);
2434 }
2435
2436 if ($this->checkCommandAccess('write', '', $parent_ref_id, $parent_type) ||
2437 $this->checkCommandAccess('write', '', $this->ref_id, $this->type)) {
2438 $this->ctrl->setParameterByClass(
2439 'ilobjectactivationgui',
2440 'cadh',
2441 $this->ajax_hash
2442 );
2443 $this->ctrl->setParameterByClass(
2444 'ilobjectactivationgui',
2445 'parent_id',
2447 );
2448 $cmd_lnk = $this->ctrl->getLinkTargetByClass(
2449 array($this->gui_class_name, 'ilcommonactiondispatchergui', 'ilobjectactivationgui'),
2450 'edit'
2451 );
2452
2453 $this->insertCommand($cmd_lnk, $this->lng->txt('obj_activation_list_gui'));
2454 }
2455
2456 if ($this->reference_ref_id) {
2457 $this->ctrl->setParameterByClass('ilobjectactivationgui', 'ref_id', $this->ref_id);
2458 }
2459 }
2460
2470 public function insertCommands(
2471 $a_use_asynch = false,
2472 $a_get_asynch_commands = false,
2473 $a_asynch_url = "",
2474 $a_header_actions = false
2475 ) {
2476 $lng = $this->lng;
2478
2479 if (!$this->getCommandsStatus()) {
2480 return;
2481 }
2482
2483 include_once("Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2484 $this->current_selection_list = new ilAdvancedSelectionListGUI();
2485 $this->current_selection_list->setAriaListTitle(
2486 sprintf(
2487 $this->lng->txt('actions_for'),
2488 htmlspecialchars(addslashes($this->getTitle()))
2489 )
2490 );
2491 $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands);
2492 $this->current_selection_list->setAsynchUrl($a_asynch_url);
2493 if ($a_header_actions) {
2494 $this->current_selection_list->setListTitle("<span class='hidden-xs'>" . $lng->txt("actions") . "</span>");
2495 } else {
2496 $this->current_selection_list->setListTitle("");
2497 }
2498 $this->current_selection_list->setId("act_" . $this->getUniqueItemId(false));
2499 $this->current_selection_list->setSelectionHeaderClass("small");
2500 $this->current_selection_list->setItemLinkClass("xsmall");
2501 $this->current_selection_list->setLinksMode("il_ContainerItemCommand2");
2502 $this->current_selection_list->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
2503 $this->current_selection_list->setUseImages(false);
2504 $this->current_selection_list->setAdditionalToggleElement($this->getUniqueItemId(true), "ilContainerListItemOuterHighlight");
2505
2506 $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", $this->ref_id);
2507
2508 // only standard command?
2509 $only_default = false;
2510 if ($a_use_asynch && !$a_get_asynch_commands) {
2511 $only_default = true;
2512 }
2513
2514 $this->default_command = false;
2515 $this->prevent_duplicate_commands = array();
2516
2517 // we only allow the following commands inside the header actions
2518 $valid_header_commands = array("mount_webfolder");
2519
2520 $commands = $this->getCommands($this->ref_id, $this->obj_id);
2521 foreach ($commands as $command) {
2522 if ($a_header_actions && !in_array($command["cmd"], $valid_header_commands)) {
2523 continue;
2524 }
2525
2526 if ($command["granted"] == true) {
2527 if (!$command["default"] === true) {
2528 if (!$this->std_cmd_only && !$only_default) {
2529 // workaround for repository frameset
2530 $command["link"] =
2531 $this->appendRepositoryFrameParameter($command["link"]);
2532
2533 $cmd_link = $command["link"];
2534 $txt = ($command["lang_var"] == "")
2535 ? $command["txt"]
2536 : $this->lng->txt($command["lang_var"]);
2537 $this->insertCommand(
2538 $cmd_link,
2539 $txt,
2540 $command["frame"],
2541 $command["img"],
2542 $command["cmd"]
2543 );
2544 }
2545 } else {
2546 $this->default_command = $this->createDefaultCommand($command);
2547 //$this->default_command = $command;
2548 }
2549 }
2550 }
2551
2552 if (!$only_default) {
2553 // custom commands
2554 if (is_array($this->cust_commands)) {
2555 foreach ($this->cust_commands as $command) {
2556 $this->insertCommand(
2557 $command["link"],
2558 $this->lng->txt($command["lang_var"]),
2559 $command["frame"],
2560 "",
2561 $command["cmd"],
2562 $command["onclick"]
2563 );
2564 }
2565 }
2566
2567 // info screen commmand
2568 if ($this->getInfoScreenStatus()) {
2569 $this->insertInfoScreenCommand();
2570 }
2571
2572 if (!$this->isMode(IL_LIST_AS_TRIGGER)) {
2573 // edit timings
2574 if ($this->timings_enabled) {
2575 $this->insertTimingsCommand();
2576 }
2577
2578 // delete
2579 if ($this->delete_enabled) {
2580 $this->insertDeleteCommand();
2581 }
2582
2583 // link
2584 if ($this->link_enabled) {
2585 $this->insertLinkCommand();
2586 }
2587
2588 // cut
2589 if ($this->cut_enabled) {
2590 $this->insertCutCommand();
2591 }
2592
2593 // copy
2594 if ($this->copy_enabled) {
2595 $this->insertCopyCommand();
2596 }
2597
2598 // cut/copy from workspace to repository
2599 if ($this->repository_transfer_enabled) {
2600 $this->insertCutCommand(true);
2601 $this->insertCopyCommand(true);
2602 }
2603
2604 // subscribe
2605 if ($this->subscribe_enabled) {
2606 $this->insertSubscribeCommand();
2607 }
2608
2609 // multi download
2610 if ($this->multi_download_enabled && $a_header_actions) {
2612 }
2613
2614 // BEGIN PATCH Lucene search
2615 if ($this->cut_enabled or $this->link_enabled) {
2616 $this->insertPasteCommand();
2617 }
2618 // END PATCH Lucene Search
2619 }
2620 }
2621
2622 // common social commands (comment, notes, tags)
2623 if (!$only_default && !$this->isMode(IL_LIST_AS_TRIGGER)) {
2624 $this->insertCommonSocialCommands($a_header_actions);
2625 }
2626
2627 if (!$a_header_actions) {
2628 $this->ctrl->clearParametersByClass($this->gui_class_name);
2629 }
2630
2631 // fix bug #12417
2632 // there is one case, where no action menu should be displayed:
2633 // public area, category, no info tab
2634 // todo: make this faster and remove type specific implementation if possible
2635 if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions) {
2636 if ($ilUser->getId() == ANONYMOUS_USER_ID && $this->checkInfoPageOnAsynchronousRendering()) {
2637 include_once("./Services/Container/classes/class.ilContainer.php");
2638 include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
2640 $this->obj_id,
2642 true
2643 )) {
2644 return;
2645 }
2646 }
2647 }
2648
2649 if ($a_use_asynch && $a_get_asynch_commands) {
2650 return $this->current_selection_list->getHTML(true);
2651 }
2652
2653 return $this->current_selection_list->getHTML();
2654 }
2655
2661 public function enableComments($a_value, $a_enable_comments_settings = true)
2662 {
2664
2665 // global switch
2666 if ($ilSetting->get("disable_comments")) {
2667 $a_value = false;
2668 }
2669
2670 $this->comments_enabled = (bool) $a_value;
2671 $this->comments_settings_enabled = (bool) $a_enable_comments_settings;
2672 }
2673
2679 public function enableNotes($a_value)
2680 {
2682
2683 // global switch
2684 if ($ilSetting->get("disable_notes")) {
2685 $a_value = false;
2686 }
2687
2688 $this->notes_enabled = (bool) $a_value;
2689 }
2690
2696 public function enableTags($a_value)
2697 {
2698 $tags_set = new ilSetting("tags");
2699 if (!$tags_set->get("enable")) {
2700 $a_value = false;
2701 }
2702 $this->tags_enabled = (bool) $a_value;
2703 }
2704
2713 public function enableRating($a_value, $a_text = null, $a_categories = false, array $a_ctrl_path = null)
2714 {
2715 $this->rating_enabled = (bool) $a_value;
2716
2717 if ($this->rating_enabled) {
2718 $this->rating_categories_enabled = (bool) $a_categories;
2719 $this->rating_text = $a_text;
2720 $this->rating_ctrl_path = $a_ctrl_path;
2721 }
2722 }
2723
2729 public function enableMultiDownload($a_value)
2730 {
2731 $folder_set = new ilSetting("fold");
2732 if (!$folder_set->get("enable_multi_download")) {
2733 $a_value = false;
2734 }
2735 $this->multi_download_enabled = (bool) $a_value;
2736 }
2737
2739 {
2740 $objDefinition = $this->obj_definition;
2741
2742 if ($this->std_cmd_only) {
2743 return;
2744 }
2745
2746 if (!$objDefinition->isContainer(ilObject::_lookupType($this->obj_id))) {
2747 return false;
2748 }
2749
2750 if (is_object($this->getContainerObject()) &&
2751 $this->getContainerObject() instanceof ilContainerGUI) {
2752 $this->ctrl->setParameter($this->getContainerObject(), "type", "");
2753 $this->ctrl->setParameter($this->getContainerObject(), "item_ref_id", "");
2754 $this->ctrl->setParameter($this->getContainerObject(), "active_node", "");
2755 // bugfix mantis 24559
2756 // undoing an erroneous change inside mantis 23516 by adding "Download Multiple Objects"-functionality for non-admins
2757 // as they don't have the possibility to use the multi-download-capability of the manage-tab
2758 $user_id = $this->user->getId();
2759 $hasAdminAccess = $this->access->checkAccessOfUser($user_id, "crs_admin", $this->ctrl->getCmd(), $_GET['ref_id']);
2760 // to still prevent duplicate download functions for admins the following if-else statement keeps the redirection for admins
2761 // while letting other course members access the original multi-download functionality
2762 if ($hasAdminAccess) {
2763 $cmd = $_GET["cmd"] == "enableAdministrationPanel" ? "render" : "enableAdministrationPanel";
2764 } else {
2765 $cmd = $_GET["cmd"] == "enableMultiDownload" ? "render" : "enableMultiDownload";
2766 }
2767 $cmd_link = $this->ctrl->getLinkTarget($this->getContainerObject(), $cmd);
2768 $this->insertCommand($cmd_link, $this->lng->txt("download_multiple_objects"));
2769 return true;
2770 }
2771
2772 return false;
2773 }
2774
2775 public function enableDownloadCheckbox($a_ref_id, $a_value)
2776 {
2777 $ilAccess = $this->access;
2778
2779 // TODO: delegate to list object class!
2780 if (!$this->getContainerObject()->isActiveAdministrationPanel() || $_SESSION["clipboard"]) {
2781 if (in_array($this->type, array("file", "fold")) &&
2782 $ilAccess->checkAccess("read", "", $a_ref_id, $this->type)) {
2783 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2784 } else {
2785 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2786 }
2787 } else {
2788 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2789 }
2790 }
2791
2793 {
2795 }
2796
2800 public static function prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl = null)
2801 {
2802 global $DIC;
2803 $tpl = $DIC["tpl"];
2804
2805 if (is_null($a_tpl)) {
2806 $a_tpl = $tpl;
2807 }
2808
2809 if ($a_notes_url) {
2810 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
2811 ilNoteGUI::initJavascript($a_notes_url, IL_NOTE_PRIVATE, $a_tpl);
2812 }
2813
2814 if ($a_tags_url) {
2815 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
2816 ilTaggingGUI::initJavascript($a_tags_url, $a_tpl);
2817 }
2818
2819 if ($a_redraw_url) {
2820 $a_tpl->addOnLoadCode("il.Object.setRedrawAHUrl('" .
2821 $a_redraw_url . "');");
2822 }
2823 }
2824
2831 public function setHeaderSubObject($a_type, $a_id)
2832 {
2833 $this->sub_obj_type = $a_type;
2834 $this->sub_obj_id = (int) $a_id;
2835 }
2836
2846 public function addHeaderIcon($a_id, $a_img, $a_tooltip = null, $a_onclick = null, $a_status_text = null, $a_href = null)
2847 {
2848 $this->header_icons[$a_id] = array("img" => $a_img,
2849 "tooltip" => $a_tooltip,
2850 "onclick" => $a_onclick,
2851 "status_text" => $a_status_text,
2852 "href" => $a_href);
2853 }
2854
2860 public function addHeaderIconHTML($a_id, $a_html)
2861 {
2862 $this->header_icons[$a_id] = $a_html;
2863 }
2864
2870 public function addHeaderGlyph($a_id, $a_glyph, $a_onclick = null)
2871 {
2872 $this->header_icons[$a_id] = array("glyph" => $a_glyph, "onclick" => $a_onclick);
2873 }
2874
2875 public function setAjaxHash($a_hash)
2876 {
2877 $this->ajax_hash = $a_hash;
2878 }
2879
2885 public function getHeaderAction(ilGlobalTemplateInterface $a_main_tpl = null)
2886 {
2887 global $DIC;
2888
2890 $lng = $this->lng;
2891
2892 if ($a_main_tpl == null) {
2893 $main_tpl = $DIC["tpl"];
2894 } else {
2895 $main_tpl = $a_main_tpl;
2896 }
2897
2898 $htpl = new ilTemplate("tpl.header_action.html", true, true, "Services/Repository");
2899
2900 $redraw_js = "il.Object.redrawActionHeader();";
2901
2902 // tags
2903 if ($this->tags_enabled) {
2904 include_once("./Services/Tagging/classes/class.ilTagging.php");
2906 $this->obj_id,
2907 ilObject::_lookupType($this->obj_id),
2908 0,
2909 "",
2910 $ilUser->getId()
2911 );
2912 if (count($tags) > 0) {
2913 include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
2914 $lng->loadLanguageModule("tagging");
2915 /*$this->addHeaderIcon("tags",
2916 ilUtil::getImagePath("icon_tag.svg"),
2917 $lng->txt("tagging_tags").": ".count($tags),
2918 ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $redraw_js),
2919 count($tags));*/
2920
2921 $f = $this->ui->factory();
2922 $this->addHeaderGlyph(
2923 "tags",
2924 $f->symbol()->glyph()->tag("#")
2925 ->withCounter($f->counter()->status((int) count($tags))),
2926 ilTaggingGUI::getListTagsJSCall($this->ajax_hash, $redraw_js)
2927 );
2928 }
2929 }
2930
2931 // notes and comments
2932 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, true, false);
2933 if ($this->notes_enabled || $comments_enabled) {
2934 include_once("./Services/Notes/classes/class.ilNote.php");
2935 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
2936 $type = ($this->sub_obj_type == "")
2937 ? $this->type
2938 : $this->sub_obj_type;
2939 $cnt = ilNote::_countNotesAndComments($this->obj_id, $this->sub_obj_id, $type);
2940
2941 if ($this->notes_enabled && $cnt[$this->obj_id][IL_NOTE_PRIVATE] > 0) {
2942 /*$this->addHeaderIcon("notes",
2943 ilUtil::getImagePath("note_unlabeled.svg"),
2944 $lng->txt("private_notes").": ".$cnt[$this->obj_id][IL_NOTE_PRIVATE],
2945 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $redraw_js),
2946 $cnt[$this->obj_id][IL_NOTE_PRIVATE]
2947 );*/
2948
2949 $f = $this->ui->factory();
2950 $this->addHeaderGlyph(
2951 "notes",
2952 $f->symbol()->glyph()->note("#")
2953 ->withCounter($f->counter()->status((int) $cnt[$this->obj_id][IL_NOTE_PRIVATE])),
2954 ilNoteGUI::getListNotesJSCall($this->ajax_hash, $redraw_js)
2955 );
2956 }
2957
2958 if ($comments_enabled && $cnt[$this->obj_id][IL_NOTE_PUBLIC] > 0) {
2959 $lng->loadLanguageModule("notes");
2960
2961 /*$this->addHeaderIcon("comments",
2962 ilUtil::getImagePath("comment_unlabeled.svg"),
2963 $lng->txt("notes_public_comments").": ".$cnt[$this->obj_id][IL_NOTE_PUBLIC],
2964 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $redraw_js),
2965 $cnt[$this->obj_id][IL_NOTE_PUBLIC]);*/
2966
2967 $f = $this->ui->factory();
2968 $this->addHeaderGlyph(
2969 "comments",
2970 $f->symbol()->glyph()->comment("#")
2971 ->withCounter($f->counter()->status((int) $cnt[$this->obj_id][IL_NOTE_PUBLIC])),
2972 ilNoteGUI::getListCommentsJSCall($this->ajax_hash, $redraw_js)
2973 );
2974 }
2975 }
2976
2977 // rating
2978 if ($this->rating_enabled) {
2979 include_once("./Services/Rating/classes/class.ilRatingGUI.php");
2980 $rating_gui = new ilRatingGUI();
2981 $rating_gui->enableCategories($this->rating_categories_enabled);
2982 // never rate sub objects from header action!
2983 $rating_gui->setObject($this->obj_id, $this->type);
2984 if ($this->rating_text) {
2985 $rating_gui->setYourRatingText($this->rating_text);
2986 }
2987
2988 $this->ctrl->setParameterByClass("ilRatingGUI", "cadh", $this->ajax_hash);
2989 $this->ctrl->setParameterByClass("ilRatingGUI", "rnsb", true);
2990 if ($this->rating_ctrl_path) {
2991 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2992 $ajax_url = $this->ctrl->getLinkTargetByClass($this->rating_ctrl_path, "saveRating", "", true, false);
2993 } else {
2994 // ???
2995 $ajax_url = $this->ctrl->getLinkTargetByClass("ilRatingGUI", "saveRating", "", true, false);
2996 }
2997 $main_tpl->addOnLoadCode("il.Object.setRatingUrl('" . $ajax_url . "');");
2998 $this->addHeaderIconHTML(
2999 "rating",
3000 $rating_gui->getHtml(
3001 true,
3002 $this->checkCommandAccess("read", "", $this->ref_id, $this->type),
3003 "il.Object.saveRating(%rating%);"
3004 )
3005 );
3006 }
3007
3008 if ($this->header_icons) {
3009 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
3010
3011 $chunks = array();
3012 foreach ($this->header_icons as $id => $attr) {
3013 $id = "headp_" . $id;
3014
3015 if (is_array($attr)) {
3016 if ($attr["glyph"]) {
3017 if ($attr["onclick"]) {
3018 $htpl->setCurrentBlock("prop_glyph_oc");
3019 $htpl->setVariable("GLYPH_ONCLICK", $attr["onclick"]);
3020 $htpl->parseCurrentBlock();
3021 }
3022 $renderer = $this->ui->renderer();
3023 $html = $renderer->render($attr["glyph"]);
3024 $htpl->setCurrentBlock("prop_glyph");
3025 $htpl->setVariable("GLYPH", $html);
3026 $htpl->parseCurrentBlock();
3027 } else {
3028 if ($attr["onclick"]) {
3029 $htpl->setCurrentBlock("onclick");
3030 $htpl->setVariable("PROP_ONCLICK", $attr["onclick"]);
3031 $htpl->parseCurrentBlock();
3032 }
3033
3034 if ($attr["status_text"]) {
3035 $htpl->setCurrentBlock("status");
3036 $htpl->setVariable("PROP_TXT", $attr["status_text"]);
3037 $htpl->parseCurrentBlock();
3038 }
3039
3040
3041 $htpl->setCurrentBlock("prop");
3042 if ($attr["href"] || $attr["onclick"]) {
3043 $htpl->setVariable("TAG", "a");
3044 } else {
3045 $htpl->setVariable("TAG", "span");
3046 }
3047 $htpl->setVariable("PROP_ID", $id);
3048 $htpl->setVariable("IMG", ilUtil::img($attr["img"], $attr["tooltip"]));
3049 if ($attr["href"] != "") {
3050 $htpl->setVariable("PROP_HREF", ' href="' . $attr["href"] . '" ');
3051 }
3052 $htpl->parseCurrentBlock();
3053
3054 if ($attr["tooltip"]) {
3055 ilTooltipGUI::addTooltip($id, $attr["tooltip"]);
3056 }
3057 }
3058 } else {
3059 $chunks[] = $attr;
3060 }
3061 }
3062
3063 if (sizeof($chunks)) {
3064 $htpl->setVariable(
3065 "PROP_CHUNKS",
3066 implode("&nbsp;&nbsp;&nbsp;", $chunks) . "&nbsp;&nbsp;&nbsp;"
3067 );
3068 }
3069 }
3070
3071 $this->setTitle(ilObject::_lookupTitle($this->obj_id));
3072 $htpl->setVariable(
3073 "ACTION_DROP_DOWN",
3074 $this->insertCommands(false, false, "", true)
3075 );
3076
3077 return $htpl->get();
3078 }
3079
3080
3085 public function appendRepositoryFrameParameter($a_link)
3086 {
3087 // we should get rid of this nonsense with 4.4 (alex)
3088 if ((strtolower($_GET["baseClass"]) != "ilrepositorygui") &&
3089 is_int(strpos($a_link, "baseClass=ilRepositoryGUI"))) {
3090 if ($this->type != "frm") {
3091 $a_link =
3092 ilUtil::appendUrlParameterString($a_link, "rep_frame=1");
3093 }
3094 }
3095
3096 return $a_link;
3097 }
3098
3099 protected function modifyTitleLink($a_default_link)
3100 {
3101 if ($this->default_command_params) {
3102 $params = array();
3103 foreach ($this->default_command_params as $name => $value) {
3104 $params[] = $name . '=' . $value;
3105 }
3106 $params = implode('&', $params);
3107
3108
3109 // #12370
3110 if (!stristr($a_default_link, '?')) {
3111 $a_default_link = ($a_default_link . '?' . $params);
3112 } else {
3113 $a_default_link = ($a_default_link . '&' . $params);
3114 }
3115 }
3116 return $a_default_link;
3117 }
3118
3122 public function modifySAHSlaunch($a_link, $wtarget)
3123 {
3124 global $DIC;
3125
3126 if (strstr($a_link, 'ilSAHSPresentationGUI') && !$this->offline_mode) {
3127 include_once 'Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
3128 $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
3129 $om = $sahs_obj->getOpenMode();
3130 $width = $sahs_obj->getWidth();
3131 $height = $sahs_obj->getHeight();
3132 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
3133 $om++;
3134 }
3135 if ($om != 0 && !$DIC['ilBrowser']->isMobile()) {
3136 $this->default_command["frame"] = "";
3137 $a_link = "javascript:void(0); onclick=startSAHS('" . $a_link . "','" . $wtarget . "'," . $om . "," . $width . "," . $height . ");";
3138 }
3139 }
3140 return $a_link;
3141 }
3142
3146 public function insertPath()
3147 {
3148 $lng = $this->lng;
3149
3150 if ($this->getPathStatus() != false) {
3151 if (!$this->path_gui instanceof \ilPathGUI) {
3152 $path_gui = new \ilPathGUI();
3153 } else {
3155 }
3156
3157 $path_gui->enableTextOnly(!$this->path_linked);
3158 $path_gui->setUseImages(false);
3159
3160 $start_node = $this->path_start_node
3161 ? $this->path_start_node
3163
3164 $this->tpl->setCurrentBlock("path_item");
3165 $this->tpl->setVariable('PATH_ITEM', $path_gui->getPath($start_node, $this->ref_id));
3166 $this->tpl->parseCurrentBlock();
3167
3168 $this->tpl->setCurrentBlock("path");
3169 $this->tpl->setVariable("TXT_LOCATION", $lng->txt("locator"));
3170 $this->tpl->parseCurrentBlock();
3171 return true;
3172 }
3173 }
3174
3181 public function insertProgressInfo()
3182 {
3183 return true;
3184 }
3185
3186
3191 {
3192 $lng = $this->lng;
3193 $objDefinition = $this->obj_definition;
3194
3195 $cnt = 0;
3196 if ($this->getCheckboxStatus()) {
3197 $this->tpl->setCurrentBlock("check");
3198 $this->tpl->setVariable("VAL_ID", $this->getCommandId());
3199 $this->tpl->parseCurrentBlock();
3200 $cnt += 1;
3201 } elseif ($this->getDownloadCheckboxState() != self::DOWNLOAD_CHECKBOX_NONE) {
3202 $this->tpl->setCurrentBlock("check_download");
3203 if ($this->getDownloadCheckboxState() == self::DOWNLOAD_CHECKBOX_ENABLED) {
3204 $this->tpl->setVariable("VAL_ID", $this->getCommandId());
3205 } else {
3206 $this->tpl->setVariable("VAL_VISIBILITY", "visibility: hidden;\" disabled=\"disabled");
3207 }
3208 $this->tpl->parseCurrentBlock();
3209 $cnt += 1;
3210 } elseif ($this->getExpandStatus()) {
3211 $this->tpl->setCurrentBlock('expand');
3212
3213 if ($this->isExpanded()) {
3214 $this->ctrl->setParameter($this->container_obj, 'expand', -1 * $this->obj_id);
3215 // "view" added, see #19922
3216 $this->tpl->setVariable('EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj, 'view', $this->getUniqueItemId(true)));
3217 $this->ctrl->clearParameters($this->container_obj);
3218 $this->tpl->setVariable('EXP_IMG', ilUtil::getImagePath('tree_exp.svg'));
3219 $this->tpl->setVariable('EXP_ALT', $this->lng->txt('collapse'));
3220 } else {
3221 $this->ctrl->setParameter($this->container_obj, 'expand', $this->obj_id);
3222 // "view" added, see #19922
3223 $this->tpl->setVariable('EXP_HREF', $this->ctrl->getLinkTarget($this->container_obj, 'view', $this->getUniqueItemId(true)));
3224 $this->ctrl->clearParameters($this->container_obj);
3225 $this->tpl->setVariable('EXP_IMG', ilUtil::getImagePath('tree_col.svg'));
3226 $this->tpl->setVariable('EXP_ALT', $this->lng->txt('expand'));
3227 }
3228
3229 $this->tpl->parseCurrentBlock();
3230 $cnt += 1;
3231 }
3232
3233 if ($this->getIconStatus()) {
3234 if ($cnt == 1) {
3235 $this->tpl->touchBlock("i_1"); // indent
3236 }
3237
3238 // icon link
3239 if ($this->title_link_disabled || !$this->default_command || (!$this->getCommandsStatus() && !$this->restrict_to_goto)) {
3240 } else {
3241 /* see #28926
3242 $this->tpl->setCurrentBlock("icon_link_s");
3243
3244 if ($this->default_command["frame"] != "") {
3245 $this->tpl->setVariable("ICON_TAR", "target='" . $this->default_command["frame"] . "'");
3246 }
3247
3248 $this->tpl->setVariable(
3249 "ICON_HREF",
3250 $this->default_command["link"]
3251 );
3252 $this->tpl->parseCurrentBlock();
3253 $this->tpl->touchBlock("icon_link_e");
3254 */
3255 }
3256
3257 $this->tpl->setCurrentBlock("icon");
3258 if (!$objDefinition->isPlugin($this->getIconImageType())) {
3259 $this->tpl->setVariable("ALT_ICON", $lng->txt("obj_" . $this->getIconImageType()));
3260 } else {
3261 include_once("Services/Component/classes/class.ilPlugin.php");
3262 $this->tpl->setVariable(
3263 "ALT_ICON",
3265 );
3266 }
3267
3268 $this->tpl->setVariable(
3269 "SRC_ICON",
3270 $this->getTypeIcon()
3271 );
3272 $this->tpl->parseCurrentBlock();
3273 $cnt += 1;
3274 }
3275
3276 $this->tpl->touchBlock("d_" . $cnt); // indent main div
3277 }
3278
3283 public function getTypeIcon()
3284 {
3285 return ilObject::getIconForReference(
3286 (int) $this->ref_id,
3287 (int) $this->obj_id,
3288 (string) 'small',
3289 $this->getIconImageType()
3290 );
3291 }
3292
3296 public function insertSubItems()
3297 {
3298 foreach ($this->sub_item_html as $sub_html) {
3299 $this->tpl->setCurrentBlock("subitem");
3300 $this->tpl->setVariable("SUBITEM", $sub_html);
3301 $this->tpl->parseCurrentBlock();
3302 }
3303 }
3304
3308 public function insertPositionField()
3309 {
3310 if ($this->position_enabled) {
3311 $this->tpl->setCurrentBlock("position");
3312 $this->tpl->setVariable("POS_ID", $this->position_field_index);
3313 $this->tpl->setVariable("POS_VAL", $this->position_value);
3314 $this->tpl->parseCurrentBlock();
3315 }
3316 }
3317
3322 public function adminCommandsIncluded()
3323 {
3324 return $this->adm_commands_included;
3325 }
3326
3330 public function storeAccessCache()
3331 {
3333 if ($this->acache->getLastAccessStatus() == "miss" &&
3334 !$this->prevent_access_caching) {
3335 $this->acache->storeEntry(
3336 $ilUser->getId() . ":" . $this->ref_id,
3337 serialize($this->access_cache),
3338 $this->ref_id
3339 );
3340 }
3341 }
3342
3357 public function getListItemHTML(
3358 $a_ref_id,
3359 $a_obj_id,
3360 $a_title,
3361 $a_description,
3362 $a_use_asynch = false,
3363 $a_get_asynch_commands = false,
3364 $a_asynch_url = ""
3365 ) {
3367
3368 // this variable stores wheter any admin commands
3369 // are included in the output
3370 $this->adm_commands_included = false;
3371
3372 // only for permformance exploration
3373 $type = ilObject::_lookupType($a_obj_id);
3374
3375 // initialization
3376 $this->initItem($a_ref_id, $a_obj_id, $type, $a_title, $a_description);
3377
3378 if ($a_use_asynch && $a_get_asynch_commands) {
3379 return $this->insertCommands(true, true);
3380 }
3381
3382 if ($this->rating_enabled) {
3383 if (ilRating::hasRatingInListGUI($this->obj_id, $this->type)) {
3384 $may_rate = $this->checkCommandAccess("read", "", $this->ref_id, $this->type);
3385
3386 $rating = new ilRatingGUI();
3387 $rating->setObject($this->obj_id, $this->type);
3388 /* $this->addCustomProperty(
3389 $this->lng->txt("rating_average_rating"),
3390 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3391 false,
3392 true
3393 );*/
3394 $this->addCustomProperty(
3395 "",
3396 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
3397 false,
3398 true
3399 );
3400 }
3401 }
3402
3403 // read from cache
3404 include_once("Services/Object/classes/class.ilListItemAccessCache.php");
3405 $this->acache = new ilListItemAccessCache();
3406 $cres = $this->acache->getEntry($ilUser->getId() . ":" . $a_ref_id);
3407 if ($this->acache->getLastAccessStatus() == "hit") {
3408 $this->access_cache = unserialize($cres);
3409 } else {
3410 // write to cache
3411 $this->storeAccessCache();
3412 }
3413
3414 // visible check
3415 if (!$this->checkCommandAccess("visible", "", $a_ref_id, "", $a_obj_id)) {
3416 $this->resetCustomData();
3417 return "";
3418 }
3419
3420 // BEGIN WEBDAV
3421 if ($type == 'file' and ilObjFileAccess::_isFileHidden($a_title)) {
3422 $this->resetCustomData();
3423 return "";
3424 }
3425 // END WEBDAV
3426
3427
3428 $this->tpl = new ilTemplate(
3429 static::$tpl_file_name,
3430 true,
3431 true,
3432 static::$tpl_component,
3433 "DEFAULT",
3434 false,
3435 true
3436 );
3437
3438 if ($this->getCommandsStatus()) {
3439 if (!$this->getSeparateCommands()) {
3440 $this->tpl->setVariable(
3441 "COMMAND_SELECTION_LIST",
3442 $this->insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url)
3443 );
3444 }
3445 }
3446
3447 if ($this->getProgressInfoStatus()) {
3448 $this->insertProgressInfo();
3449 }
3450
3451 // insert title and describtion
3452 $this->insertTitle();
3453 if (!$this->isMode(IL_LIST_AS_TRIGGER)) {
3454 if ($this->getDescriptionStatus()) {
3455 $this->insertDescription();
3456 }
3457 }
3458
3459 if ($this->getSearchFragmentStatus()) {
3460 $this->insertSearchFragment();
3461 }
3462 if ($this->enabledRelevance()) {
3463 $this->insertRelevance();
3464 }
3465
3466 // properties
3467 if ($this->getPropertiesStatus()) {
3468 $this->insertProperties();
3469 }
3470
3471 // notice properties
3472 if ($this->getNoticePropertiesStatus()) {
3473 $this->insertNoticeProperties();
3474 }
3475
3476 // preconditions
3477 if ($this->getPreconditionsStatus()) {
3478 $this->insertPreconditions();
3479 }
3480
3481 // path
3482 $this->insertPath();
3483
3484 if ($this->getItemDetailLinkStatus()) {
3485 $this->insertItemDetailLinks();
3486 }
3487
3488 // icons and checkboxes
3489 $this->insertIconsAndCheckboxes();
3490
3491 // input field for position
3492 $this->insertPositionField();
3493
3494 // subitems
3495 $this->insertSubItems();
3496
3497 // file upload
3498 if ($this->isFileUploadAllowed()) {
3499 $this->insertFileUpload();
3500 }
3501
3502 $this->resetCustomData();
3503
3504 $this->tpl->setVariable("DIV_CLASS", 'ilContainerListItemOuter');
3505 $this->tpl->setVariable("DIV_ID", 'data-list-item-id="' . $this->getUniqueItemId(true) . '" id = "' . $this->getUniqueItemId(true) . '"');
3506 $this->tpl->setVariable("ADDITIONAL", $this->getAdditionalInformation());
3507
3508 if (is_object($this->getContainerObject())) {
3509 // #11554 - make sure that internal ids are reset
3510 $this->ctrl->setParameter($this->getContainerObject(), "item_ref_id", "");
3511 }
3512
3513 return $this->tpl->get();
3514 }
3515
3519 protected function resetCustomData()
3520 {
3521 // #15747
3522 $this->cust_prop = array();
3523 $this->cust_commands = array();
3524 $this->sub_item_html = array();
3525 $this->position_enabled = false;
3526 }
3527
3533 public function setParentRefId($a_ref_id)
3534 {
3535 $this->parent_ref_id = $a_ref_id;
3536 }
3537
3544 public function getUniqueItemId($a_as_div = false)
3545 {
3546 // use correct id for references
3547 $id_ref = ($this->reference_ref_id > 0)
3548 ? $this->reference_ref_id
3549 : $this->ref_id;
3550
3551 // add unique identifier for preconditions (objects can appear twice in same container)
3552 if ($this->condition_depth) {
3553 $id_ref .= "_pc" . $this->condition_depth;
3554 }
3555
3556 // unique
3557 $id_ref .= "_pref_" . $this->parent_ref_id;
3558
3559 if (!$a_as_div) {
3560 return $id_ref;
3561 } else {
3562 // action menu [yellow] toggle
3563 return "lg_div_" . $id_ref;
3564 }
3565 }
3566
3570 public function getCommandsHTML()
3571 {
3572 return $this->insertCommands();
3573 }
3574
3578 public function isSideBlock()
3579 {
3580 return false;
3581 }
3582
3588 public function setBoldTitle($a_bold_title)
3589 {
3590 $this->bold_title = $a_bold_title;
3591 }
3592
3598 public function isTitleBold()
3599 {
3600 return $this->bold_title;
3601 }
3602
3609 public static function preloadCommonProperties($a_obj_ids, $a_context)
3610 {
3611 global $DIC;
3612 $lng = $DIC->language();
3613 $ilSetting = $DIC->settings();
3614 $ilUser = $DIC->user();
3615 if ($a_context == self::CONTEXT_REPOSITORY) {
3616 $active_notes = !$ilSetting->get("disable_notes");
3617 $active_comments = !$ilSetting->get("disable_comments");
3618
3619 if ($active_notes || $active_comments) {
3620 include_once("./Services/Notes/classes/class.ilNote.php");
3621 }
3622
3623 if ($active_comments) {
3624 // needed for action
3625 self::$comments_activation = ilNote::getRepObjActivation($a_obj_ids);
3626 }
3627
3628 // properties are optional
3629 if ($ilSetting->get('comments_tagging_in_lists')) {
3630 if ($active_notes || $active_comments) {
3631 self::$cnt_notes = ilNote::_countNotesAndCommentsMultiple($a_obj_ids, true);
3632
3633 $lng->loadLanguageModule("notes");
3634 }
3635
3636 $tags_set = new ilSetting("tags");
3637 if ($tags_set->get("enable")) {
3638 $all_users = $tags_set->get("enable_all_users");
3639
3640 include_once("./Services/Tagging/classes/class.ilTagging.php");
3641 if (!$ilSetting->get('comments_tagging_in_lists_tags')) {
3642 self::$cnt_tags = ilTagging::_countTags($a_obj_ids, $all_users);
3643 } else {
3644 $tag_user_id = null;
3645 if (!$all_users) {
3646 $tag_user_id = $ilUser->getId();
3647 }
3648 self::$tags = ilTagging::_getListTagsForObjects($a_obj_ids, $tag_user_id);
3649 }
3650
3651 $lng->loadLanguageModule("tagging");
3652 }
3653 }
3654
3655 $lng->loadLanguageModule("rating");
3656 }
3657
3658 self::$preload_done = true;
3659 }
3660
3671 protected function isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access = true)
3672 {
3673 if ($this->comments_enabled) {
3674 if (!$this->comments_settings_enabled) {
3675 return true;
3676 }
3677 if ($a_check_write_access && $this->checkCommandAccess('write', '', $a_ref_id, $a_type)) {
3678 return true;
3679 }
3680 // fallback to single object check if no preloaded data
3681 // only the repository does preloadCommonProperties() yet
3682 if (!$a_header_actions && self::$preload_done) {
3683 if (self::$comments_activation[$a_obj_id][$a_type]) {
3684 return true;
3685 }
3686 } else {
3687 include_once("./Services/Notes/classes/class.ilNote.php");
3688 if (ilNote::commentsActivated($a_obj_id, 0, $a_type)) {
3689 return true;
3690 }
3691 }
3692 }
3693 return false;
3694 }
3695
3703 public function enableTimings($a_status)
3704 {
3705 $this->timings_enabled = (bool) $a_status;
3706 }
3707
3713 public function isFileUploadAllowed()
3714 {
3715 // check if file upload allowed
3716 include_once("./Services/FileUpload/classes/class.ilFileUploadUtil.php");
3717 return ilFileUploadUtil::isUploadAllowed($this->ref_id, $this->type);
3718 }
3719
3723 public function insertFileUpload()
3724 {
3725 include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
3727
3728 $upload = new ilFileUploadGUI($this->getUniqueItemId(true), $this->ref_id);
3729
3730 $this->tpl->setCurrentBlock("fileupload");
3731 $this->tpl->setVariable("FILE_UPLOAD", $upload->getHTML());
3732 $this->tpl->parseCurrentBlock();
3733 }
3734
3745 public function getAsListItem(
3746 int $ref_id,
3747 int $obj_id,
3748 string $type,
3749 string $title,
3750 string $description
3751 ) : ?\ILIAS\UI\Component\Item\Item {
3752 $ui = $this->ui;
3753
3754 // even b tag produced bugs, see #32304
3755 $description = strip_tags($description);
3756
3757 $this->initItem(
3758 $ref_id,
3759 $obj_id,
3760 $type,
3761 $title,
3762 $description
3763 );
3764
3765 $this->enableCommands(true);
3766
3767 // actions
3768 $this->insertCommands();
3769 $actions = [];
3770 foreach ($this->current_selection_list->getItems() as $action_item) {
3771 $action = $ui->factory()
3772 ->button()
3773 ->shy($action_item['title'], $action_item['link']);
3774
3775 // Dirty hack to remain the "onclick" action of action items
3776 if ($action_item['onclick'] != null && $action_item['onclick'] != '') {
3777 $action = $action->withAdditionalOnLoadCode(function ($id) use ($action_item) {
3778 return "$('#$id').click(function(){" . $action_item['onclick'] . ";});";
3779 });
3780 }
3781
3782 $actions[] = $action;
3783 }
3784
3785 $dropdown = $ui->factory()
3786 ->dropdown()
3787 ->standard($actions)
3788 ->withAriaLabel(sprintf(
3789 $this->lng->txt('actions_for'),
3790 htmlspecialchars(addslashes($title))
3791 ));
3792
3793 $def_command = $this->getDefaultCommand();
3794
3795 $icon = $this->ui->factory()
3796 ->symbol()
3797 ->icon()
3798 ->custom(ilObject::_getIcon($obj_id), $this->lng->txt("icon") . " " . $this->lng->txt('obj_' . $type))
3799 ->withSize('medium');
3800
3801
3802 if ($def_command['link']) {
3803 $def_command['link'] = $this->modifySAHSlaunch($def_command['link'], $def_command['frame']);
3804 $new_viewport = !in_array($this->getDefaultCommand()['frame'], ['', '_top', '_self', '_parent'], true); // Cannot use $def_command['frame']. $this->default_command has been edited.
3805 $link = $this->ui->factory()
3806 ->link()
3807 ->standard($this->getTitle(), $def_command['link'])
3808 ->withOpenInNewViewport($new_viewport);
3809 $list_item = $ui->factory()->item()->standard($link);
3810 } else {
3811 $list_item = $ui->factory()->item()->standard($this->getTitle());
3812 }
3813
3814 if ($description != "") {
3815 $list_item = $list_item->withDescription($description);
3816 }
3817 $list_item = $list_item->withActions($dropdown)->withLeadIcon($icon);
3818
3819
3820 $l = [];
3821 $this->enableComments(true);
3822 $this->enableNotes(true);
3823 $this->enableTags(true);
3824 $this->enableRating(true);
3825
3826 foreach ($this->determineProperties() as $p) {
3827 //if ($p['property'] !== $this->lng->txt('learning_progress')) {
3828 $l[(string) $p['property']] = (string) $p['value'];
3829 //}
3830 }
3831 if (count($l) > 0) {
3832 $list_item = $list_item->withProperties($l);
3833 }
3834
3835 // @todo: learning progress
3836
3837
3838 /*
3839 $lp = ilLPStatus::getListGUIStatus($item['obj_id'], false);
3840 if (is_array($lp) && array_key_exists('status', $lp)) {
3841 $percentage = (int)ilLPStatus::_lookupPercentage($item['obj_id'], $this->user->getId());
3842 if ($lp['status'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
3843 $percentage = 100;
3844 }
3845
3846 $card = $card->withProgress(
3847 $this->uiFactory
3848 ->chart()
3849 ->progressMeter()
3850 ->mini(100, $percentage)
3851 );
3852 }*/
3853
3854 return $list_item;
3855 }
3856
3867 public function getAsCard(
3868 int $ref_id,
3869 int $obj_id,
3870 string $type,
3871 string $title,
3872 string $description
3873 ) : ?\ILIAS\UI\Component\Card\Card {
3874 $ui = $this->ui;
3875
3876 // even b tag produced bugs, see #32304
3877 $description = strip_tags($description);
3878
3879 $this->initItem(
3880 $ref_id,
3881 $obj_id,
3882 $type,
3883 $title,
3884 $description
3885 );
3886
3887 $user = $this->user;
3888 $access = $this->access;
3889
3890 $this->enableCommands(true);
3891
3892 $sections = [];
3893
3894 // description, @todo: move to new ks element
3895 if ($description != "") {
3896 $sections[] = $ui->factory()->legacy("<div class='il-multi-line-cap-3'>" . $description . "</div>");
3897 }
3898
3899 $this->insertCommands();
3900 $actions = [];
3901
3902 foreach ($this->current_selection_list->getItems() as $item) {
3903 if (!isset($item["onclick"]) || $item["onclick"] == "") {
3904 $actions[] =
3905 $ui->factory()->button()->shy($item["title"], $item["link"]);
3906 } else {
3907 $actions[] =
3908 $ui->factory()->button()->shy($item["title"], "")->withAdditionalOnLoadCode(function ($id) use ($item) {
3909 return
3910 "$('#$id').click(function(e) { " . $item["onclick"] . "});";
3911 });
3912 }
3913 }
3914
3915 $def_command = $this->getDefaultCommand();
3916
3917 if ($def_command["frame"] != "") {
3918 /* this seems to be introduced due to #25624, but does not fix it
3919 removed with ##30732
3920 $button =
3921 $ui->factory()->button()->shy("Open", "")->withAdditionalOnLoadCode(function ($id) use ($def_command) {
3922 return
3923 "$('#$id').click(function(e) { window.open('" . str_replace(
3924 "&amp;",
3925 "&",
3926 $def_command["link"]
3927 ) . "', '" . $def_command["frame"] . "');});";
3928 });
3929 $actions[] = $button;*/
3930 }
3931 $dropdown = $ui->factory()->dropdown()->standard($actions)
3932 ->withAriaLabel(sprintf(
3933 $this->lng->txt('actions_for'),
3934 htmlspecialchars(addslashes($title))
3935 ));
3936
3937
3938 $path = $this->getTileImagePath();
3939
3940 // workaround for #26205
3941 // we should get rid of _top links completely and gifure our how
3942 // to manage scorm links better
3943 if ($def_command["frame"] == "_top") {
3944 $def_command["frame"] = "";
3945 }
3946
3947 // workaround for scorm
3948 $modified_link =
3949 $this->modifySAHSlaunch($def_command["link"], $def_command["frame"]);
3950
3951 $image = $this->ui->factory()
3952 ->image()
3953 ->responsive($path, '');
3954 if ($def_command['link'] != '') { // #24256
3955 if ($def_command["frame"] != "" && ($modified_link == $def_command["link"])) {
3956 $image = $image->withAdditionalOnLoadCode(function ($id) use ($def_command) {
3957 return
3958 "$('#$id').click(function(e) { window.open('" . str_replace(
3959 "&amp;",
3960 "&",
3961 $def_command["link"]
3962 ) . "', '" . $def_command["frame"] . "');});";
3963 });
3964
3965 $button =
3966 $ui->factory()->button()->shy($title, "")->withAdditionalOnLoadCode(function ($id) use (
3967 $def_command
3968 ) {
3969 return
3970 "$('#$id').click(function(e) { window.open('" . str_replace(
3971 "&amp;",
3972 "&",
3973 $def_command["link"]
3974 ) . "', '" . $def_command["frame"] . "');});";
3975 });
3976 $title = $ui->renderer()->render($button);
3977 } else {
3978 $image = $image->withAction($modified_link);
3979 }
3980 }
3981
3982 if ($type == 'sess') {
3983 if ($title != "") {
3984 $title = ": " . $title;
3985 }
3986 $app_info = ilSessionAppointment::_lookupAppointment($obj_id);
3988 $app_info['start'],
3989 $app_info['end'],
3990 $app_info['fullday']
3991 ) . $title;
3992 }
3993
3994 $icon = $this->ui->factory()
3995 ->symbol()
3996 ->icon()
3997 ->standard($type, $this->lng->txt('obj_' . $type))
3998 ->withIsOutlined(true);
3999
4000 // card title action
4001 $card_title_action = "";
4002 if ($def_command["link"] != "" && ($def_command["frame"] == "" || $modified_link != $def_command["link"])) { // #24256
4003 $card_title_action = $modified_link;
4004 } elseif ($def_command['link'] == "" &&
4005 $this->getInfoScreenStatus() &&
4006 $access->checkAccessOfUser(
4007 $user->getId(),
4008 "visible",
4009 "",
4010 $ref_id
4011 )) {
4012 $card_title_action = ilLink::_getLink($ref_id);
4013 if ($image->getAction() == "") {
4014 $image = $image->withAction($card_title_action);
4015 }
4016 }
4017
4018 $card = $ui->factory()->card()->repositoryObject(
4019 $title . '<span data-list-item-id="' . $this->getUniqueItemId(true) . '"></span>',
4020 $image
4021 )->withObjectIcon(
4022 $icon
4023 )->withActions(
4024 $dropdown
4025 );
4026
4027 if ($card_title_action != "") {
4028 $card = $card->withTitleAction($card_title_action);
4029 }
4030
4031 $l = [];
4032 foreach ($this->determineProperties() as $p) {
4033 if ($p["alert"] && $p['property'] !== $this->lng->txt('learning_progress')) {
4034 $l[(string) $p['property']] = (string) $p['value'];
4035 }
4036 }
4037 if (count($l) > 0) {
4038 $prop_list = $ui->factory()->listing()->descriptive($l);
4039 $sections[] = $prop_list;
4040 }
4041 if (count($sections) > 0) {
4042 $card = $card->withSections($sections);
4043 }
4044
4045 $lp = ilLPStatus::getListGUIStatus($obj_id, false);
4046 if (is_array($lp) && array_key_exists('status', $lp)) {
4047 $percentage = (int) ilLPStatus::_lookupPercentage($obj_id, $this->user->getId());
4048 if ($lp['status'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
4049 $percentage = 100;
4050 }
4051
4052 $card = $card->withProgress(
4053 $ui->factory()
4054 ->chart()
4055 ->progressMeter()
4056 ->mini(100, $percentage)
4057 );
4058 }
4059
4060 return $card;
4061 }
4062
4063 protected function getTileImagePath() : string
4064 {
4065 $img = $this->object_service->commonSettings()->tileImage()->getByObjId($this->obj_id);
4066 if ($img->exists()) {
4067 $path = $img->getFullPath();
4068 } else {
4069 $path = ilUtil::getImagePath('cont_tile/cont_tile_default_' . $this->type . '.svg');
4070 if (!is_file($path)) {
4071 $path = ilUtil::getImagePath('cont_tile/cont_tile_default.svg');
4072 }
4073 }
4074 return $path;
4075 }
4076
4081 {
4082 return false;
4083 }
4084}
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
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
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 _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
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)
const ANONYMOUS_USER_ID
Definition: constants.php:25
const ROOT_FOLDER_ID
Definition: constants.php:30
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$txt
Definition: error.php:13
global $DIC
Definition: goto.php:24
$preview
Definition: imgupload.php:55
$img
Definition: imgupload.php:57
$ilUser
Definition: imgupload.php:18
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
ui()
Definition: ui.php:5