19declare(strict_types=1);
68 protected static array
$tags = [];
201 $this->
access = $DIC[
'ilAccess'];
202 $this->
user = $DIC[
'user']->getLoggedInUser();
203 $this->object_dic = LocalDIC::dic();
204 $this->obj_definition =
$DIC[
'objDefinition'];
205 $this->tree =
$DIC[
'tree'];
206 $this->
settings = $DIC[
'ilSetting'];
207 $this->
http = $DIC->http();
208 $this->
ui = $DIC->ui();
209 $this->main_tpl =
$DIC[
'tpl'];
210 $this->rbacsystem =
$DIC[
'rbacsystem'];
211 $this->
ctrl = $DIC[
'ilCtrl'];
212 $this->
lng = $DIC[
'lng'];
214 $this->path_enabled =
false;
216 $this->request_wrapper =
$DIC->http()->wrapper()->query();
231 $this->
lng->loadLanguageModule(
'obj');
232 $this->
lng->loadLanguageModule(
'rep');
233 $params = $DIC->http()->request()->getQueryParams();
234 $this->requested_ref_id = (
int) (
$params[
'ref_id'] ??
null);
235 $this->requested_cmd = (string) (
$params[
'cmd'] ??
null);
236 $this->requested_base_class = (string) (
$params[
'baseClass'] ??
null);
237 $this->clipboard =
$DIC
242 $this->notes_service =
$DIC->notes();
264 $this->static_link_enabled =
true;
265 $this->delete_enabled =
true;
266 $this->cut_enabled =
true;
267 $this->subscribe_enabled =
true;
268 $this->link_enabled =
false;
269 $this->copy_enabled =
false;
270 $this->progress_enabled =
false;
271 $this->notice_properties_enabled =
true;
272 $this->info_screen_enabled =
false;
274 $this->gui_class_name =
'';
282 $this->properties_enabled = $status;
292 $this->preconditions_enabled = $status;
302 $this->notice_properties_enabled = $status;
312 $this->description_enabled = $status;
322 $this->search_fragment_enabled = $status;
332 $this->path_linked = $status;
337 $this->relevance = $rel;
347 $this->icons_enabled = $status;
357 $this->checkboxes_enabled = $status;
367 $this->expand_enabled = $status;
377 $this->is_expanded = $status;
390 $this->position_enabled =
true;
391 $this->position_field_index = $field_index;
397 $this->delete_enabled = $status;
407 $this->cut_enabled = $status;
417 $this->copy_enabled = $status;
427 $this->subscribe_enabled = $status;
437 $this->link_enabled = $status;
447 $this->path_enabled =
$path;
448 $this->path_start_node = $start_node;
459 $this->commands_enabled = $status;
460 $this->std_cmd_only = $std_only;
470 $this->info_screen_enabled = $info_screen;
480 $this->lp_cmd_enabled = $enabled;
485 $this->lp_settings_cmd_enabled = $enabled;
495 $this->sub_item_html[] = $html;
500 $this->progress_enabled = $status;
510 $this->substitutions_enabled = $status;
524 $this->item_detail_links_enabled = $status;
542 $this->item_detail_links = $detail_links;
543 $this->item_detail_links_intro = $intro_txt;
548 if (!count($this->item_detail_links)) {
551 if (strlen($this->item_detail_links_intro)) {
552 $this->tpl->setCurrentBlock(
'item_detail_intro');
553 $this->tpl->setVariable(
'ITEM_DETAIL_INTRO_TXT', $this->item_detail_links_intro);
554 $this->tpl->parseCurrentBlock();
557 foreach ($this->item_detail_links as
$info) {
558 $this->tpl->setCurrentBlock(
'item_detail_link');
559 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_TARGET',
$info[
'target']);
560 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_DESC',
$info[
'desc']);
561 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_HREF',
$info[
'link']);
562 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_NAME',
$info[
'name']);
563 $this->tpl->parseCurrentBlock();
565 $this->tpl->setCurrentBlock(
'item_detail_links');
566 $this->tpl->parseCurrentBlock();
570 $this->title = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform(
585 $this->description = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform(
603 $this->search_fragment =
$text;
613 $this->separate_commands = $val;
633 $this->additional_information = $val;
648 $this->details_level = $level;
661 $this->repository_transfer_enabled = $value;
669 $this->restrict_to_goto = $value;
689 $cache_prefix =
null;
690 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
691 $cache_prefix =
'wsp';
692 if (!isset($this->ws_access)) {
697 if (isset($this->access_cache[$permission][
'-' . $cmd][$cache_prefix .
$ref_id])) {
698 return $this->access_cache[$permission][
'-' . $cmd][$cache_prefix .
$ref_id];
701 if ($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SEARCH) {
703 if ($this->
access->getPreventCachingLastResult()) {
704 $this->prevent_access_caching =
true;
710 $this->access_cache[$permission][
'-' . $cmd][$cache_prefix .
$ref_id] =
$access;
722 string $description =
''
724 $this->access_cache = [];
726 $this->obj_id = $obj_id;
727 $this->object_properties = $this->object_dic[
'properties.aggregator']->getFor($obj_id);
728 $this->setTitle($title);
729 $this->setDescription($description);
732 $this->adm_commands_included =
false;
733 $this->prevent_access_caching =
false;
736 if ($this->context == self::CONTEXT_REPOSITORY) {
746 $this->condition_target = [
749 'target_type' => $target_type
755 $this->condition_target = [];
760 $this->title_link_disabled = $status;
765 $this->default_command_params =
$params;
775 if ($this->static_link_enabled and !$this->default_command_params) {
777 $command[
'link'] = $link;
778 $command[
'frame'] =
'_top';
781 if ($this->default_command_params) {
783 foreach ($this->default_command_params as $name => $value) {
784 $params[] = $name .
'=' . $value;
788 if (!stristr($command[
'link'],
'?')) {
789 $command[
'link'] .=
'?' .
$params;
791 $command[
'link'] .=
'&' .
$params;
807 if ($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SEARCH) {
811 return $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
815 $this->
ctrl->setParameterByClass(
'ilrepositorygui',
'ref_id', $this->getCommandId());
816 $cmd_link = $this->
ctrl->getLinkTargetByClass(
'ilrepositorygui', $cmd);
817 $this->
ctrl->setParameterByClass(
'ilrepositorygui',
'ref_id', $this->requested_ref_id);
821 $this->
ctrl->setParameterByClass($this->gui_class_name,
'ref_id',
'');
822 $this->
ctrl->setParameterByClass($this->gui_class_name,
'wsp_id', $this->ref_id);
823 return $this->
ctrl->getLinkTargetByClass($this->gui_class_name, $cmd);
868 if ($this->context == self::CONTEXT_REPOSITORY) {
874 'property' => $this->
lng->txt(
'status'),
875 'value' => $this->
lng->txt(
'offline')
884 $webdav_lock_backend =
$webdav_dic->locksbackend();
886 if ($lock = $webdav_lock_backend->getLocksOnObjectId($this->obj_id)) {
887 $lock_user =
new ilObjUser($lock->getIliasOwner());
891 'property' => $this->
lng->txt(
'in_use_by'),
892 'value' => $lock_user->getLogin(),
894 './ilias.php?user=' .
895 $lock_user->getId() .
896 '&cmd=showUserProfile&cmdClass=ildashboardgui&baseClass=ilDashboardGUI'
908 string $property =
'',
911 bool $newline =
false
913 $this->cust_prop[] = [
914 'property' => $property,
917 'newline' => $newline
923 if (is_array($this->cust_prop)) {
924 foreach ($this->cust_prop as $property) {
934 foreach ($this->getProperties() as $prop) {
935 if (isset($prop[
'alert']) && $prop[
'alert'] ==
true) {
944 $this->notice_prop = [];
945 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true)) {
946 foreach ($infos as
$info) {
947 $this->notice_prop[] = [
'value' =>
$info];
950 return $this->notice_prop;
953 public function addCustomCommand(
string $link,
string $lang_var,
string $frame =
'',
string $onclick =
''): void
955 $this->cust_commands[] = [
957 'lang_var' => $lang_var,
959 'onclick' => $onclick
965 ?
Modal $triggeredModal =
null
967 $this->cust_commands[] = $button;
968 if ($triggeredModal !==
null) {
969 $this->cust_modals[] = $triggeredModal;
975 $this->force_visible_only = $stat;
980 return $this->force_visible_only;
1009 foreach ($this->commands as $command) {
1010 $permission = $command[
'permission'];
1011 $cmd = $command[
'cmd'];
1012 $lang_var = $command[
'lang_var'] ??
'';
1014 $info_object =
null;
1018 $access_granted =
false;
1020 if (isset($command[
'txt'])) {
1021 $txt = $command[
'txt'];
1027 (isset($command[
'enable_anonymous']) && $command[
'enable_anonymous'] ==
'false')
1035 $access = $this->checkCommandAccess($permission, $cmd, $this->ref_id, $this->type);
1038 $access_granted =
true;
1039 $cmd_link = $this->getCommandLink($command[
'cmd']);
1040 $cmd_frame = $this->getCommandFrame($command[
'cmd']);
1041 $cmd_image = $this->getCommandImage($command[
'cmd']);
1043 $info_object = $this->
access->getInfo();
1046 if (!isset($command[
'default'])) {
1047 $command[
'default'] =
'';
1050 'permission' => $permission,
1052 'link' => $cmd_link,
1053 'frame' => $cmd_frame,
1054 'lang_var' => $lang_var,
1056 'granted' => $access_granted,
1057 'access_info' => $info_object,
1058 'img' => $cmd_image,
1059 'default' => $command[
'default']
1063 return $ref_commands;
1080 if ($this->restrict_to_goto) {
1081 $this->default_command = [
1083 'link' => $this->buildGotoLink()
1088 !$this->default_command ||
1089 (!$this->getCommandsStatus() && !$this->restrict_to_goto) ||
1090 $this->title_link_disabled
1093 $this->tpl->setCurrentBlock(
'item_title');
1094 $this->tpl->setVariable(
'TXT_TITLE', $this->
getTitle());
1096 $this->default_command[
'link'] = $this->modifyTitleLink($this->default_command[
'link']);
1098 list($this->default_command[
'link'], $this->default_command[
'frame']) =
1099 $this->modifySAHSlaunch($this->default_command[
'link'], $this->default_command[
'frame']);
1101 if ($this->default_command[
'frame'] !=
'') {
1102 $this->tpl->setCurrentBlock(
'title_linked_frame');
1103 $this->tpl->setVariable(
'TARGET_TITLE_LINKED', $this->default_command[
'frame']);
1104 $this->tpl->parseCurrentBlock();
1108 $this->default_command[
'link'] = $this->appendRepositoryFrameParameter($this->default_command[
'link']);
1111 $this->tpl->setCurrentBlock(
'item_title_linked');
1112 $this->tpl->setVariable(
'TXT_TITLE_LINKED', $this->
getTitle());
1113 $this->tpl->setVariable(
'HREF_TITLE_LINKED', $this->default_command[
'link']);
1116 if ($this->type ===
'file') {
1118 if ($preview->has()) {
1119 $this->tpl->setVariable(
'PREVIEW_GLYPH', $preview->getRenderedTriggerComponents());
1120 $this->tpl->parseCurrentBlock();
1124 $this->tpl->parseCurrentBlock();
1126 if ($this->bold_title ==
true) {
1127 $this->tpl->touchBlock(
'bold_title_start');
1128 $this->tpl->touchBlock(
'bold_title_end');
1134 switch ($this->context) {
1135 case self::CONTEXT_WORKSPACE_SHARING:
1147 $fields_shown =
false;
1148 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as
$data) {
1149 if (
$data[
'bold']) {
1150 $data[
'name'] =
'<strong>' .
$data[
'name'] .
'</strong>';
1151 $data[
'value'] =
'<strong>' .
$data[
'value'] .
'</strong>';
1153 $this->tpl->touchBlock(
'std_prop');
1154 $this->tpl->setCurrentBlock(
'item_property');
1155 if (
$data[
'show_field']) {
1156 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1158 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1159 $this->tpl->parseCurrentBlock();
1161 if (
$data[
'newline']) {
1162 $this->tpl->touchBlock(
'newline_prop');
1164 $fields_shown =
false;
1170 if ($this->getSubstitutionStatus()) {
1171 $this->insertSubstitutions();
1172 if (!$this->substitutions->isDescriptionEnabled()) {
1177 $this->tpl->setCurrentBlock(
'item_description');
1178 $this->tpl->setVariable(
'TXT_DESC', $this->getDescription());
1179 $this->tpl->parseCurrentBlock();
1187 if (strlen($this->getSearchFragment())) {
1188 $this->tpl->setCurrentBlock(
'search_fragment');
1189 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT', $this->getSearchFragment() .
' ...');
1190 $this->tpl->parseCurrentBlock();
1201 $this->mode = $mode;
1219 $this->condition_depth = $depth;
1230 return $mode === $this->mode;
1235 $props = $this->getCustomProperties(
1236 $this->getProperties()
1239 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1245 'property' => $this->
lng->txt(
'learning_progress'),
1254 if (!$this->
access->checkAccess(
'read',
'', $this->ref_id, $this->type, $this->obj_id)) {
1257 'value' => $this->
lng->txt(
'no_access_item_public'),
1266 $note_obj_id = $this->obj_id;
1267 if ($this->reference_ref_id) {
1268 $note_ref_id = $this->reference_ref_id;
1269 $note_obj_id = $this->reference_obj_id;
1271 $redraw_js =
'il.Object.redrawListItem(' . $note_ref_id .
');';
1277 isset(self::$cnt_notes[$note_obj_id][Note::PRIVATE]) &&
1278 self::$cnt_notes[$note_obj_id][Note::PRIVATE] > 0
1280 isset(self::$cnt_notes[$note_obj_id][Note::PUBLIC]) &&
1281 self::$cnt_notes[$note_obj_id][Note::PUBLIC] > 0
1283 isset(self::$cnt_tags[$note_obj_id]) && self::$cnt_tags[$note_obj_id] > 0
1285 isset(self::$tags[$note_obj_id]) && is_array(self::$tags[$note_obj_id])
1290 $cnt_comments = self::$cnt_notes[$note_obj_id][Note::PUBLIC] ?? 0;
1291 if ($this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id,
false,
false)
1292 && $cnt_comments > 0) {
1295 'property' => $this->
lng->txt(
'notes_comments'),
1297 '<a href="#" onclick="return ' .
1299 self::$cnt_notes[$note_obj_id][Note::PUBLIC] .
'</a>',
1305 $cnt_notes = self::$cnt_notes[$note_obj_id][Note::PRIVATE] ?? 0;
1306 if ($this->notes_enabled && $cnt_notes > 0) {
1309 'property' => $this->
lng->txt(
'notes'),
1311 '<a href="#" onclick="return ' .
1313 self::$cnt_notes[$note_obj_id][Note::PRIVATE] .
'</a>',
1318 $cnt_tags = self::$cnt_tags[$note_obj_id] ?? 0;
1319 if ($this->tags_enabled && ($cnt_tags > 0 || isset(self::$tags[$note_obj_id]))) {
1321 if ($tags_set->get(
'enable')) {
1325 if (isset(self::$tags[$note_obj_id])) {
1327 foreach (self::$tags[$note_obj_id] as $tag => $is_tag_owner) {
1328 if ($is_tag_owner) {
1329 $tags_tmp[] =
'<a class="ilTag ilTagRelHigh" href="#" onclick="return ' .
1330 $tags_url .
'">' . $tag .
'</a>';
1332 $tags_tmp[] =
'<span class="ilTag ilTagRelMiddle">' . $tag .
'</span>';
1335 $tags_value = implode(
' ', $tags_tmp);
1340 $tags_value =
'<a href="#" onclick="return ' . $tags_url .
'">' .
1341 self::$cnt_tags[$note_obj_id] .
'</a>';
1342 $prop_text = $this->
lng->txt(
'tagging_tags');
1346 'property' => $prop_text,
1347 'value' => $tags_value,
1354 if (!isset($props)) {
1363 $props = $this->determineProperties();
1365 if (is_array($props) && count($props) > 0) {
1366 foreach ($props as $prop) {
1368 $this->tpl->touchBlock(
'separator_prop');
1371 if (isset($prop[
'alert']) && $prop[
'alert'] ==
true) {
1372 $this->tpl->touchBlock(
'alert_prop');
1374 $this->tpl->touchBlock(
'std_prop');
1377 if (isset($prop[
'newline']) && $prop[
'newline'] ==
true && $cnt > 1) {
1378 $this->tpl->touchBlock(
'newline_prop');
1383 isset($prop[
'property']) &&
1384 (($prop[
'propertyNameVisible'] ??
null) !==
false) &&
1385 $prop[
'property'] !=
''
1388 $this->tpl->setCurrentBlock(
'prop_name');
1389 $this->tpl->setVariable(
'TXT_PROP', $prop[
'property']);
1390 $this->tpl->parseCurrentBlock();
1393 $this->tpl->setCurrentBlock(
'item_property');
1395 if (isset($prop[
'link']) && $prop[
'link']) {
1396 $this->tpl->setVariable(
'LINK_PROP', $prop[
'link']);
1397 $this->tpl->setVariable(
'LINK_VAL_PROP', $prop[
'value']);
1399 $this->tpl->setVariable(
'VAL_PROP', $prop[
'value']);
1402 $this->tpl->parseCurrentBlock();
1406 $this->tpl->setCurrentBlock(
'item_properties');
1407 $this->tpl->parseCurrentBlock();
1413 $this->getNoticeProperties();
1414 foreach ($this->notice_prop as $property) {
1415 $this->tpl->setCurrentBlock(
'notice_item');
1416 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE', $property[
'value']);
1417 $this->tpl->parseCurrentBlock();
1419 $this->tpl->setCurrentBlock(
'notice_property');
1420 $this->tpl->parseCurrentBlock();
1423 protected function parseConditions(
int $toggle_id, array $conditions,
bool $obligatory =
true): bool
1426 $num_optional_required =
1428 count($conditions) +
1433 $visible_conditions = [];
1434 $passed_optional = 0;
1435 foreach ($conditions as $condition) {
1436 if ($obligatory && !$condition[
'obligatory']) {
1439 if (!$obligatory && $condition[
'obligatory']) {
1443 if ($this->tree->isDeleted($condition[
'trigger_ref_id'])) {
1450 $visible_conditions[] = $condition[
'id'];
1453 if (!$obligatory && $ok) {
1456 if ($passed_optional >= $num_optional_required) {
1462 $missing_cond_exist =
false;
1463 foreach ($conditions as $condition) {
1464 if (!in_array($condition[
'id'], $visible_conditions)) {
1471 $class = $this->obj_definition->getClassName($condition[
'trigger_type']);
1472 $location = $this->obj_definition->getLocation($condition[
'trigger_type']);
1476 $missing_cond_exist =
true;
1478 $full_class =
'ilObj' . $class .
'ListGUI';
1479 $item_list_gui =
new $full_class($this->context);
1480 $item_list_gui->setMode(self::IL_LIST_AS_TRIGGER);
1481 $item_list_gui->enablePath(
false);
1482 $item_list_gui->enableIcon(
true);
1483 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1484 $item_list_gui->setParentRefId($this->ref_id);
1485 $item_list_gui->addCustomProperty($this->
lng->txt(
'precondition_required_itemlist'), $cond_txt,
false,
true);
1486 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1487 $item_list_gui->enableProperties($this->properties_enabled);
1489 $trigger_html = $item_list_gui->getListItemHTML(
1490 $condition[
'trigger_ref_id'],
1491 $condition[
'trigger_obj_id'],
1495 $this->tpl->setCurrentBlock(
'precondition');
1496 if ($trigger_html ==
'') {
1497 $trigger_html = $this->
lng->txt(
'precondition_not_accessible');
1499 $this->tpl->setVariable(
'TXT_CONDITION', trim($cond_txt));
1500 $this->tpl->setVariable(
'TRIGGER_ITEM', $trigger_html);
1501 $this->tpl->parseCurrentBlock();
1504 if ($missing_cond_exist && $obligatory) {
1505 $this->tpl->setCurrentBlock(
'preconditions');
1506 $this->tpl->setVariable(
'CONDITION_TOGGLE_ID',
'_obl_' . $toggle_id);
1507 $this->tpl->setVariable(
'TXT_PRECONDITIONS', $this->
lng->txt(
'preconditions_obligatory_hint'));
1508 $this->tpl->parseCurrentBlock();
1509 } elseif ($missing_cond_exist && !$obligatory) {
1510 $this->tpl->setCurrentBlock(
'preconditions');
1511 $this->tpl->setVariable(
'CONDITION_TOGGLE_ID',
'_opt_' . $toggle_id);
1512 $this->tpl->setVariable(
1513 'TXT_PRECONDITIONS',
1515 $this->
lng->txt(
'preconditions_optional_hint'),
1516 $num_optional_required - $passed_optional
1519 $this->tpl->parseCurrentBlock();
1522 return !$missing_cond_exist;
1531 if ($this->condition_depth > 0) {
1535 if ($this->context == self::CONTEXT_WORKSPACE) {
1539 if (isset($this->condition_target) && is_array($this->condition_target)
1540 && count($this->condition_target) > 0) {
1541 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget(
1542 (
int) $this->condition_target[
'ref_id'],
1543 (
int) $this->condition_target[
'obj_id'],
1544 $this->condition_target[
'target_type'] ??
''
1547 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget($this->ref_id, $this->obj_id);
1550 if (
sizeof($conditions)) {
1551 for ($i = 0; $i < count($conditions); $i++) {
1556 ++self::$js_unique_id;
1558 $all_done_obl = $this->parseConditions(self::$js_unique_id, $conditions);
1559 $all_done_opt = $this->parseConditions(self::$js_unique_id, $conditions,
false);
1561 if (!$all_done_obl || !$all_done_opt) {
1562 $this->tpl->setCurrentBlock(
'preconditions_toggle');
1563 $this->tpl->setVariable(
'PRECONDITION_TOGGLE_INTRO', $this->
lng->txt(
'precondition_toggle'));
1564 $this->tpl->setVariable(
'PRECONDITION_TOGGLE_TRIGGER', $this->
lng->txt(
'show'));
1565 $this->tpl->setVariable(
'PRECONDITION_TOGGLE_ID', self::$js_unique_id);
1566 $this->tpl->setVariable(
'TXT_PRECONDITION_SHOW', $this->
lng->txt(
'show'));
1567 $this->tpl->setVariable(
'TXT_PRECONDITION_HIDE', $this->
lng->txt(
'hide'));
1568 $this->tpl->parseCurrentBlock();
1582 string $onclick =
''
1585 $checksum = md5($href .
$text);
1586 if ($href !==
'#' && in_array($checksum, $this->prevent_duplicate_commands)) {
1590 if ($href !==
'#') {
1591 $this->prevent_duplicate_commands[] = $checksum;
1594 if ($cmd ===
'mount_webfolder') {
1595 $onclick =
"triggerWebDAVModal('$href')";
1600 $action = $this->
ui->factory()
1602 ->shy($text, $href);
1604 if ($frame !==
'') {
1605 $action = $this->
ui->factory()->link()->standard($text, $href)->withOpenInNewViewport(
true);
1608 if ($onclick !==
'') {
1609 $action = $action->withAdditionalOnLoadCode(
function (
$id) use ($onclick):
string {
1610 return "$('#$id').click(function(){" . $onclick .
';});';
1616 $this->current_actions[] = $action;
1621 if ($this->std_cmd_only) {
1625 if (is_object($this->getContainerObject()) and
1627 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type)) {
1628 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1629 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'delete');
1630 $this->insertCommand($cmd_link, $this->
lng->txt(
'delete'));
1631 $this->adm_commands_included =
true;
1636 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type)) {
1637 $this->
ctrl->setParameter(
1638 $this->container_obj,
1640 $this->container_obj->getObject()->getRefId()
1642 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1643 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'delete');
1644 $this->insertCommand($cmd_link, $this->
lng->txt(
'delete'));
1645 $this->adm_commands_included =
true;
1651 $objDefinition = $this->obj_definition;
1653 if ($this->std_cmd_only) {
1659 !$this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type) ||
1660 !$objDefinition->allowLink($this->type)
1667 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1668 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'link');
1669 $this->insertCommand($cmd_link, $this->
lng->txt(
'link'));
1670 $this->adm_commands_included =
true;
1677 $this->
ctrl->setParameter(
1678 $this->container_obj,
1680 $this->container_obj->getObject()->getRefId()
1682 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1683 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'link');
1684 $this->insertCommand($cmd_link, $this->
lng->txt(
'link'));
1685 $this->adm_commands_included =
true;
1690 if ($this->std_cmd_only) {
1697 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type)) {
1698 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1699 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'cut');
1700 $this->insertCommand($cmd_link, $this->
lng->txt(
'move'));
1701 $this->adm_commands_included =
true;
1709 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type) && $this->container_obj->getObject()) {
1710 $this->
ctrl->setParameter(
1711 $this->container_obj,
1713 $this->container_obj->getObject()->getRefId()
1715 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1717 if (!$to_repository) {
1718 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'cut');
1719 $this->insertCommand($cmd_link, $this->
lng->txt(
'move'));
1721 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'cut_for_repository');
1722 $this->insertCommand($cmd_link, $this->
lng->txt(
'wsp_move_to_repository'));
1725 $this->adm_commands_included =
true;
1731 if ($this->std_cmd_only) {
1735 if ($this->checkCommandAccess(
'copy',
'copy', $this->ref_id, $this->type) &&
1736 $this->obj_definition->allowCopy($this->type)) {
1737 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1738 $this->
ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id', $this->getCommandId());
1739 $cmd_copy = $this->
ctrl->getLinkTargetByClass([get_class($this->container_obj),
'ilobjectcopygui'],
'initTargetSelection');
1740 $this->insertCommand($cmd_copy, $this->
lng->txt(
'copy'));
1742 $this->
ctrl->setParameter(
1743 $this->container_obj,
1745 $this->container_obj->getObject()->getRefId()
1747 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1749 if (!$to_repository) {
1750 $cmd_copy = $this->
ctrl->getLinkTarget($this->container_obj,
'copy');
1751 $this->insertCommand($cmd_copy, $this->
lng->txt(
'copy'));
1753 $cmd_copy = $this->
ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
1754 $this->insertCommand($cmd_copy, $this->
lng->txt(
'wsp_copy_to_repository'));
1758 $this->adm_commands_included =
true;
1764 if ($this->std_cmd_only) {
1774 $this->clipboard->hasEntries()
1776 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1777 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'paste');
1778 $this->insertCommand($cmd_link, $this->
lng->txt(
'paste'));
1779 $this->adm_commands_included =
true;
1785 if ($this->std_cmd_only
1788 || $this->settings->get(
'rep_favourites',
'0') !==
'1') {
1796 is_object($this->container_obj) &&
1798 method_exists($this->container_obj,
'getObject') &&
1799 is_object($this->container_obj->getObject())
1801 $this->
ctrl->setParameter(
1802 $this->container_obj,
1804 $this->container_obj->getObject()->getRefId()
1808 $this->
ctrl->setParameter($this->container_obj,
'type', $type);
1809 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1811 if (!$this->fav_manager->ifIsFavourite($this->user->getId(), $this->getCommandId())) {
1813 if ($this->checkCommandAccess(
'read',
'', $this->ref_id, $this->type, $this->obj_id)) {
1814 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'addToDesk');
1815 $this->insertCommand($cmd_link, $this->
lng->txt(
'rep_add_to_favourites'));
1818 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'removeFromDesk');
1819 $this->insertCommand($cmd_link, $this->
lng->txt(
'rep_remove_from_favourites'));
1822 $this->
ctrl->clearParameters($this->container_obj);
1828 if ($this->std_cmd_only) {
1831 $this->insertCommand(
1832 $this->getCommandLink(
'infoScreen'),
1833 $this->
lng->txt(
'info_short'),
1834 $this->getCommandFrame(
'infoScreen'),
1844 if ($this->std_cmd_only || $this->
user->isAnonymous()) {
1848 $this->
lng->loadLanguageModule(
'notes');
1849 $this->
lng->loadLanguageModule(
'tagging');
1850 $cmd_frame = $this->getCommandFrame(
'infoScreen');
1854 if ($this->reference_ref_id) {
1855 $note_ref_id = $this->reference_ref_id;
1858 $js_updater = $header_actions
1859 ?
'il.Object.redrawActionHeader();'
1860 :
'il.Object.redrawListItem(' . $note_ref_id .
')';
1862 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, $header_actions);
1863 if ($comments_enabled) {
1864 $this->insertCommand(
1866 $this->
lng->txt(
'notes_comments'),
1874 if ($this->notes_enabled) {
1875 $this->insertCommand(
1877 $this->
lng->txt(
'notes'),
1885 if ($this->tags_enabled) {
1886 $this->insertCommand(
1888 $this->
lng->txt(
'tagging_set_tag'),
1906 $this->std_cmd_only || is_null($this->container_obj) ||
1907 !method_exists($this->container_obj,
'getObject') ||
1908 !is_object($this->container_obj->getObject())
1913 $parent_ref_id = $this->container_obj->getObject()->getRefId();
1914 $parent_type = $this->container_obj->getObject()->getType();
1917 if ($this->reference_ref_id) {
1918 $this->
ctrl->setParameterByClass(
'ilconditionhandlergui',
'ref_id', $this->reference_ref_id);
1922 $this->checkCommandAccess(
'write',
'', $parent_ref_id, $parent_type) ||
1923 $this->checkCommandAccess(
'write',
'', $this->ref_id, $this->type)
1925 $this->
ctrl->setParameterByClass(
1926 get_class($this->container_obj),
1930 $time_limit_link = $this->
ctrl->getLinkTargetByClass(
1931 get_class($this->container_obj),
1932 'editAvailabilityPeriod'
1934 $this->insertCommand($time_limit_link, $this->
lng->txt(
'edit_availability_period'));
1935 $this->
ctrl->clearParameterByClass(
1936 get_class($this->container_obj),
1940 $this->
ctrl->setParameterByClass(
1941 'ilconditionhandlergui',
1945 $this->
ctrl->setParameterByClass(
1946 'ilconditionhandlergui',
1951 $availbility_link = $this->
ctrl->getLinkTargetByClass(
1952 [$this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui',
'ilconditionhandlergui'],
1956 $this->insertCommand($availbility_link, $this->
lng->txt(
'preconditions'));
1959 if ($this->reference_ref_id) {
1960 $this->
ctrl->setParameterByClass(
'ilconditionhandlergui',
'ref_id', $this->ref_id);
1970 $commands = $this->getCommands();
1971 if (!$this->getCommandsStatus() || $this->commandsNeedToBeHidden($for_header)) {
1972 foreach ($commands as $command) {
1973 if ($command[
'default'] ===
true) {
1974 $this->default_command = $command[
'granted'] ===
true ? $this->createDefaultCommand($command) : [];
1981 $this->
ctrl->setParameterByClass($this->gui_class_name,
'ref_id', $this->ref_id);
1983 $this->current_actions = [];
1984 $this->default_command = [];
1985 $this->prevent_duplicate_commands = [];
1988 $valid_header_commands = [
'mount_webfolder'];
1990 foreach ($commands as $command) {
1991 if ($for_header && !in_array($command[
'cmd'], $valid_header_commands)
1992 || $command[
'granted'] ===
false) {
1996 if ($command[
'default'] !==
true) {
1997 if (!$this->std_cmd_only) {
2000 $this->appendRepositoryFrameParameter($command[
'link']);
2002 $cmd_link = $command[
'link'];
2003 $txt = ($command[
'lang_var'] ==
'')
2005 : $this->
lng->txt($command[
'lang_var']);
2006 $this->insertCommand(
2015 $this->default_command = $this->createDefaultCommand($command);
2020 if (is_array($this->cust_commands)) {
2021 foreach ($this->cust_commands as $command) {
2022 if ($command instanceof
Button) {
2023 $this->current_actions[] = $command;
2027 $this->insertCommand(
2029 $this->
lng->txt($command[
'lang_var']),
2032 $command[
'cmd'] ??
'',
2037 $this->insertLPSettingsCommand();
2040 if ($this->getInfoScreenStatus()) {
2041 $this->insertInfoScreenCommand();
2044 $this->insertLPCommand();
2046 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2048 if ($this->timings_enabled) {
2049 $this->insertTimingsCommand();
2053 if ($this->delete_enabled) {
2054 $this->insertDeleteCommand();
2058 if ($this->link_enabled) {
2059 $this->insertLinkCommand();
2063 if ($this->cut_enabled) {
2064 $this->insertCutCommand();
2068 if ($this->copy_enabled) {
2069 $this->insertCopyCommand();
2073 if ($this->repository_transfer_enabled) {
2074 $this->insertCutCommand(
true);
2075 $this->insertCopyCommand(
true);
2079 if ($this->subscribe_enabled) {
2080 $this->insertSubscribeCommand();
2084 if ($this->multi_download_enabled && $for_header) {
2085 $this->insertMultiDownloadCommand();
2089 if ($this->cut_enabled or $this->link_enabled) {
2090 $this->insertPasteCommand();
2096 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2097 $this->insertCommonSocialCommands($for_header);
2112 && $this->object_properties->getPropertyInfoTabVisibility()) {
2118 public function enableComments(
bool $value,
bool $enable_comments_settings =
true): void
2120 if ($this->
settings->get(
'disable_comments')) {
2124 $this->comments_enabled = $value;
2125 $this->comments_settings_enabled = $enable_comments_settings;
2130 if ($this->
settings->get(
'disable_notes')) {
2134 $this->notes_enabled = $value;
2140 if (!$tags_set->get(
'enable')) {
2143 $this->tags_enabled = $value;
2148 ?
string $text =
null,
2149 bool $categories =
false,
2150 ?array $ctrl_path =
null,
2151 bool $force_rate_parent =
false
2153 $this->rating_enabled = $value;
2155 if ($this->rating_enabled) {
2156 $this->rating_categories_enabled = $categories;
2157 $this->rating_text =
$text;
2158 $this->rating_ctrl_path = $ctrl_path;
2159 $this->force_rate_parent = $force_rate_parent;
2171 if (!$folder_set->get(
'enable_multi_download')) {
2174 $this->multi_download_enabled = $value;
2179 if ($this->std_cmd_only) {
2188 $this->
ctrl->setParameter($this->getContainerObject(),
'type',
'');
2189 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id',
'');
2190 $this->
ctrl->setParameter($this->getContainerObject(),
'active_node',
'');
2196 $hasAdminAccess = $this->
access->checkAccessOfUser(
$user_id,
'crs_admin', $this->
ctrl->getCmd(), $this->requested_ref_id);
2200 if ($hasAdminAccess) {
2201 $cmd = ($this->requested_cmd ==
'enableAdministrationPanel')
2203 :
'enableAdministrationPanel';
2205 $cmd = ($this->requested_cmd ==
'enableMultiDownload')
2207 :
'enableMultiDownload';
2209 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(), $cmd);
2210 $this->insertCommand($cmd_link, $this->
lng->txt(
'download_multiple_objects'));
2217 if (!$this->getContainerObject()->isActiveAdministrationPanel() || $this->clipboard->hasEntries()) {
2219 in_array($this->type, [
'file',
'fold']) &&
2220 $this->
access->checkAccess(
'read',
'', $ref_id, $this->type)
2222 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2224 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2227 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2233 return $this->download_checkbox_state;
2247 if (is_null($tpl)) {
2252 $DIC->notes()->gui()->initJavascript($notes_url);
2260 $tpl->addOnLoadCode(
'il.Object.setRedrawAHUrl("' . $redraw_url .
'");');
2266 $this->sub_obj_type = $type;
2267 $this->sub_obj_id = (
int)
$id;
2273 ?
string $tooltip =
null,
2274 ?
string $onclick =
null,
2275 ?
string $status_text =
null,
2276 ?
string $href =
null
2278 $this->header_icons[
$id] = [
2280 'tooltip' => $tooltip,
2281 'onclick' => $onclick,
2282 'status_text' => $status_text,
2289 $this->header_icons[
$id] = $html;
2294 $this->header_icons[
$id] = [
'glyph' => $glyph,
'onclick' => $onclick];
2299 $this->ajax_hash = $hash;
2304 if ($main_tpl ==
null) {
2305 $main_tpl = $this->main_tpl;
2308 $htpl =
new ilTemplate(
'tpl.header_action.html',
true,
true,
'components/ILIAS/ILIASObject');
2310 $redraw_js =
'il.Object.redrawActionHeader();';
2313 if ($this->tags_enabled) {
2319 $this->
user->getId()
2321 if (count($tags) > 0) {
2322 $this->
lng->loadLanguageModule(
'tagging');
2324 $f = $this->
ui->factory();
2325 $this->addHeaderGlyph(
2327 $f->symbol()->glyph()->tag(
'#')
2328 ->withCounter(
$f->counter()->status(count($tags))),
2335 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id,
true,
false);
2336 if ($this->notes_enabled || $comments_enabled) {
2337 $type = ($this->sub_obj_type ==
'') ? $this->type : $this->sub_obj_type;
2338 $context = $this->notes_service->data()->context($this->obj_id, $this->sub_obj_id, $type);
2339 $cnt[$this->obj_id][Note::PUBLIC] = $this->notes_service->domain()->getNrOfCommentsForContext(
$context);
2340 $cnt[$this->obj_id][Note::PRIVATE] = $this->notes_service->domain()->getNrOfNotesForContext(
$context);
2342 $this->notes_enabled &&
2343 isset($cnt[$this->obj_id][Note::PRIVATE]) &&
2344 $cnt[$this->obj_id][Note::PRIVATE] > 0
2346 $f = $this->
ui->factory();
2347 $this->addHeaderGlyph(
2349 $f->symbol()->glyph()->note(
'#')
2350 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][Note::PRIVATE])),
2356 $comments_enabled &&
2357 isset($cnt[$this->obj_id][Note::PUBLIC]) &&
2358 $cnt[$this->obj_id][Note::PUBLIC] > 0
2360 $this->
lng->loadLanguageModule(
'notes');
2361 $f = $this->
ui->factory();
2362 $this->addHeaderGlyph(
2364 $f->symbol()->glyph()->comment(
'#')
2365 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][Note::PUBLIC])),
2372 if ($this->rating_enabled) {
2374 $rating_gui->enableCategories($this->rating_categories_enabled);
2376 $rating_gui->setObject($this->obj_id, $this->type);
2377 if ($this->rating_text) {
2378 $rating_gui->setYourRatingText($this->rating_text);
2381 $ajax_hash = $this->force_rate_parent
2384 $this->
ctrl->setParameterByClass(
'ilRatingGUI',
'cadh', $ajax_hash);
2385 $this->
ctrl->setParameterByClass(
'ilRatingGUI',
'rnsb',
true);
2386 if ($this->rating_ctrl_path) {
2387 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2388 $ajax_url = $this->
ctrl->getFormActionByClass($this->rating_ctrl_path,
'saveRating',
'',
true);
2390 $ajax_url = $this->
ctrl->getFormActionByClass(
'ilRatingGUI',
'saveRating',
'',
true);
2392 $main_tpl->
addOnLoadCode(
'il.Object.setRatingUrl("' . $ajax_url .
'");');
2393 $this->addHeaderIconHTML(
2395 $rating_gui->getHTML(
2397 $this->checkCommandAccess(
'read',
'', $this->ref_id, $this->type),
2398 'il.Object.saveRating(%rating%);'
2403 if ($this->header_icons) {
2405 foreach ($this->header_icons as
$id => $attr) {
2408 if (is_array($attr)) {
2409 if (isset($attr[
'glyph']) && $attr[
'glyph']) {
2410 if ($attr[
'onclick']) {
2411 $htpl->setCurrentBlock(
'prop_glyph_oc');
2412 $htpl->setVariable(
'GLYPH_ONCLICK', $attr[
'onclick']);
2413 $htpl->parseCurrentBlock();
2416 $html =
$renderer->render($attr[
'glyph']);
2417 $htpl->setCurrentBlock(
'prop_glyph');
2418 $htpl->setVariable(
'GLYPH', $html);
2419 $htpl->parseCurrentBlock();
2421 if ($attr[
'onclick']) {
2422 $htpl->setCurrentBlock(
'onclick');
2423 $htpl->setVariable(
'PROP_ONCLICK', $attr[
'onclick']);
2424 $htpl->parseCurrentBlock();
2427 if ($attr[
'status_text']) {
2428 $htpl->setCurrentBlock(
'status');
2429 $htpl->setVariable(
'PROP_TXT', $attr[
'status_text']);
2430 $htpl->parseCurrentBlock();
2434 $htpl->setCurrentBlock(
'prop');
2435 if ($attr[
'href'] || $attr[
'onclick']) {
2436 $htpl->setVariable(
'TAG',
'a');
2438 $htpl->setVariable(
'TAG',
'span');
2440 $htpl->setVariable(
'PROP_ID',
$id);
2441 $htpl->setVariable(
'IMG_SRC', $attr[
'img']);
2442 if ($attr[
'href'] !=
'') {
2443 $htpl->setVariable(
'PROP_HREF',
' href="' . $attr[
'href'] .
'" ');
2446 if ($attr[
'tooltip']) {
2447 $htpl->setVariable(
'IMG_ADDITIONAL',
"alt=\"{$attr['tooltip']}\" title=\"{$attr['tooltip']}\"");
2449 $htpl->parseCurrentBlock();
2456 if (
sizeof($chunks)) {
2459 implode(
' ', $chunks) .
' '
2465 $dropdown_label =
'<span class="hidden-xs">' .
2466 $this->
lng->txt(
'actions') .
2468 $dropdown = $this->getCommandsDropdown($dropdown_label,
true);
2471 $this->
ui->renderer()->render($dropdown)
2474 if ($this->cust_modals !== []) {
2475 $htpl->setVariable(
'TRIGGERED_MODALS', $this->
ui->renderer()->render($this->cust_modals));
2478 return $htpl->get();
2489 $base_class = $this->request_wrapper->retrieve(
'baseClass', $this->
refinery->kindlyTo()->string());
2491 (strtolower($base_class) !=
'ilrepositorygui') &&
2492 is_int(strpos($link,
'baseClass=ilRepositoryGUI'))
2494 if ($this->type !=
'frm') {
2504 if ($this->default_command_params) {
2506 foreach ($this->default_command_params as $name => $value) {
2507 $params[] = $name .
'=' . $value;
2513 if (!stristr($default_link,
'?')) {
2514 $default_link = ($default_link .
'?' .
$params);
2516 $default_link = ($default_link .
'&' .
$params);
2519 return $default_link;
2527 if (strstr($link, ilSAHSPresentationGUI::class) ===
false) {
2528 return [$link, $target];
2532 $om = $sahs_obj->getOpenMode();
2533 $width = $sahs_obj->getWidth();
2534 $height = $sahs_obj->getHeight();
2535 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
2538 if ($om !== 0 && !$this->
http->agent()->isMobile()) {
2539 $this->default_command[
'frame'] =
'';
2541 'javascript:void(0); onclick=startSAHS(\'' .
2554 $target = "ilContObj" . $this->ref_id;
2556 return [$link, $target];
2559 public function insertPath(): void
2561 if ($this->getPathStatus() != false) {
2562 if (!$this->path_gui instanceof \ilPathGUI) {
2563 $path_gui = new \ilPathGUI();
2565 $path_gui = $this->path_gui;
2568 $path_gui->enableTextOnly(!$this->path_linked);
2569 $path_gui->setUseImages(false);
2571 $start_node = ROOT_FOLDER_ID;
2572 if ($this->path_start_node) {
2573 $start_node = $this->path_start_node;
2576 $this->tpl->setCurrentBlock('path_item
');
2577 $this->tpl->setVariable('PATH_ITEM
', $path_gui->getPath($start_node, $this->ref_id));
2578 $this->tpl->parseCurrentBlock();
2580 $this->tpl->setCurrentBlock('path
');
2581 $this->tpl->setVariable('TXT_LOCATION
', $this->lng->txt('locator'));
2582 $this->tpl->parseCurrentBlock();
2586 public function insertProgressInfo(): void
2590 public function insertIconsAndCheckboxes(): void
2593 if ($this->getCheckboxStatus()) {
2594 $this->tpl->setCurrentBlock('check');
2595 $this->tpl->setVariable('VAL_ID
', $this->getCommandId());
2596 $this->tpl->setVariable('CHECK_TITLE
', $this->lng->txt('select
') . ' ' . $this->getTitle());
2597 $this->tpl->parseCurrentBlock();
2599 } elseif ($this->getDownloadCheckboxState() != self::DOWNLOAD_CHECKBOX_NONE) {
2600 $this->tpl->setCurrentBlock('check_download
');
2601 $this->tpl->setVariable('CHECK_DOWNLOAD_TITLE
', $this->lng->txt('download
') . ' ' . $this->getTitle());
2602 if ($this->getDownloadCheckboxState() == self::DOWNLOAD_CHECKBOX_ENABLED) {
2603 $this->tpl->setVariable('VAL_ID
', $this->getCommandId());
2605 $this->tpl->setVariable('VAL_VISIBILITY
', 'visibility: hidden;
" disabled="disabled');
2607 $this->tpl->parseCurrentBlock();
2609 } elseif ($this->getExpandStatus()) {
2610 $this->tpl->setCurrentBlock('expand');
2612 if ($this->isExpanded()) {
2613 $this->ctrl->setParameter($this->container_obj, 'expand', -1 * $this->obj_id);
2614 // 'view
' added, see #19922
2615 $this->tpl->setVariable('EXP_HREF
', $this->ctrl->getLinkTarget($this->container_obj, 'view
', $this->getUniqueItemId(true)));
2616 $this->ctrl->clearParameters($this->container_obj);
2617 $this->tpl->setVariable('EXP_IMG
', ilUtil::getImagePath('nav/tree_exp.svg
'));
2618 $this->tpl->setVariable('EXP_ALT
', $this->lng->txt('collapse'));
2620 $this->ctrl->setParameter($this->container_obj, 'expand', $this->obj_id);
2621 // 'view
' added, see #19922
2622 $this->tpl->setVariable('EXP_HREF
', $this->ctrl->getLinkTarget($this->container_obj, 'view
', $this->getUniqueItemId(true)));
2623 $this->ctrl->clearParameters($this->container_obj);
2624 $this->tpl->setVariable('EXP_IMG
', ilUtil::getImagePath('nav/tree_col.svg
'));
2625 $this->tpl->setVariable('EXP_ALT
', $this->lng->txt('expand'));
2628 $this->tpl->parseCurrentBlock();
2632 if ($this->getIconStatus()) {
2634 $this->tpl->touchBlock('i_1
');
2637 $this->tpl->setCurrentBlock('icon
');
2638 $this->tpl->setVariable('ALT_ICON
', $this->buildTranslatedType());
2640 $this->tpl->setVariable(
2642 $this->getTypeIcon()
2644 $this->tpl->parseCurrentBlock();
2648 $this->tpl->touchBlock('d_
' . $cnt);
2654 public function getTypeIcon(): string
2656 return ilObject::getIconForReference(
2660 $this->getIconImageType()
2664 public function insertSubItems(): void
2666 foreach ($this->sub_item_html as $sub_html) {
2667 $this->tpl->setCurrentBlock('subitem
');
2668 $this->tpl->setVariable('SUBITEM
', $sub_html);
2669 $this->tpl->parseCurrentBlock();
2673 public function insertPositionField(): void
2675 if ($this->position_enabled) {
2676 $this->tpl->setCurrentBlock('position
');
2677 $this->tpl->setVariable('POS_ID
', $this->position_field_index);
2678 $this->tpl->setVariable('POS_VAL
', $this->position_value);
2679 $this->tpl->parseCurrentBlock();
2687 public function adminCommandsIncluded(): bool
2689 return $this->adm_commands_included;
2695 public function getListItemHTML(
2701 // this variable stores whether any admin commands
2702 // are included in the output
2703 $this->adm_commands_included = false;
2705 // only for performance exploration
2706 $type = ilObject::_lookupType($obj_id);
2708 $this->initItem($ref_id, $obj_id, $type, $title, $description);
2710 if ($this->rating_enabled) {
2711 if (ilRating::hasRatingInListGUI($this->obj_id, $this->type)) {
2712 $may_rate = $this->checkCommandAccess('read
', '', $this->ref_id, $this->type);
2713 $rating = new ilRatingGUI();
2714 $rating->setObject($this->obj_id, $this->type);
2715 $this->addCustomProperty(
2717 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
2725 if (!$this->checkCommandAccess('visible
', '', $ref_id, '', $obj_id)) {
2726 $this->resetCustomData();
2731 if ($type == 'file
' and ilObjFileAccess::_isFileHidden($title)) {
2732 $this->resetCustomData();
2737 $this->tpl = new ilTemplate(
2738 static::$tpl_file_name,
2741 static::$tpl_component,
2747 if ($this->getCommandsStatus()) {
2748 if (!$this->getSeparateCommands()) {
2749 $dropdown = $this->getCommandsDropdown($title);
2750 $this->tpl->setVariable(
2751 'COMMAND_SELECTION_LIST
',
2752 $this->ui->renderer()->render($dropdown)
2757 if ($this->getProgressInfoStatus()) {
2758 $this->insertProgressInfo();
2761 // insert title and describtion
2762 $this->insertTitle();
2763 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2764 if ($this->getDescriptionStatus()) {
2765 $this->insertDescription();
2769 if ($this->getSearchFragmentStatus()) {
2770 $this->insertSearchFragment();
2774 if ($this->getPropertiesStatus()) {
2775 $this->insertProperties();
2778 // notice properties
2779 if ($this->getNoticePropertiesStatus()) {
2780 $this->insertNoticeProperties();
2784 if ($this->getPreconditionsStatus()) {
2785 $this->insertPreconditions();
2789 $this->insertPath();
2791 if ($this->getItemDetailLinkStatus()) {
2792 $this->insertItemDetailLinks();
2795 // icons and checkboxes
2796 $this->insertIconsAndCheckboxes();
2798 // input field for position
2799 $this->insertPositionField();
2802 $this->insertSubItems();
2804 $this->resetCustomData();
2806 $this->tpl->setVariable('DIV_CLASS
', 'ilContainerListItemOuter
');
2807 $this->tpl->setVariable(
2809 'data-list-item-
id=
"' . $this->getUniqueItemId(true) . '" id =
"' . $this->getUniqueItemId(true) . '"'
2811 $this->tpl->setVariable('ADDITIONAL
', $this->getAdditionalInformation());
2813 if (is_object($this->getContainerObject())) {
2814 // #11554 - make sure that internal ids are reset
2815 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id
', '');
2818 // if file upload is enabled the content is wrapped by a UI dropzone.
2819 $content = $this->tpl->get();
2820 $file_upload_dropzone = new ilObjFileUploadDropzone($this->ref_id, $content);
2821 if ($this->context === self::CONTEXT_REPOSITORY
2822 && ($this->requested_cmd === "view" || $this->requested_cmd === "" || $this->requested_cmd === "render")
2823 && $file_upload_dropzone->isUploadAllowed($this->type)
2824 && !(new ModeSessionRepository())->isAdminMode()
2826 return $file_upload_dropzone->getDropzoneHtml();
2835 protected function resetCustomData(): void
2838 $this->cust_prop = [];
2839 $this->cust_commands = [];
2840 $this->cust_modals = [];
2841 $this->sub_item_html = [];
2842 $this->position_enabled = false;
2848 public function setParentRefId(int $ref_id): void
2850 $this->parent_ref_id = $ref_id;
2859 public function getUniqueItemId(bool $as_div = false): string
2861 // use correct id for references
2862 $id_ref = $this->ref_id;
2863 if ($this->reference_ref_id > 0) {
2864 $id_ref = $this->reference_ref_id;
2867 // add unique identifier for preconditions (objects can appear twice in same container)
2868 if ($this->condition_depth) {
2869 $id_ref .= '_pc
' . $this->condition_depth;
2873 $id_ref .= '_pref_
' . $this->parent_ref_id;
2878 // action menu [yellow] toggle
2879 return 'lg_div_
' . $id_ref;
2886 public function getCommandsHTML(string $title = ''): string
2888 return $this->ui->renderer()->render($this->getCommandsDropdown($title, false));
2891 private function getCommandsDropdown(string $title, bool $for_header = false): StandardDropdown
2893 $this->populateCommands($for_header);
2894 return $this->ui->factory()
2896 ->standard($this->current_actions)
2897 ->withAriaLabel(sprintf(
2898 $this->lng->txt('actions_for
'),
2899 htmlspecialchars(addslashes($title))
2906 public function isSideBlock(): bool
2911 public function setBoldTitle(bool $bold_title): void
2913 $this->bold_title = $bold_title;
2916 public function isTitleBold(): bool
2918 return $this->bold_title;
2921 public static function preloadCommonProperties(array $obj_ids, int $context): void
2924 $lng = $DIC->language();
2925 $ilSetting = $DIC->settings();
2926 $ilUser = $DIC->user();
2927 $notes_manager = $DIC->notes()->internal()->domain()->notes();
2929 if ($context == self::CONTEXT_REPOSITORY) {
2930 $active_notes = !$ilSetting->get('disable_notes
');
2931 $active_comments = !$ilSetting->get('disable_comments
');
2933 if ($active_comments) {
2934 // needed for action
2935 self::$comments_activation = $DIC->notes()
2938 ->notes()->commentsActiveMultiple($obj_ids);
2941 // properties are optional
2942 if ($ilSetting->get('comments_tagging_in_lists
')) {
2943 if ($active_notes || $active_comments) {
2944 // @todo: should be refactored, see comment in notes db repo
2945 self::$cnt_notes = $notes_manager->countNotesAndCommentsMultipleObjects(
2950 $lng->loadLanguageModule('notes
');
2953 $tags_set = new ilSetting('tags
');
2954 if ($tags_set->get('enable
')) {
2955 $all_users = (bool) $tags_set->get('enable_all_users
');
2957 if (!$ilSetting->get('comments_tagging_in_lists_tags
')) {
2958 self::$cnt_tags = ilTagging::_countTags($obj_ids, $all_users);
2960 $tag_user_id = null;
2962 $tag_user_id = $ilUser->getId();
2964 self::$tags = ilTagging::_getListTagsForObjects($obj_ids, $tag_user_id);
2967 $lng->loadLanguageModule('tagging
');
2971 $lng->loadLanguageModule('rating
');
2974 self::$preload_done = true;
2980 protected function isCommentsActivated(
2984 bool $header_actions,
2985 bool $check_write_access = true
2987 if ($this->comments_enabled) {
2988 if (!$this->comments_settings_enabled) {
2991 if ($check_write_access && $this->checkCommandAccess('write
', '', $ref_id, $type)) {
2994 // fallback to single object check if no preloaded data
2995 // only the repository does preloadCommonProperties() yet
2996 if (!$header_actions && self::$preload_done) {
2997 if (isset(self::$comments_activation[$obj_id]) &&
2998 self::$comments_activation[$obj_id]) {
3001 } elseif ($this->notes_service->domain()->commentsActive($obj_id)) {
3011 public function enableTimings(bool $status): void
3013 $this->timings_enabled = $status;
3019 public function getAsListItem(
3028 // even b tag produced bugs, see #32304
3029 $description = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
3041 $this->enableCommands(true);
3044 $this->populateCommands(false);
3046 $dropdown = $this->getCommandsDropdown($title);
3047 $def_command = $this->getDefaultCommand();
3049 if ($def_command['link'] ?? false) {
3050 list($def_command['link'], $def_command['frame
']) =
3051 $this->modifySAHSlaunch($def_command['link'], $def_command['frame
']);
3052 $new_viewport = !in_array($def_command['frame
'], ['', '_top
', '_self
', '_parent
'], true);
3053 $link = $this->ui->factory()
3055 ->standard($this->getTitle(), $def_command['link'])
3056 ->withOpenInNewViewport($new_viewport);
3057 $list_item = $ui->factory()->item()->standard($link);
3059 $list_item = $ui->factory()->item()->standard($this->getTitle());
3062 if ($description != '') {
3063 $list_item = $list_item->withDescription($description);
3065 $list_item = $list_item->withActions($dropdown)->withLeadIcon(
3066 $this->ui->factory()->symbol()->icon()->custom(
3067 $this->getTypeIcon(),
3068 $this->buildTranslatedType(),
3075 $this->enableComments(true);
3076 $this->enableNotes(true);
3077 $this->enableTags(true);
3078 $this->enableRating(true);
3080 foreach ($this->determineProperties() as $p) {
3081 //if ($p['property'] !== $this->lng->txt('learning_progress
')) {
3082 $l[(string) $p['property']] = (string) $p['value
'];
3085 if (count($l) > 0) {
3086 $list_item = $list_item->withProperties($l);
3095 public function getAsCard(
3101 ): ?RepositoryObject {
3104 $title = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($title);
3105 // even b tag produced bugs, see #32304
3106 $description = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
3118 $user = $this->user;
3119 $access = $this->access;
3121 $this->enableCommands(true);
3124 if ($description !== '') {
3125 $sections[] = $ui->factory()->legacy()->content('<div
class=
"il-multi-line-cap-3">
' . $description . '</div>
');
3128 $this->populateCommands(false);
3130 $def_command = $this->getDefaultCommand();
3132 $dropdown = $this->getCommandsDropdown($title);
3134 // workaround for #26205
3135 // we should get rid of _top links completely and gifure our how
3136 // to manage scorm links better
3137 $def_cmd_frame = ($def_command['frame
'] ?? '');
3138 if ($def_cmd_frame === '_top
') {
3139 $def_cmd_frame = '';
3141 $def_cmd_link = ($def_command['link'] ?? '');
3143 // workaround for scorm
3144 list($modified_link, $def_cmd_frame) =
3145 $this->modifySAHSlaunch($def_cmd_link, $def_cmd_frame);
3147 $image = $this->getTileImage();
3149 if ($def_cmd_link != '') { // #24256
3150 if ($def_cmd_frame !== '' && ($modified_link === $def_cmd_link)) {
3151 $signal = (new SignalGenerator())->create();
3152 $this->main_tpl->addOnLoadCode(
3153 "$(document).on('{$signal->getId()}
', function(event, signalData) {"
3154 . ' window.open(
"' . str_replace(
3158 ) . '",
"' . $def_cmd_frame . '");
'
3162 $image = $image->withAction($signal);
3165 $ui->factory()->button()->shy($title, '')->appendOnClick($signal);
3166 $title = $ui->renderer()->render($button);
3168 $image = $image->withAction($modified_link);
3172 if ($type == 'sess
') {
3174 $title = ':
' . $title;
3176 $app_info = ilSessionAppointment::_lookupAppointment($obj_id);
3177 $title = ilSessionAppointment::_appointmentToString(
3180 (bool) $app_info['fullday
']
3184 $icon = $this->ui->factory()->symbol()->icon()->custom(
3185 $this->getTypeIcon(),
3186 $this->buildTranslatedType(),
3190 // card title action
3191 $card_title_action = '';
3192 if ($def_cmd_link != '' && ($def_cmd_frame == '' || $modified_link != $def_cmd_link)) { // #24256
3193 $card_title_action = $modified_link;
3194 } elseif ($def_cmd_link == '' &&
3195 $this->getInfoScreenStatus() &&
3196 $access->checkAccessOfUser(
3202 $card_title_action = ilLink::_getLink($ref_id);
3203 if ($image->getAction() == '') {
3204 $image = $image->withAction($card_title_action);
3208 $card = $ui->factory()->card()->repositoryObject(
3209 $title . '<span data-list-item-
id=
"' . $this->getUniqueItemId(true) . '"></span>
',
3217 if ($card_title_action != '') {
3218 $card = $card->withTitleAction($card_title_action);
3222 foreach ($this->determineProperties() as $p) {
3223 if (isset($p['alert
']) && $p['alert
'] == true
3224 && isset($p['property']) && $p['property'] !== $this->lng->txt('learning_progress
')) {
3225 $l[(string) $p['property']] = (string) $p['value
'];
3228 if (count($l) > 0) {
3229 $prop_list = $ui->factory()->listing()->descriptive($l);
3230 $sections[] = $prop_list;
3232 if (count($sections) > 0) {
3233 $card = $card->withSections($sections);
3236 $lp = ilLPStatus::getListGUIStatus($obj_id, false);
3237 if (is_array($lp) && array_key_exists('status
', $lp)) {
3238 $percentage = (int) ilLPStatus::_lookupPercentage($obj_id, $this->user->getId());
3239 if ($lp['status
'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
3243 $card = $card->withProgress(
3247 ->mini(100, $percentage)
3254 public function checkInfoPageOnAsynchronousRendering(): bool
3259 private function getTileImage(): Image
3261 return $this->object_properties->getPropertyTileImage()
3262 ->getTileImage()->getImage($this->ui->factory()->image());
3268 public function insertLPCommand(): void
3270 if ($this->std_cmd_only || !$this->lp_cmd_enabled) {
3273 $relevant = ilLPStatus::hasListGUIStatus($this->obj_id);
3275 $cmd_link = $this->getCommandLink('learningProgress
');
3276 $this->insertCommand(
3278 $this->lng->txt('learning_progress
')
3286 private function insertLPSettingsCommand(): void
3288 if (!$this->lp_settings_cmd_enabled
3289 || !ilObjUserTracking::_enabledLearningProgress()
3290 || ilObjectLP::getTypeClass($this->type) === ''
3291 || ! $this->checkCommandAccess('edit_learning_progress
', '', $this->ref_id, $this->type)
3297 $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, 'ref_id
', $this->ref_id);
3298 switch ($this->type) {
3300 switch (ilObjSAHSLearningModule::_lookupSubType($this->obj_id)) {
3302 $scorm_class = ilObjSCORM2004LearningModuleGUI::class;
3305 $scorm_class = ilObjSCORMLearningModuleGUI::class;
3312 $cmd_link = $this->ctrl->getLinkTargetByClass([
3313 ilSAHSEditGUI::class,
3315 ilLearningProgressGUI::class,
3316 ilLPListOfSettingsGUI::class
3321 $cmd_link = $this->ctrl->getLinkTargetByClass([
3322 ilLMEditorGUI::class,
3323 ilObjLearningModuleGUI::class,
3324 ilLearningProgressGUI::class,
3325 ilLPListOfSettingsGUI::class
3330 $cmd_link = $this->ctrl->getLinkTargetByClass([
3331 ilObjLearningSequenceGUI::class,
3332 ilLearningProgressGUI::class,
3333 ilLPListOfSettingsGUI::class
3346 $gui_class = 'ilObj
' . $this->obj_definition->getClassName($this->type) . 'GUI
';
3347 $cmd_link = $this->ctrl->getLinkTargetByClass([
3348 ilRepositoryGUI::class,
3350 ilLearningProgressGUI::class,
3351 ilLPListOfSettingsGUI::class
3363 $this->ctrl->setParameterByClass('ilrepositorygui
', 'ref_id
', $this->requested_ref_id);
3364 if ($cmd_link !== '') {
3365 $this->insertCommand(
3367 $this->lng->txt('listaction_learning_progress_settings
')
3372 private function buildTranslatedType(): string
3374 if ($this->obj_definition->isPlugin($this->getIconImageType())) {
3375 return ilObjectPlugin::lookupTxtById($this->getIconImageType(), 'obj_
' . $this->getIconImageType());
3378 return $this->lng->txt('obj_
' . $this->getIconImageType());
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Provides fluid interface to RBAC services.
Manages items in repository clipboard.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static removeSubObjFromAjaxHash(string $hash)
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, ?string $sub_type=null, ?int $sub_id=null, int $news_id=0)
Build ajax hash.
static translateOperator(int $a_obj_id, string $a_operator, string $value='')
static calculateEffectiveRequiredTriggers(int $a_target_ref_id, int $a_target_obj_id, string $a_target_obj_type='')
static _checkCondition(array $condition, int $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static getEffectiveOptionalConditionsOfTarget(int $a_target_ref_id, int $a_target_obj_id, string $a_obj_type='')
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
Manages favourites, currently the interface for other components, needs discussion.
static _getInstance()
Get singleton instance of this class.
static getListGUIStatus(int $a_obj_id, bool $a_image_only=true)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
static getListNotesJSCall(string $a_hash, ?string $a_update_code=null)
Get list notes js call.
static getListCommentsJSCall(string $a_hash, ?string $a_update_code=null)
Get list comments js call.
Class ilObjSCORMLearningModule.
static _getCommands()
get commands
parses the objects.xml it handles the xml-description of all ilias objects
getProperties()
Get item properties.
bool $search_fragment_enabled
getAdditionalInformation()
ilObjectDefinition $obj_definition
static bool $preload_done
bool $repository_transfer_enabled
getTitle()
getTitle overwritten in class.ilObjLinkResourceList.php
const DOWNLOAD_CHECKBOX_DISABLED
enableItemDetailLinks(bool $status)
enable item detail links E.g Direct links to chapters or pages
bool $rating_categories_enabled
setDefaultCommandParameters(array $params)
addHeaderGlyph(string $id, ILIAS\UI\Component\Symbol\Glyph\Glyph $glyph, $onclick=null)
bool $item_detail_links_enabled
enablePath(bool $path, int $start_node=0, ?\ilPathGUI $path_gui=null)
bool $multi_download_enabled
ILIAS Notes Service $notes_service
bool $info_screen_enabled
getCustomProperties(array $prop)
int $download_checkbox_state
enableDownloadCheckbox(int $ref_id)
enableLearningProgress(bool $enabled)
enableDelete(bool $status)
checkCommandAccess(string $permission, string $cmd, int $ref_id, string $type, ?int $obj_id=null)
ilAdvancedMDSubstitution $substitutions
enableDescription(bool $status)
getHeaderAction(?ilGlobalTemplateInterface $main_tpl=null)
ilWorkspaceAccessHandler $ws_access
ILIAS Refinery Factory $refinery
const CONTEXT_WORKSPACE_SHARING
enableProgressInfo(bool $status)
getCommands()
get all current commands for a specific ref id (in the permission context of the current user)
enableMultiDownload(bool $value)
Toggles whether multiple objects can be downloaded at once or not.
enablePreconditions(bool $status)
addHeaderIcon(string $id, string $img, ?string $tooltip=null, ?string $onclick=null, ?string $status_text=null, ?string $href=null)
getIconImageType()
Returns the icon image type.
bool $lp_settings_cmd_enabled
insertPreconditions()
insert all missing preconditions
const CONTEXT_PERSONAL_DESKTOP
addHeaderIconHTML(string $id, string $html)
const DOWNLOAD_CHECKBOX_NONE
modifyTitleLink(string $default_link)
isMode(string $mode)
check current output mode
appendRepositoryFrameParameter(string $link)
workaround: all links into the repository (from outside) must tell repository to set up the frameset
setDetailsLevel(int $level)
Details level Currently used in Search which shows only limited properties of forums Currently used f...
ilListItemAccessCache $acache
insertCopyCommand(bool $to_repository=false)
string $position_field_index
bool $notice_properties_enabled
getSearchFragmentStatus()
setHeaderSubObject(?string $type, ?int $id)
getCommandFrame(string $cmd)
Get command target frame.
setConditionTarget(int $ref_id, int $obj_id, string $target_type)
setAdditionalInformation(?string $val)
enableRepositoryTransfer(bool $value)
Enable copy/move to repository (from personal workspace)
ilGlobalTemplateInterface $main_tpl
addSubItemHTML(string $html)
Add HTML for sub item (used for sessions)
createDefaultCommand(array $command)
Get default command link Overwritten for e.g categories,courses => they return a goto link If search ...
ilLDAPRoleGroupMapping $ldap_mapping
const DOWNLOAD_CHECKBOX_ENABLED
insertMultiDownloadCommand()
restrictToGoto(bool $value)
Restrict all actions/links to goto.
initItem(int $ref_id, int $obj_id, string $type, string $title='', string $description='')
initialize new item (is called by getItemHTML())
setContainerObject(object $container_obj)
setExpanded(bool $status)
getItemDetailLinkStatus()
get item detail link status
ilFavouritesManager $fav_manager
bool $comments_settings_enabled
disableTitleLink(bool $status)
ClipboardManager $clipboard
addCustomProperty(string $property='', string $value='', bool $alert=false, bool $newline=false)
setPositionInputField(string $field_index, string $position_value)
enableComments(bool $value, bool $enable_comments_settings=true)
enableInfoScreen(bool $info_screen)
setAjaxHash(string $hash)
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
bool $description_enabled
commandsNeedToBeHidden(bool $for_header)
Fix bug #12417: We hide the action menu when we are in the public area.
insertTimingsCommand()
ks, 23 OCT 2023: This function is badly named and it already was before the changes made today.
bool $substitutions_enabled
insertInfoScreenCommand()
getCommandImage(string $cmd)
Get command icon image.
populateCommands(bool $for_header)
insert all commands into html code
enableSearchFragments(bool $status)
setItemDetailLinks(array $detail_links, string $intro_txt='')
set items detail links
setParentRefId(int $ref_id)
Set current parent ref id to enable unique js-ids (sessions, etc.)
insertSearchFragment()
Insert highlighted search fragment.
enableLPSettingsCommand(bool $enabled)
setDescription(string $description)
enableRating(bool $value, ?string $text=null, bool $categories=false, ?array $ctrl_path=null, bool $force_rate_parent=false)
addCustomCommandButton(Button $button, ?Modal $triggeredModal=null)
enableLinkedPath(bool $status)
modifySAHSlaunch(string $link, string $target)
workaround: SAHS in new javavasript-created window or iframe
static string $tpl_file_name
string $item_detail_links_intro
enableCommands(bool $status, bool $std_only=false)
insertCommonSocialCommands(bool $header_actions=false)
Insert common social commands (comments, notes, tagging)
insertCommand(string $href, string $text, string $frame='', string $img='', string $cmd='', string $onclick='')
insert command button
array $prevent_duplicate_commands
static string $tpl_component
insertCutCommand(bool $to_repository=false)
getDescription()
getDescription overwritten in class.ilObjLinkResourceList.php
setSearchFragment(string $text)
bool $static_link_enabled
addCustomCommand(string $link, string $lang_var, string $frame='', string $onclick='')
setConditionDepth(int $depth)
set depth for precondition output (stops at level 5)
bool $adm_commands_included
bool $search_fragments_enabled
bool $prevent_access_caching
array $default_command_params
setMode(string $mode)
set output mode
getDownloadCheckboxState()
setSeparateCommands(bool $val)
string $additional_information
enableCheckbox(bool $status)
bool $title_link_disabled
enableNoticeProperties(bool $status)
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ?ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
forceVisibleOnly(bool $stat)
parseConditions(int $toggle_id, array $conditions, bool $obligatory=true)
Properties $object_properties
static array $comments_activation
enableSubstitutions(bool $status)
getCommandId()
get command id Normally the ref id.
getCommandLink(string $cmd)
Get command link url.
enableProperties(bool $status)
string $requested_base_class
bool $preconditions_enabled
enableExpand(bool $status)
getNoticePropertiesStatus()
enableSubscribe(bool $status)
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static initJavascript(string $a_ajax_url, ?ilGlobalTemplateInterface $a_main_tpl=null)
static getListTagsJSCall(string $a_hash, ?string $a_update_code=null)
static getTagsForUserAndObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id, string $a_sub_obj_type, int $a_user_id)
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static maybeRenderWebDAVModalInGlobalTpl()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getGotoLink(int $a_node_id, int $a_obj_id, string $a_additional="")
Interface RequestWrapper.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
This describes a Standard Dropdown.
Common interface to all items.
This describes commonalities between the different modals.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Interface for GUI classes (PDGUI, LuceneSearchGUI...) that have to handle administration commands (cu...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
link(string $caption, string $href, bool $new_viewport=false)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))
catch(InvalidArgumentException) if(!ilDAVActivationChecker::_isActive()) $webdav_dic