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 $this->
lng->loadLanguageModule(
'dash');
1812 if (!$this->fav_manager->ifIsFavourite($this->user->getId(), $this->getCommandId())) {
1814 if ($this->checkCommandAccess(
'read',
'', $this->ref_id, $this->type, $this->obj_id)) {
1815 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'addToDesk');
1816 $this->insertCommand($cmd_link, $this->
lng->txt(
'add_to_favourites'));
1819 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'removeFromDesk');
1820 $this->insertCommand($cmd_link, $this->
lng->txt(
'remove_from_favourites'));
1823 $this->
ctrl->clearParameters($this->container_obj);
1829 if ($this->std_cmd_only) {
1832 $this->insertCommand(
1833 $this->getCommandLink(
'infoScreen'),
1834 $this->
lng->txt(
'info_short'),
1835 $this->getCommandFrame(
'infoScreen'),
1845 if ($this->std_cmd_only || $this->
user->isAnonymous()) {
1849 $this->
lng->loadLanguageModule(
'notes');
1850 $this->
lng->loadLanguageModule(
'tagging');
1851 $cmd_frame = $this->getCommandFrame(
'infoScreen');
1855 if ($this->reference_ref_id) {
1856 $note_ref_id = $this->reference_ref_id;
1859 $js_updater = $header_actions
1860 ?
'il.Object.redrawActionHeader();'
1861 :
'il.Object.redrawListItem(' . $note_ref_id .
')';
1863 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, $header_actions);
1864 if ($comments_enabled) {
1865 $this->insertCommand(
1867 $this->
lng->txt(
'notes_comments'),
1875 if ($this->notes_enabled) {
1876 $this->insertCommand(
1878 $this->
lng->txt(
'notes'),
1886 if ($this->tags_enabled) {
1887 $this->insertCommand(
1889 $this->
lng->txt(
'tagging_set_tag'),
1907 $this->std_cmd_only || is_null($this->container_obj) ||
1908 !method_exists($this->container_obj,
'getObject') ||
1909 !is_object($this->container_obj->getObject())
1914 $parent_ref_id = $this->container_obj->getObject()->getRefId();
1915 $parent_type = $this->container_obj->getObject()->getType();
1918 if ($this->reference_ref_id) {
1919 $this->
ctrl->setParameterByClass(
'ilconditionhandlergui',
'ref_id', $this->reference_ref_id);
1923 $this->checkCommandAccess(
'write',
'', $parent_ref_id, $parent_type) ||
1924 $this->checkCommandAccess(
'write',
'', $this->ref_id, $this->type)
1926 $this->
ctrl->setParameterByClass(
1927 get_class($this->container_obj),
1931 $time_limit_link = $this->
ctrl->getLinkTargetByClass(
1932 get_class($this->container_obj),
1933 'editAvailabilityPeriod'
1935 $this->insertCommand($time_limit_link, $this->
lng->txt(
'edit_availability_period'));
1936 $this->
ctrl->clearParameterByClass(
1937 get_class($this->container_obj),
1941 $this->
ctrl->setParameterByClass(
1942 'ilconditionhandlergui',
1946 $this->
ctrl->setParameterByClass(
1947 'ilconditionhandlergui',
1952 $availbility_link = $this->
ctrl->getLinkTargetByClass(
1953 [$this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui',
'ilconditionhandlergui'],
1957 $this->insertCommand($availbility_link, $this->
lng->txt(
'preconditions'));
1960 if ($this->reference_ref_id) {
1961 $this->
ctrl->setParameterByClass(
'ilconditionhandlergui',
'ref_id', $this->ref_id);
1971 $commands = $this->getCommands();
1972 if (!$this->getCommandsStatus() || $this->commandsNeedToBeHidden($for_header)) {
1973 foreach ($commands as $command) {
1974 if ($command[
'default'] ===
true) {
1975 $this->default_command = $command[
'granted'] ===
true ? $this->createDefaultCommand($command) : [];
1982 $this->
ctrl->setParameterByClass($this->gui_class_name,
'ref_id', $this->ref_id);
1984 $this->current_actions = [];
1985 $this->default_command = [];
1986 $this->prevent_duplicate_commands = [];
1989 $valid_header_commands = [
'mount_webfolder'];
1991 foreach ($commands as $command) {
1992 if ($for_header && !in_array($command[
'cmd'], $valid_header_commands)
1993 || $command[
'granted'] ===
false) {
1997 if ($command[
'default'] !==
true) {
1998 if (!$this->std_cmd_only) {
2001 $this->appendRepositoryFrameParameter($command[
'link']);
2003 $cmd_link = $command[
'link'];
2004 $txt = ($command[
'lang_var'] ==
'')
2006 : $this->
lng->txt($command[
'lang_var']);
2007 $this->insertCommand(
2016 $this->default_command = $this->createDefaultCommand($command);
2021 if (is_array($this->cust_commands)) {
2022 foreach ($this->cust_commands as $command) {
2023 if ($command instanceof
Button) {
2024 $this->current_actions[] = $command;
2028 $this->insertCommand(
2030 $this->
lng->txt($command[
'lang_var']),
2033 $command[
'cmd'] ??
'',
2038 $this->insertLPSettingsCommand();
2041 if ($this->getInfoScreenStatus()) {
2042 $this->insertInfoScreenCommand();
2045 $this->insertLPCommand();
2047 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2049 if ($this->timings_enabled) {
2050 $this->insertTimingsCommand();
2054 if ($this->delete_enabled) {
2055 $this->insertDeleteCommand();
2059 if ($this->link_enabled) {
2060 $this->insertLinkCommand();
2064 if ($this->cut_enabled) {
2065 $this->insertCutCommand();
2069 if ($this->copy_enabled) {
2070 $this->insertCopyCommand();
2074 if ($this->repository_transfer_enabled) {
2075 $this->insertCutCommand(
true);
2076 $this->insertCopyCommand(
true);
2080 if ($this->subscribe_enabled) {
2081 $this->insertSubscribeCommand();
2085 if ($this->multi_download_enabled && $for_header) {
2086 $this->insertMultiDownloadCommand();
2090 if ($this->cut_enabled or $this->link_enabled) {
2091 $this->insertPasteCommand();
2097 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2098 $this->insertCommonSocialCommands($for_header);
2113 && $this->object_properties->getPropertyInfoTabVisibility()) {
2119 public function enableComments(
bool $value,
bool $enable_comments_settings =
true): void
2121 if ($this->
settings->get(
'disable_comments')) {
2125 $this->comments_enabled = $value;
2126 $this->comments_settings_enabled = $enable_comments_settings;
2131 if ($this->
settings->get(
'disable_notes')) {
2135 $this->notes_enabled = $value;
2141 if (!$tags_set->get(
'enable')) {
2144 $this->tags_enabled = $value;
2149 ?
string $text =
null,
2150 bool $categories =
false,
2151 ?array $ctrl_path =
null,
2152 bool $force_rate_parent =
false
2154 $this->rating_enabled = $value;
2156 if ($this->rating_enabled) {
2157 $this->rating_categories_enabled = $categories;
2158 $this->rating_text =
$text;
2159 $this->rating_ctrl_path = $ctrl_path;
2160 $this->force_rate_parent = $force_rate_parent;
2172 if (!$folder_set->get(
'enable_multi_download')) {
2175 $this->multi_download_enabled = $value;
2180 if ($this->std_cmd_only) {
2189 $this->
ctrl->setParameter($this->getContainerObject(),
'type',
'');
2190 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id',
'');
2191 $this->
ctrl->setParameter($this->getContainerObject(),
'active_node',
'');
2197 $hasAdminAccess = $this->
access->checkAccessOfUser(
$user_id,
'crs_admin', $this->
ctrl->getCmd(), $this->requested_ref_id);
2201 if ($hasAdminAccess) {
2202 $cmd = ($this->requested_cmd ==
'enableAdministrationPanel')
2204 :
'enableAdministrationPanel';
2206 $cmd = ($this->requested_cmd ==
'enableMultiDownload')
2208 :
'enableMultiDownload';
2210 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(), $cmd);
2211 $this->insertCommand($cmd_link, $this->
lng->txt(
'download_multiple_objects'));
2218 if (!$this->getContainerObject()->isActiveAdministrationPanel() || $this->clipboard->hasEntries()) {
2220 in_array($this->type, [
'file',
'fold']) &&
2221 $this->
access->checkAccess(
'read',
'', $ref_id, $this->type)
2223 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2225 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2228 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2234 return $this->download_checkbox_state;
2248 if (is_null($tpl)) {
2253 $DIC->notes()->gui()->initJavascript($notes_url);
2261 $tpl->addOnLoadCode(
'il.Object.setRedrawAHUrl("' . $redraw_url .
'");');
2267 $this->sub_obj_type = $type;
2268 $this->sub_obj_id = (
int)
$id;
2274 ?
string $tooltip =
null,
2275 ?
string $onclick =
null,
2276 ?
string $status_text =
null,
2277 ?
string $href =
null
2279 $this->header_icons[
$id] = [
2281 'tooltip' => $tooltip,
2282 'onclick' => $onclick,
2283 'status_text' => $status_text,
2290 $this->header_icons[
$id] = $html;
2295 $this->header_icons[
$id] = [
'glyph' => $glyph,
'onclick' => $onclick];
2306 static function (string
$id) use ($onclick_js): string {
2307 return '$("#' .
$id .
'").on("click", function(event) {'
2309 .
' return false; });';
2316 $this->ajax_hash = $hash;
2321 if ($main_tpl ==
null) {
2322 $main_tpl = $this->main_tpl;
2325 $htpl =
new ilTemplate(
'tpl.header_action.html',
true,
true,
'components/ILIAS/ILIASObject');
2327 $redraw_js =
'il.Object.redrawActionHeader();';
2330 if ($this->tags_enabled) {
2336 $this->
user->getId()
2338 if (count($tags) > 0) {
2339 $this->
lng->loadLanguageModule(
'tagging');
2341 $f = $this->
ui->factory();
2342 $this->addHeaderGlyph(
2344 $f->symbol()->glyph()->tag()
2345 ->withCounter(
$f->counter()->status(count($tags))),
2352 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id,
true,
false);
2353 if ($this->notes_enabled || $comments_enabled) {
2354 $type = ($this->sub_obj_type ==
'') ? $this->type : $this->sub_obj_type;
2355 $context = $this->notes_service->data()->context($this->obj_id, $this->sub_obj_id, $type);
2356 $cnt[$this->obj_id][Note::PUBLIC] = $this->notes_service->domain()->getNrOfCommentsForContext($context);
2357 $cnt[$this->obj_id][Note::PRIVATE] = $this->notes_service->domain()->getNrOfNotesForContext($context);
2359 $this->notes_enabled &&
2360 isset($cnt[$this->obj_id][Note::PRIVATE]) &&
2361 $cnt[$this->obj_id][Note::PRIVATE] > 0
2363 $f = $this->
ui->factory();
2364 $this->addHeaderGlyph(
2366 $f->symbol()->glyph()->note()
2367 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][Note::PRIVATE])),
2373 $comments_enabled &&
2374 isset($cnt[$this->obj_id][Note::PUBLIC]) &&
2375 $cnt[$this->obj_id][Note::PUBLIC] > 0
2377 $this->
lng->loadLanguageModule(
'notes');
2378 $f = $this->
ui->factory();
2379 $this->addHeaderGlyph(
2381 $f->symbol()->glyph()->comment()
2382 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][Note::PUBLIC])),
2389 if ($this->rating_enabled) {
2391 $rating_gui->enableCategories($this->rating_categories_enabled);
2393 $rating_gui->setObject($this->obj_id, $this->type);
2394 if ($this->rating_text) {
2395 $rating_gui->setYourRatingText($this->rating_text);
2398 $ajax_hash = $this->force_rate_parent
2401 $this->
ctrl->setParameterByClass(
'ilRatingGUI',
'cadh', $ajax_hash);
2402 $this->
ctrl->setParameterByClass(
'ilRatingGUI',
'rnsb',
true);
2403 if ($this->rating_ctrl_path) {
2404 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2405 $ajax_url = $this->
ctrl->getFormActionByClass($this->rating_ctrl_path,
'saveRating',
'',
true);
2407 $ajax_url = $this->
ctrl->getFormActionByClass(
'ilRatingGUI',
'saveRating',
'',
true);
2409 $main_tpl->
addOnLoadCode(
'il.Object.setRatingUrl("' . $ajax_url .
'");');
2410 $this->addHeaderIconHTML(
2412 $rating_gui->getHTML(
2414 $this->checkCommandAccess(
'read',
'', $this->ref_id, $this->type),
2415 'il.Object.saveRating(%rating%);'
2420 if ($this->header_icons) {
2422 foreach ($this->header_icons as
$id => $attr) {
2425 if (is_array($attr)) {
2426 if (isset($attr[
'glyph']) && $attr[
'glyph']) {
2428 if (!empty($attr[
'onclick'])) {
2430 $this->getHeaderGlyphShyButton($attr[
'glyph'], $attr[
'onclick'])
2433 $html =
'<span class="prop">'
2437 $htpl->setCurrentBlock(
'prop_glyph');
2438 $htpl->setVariable(
'GLYPH', $html);
2439 $htpl->parseCurrentBlock();
2441 if ($attr[
'onclick']) {
2442 $htpl->setCurrentBlock(
'onclick');
2443 $htpl->setVariable(
'PROP_ONCLICK', $attr[
'onclick']);
2444 $htpl->parseCurrentBlock();
2447 if ($attr[
'status_text']) {
2448 $htpl->setCurrentBlock(
'status');
2449 $htpl->setVariable(
'PROP_TXT', $attr[
'status_text']);
2450 $htpl->parseCurrentBlock();
2454 $htpl->setCurrentBlock(
'prop');
2455 if ($attr[
'href'] || $attr[
'onclick']) {
2456 $htpl->setVariable(
'TAG',
'a');
2458 $htpl->setVariable(
'TAG',
'span');
2460 $htpl->setVariable(
'PROP_ID',
$id);
2461 $htpl->setVariable(
'IMG_SRC', $attr[
'img']);
2462 if ($attr[
'href'] !=
'') {
2463 $htpl->setVariable(
'PROP_HREF',
' href="' . $attr[
'href'] .
'" ');
2466 if ($attr[
'tooltip']) {
2467 $htpl->setVariable(
'IMG_ADDITIONAL',
"alt=\"{$attr['tooltip']}\" title=\"{$attr['tooltip']}\"");
2469 $htpl->parseCurrentBlock();
2476 if (
sizeof($chunks)) {
2479 implode(
' ', $chunks) .
' '
2485 $dropdown_label =
'<span class="hidden-xs">' .
2486 $this->
lng->txt(
'actions') .
2488 $dropdown = $this->getCommandsDropdown($dropdown_label,
true);
2491 $this->
ui->renderer()->render($dropdown)
2494 if ($this->cust_modals !== []) {
2495 $htpl->setVariable(
'TRIGGERED_MODALS', $this->
ui->renderer()->render($this->cust_modals));
2498 return $htpl->get();
2509 $base_class = $this->request_wrapper->retrieve(
'baseClass', $this->
refinery->kindlyTo()->string());
2511 (strtolower($base_class) !=
'ilrepositorygui') &&
2512 is_int(strpos($link,
'baseClass=ilRepositoryGUI'))
2514 if ($this->type !=
'frm') {
2524 if ($this->default_command_params) {
2526 foreach ($this->default_command_params as $name => $value) {
2527 $params[] = $name .
'=' . $value;
2533 if (!stristr($default_link,
'?')) {
2534 $default_link = ($default_link .
'?' .
$params);
2536 $default_link = ($default_link .
'&' .
$params);
2539 return $default_link;
2547 if (strstr($link, ilSAHSPresentationGUI::class) ===
false) {
2548 return [$link, $target];
2552 $om = $sahs_obj->getOpenMode();
2553 $width = $sahs_obj->getWidth();
2554 $height = $sahs_obj->getHeight();
2555 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
2558 if ($om !== 0 && !$this->
http->agent()->isMobile()) {
2559 $this->default_command[
'frame'] =
'';
2561 'javascript:void(0); onclick=startSAHS(\'' .
2574 $target = "ilContObj" . $this->ref_id;
2576 return [$link, $target];
2579 public function insertPath(): void
2581 if ($this->getPathStatus() != false) {
2582 if (!$this->path_gui instanceof \ilPathGUI) {
2583 $path_gui = new \ilPathGUI();
2585 $path_gui = $this->path_gui;
2588 $path_gui->enableTextOnly(!$this->path_linked);
2589 $path_gui->setUseImages(false);
2591 $start_node = ROOT_FOLDER_ID;
2592 if ($this->path_start_node) {
2593 $start_node = $this->path_start_node;
2596 $this->tpl->setCurrentBlock('path_item
');
2597 $this->tpl->setVariable('PATH_ITEM
', $path_gui->getPath($start_node, $this->ref_id));
2598 $this->tpl->parseCurrentBlock();
2600 $this->tpl->setCurrentBlock('path
');
2601 $this->tpl->setVariable('TXT_LOCATION
', $this->lng->txt('locator'));
2602 $this->tpl->parseCurrentBlock();
2606 public function insertProgressInfo(): void
2610 public function insertIconsAndCheckboxes(): void
2613 if ($this->getCheckboxStatus()) {
2614 $this->tpl->setCurrentBlock('check');
2615 $this->tpl->setVariable('VAL_ID
', $this->getCommandId());
2616 $this->tpl->setVariable('CHECK_TITLE
', $this->lng->txt('select
') . ' ' . $this->getTitle());
2617 $this->tpl->parseCurrentBlock();
2619 } elseif ($this->getDownloadCheckboxState() != self::DOWNLOAD_CHECKBOX_NONE) {
2620 $this->tpl->setCurrentBlock('check_download
');
2621 $this->tpl->setVariable('CHECK_DOWNLOAD_TITLE
', $this->lng->txt('download
') . ' ' . $this->getTitle());
2622 if ($this->getDownloadCheckboxState() == self::DOWNLOAD_CHECKBOX_ENABLED) {
2623 $this->tpl->setVariable('VAL_ID
', $this->getCommandId());
2625 $this->tpl->setVariable('VAL_VISIBILITY
', 'visibility: hidden;
" disabled="disabled');
2627 $this->tpl->parseCurrentBlock();
2629 } elseif ($this->getExpandStatus()) {
2630 $this->tpl->setCurrentBlock('expand');
2632 if ($this->isExpanded()) {
2633 $this->ctrl->setParameter($this->container_obj, 'expand', -1 * $this->obj_id);
2634 // 'view
' added, see #19922
2635 $this->tpl->setVariable('EXP_HREF
', $this->ctrl->getLinkTarget($this->container_obj, 'view
', $this->getUniqueItemId(true)));
2636 $this->ctrl->clearParameters($this->container_obj);
2637 $this->tpl->setVariable('EXP_IMG
', ilUtil::getImagePath('nav/tree_exp.svg
'));
2638 $this->tpl->setVariable('EXP_ALT
', $this->lng->txt('collapse'));
2640 $this->ctrl->setParameter($this->container_obj, 'expand', $this->obj_id);
2641 // 'view
' added, see #19922
2642 $this->tpl->setVariable('EXP_HREF
', $this->ctrl->getLinkTarget($this->container_obj, 'view
', $this->getUniqueItemId(true)));
2643 $this->ctrl->clearParameters($this->container_obj);
2644 $this->tpl->setVariable('EXP_IMG
', ilUtil::getImagePath('nav/tree_col.svg
'));
2645 $this->tpl->setVariable('EXP_ALT
', $this->lng->txt('expand'));
2648 $this->tpl->parseCurrentBlock();
2652 if ($this->getIconStatus()) {
2654 $this->tpl->touchBlock('i_1
');
2657 $this->tpl->setCurrentBlock('icon
');
2658 $this->tpl->setVariable('ALT_ICON
', $this->buildTranslatedType());
2660 $this->tpl->setVariable(
2662 $this->getTypeIcon()
2664 $this->tpl->parseCurrentBlock();
2668 $this->tpl->touchBlock('d_
' . $cnt);
2674 public function getTypeIcon(): string
2676 return ilObject::getIconForReference(
2680 $this->getIconImageType()
2684 public function insertSubItems(): void
2686 foreach ($this->sub_item_html as $sub_html) {
2687 $this->tpl->setCurrentBlock('subitem
');
2688 $this->tpl->setVariable('SUBITEM
', $sub_html);
2689 $this->tpl->parseCurrentBlock();
2693 public function insertPositionField(): void
2695 if ($this->position_enabled) {
2696 $this->tpl->setCurrentBlock('position
');
2697 $this->tpl->setVariable('POS_ID
', $this->position_field_index);
2698 $this->tpl->setVariable('POS_VAL
', $this->position_value);
2699 $this->tpl->parseCurrentBlock();
2707 public function adminCommandsIncluded(): bool
2709 return $this->adm_commands_included;
2715 public function getListItemHTML(
2721 // this variable stores whether any admin commands
2722 // are included in the output
2723 $this->adm_commands_included = false;
2725 // only for performance exploration
2726 $type = ilObject::_lookupType($obj_id);
2728 $this->initItem($ref_id, $obj_id, $type, $title, $description);
2730 if ($this->rating_enabled) {
2731 if (ilRating::hasRatingInListGUI($this->obj_id, $this->type)) {
2732 $may_rate = $this->checkCommandAccess('read
', '', $this->ref_id, $this->type);
2733 $rating = new ilRatingGUI();
2734 $rating->setObject($this->obj_id, $this->type);
2735 $this->addCustomProperty(
2737 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
2745 if (!$this->checkCommandAccess('visible
', '', $ref_id, '', $obj_id)) {
2746 $this->resetCustomData();
2751 if ($type == 'file
' and ilObjFileAccess::_isFileHidden($title)) {
2752 $this->resetCustomData();
2757 $this->tpl = new ilTemplate(
2758 static::$tpl_file_name,
2761 static::$tpl_component,
2767 if ($this->getCommandsStatus()) {
2768 if (!$this->getSeparateCommands()) {
2769 $dropdown = $this->getCommandsDropdown($title);
2770 $this->tpl->setVariable(
2771 'COMMAND_SELECTION_LIST
',
2772 $this->ui->renderer()->render($dropdown)
2777 if ($this->getProgressInfoStatus()) {
2778 $this->insertProgressInfo();
2781 // insert title and describtion
2782 $this->insertTitle();
2783 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2784 if ($this->getDescriptionStatus()) {
2785 $this->insertDescription();
2789 if ($this->getSearchFragmentStatus()) {
2790 $this->insertSearchFragment();
2794 if ($this->getPropertiesStatus()) {
2795 $this->insertProperties();
2798 // notice properties
2799 if ($this->getNoticePropertiesStatus()) {
2800 $this->insertNoticeProperties();
2804 if ($this->getPreconditionsStatus()) {
2805 $this->insertPreconditions();
2809 $this->insertPath();
2811 if ($this->getItemDetailLinkStatus()) {
2812 $this->insertItemDetailLinks();
2815 // icons and checkboxes
2816 $this->insertIconsAndCheckboxes();
2818 // input field for position
2819 $this->insertPositionField();
2822 $this->insertSubItems();
2824 $this->resetCustomData();
2826 $this->tpl->setVariable('DIV_CLASS
', 'ilContainerListItemOuter
');
2827 $this->tpl->setVariable(
2829 'data-list-item-
id=
"' . $this->getUniqueItemId(true) . '" id =
"' . $this->getUniqueItemId(true) . '"'
2831 $this->tpl->setVariable('ADDITIONAL
', $this->getAdditionalInformation());
2833 if (is_object($this->getContainerObject())) {
2834 // #11554 - make sure that internal ids are reset
2835 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id
', '');
2838 // if file upload is enabled the content is wrapped by a UI dropzone.
2839 $content = $this->tpl->get();
2840 $file_upload_dropzone = new ilObjFileUploadDropzone($this->ref_id, $content);
2841 if ($this->context === self::CONTEXT_REPOSITORY
2842 && ($this->requested_cmd === "view" || $this->requested_cmd === "" || $this->requested_cmd === "render")
2843 && $file_upload_dropzone->isUploadAllowed($this->type)
2844 && !(new ModeSessionRepository())->isAdminMode()
2846 return $file_upload_dropzone->getDropzoneHtml();
2855 protected function resetCustomData(): void
2858 $this->cust_prop = [];
2859 $this->cust_commands = [];
2860 $this->cust_modals = [];
2861 $this->sub_item_html = [];
2862 $this->position_enabled = false;
2868 public function setParentRefId(int $ref_id): void
2870 $this->parent_ref_id = $ref_id;
2879 public function getUniqueItemId(bool $as_div = false): string
2881 // use correct id for references
2882 $id_ref = $this->ref_id;
2883 if ($this->reference_ref_id > 0) {
2884 $id_ref = $this->reference_ref_id;
2887 // add unique identifier for preconditions (objects can appear twice in same container)
2888 if ($this->condition_depth) {
2889 $id_ref .= '_pc
' . $this->condition_depth;
2893 $id_ref .= '_pref_
' . $this->parent_ref_id;
2898 // action menu [yellow] toggle
2899 return 'lg_div_
' . $id_ref;
2906 public function getCommandsHTML(string $title = ''): string
2908 return $this->ui->renderer()->render($this->getCommandsDropdown($title, false));
2911 private function getCommandsDropdown(string $title, bool $for_header = false): StandardDropdown
2913 $this->populateCommands($for_header);
2914 return $this->ui->factory()
2916 ->standard($this->current_actions)
2917 ->withAriaLabel(sprintf(
2918 $this->lng->txt('actions_for
'),
2919 htmlspecialchars(addslashes($title))
2926 public function isSideBlock(): bool
2931 public function setBoldTitle(bool $bold_title): void
2933 $this->bold_title = $bold_title;
2936 public function isTitleBold(): bool
2938 return $this->bold_title;
2941 public static function preloadCommonProperties(array $obj_ids, int $context): void
2944 $lng = $DIC->language();
2945 $ilSetting = $DIC->settings();
2946 $ilUser = $DIC->user();
2947 $notes_manager = $DIC->notes()->internal()->domain()->notes();
2949 if ($context == self::CONTEXT_REPOSITORY) {
2950 $active_notes = !$ilSetting->get('disable_notes
');
2951 $active_comments = !$ilSetting->get('disable_comments
');
2953 if ($active_comments) {
2954 // needed for action
2955 self::$comments_activation = $DIC->notes()
2958 ->notes()->commentsActiveMultiple($obj_ids);
2961 // properties are optional
2962 if ($ilSetting->get('comments_tagging_in_lists
')) {
2963 if ($active_notes || $active_comments) {
2964 // @todo: should be refactored, see comment in notes db repo
2965 self::$cnt_notes = $notes_manager->countNotesAndCommentsMultipleObjects(
2970 $lng->loadLanguageModule('notes
');
2973 $tags_set = new ilSetting('tags
');
2974 if ($tags_set->get('enable
')) {
2975 $all_users = (bool) $tags_set->get('enable_all_users
');
2977 if (!$ilSetting->get('comments_tagging_in_lists_tags
')) {
2978 self::$cnt_tags = ilTagging::_countTags($obj_ids, $all_users);
2980 $tag_user_id = null;
2982 $tag_user_id = $ilUser->getId();
2984 self::$tags = ilTagging::_getListTagsForObjects($obj_ids, $tag_user_id);
2987 $lng->loadLanguageModule('tagging
');
2991 $lng->loadLanguageModule('rating
');
2994 self::$preload_done = true;
3000 protected function isCommentsActivated(
3004 bool $header_actions,
3005 bool $check_write_access = true
3007 if ($this->comments_enabled) {
3008 if (!$this->comments_settings_enabled) {
3011 if ($check_write_access && $this->checkCommandAccess('write
', '', $ref_id, $type)) {
3014 // fallback to single object check if no preloaded data
3015 // only the repository does preloadCommonProperties() yet
3016 if (!$header_actions && self::$preload_done) {
3017 if (isset(self::$comments_activation[$obj_id]) &&
3018 self::$comments_activation[$obj_id]) {
3021 } elseif ($this->notes_service->domain()->commentsActive($obj_id)) {
3031 public function enableTimings(bool $status): void
3033 $this->timings_enabled = $status;
3039 public function getAsListItem(
3048 // even b tag produced bugs, see #32304
3049 $description = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
3061 $this->enableCommands(true);
3064 $this->populateCommands(false);
3066 $dropdown = $this->getCommandsDropdown($title);
3067 $def_command = $this->getDefaultCommand();
3069 if ($def_command['link'] ?? false) {
3070 list($def_command['link'], $def_command['frame
']) =
3071 $this->modifySAHSlaunch($def_command['link'], $def_command['frame
']);
3072 $new_viewport = !in_array($def_command['frame
'], ['', '_top
', '_self
', '_parent
'], true);
3073 $link = $this->ui->factory()
3075 ->standard($this->getTitle(), $def_command['link'])
3076 ->withOpenInNewViewport($new_viewport);
3077 $list_item = $ui->factory()->item()->standard($link);
3079 $list_item = $ui->factory()->item()->standard($this->getTitle());
3082 if ($description != '') {
3083 $list_item = $list_item->withDescription($description);
3085 $list_item = $list_item->withActions($dropdown)->withLeadIcon(
3086 $this->ui->factory()->symbol()->icon()->custom(
3087 $this->getTypeIcon(),
3088 $this->buildTranslatedType(),
3095 $this->enableComments(true);
3096 $this->enableNotes(true);
3097 $this->enableTags(true);
3098 $this->enableRating(true);
3100 foreach ($this->determineProperties() as $p) {
3101 //if ($p['property'] !== $this->lng->txt('learning_progress
')) {
3102 $l[(string) $p['property']] = (string) $p['value
'];
3105 if (count($l) > 0) {
3106 $list_item = $list_item->withProperties($l);
3115 public function getAsCard(
3121 ): ?RepositoryObject {
3124 $title = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($title);
3125 // even b tag produced bugs, see #32304
3126 $description = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
3138 $user = $this->user;
3139 $access = $this->access;
3141 $this->enableCommands(true);
3144 if ($description !== '') {
3145 $sections[] = $ui->factory()->legacy()->content('<div
class=
"il-multi-line-cap-3">
' . $description . '</div>
');
3148 $this->populateCommands(false);
3150 $def_command = $this->getDefaultCommand();
3152 $dropdown = $this->getCommandsDropdown($title);
3154 // workaround for #26205
3155 // we should get rid of _top links completely and gifure our how
3156 // to manage scorm links better
3157 $def_cmd_frame = ($def_command['frame
'] ?? '');
3158 if ($def_cmd_frame === '_top
') {
3159 $def_cmd_frame = '';
3161 $def_cmd_link = ($def_command['link'] ?? '');
3163 // workaround for scorm
3164 list($modified_link, $def_cmd_frame) =
3165 $this->modifySAHSlaunch($def_cmd_link, $def_cmd_frame);
3167 $image = $this->getTileImage();
3169 if ($def_cmd_link != '') { // #24256
3170 if ($def_cmd_frame !== '' && ($modified_link === $def_cmd_link)) {
3171 $signal = (new SignalGenerator())->create();
3172 $this->main_tpl->addOnLoadCode(
3173 "$(document).on('{$signal->getId()}
', function(event, signalData) {"
3174 . ' window.open(
"' . str_replace(
3178 ) . '",
"' . $def_cmd_frame . '");
'
3182 $image = $image->withAction($signal);
3185 $ui->factory()->button()->shy($title, '')->appendOnClick($signal);
3186 $title = $ui->renderer()->render($button);
3188 $image = $image->withAction($modified_link);
3192 if ($type == 'sess
') {
3194 $title = ':
' . $title;
3196 $app_info = ilSessionAppointment::_lookupAppointment($obj_id);
3197 $title = ilSessionAppointment::_appointmentToString(
3200 (bool) $app_info['fullday
']
3204 $icon = $this->ui->factory()->symbol()->icon()->custom(
3205 $this->getTypeIcon(),
3206 $this->buildTranslatedType(),
3210 // card title action
3211 $card_title_action = '';
3212 if ($def_cmd_link != '' && ($def_cmd_frame == '' || $modified_link != $def_cmd_link)) { // #24256
3213 $card_title_action = $modified_link;
3214 } elseif ($def_cmd_link == '' &&
3215 $this->getInfoScreenStatus() &&
3216 $access->checkAccessOfUser(
3222 $card_title_action = ilLink::_getLink($ref_id);
3223 if ($image->getAction() == '') {
3224 $image = $image->withAction($card_title_action);
3228 $card = $ui->factory()->card()->repositoryObject(
3229 $title . '<span data-list-item-
id=
"' . $this->getUniqueItemId(true) . '"></span>
',
3237 if ($card_title_action != '') {
3238 $card = $card->withTitleAction($card_title_action);
3242 foreach ($this->determineProperties() as $p) {
3243 if (isset($p['alert
']) && $p['alert
'] == true
3244 && isset($p['property']) && $p['property'] !== $this->lng->txt('learning_progress
')) {
3245 $l[(string) $p['property']] = (string) $p['value
'];
3248 if (count($l) > 0) {
3249 $prop_list = $ui->factory()->listing()->descriptive($l);
3250 $sections[] = $prop_list;
3252 if (count($sections) > 0) {
3253 $card = $card->withSections($sections);
3256 $lp = ilLPStatus::getListGUIStatus($obj_id, false);
3257 if (is_array($lp) && array_key_exists('status
', $lp)) {
3258 $percentage = (int) ilLPStatus::_lookupPercentage($obj_id, $this->user->getId());
3259 if ($lp['status
'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
3263 $card = $card->withProgress(
3267 ->mini(100, $percentage)
3274 public function checkInfoPageOnAsynchronousRendering(): bool
3279 private function getTileImage(): Image
3281 return $this->object_properties->getPropertyTileImage()
3282 ->getTileImage()->getImage($this->ui->factory()->image());
3288 public function insertLPCommand(): void
3290 if ($this->std_cmd_only || !$this->lp_cmd_enabled) {
3293 $relevant = ilLPStatus::hasListGUIStatus($this->obj_id);
3295 $cmd_link = $this->getCommandLink('learningProgress
');
3296 $this->insertCommand(
3298 $this->lng->txt('learning_progress
')
3306 private function insertLPSettingsCommand(): void
3308 if (!$this->lp_settings_cmd_enabled
3309 || !ilObjUserTracking::_enabledLearningProgress()
3310 || ilObjectLP::getTypeClass($this->type) === ''
3311 || ! $this->checkCommandAccess('edit_learning_progress
', '', $this->ref_id, $this->type)
3317 $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, 'ref_id
', $this->ref_id);
3318 switch ($this->type) {
3320 switch (ilObjSAHSLearningModule::_lookupSubType($this->obj_id)) {
3322 $scorm_class = ilObjSCORM2004LearningModuleGUI::class;
3325 $scorm_class = ilObjSCORMLearningModuleGUI::class;
3332 $cmd_link = $this->ctrl->getLinkTargetByClass([
3333 ilSAHSEditGUI::class,
3335 ilLearningProgressGUI::class,
3336 ilLPListOfSettingsGUI::class
3341 $cmd_link = $this->ctrl->getLinkTargetByClass([
3342 ilLMEditorGUI::class,
3343 ilObjLearningModuleGUI::class,
3344 ilLearningProgressGUI::class,
3345 ilLPListOfSettingsGUI::class
3350 $cmd_link = $this->ctrl->getLinkTargetByClass([
3351 ilObjLearningSequenceGUI::class,
3352 ilLearningProgressGUI::class,
3353 ilLPListOfSettingsGUI::class
3366 $gui_class = 'ilObj
' . $this->obj_definition->getClassName($this->type) . 'GUI
';
3367 $cmd_link = $this->ctrl->getLinkTargetByClass([
3368 ilRepositoryGUI::class,
3370 ilLearningProgressGUI::class,
3371 ilLPListOfSettingsGUI::class
3383 $this->ctrl->setParameterByClass('ilrepositorygui
', 'ref_id
', $this->requested_ref_id);
3384 if ($cmd_link !== '') {
3385 $this->insertCommand(
3387 $this->lng->txt('listaction_learning_progress_settings
')
3392 private function buildTranslatedType(): string
3394 if ($this->obj_definition->isPlugin($this->getIconImageType())) {
3395 return ilObjectPlugin::lookupTxtById($this->getIconImageType(), 'obj_
' . $this->getIconImageType());
3398 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.)
getHeaderGlyphShyButton(ILIAS\UI\Component\Symbol\Glyph\Glyph $glyph, string $onclick_js)
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="")
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
withSymbol(Symbol $symbol)
@inheritDoc
button(string $caption, string $cmd)
link(string $caption, string $href, bool $new_viewport=false)
withAdditionalOnLoadCode(Closure $binder)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))
catch(InvalidArgumentException) if(!ilDAVActivationChecker::_isActive()) $webdav_dic