19declare(strict_types=1);
69 protected static array
$tags = [];
202 $this->
access = $DIC[
'ilAccess'];
203 $this->
user = $DIC[
'user']->getLoggedInUser();
204 $this->object_dic = LocalDIC::dic();
205 $this->obj_definition =
$DIC[
'objDefinition'];
206 $this->tree =
$DIC[
'tree'];
207 $this->
settings = $DIC[
'ilSetting'];
208 $this->
http = $DIC->http();
209 $this->
ui = $DIC->ui();
210 $this->main_tpl =
$DIC[
'tpl'];
211 $this->rbacsystem =
$DIC[
'rbacsystem'];
212 $this->
ctrl = $DIC[
'ilCtrl'];
213 $this->
lng = $DIC[
'lng'];
215 $this->path_enabled =
false;
217 $this->request_wrapper =
$DIC->http()->wrapper()->query();
232 $this->
lng->loadLanguageModule(
'obj');
233 $this->
lng->loadLanguageModule(
'rep');
234 $params = $DIC->http()->request()->getQueryParams();
235 $this->requested_ref_id = (
int) (
$params[
'ref_id'] ??
null);
236 $this->requested_cmd = (string) (
$params[
'cmd'] ??
null);
237 $this->requested_base_class = (string) (
$params[
'baseClass'] ??
null);
238 $this->clipboard =
$DIC
243 $this->notes_service =
$DIC->notes();
265 $this->static_link_enabled =
true;
266 $this->delete_enabled =
true;
267 $this->cut_enabled =
true;
268 $this->subscribe_enabled =
true;
269 $this->link_enabled =
false;
270 $this->copy_enabled =
false;
271 $this->progress_enabled =
false;
272 $this->notice_properties_enabled =
true;
273 $this->info_screen_enabled =
false;
275 $this->gui_class_name =
'';
283 $this->properties_enabled = $status;
293 $this->preconditions_enabled = $status;
303 $this->notice_properties_enabled = $status;
313 $this->description_enabled = $status;
323 $this->search_fragment_enabled = $status;
333 $this->path_linked = $status;
338 $this->relevance = $rel;
348 $this->icons_enabled = $status;
358 $this->checkboxes_enabled = $status;
368 $this->expand_enabled = $status;
378 $this->is_expanded = $status;
391 $this->position_enabled =
true;
392 $this->position_field_index = $field_index;
398 $this->delete_enabled = $status;
408 $this->cut_enabled = $status;
418 $this->copy_enabled = $status;
428 $this->subscribe_enabled = $status;
438 $this->link_enabled = $status;
448 $this->path_enabled =
$path;
449 $this->path_start_node = $start_node;
460 $this->commands_enabled = $status;
461 $this->std_cmd_only = $std_only;
471 $this->info_screen_enabled = $info_screen;
481 $this->lp_cmd_enabled = $enabled;
486 $this->lp_settings_cmd_enabled = $enabled;
496 $this->sub_item_html[] = $html;
501 $this->progress_enabled = $status;
511 $this->substitutions_enabled = $status;
525 $this->item_detail_links_enabled = $status;
543 $this->item_detail_links = $detail_links;
544 $this->item_detail_links_intro = $intro_txt;
549 if (!count($this->item_detail_links)) {
552 if (strlen($this->item_detail_links_intro)) {
553 $this->tpl->setCurrentBlock(
'item_detail_intro');
554 $this->tpl->setVariable(
'ITEM_DETAIL_INTRO_TXT', $this->item_detail_links_intro);
555 $this->tpl->parseCurrentBlock();
558 foreach ($this->item_detail_links as
$info) {
559 $this->tpl->setCurrentBlock(
'item_detail_link');
560 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_TARGET',
$info[
'target']);
561 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_DESC',
$info[
'desc']);
562 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_HREF',
$info[
'link']);
563 $this->tpl->setVariable(
'ITEM_DETAIL_LINK_NAME',
$info[
'name']);
564 $this->tpl->parseCurrentBlock();
566 $this->tpl->setCurrentBlock(
'item_detail_links');
567 $this->tpl->parseCurrentBlock();
571 $this->title = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform(
586 $this->description = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform(
604 $this->search_fragment =
$text;
614 $this->separate_commands = $val;
634 $this->additional_information = $val;
649 $this->details_level = $level;
662 $this->repository_transfer_enabled = $value;
670 $this->restrict_to_goto = $value;
690 $cache_prefix =
null;
691 if ($this->context == self::CONTEXT_WORKSPACE || $this->context == self::CONTEXT_WORKSPACE_SHARING) {
692 $cache_prefix =
'wsp';
693 if (!isset($this->ws_access)) {
698 if (isset($this->access_cache[$permission][
'-' . $cmd][$cache_prefix .
$ref_id])) {
699 return $this->access_cache[$permission][
'-' . $cmd][$cache_prefix .
$ref_id];
702 if ($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SEARCH) {
704 if ($this->
access->getPreventCachingLastResult()) {
705 $this->prevent_access_caching =
true;
711 $this->access_cache[$permission][
'-' . $cmd][$cache_prefix .
$ref_id] =
$access;
723 string $description =
''
725 $this->access_cache = [];
727 $this->obj_id = $obj_id;
728 $this->object_properties = $this->object_dic[
'properties.aggregator']->getFor($obj_id);
729 $this->setTitle($title);
730 $this->setDescription($description);
733 $this->adm_commands_included =
false;
734 $this->prevent_access_caching =
false;
737 if ($this->context == self::CONTEXT_REPOSITORY) {
747 $this->condition_target = [
750 'target_type' => $target_type
756 $this->condition_target = [];
761 $this->title_link_disabled = $status;
766 $this->default_command_params =
$params;
776 if ($this->static_link_enabled and !$this->default_command_params) {
778 $command[
'link'] = $link;
779 $command[
'frame'] =
'_top';
782 if ($this->default_command_params) {
784 foreach ($this->default_command_params as $name => $value) {
785 $params[] = $name .
'=' . $value;
789 if (!stristr($command[
'link'],
'?')) {
790 $command[
'link'] .=
'?' .
$params;
792 $command[
'link'] .=
'&' .
$params;
806 public function getCommandLink(
string $cmd): string
808 if ($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SEARCH) {
812 $webdav =
$DIC[ILIAS\WebDAV\Environment::class];
813 if ($cmd ==
'mount_webfolder' && $webdav->isActive()) {
814 return $webdav->getUriToMountInstructionModalByRef($this->ref_id);
818 $this->
ctrl->setParameterByClass(
'ilrepositorygui',
'ref_id', $this->getCommandId());
819 $cmd_link = $this->
ctrl->getLinkTargetByClass(
'ilrepositorygui', $cmd);
820 $this->
ctrl->setParameterByClass(
'ilrepositorygui',
'ref_id', $this->requested_ref_id);
824 $this->
ctrl->setParameterByClass($this->gui_class_name,
'ref_id',
'');
825 $this->
ctrl->setParameterByClass($this->gui_class_name,
'wsp_id', $this->ref_id);
826 return $this->
ctrl->getLinkTargetByClass($this->gui_class_name, $cmd);
871 if ($this->context == self::CONTEXT_REPOSITORY) {
877 'property' => $this->
lng->txt(
'status'),
878 'value' => $this->
lng->txt(
'offline')
887 string $property =
'',
890 bool $newline =
false
892 $this->cust_prop[] = [
893 'property' => $property,
896 'newline' => $newline
902 if (is_array($this->cust_prop)) {
903 foreach ($this->cust_prop as $property) {
913 foreach ($this->getProperties() as $prop) {
914 if (isset($prop[
'alert']) && $prop[
'alert'] ==
true) {
923 $this->notice_prop = [];
924 if ($infos = $this->ldap_mapping->getInfoStrings($this->obj_id,
true)) {
925 foreach ($infos as
$info) {
926 $this->notice_prop[] = [
'value' =>
$info];
929 return $this->notice_prop;
932 public function addCustomCommand(
string $link,
string $lang_var,
string $frame =
'',
string $onclick =
''): void
934 $this->cust_commands[] = [
936 'lang_var' => $lang_var,
938 'onclick' => $onclick
944 ?
Modal $triggeredModal =
null
946 $this->cust_commands[] = $button;
947 if ($triggeredModal !==
null) {
948 $this->cust_modals[] = $triggeredModal;
954 $this->force_visible_only = $stat;
959 return $this->force_visible_only;
988 foreach ($this->commands as $command) {
989 $permission = $command[
'permission'];
990 $cmd = $command[
'cmd'];
991 $lang_var = $command[
'lang_var'] ??
'';
997 $access_granted =
false;
999 if (isset($command[
'txt'])) {
1000 $txt = $command[
'txt'];
1006 (isset($command[
'enable_anonymous']) && $command[
'enable_anonymous'] ==
'false')
1014 $access = $this->checkCommandAccess($permission, $cmd, $this->ref_id, $this->type);
1017 $access_granted =
true;
1018 $cmd_link = $this->getCommandLink($command[
'cmd']);
1019 $cmd_frame = $this->getCommandFrame($command[
'cmd']);
1020 $cmd_image = $this->getCommandImage($command[
'cmd']);
1022 $info_object = $this->
access->getInfo();
1025 if (!isset($command[
'default'])) {
1026 $command[
'default'] =
'';
1029 'permission' => $permission,
1031 'link' => $cmd_link,
1032 'frame' => $cmd_frame,
1033 'lang_var' => $lang_var,
1035 'granted' => $access_granted,
1036 'access_info' => $info_object,
1037 'img' => $cmd_image,
1038 'default' => $command[
'default']
1042 return $ref_commands;
1059 if ($this->restrict_to_goto) {
1060 $this->default_command = [
1062 'link' => $this->buildGotoLink()
1067 !$this->default_command ||
1068 (!$this->getCommandsStatus() && !$this->restrict_to_goto) ||
1069 $this->title_link_disabled
1072 $this->tpl->setCurrentBlock(
'item_title');
1073 $this->tpl->setVariable(
'TXT_TITLE', $this->
getTitle());
1075 $this->default_command[
'link'] = $this->modifyTitleLink($this->default_command[
'link']);
1077 list($this->default_command[
'link'], $this->default_command[
'frame']) =
1078 $this->modifySAHSlaunch($this->default_command[
'link'], $this->default_command[
'frame']);
1080 if ($this->default_command[
'frame'] !=
'') {
1081 $this->tpl->setCurrentBlock(
'title_linked_frame');
1082 $this->tpl->setVariable(
'TARGET_TITLE_LINKED', $this->default_command[
'frame']);
1083 $this->tpl->parseCurrentBlock();
1087 $this->default_command[
'link'] = $this->appendRepositoryFrameParameter($this->default_command[
'link']);
1090 $this->tpl->setCurrentBlock(
'item_title_linked');
1091 $this->tpl->setVariable(
'TXT_TITLE_LINKED', $this->
getTitle());
1092 $this->tpl->setVariable(
'HREF_TITLE_LINKED', $this->default_command[
'link']);
1095 if ($this->type ===
'file') {
1097 if ($preview->has()) {
1098 $this->tpl->setVariable(
'PREVIEW_GLYPH', $preview->getRenderedTriggerComponents());
1099 $this->tpl->parseCurrentBlock();
1103 $this->tpl->parseCurrentBlock();
1105 if ($this->bold_title ==
true) {
1106 $this->tpl->touchBlock(
'bold_title_start');
1107 $this->tpl->touchBlock(
'bold_title_end');
1113 switch ($this->context) {
1114 case self::CONTEXT_WORKSPACE_SHARING:
1126 $fields_shown =
false;
1127 foreach ($this->substitutions->getParsedSubstitutions($this->ref_id, $this->obj_id) as
$data) {
1128 if (
$data[
'bold']) {
1129 $data[
'name'] =
'<strong>' .
$data[
'name'] .
'</strong>';
1130 $data[
'value'] =
'<strong>' .
$data[
'value'] .
'</strong>';
1132 $this->tpl->touchBlock(
'std_prop');
1133 $this->tpl->setCurrentBlock(
'item_property');
1134 if (
$data[
'show_field']) {
1135 $this->tpl->setVariable(
'TXT_PROP',
$data[
'name']);
1137 $this->tpl->setVariable(
'VAL_PROP',
$data[
'value']);
1138 $this->tpl->parseCurrentBlock();
1140 if (
$data[
'newline']) {
1141 $this->tpl->touchBlock(
'newline_prop');
1143 $fields_shown =
false;
1149 if ($this->getSubstitutionStatus()) {
1150 $this->insertSubstitutions();
1151 if (!$this->substitutions->isDescriptionEnabled()) {
1156 $this->tpl->setCurrentBlock(
'item_description');
1157 $this->tpl->setVariable(
'TXT_DESC', $this->getDescription());
1158 $this->tpl->parseCurrentBlock();
1166 if (strlen($this->getSearchFragment())) {
1167 $this->tpl->setCurrentBlock(
'search_fragment');
1168 $this->tpl->setVariable(
'TXT_SEARCH_FRAGMENT', $this->getSearchFragment() .
' ...');
1169 $this->tpl->parseCurrentBlock();
1180 $this->mode = $mode;
1198 $this->condition_depth = $depth;
1209 return $mode === $this->mode;
1214 $props = $this->getCustomProperties(
1215 $this->getProperties()
1218 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1224 'property' => $this->
lng->txt(
'learning_progress'),
1233 if (!$this->
access->checkAccess(
'read',
'', $this->ref_id, $this->type, $this->obj_id)) {
1236 'value' => $this->
lng->txt(
'no_access_item_public'),
1245 $note_obj_id = $this->obj_id;
1246 if ($this->reference_ref_id) {
1247 $note_ref_id = $this->reference_ref_id;
1248 $note_obj_id = $this->reference_obj_id;
1250 $redraw_js =
'il.Object.redrawListItem(' . $note_ref_id .
');';
1256 isset(self::$cnt_notes[$note_obj_id][Note::PRIVATE]) &&
1257 self::$cnt_notes[$note_obj_id][Note::PRIVATE] > 0
1259 isset(self::$cnt_notes[$note_obj_id][Note::PUBLIC]) &&
1260 self::$cnt_notes[$note_obj_id][Note::PUBLIC] > 0
1262 isset(self::$cnt_tags[$note_obj_id]) && self::$cnt_tags[$note_obj_id] > 0
1264 isset(self::$tags[$note_obj_id]) && is_array(self::$tags[$note_obj_id])
1269 $cnt_comments = self::$cnt_notes[$note_obj_id][Note::PUBLIC] ?? 0;
1270 if ($this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id,
false,
false)
1271 && $cnt_comments > 0) {
1274 'property' => $this->
lng->txt(
'notes_comments'),
1276 '<a href="#" onclick="return ' .
1278 self::$cnt_notes[$note_obj_id][Note::PUBLIC] .
'</a>',
1284 $cnt_notes = self::$cnt_notes[$note_obj_id][Note::PRIVATE] ?? 0;
1285 if ($this->notes_enabled && $cnt_notes > 0) {
1288 'property' => $this->
lng->txt(
'notes'),
1290 '<a href="#" onclick="return ' .
1292 self::$cnt_notes[$note_obj_id][Note::PRIVATE] .
'</a>',
1297 $cnt_tags = self::$cnt_tags[$note_obj_id] ?? 0;
1298 if ($this->tags_enabled && ($cnt_tags > 0 || isset(self::$tags[$note_obj_id]))) {
1300 if ($tags_set->get(
'enable')) {
1304 if (isset(self::$tags[$note_obj_id])) {
1306 foreach (self::$tags[$note_obj_id] as $tag => $is_tag_owner) {
1307 if ($is_tag_owner) {
1308 $tags_tmp[] =
'<a class="ilTag ilTagRelHigh" href="#" onclick="return ' .
1309 $tags_url .
'">' . $tag .
'</a>';
1311 $tags_tmp[] =
'<span class="ilTag ilTagRelMiddle">' . $tag .
'</span>';
1314 $tags_value = implode(
' ', $tags_tmp);
1319 $tags_value =
'<a href="#" onclick="return ' . $tags_url .
'">' .
1320 self::$cnt_tags[$note_obj_id] .
'</a>';
1321 $prop_text = $this->
lng->txt(
'tagging_tags');
1325 'property' => $prop_text,
1326 'value' => $tags_value,
1333 if (!isset($props)) {
1342 $props = $this->determineProperties();
1344 if (is_array($props) && count($props) > 0) {
1345 foreach ($props as $prop) {
1347 $this->tpl->touchBlock(
'separator_prop');
1350 if (isset($prop[
'alert']) && $prop[
'alert'] ==
true) {
1351 $this->tpl->touchBlock(
'alert_prop');
1353 $this->tpl->touchBlock(
'std_prop');
1356 if (isset($prop[
'newline']) && $prop[
'newline'] ==
true && $cnt > 1) {
1357 $this->tpl->touchBlock(
'newline_prop');
1362 isset($prop[
'property']) &&
1363 (($prop[
'propertyNameVisible'] ??
null) !==
false) &&
1364 $prop[
'property'] !=
''
1367 $this->tpl->setCurrentBlock(
'prop_name');
1368 $this->tpl->setVariable(
'TXT_PROP', $prop[
'property']);
1369 $this->tpl->parseCurrentBlock();
1372 $this->tpl->setCurrentBlock(
'item_property');
1374 if (isset($prop[
'link']) && $prop[
'link']) {
1375 $this->tpl->setVariable(
'LINK_PROP', $prop[
'link']);
1376 $this->tpl->setVariable(
'LINK_VAL_PROP', $prop[
'value']);
1378 $this->tpl->setVariable(
'VAL_PROP', $prop[
'value']);
1381 $this->tpl->parseCurrentBlock();
1385 $this->tpl->setCurrentBlock(
'item_properties');
1386 $this->tpl->parseCurrentBlock();
1392 $this->getNoticeProperties();
1393 foreach ($this->notice_prop as $property) {
1394 $this->tpl->setCurrentBlock(
'notice_item');
1395 $this->tpl->setVariable(
'NOTICE_ITEM_VALUE', $property[
'value']);
1396 $this->tpl->parseCurrentBlock();
1398 $this->tpl->setCurrentBlock(
'notice_property');
1399 $this->tpl->parseCurrentBlock();
1402 protected function parseConditions(
int $toggle_id, array $conditions,
bool $obligatory =
true): bool
1405 $num_optional_required =
1407 count($conditions) +
1412 $visible_conditions = [];
1413 $passed_optional = 0;
1414 foreach ($conditions as $condition) {
1415 if ($obligatory && !$condition[
'obligatory']) {
1418 if (!$obligatory && $condition[
'obligatory']) {
1422 if ($this->tree->isDeleted($condition[
'trigger_ref_id'])) {
1429 $visible_conditions[] = $condition[
'id'];
1432 if (!$obligatory && $ok) {
1435 if ($passed_optional >= $num_optional_required) {
1441 $missing_cond_exist =
false;
1442 foreach ($conditions as $condition) {
1443 if (!in_array($condition[
'id'], $visible_conditions)) {
1450 $class = $this->obj_definition->getClassName($condition[
'trigger_type']);
1451 $location = $this->obj_definition->getLocation($condition[
'trigger_type']);
1455 $missing_cond_exist =
true;
1457 $full_class =
'ilObj' . $class .
'ListGUI';
1458 $item_list_gui =
new $full_class($this->context);
1459 $item_list_gui->setMode(self::IL_LIST_AS_TRIGGER);
1460 $item_list_gui->enablePath(
false);
1461 $item_list_gui->enableIcon(
true);
1462 $item_list_gui->setConditionDepth($this->condition_depth + 1);
1463 $item_list_gui->setParentRefId($this->ref_id);
1464 $item_list_gui->addCustomProperty($this->
lng->txt(
'precondition_required_itemlist'), $cond_txt,
false,
true);
1465 $item_list_gui->enableCommands($this->commands_enabled, $this->std_cmd_only);
1466 $item_list_gui->enableProperties($this->properties_enabled);
1468 $trigger_html = $item_list_gui->getListItemHTML(
1469 $condition[
'trigger_ref_id'],
1470 $condition[
'trigger_obj_id'],
1474 $this->tpl->setCurrentBlock(
'precondition');
1475 if ($trigger_html ==
'') {
1476 $trigger_html = $this->
lng->txt(
'precondition_not_accessible');
1478 $this->tpl->setVariable(
'TXT_CONDITION', trim($cond_txt));
1479 $this->tpl->setVariable(
'TRIGGER_ITEM', $trigger_html);
1480 $this->tpl->parseCurrentBlock();
1483 if ($missing_cond_exist && $obligatory) {
1484 $this->tpl->setCurrentBlock(
'preconditions');
1485 $this->tpl->setVariable(
'CONDITION_TOGGLE_ID',
'_obl_' . $toggle_id);
1486 $this->tpl->setVariable(
'TXT_PRECONDITIONS', $this->
lng->txt(
'preconditions_obligatory_hint'));
1487 $this->tpl->parseCurrentBlock();
1488 } elseif ($missing_cond_exist && !$obligatory) {
1489 $this->tpl->setCurrentBlock(
'preconditions');
1490 $this->tpl->setVariable(
'CONDITION_TOGGLE_ID',
'_opt_' . $toggle_id);
1491 $this->tpl->setVariable(
1492 'TXT_PRECONDITIONS',
1494 $this->
lng->txt(
'preconditions_optional_hint'),
1495 $num_optional_required - $passed_optional
1498 $this->tpl->parseCurrentBlock();
1501 return !$missing_cond_exist;
1510 if ($this->condition_depth > 0) {
1514 if ($this->context == self::CONTEXT_WORKSPACE) {
1518 if (isset($this->condition_target) && is_array($this->condition_target)
1519 && count($this->condition_target) > 0) {
1520 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget(
1521 (
int) $this->condition_target[
'ref_id'],
1522 (
int) $this->condition_target[
'obj_id'],
1523 $this->condition_target[
'target_type'] ??
''
1526 $conditions = ilConditionHandler::_getEffectiveConditionsOfTarget($this->ref_id, $this->obj_id);
1529 if (
sizeof($conditions)) {
1530 for ($i = 0; $i < count($conditions); $i++) {
1535 ++self::$js_unique_id;
1537 $all_done_obl = $this->parseConditions(self::$js_unique_id, $conditions);
1538 $all_done_opt = $this->parseConditions(self::$js_unique_id, $conditions,
false);
1540 if (!$all_done_obl || !$all_done_opt) {
1541 $this->tpl->setCurrentBlock(
'preconditions_toggle');
1542 $this->tpl->setVariable(
'PRECONDITION_TOGGLE_INTRO', $this->
lng->txt(
'precondition_toggle'));
1543 $this->tpl->setVariable(
'PRECONDITION_TOGGLE_TRIGGER', $this->
lng->txt(
'show'));
1544 $this->tpl->setVariable(
'PRECONDITION_TOGGLE_ID', self::$js_unique_id);
1545 $this->tpl->setVariable(
'TXT_PRECONDITION_SHOW', $this->
lng->txt(
'show'));
1546 $this->tpl->setVariable(
'TXT_PRECONDITION_HIDE', $this->
lng->txt(
'hide'));
1547 $this->tpl->parseCurrentBlock();
1561 string $onclick =
''
1564 $checksum = md5($href .
$text);
1565 if ($href !==
'#' && in_array($checksum, $this->prevent_duplicate_commands)) {
1569 if ($href !==
'#') {
1570 $this->prevent_duplicate_commands[] = $checksum;
1573 if ($cmd ===
'mount_webfolder') {
1574 $onclick =
"triggerWebDAVModal('$href')";
1576 ModalGUI::maybeRenderWebDAVModalInGlobalTpl();
1579 $action = $this->
ui->factory()
1581 ->shy($text, $href);
1583 if ($frame !==
'') {
1584 $action = $this->
ui->factory()->link()->standard($text, $href)->withOpenInNewViewport(
true);
1587 if ($onclick !==
'') {
1588 $action = $action->withAdditionalOnLoadCode(
function (
$id) use ($onclick):
string {
1589 return "$('#$id').click(function(){" . $onclick .
';});';
1595 $this->current_actions[] = $action;
1600 if ($this->std_cmd_only) {
1604 if (is_object($this->getContainerObject()) and
1606 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type)) {
1607 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1608 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'delete');
1609 $this->insertCommand($cmd_link, $this->
lng->txt(
'delete'));
1610 $this->adm_commands_included =
true;
1615 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type)) {
1616 $this->
ctrl->setParameter(
1617 $this->container_obj,
1619 $this->container_obj->getObject()->getRefId()
1621 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1622 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'delete');
1623 $this->insertCommand($cmd_link, $this->
lng->txt(
'delete'));
1624 $this->adm_commands_included =
true;
1630 $objDefinition = $this->obj_definition;
1632 if ($this->std_cmd_only) {
1638 !$this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type) ||
1639 !$objDefinition->allowLink($this->type)
1646 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1647 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'link');
1648 $this->insertCommand($cmd_link, $this->
lng->txt(
'link'));
1649 $this->adm_commands_included =
true;
1656 $this->
ctrl->setParameter(
1657 $this->container_obj,
1659 $this->container_obj->getObject()->getRefId()
1661 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1662 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'link');
1663 $this->insertCommand($cmd_link, $this->
lng->txt(
'link'));
1664 $this->adm_commands_included =
true;
1669 if ($this->std_cmd_only) {
1676 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type)) {
1677 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1678 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'cut');
1679 $this->insertCommand($cmd_link, $this->
lng->txt(
'move'));
1680 $this->adm_commands_included =
true;
1688 if ($this->checkCommandAccess(
'delete',
'', $this->ref_id, $this->type) && $this->container_obj->getObject()) {
1689 $this->
ctrl->setParameter(
1690 $this->container_obj,
1692 $this->container_obj->getObject()->getRefId()
1694 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1696 if (!$to_repository) {
1697 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'cut');
1698 $this->insertCommand($cmd_link, $this->
lng->txt(
'move'));
1700 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'cut_for_repository');
1701 $this->insertCommand($cmd_link, $this->
lng->txt(
'wsp_move_to_repository'));
1704 $this->adm_commands_included =
true;
1710 if ($this->std_cmd_only) {
1714 if ($this->checkCommandAccess(
'copy',
'copy', $this->ref_id, $this->type) &&
1715 $this->obj_definition->allowCopy($this->type)) {
1716 if ($this->context != self::CONTEXT_WORKSPACE && $this->context != self::CONTEXT_WORKSPACE_SHARING) {
1717 $this->
ctrl->setParameterByClass(
'ilobjectcopygui',
'source_id', $this->getCommandId());
1718 $cmd_copy = $this->
ctrl->getLinkTargetByClass([get_class($this->container_obj),
'ilobjectcopygui'],
'initTargetSelection');
1719 $this->insertCommand($cmd_copy, $this->
lng->txt(
'copy'));
1721 $this->
ctrl->setParameter(
1722 $this->container_obj,
1724 $this->container_obj->getObject()->getRefId()
1726 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1728 if (!$to_repository) {
1729 $cmd_copy = $this->
ctrl->getLinkTarget($this->container_obj,
'copy');
1730 $this->insertCommand($cmd_copy, $this->
lng->txt(
'copy'));
1732 $cmd_copy = $this->
ctrl->getLinkTarget($this->container_obj,
'copy_to_repository');
1733 $this->insertCommand($cmd_copy, $this->
lng->txt(
'wsp_copy_to_repository'));
1737 $this->adm_commands_included =
true;
1743 if ($this->std_cmd_only) {
1753 $this->clipboard->hasEntries()
1755 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id', $this->getCommandId());
1756 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(),
'paste');
1757 $this->insertCommand($cmd_link, $this->
lng->txt(
'paste'));
1758 $this->adm_commands_included =
true;
1764 if ($this->std_cmd_only
1767 || $this->settings->get(
'rep_favourites',
'0') !==
'1') {
1775 is_object($this->container_obj) &&
1777 method_exists($this->container_obj,
'getObject') &&
1778 is_object($this->container_obj->getObject())
1780 $this->
ctrl->setParameter(
1781 $this->container_obj,
1783 $this->container_obj->getObject()->getRefId()
1787 $this->
ctrl->setParameter($this->container_obj,
'type', $type);
1788 $this->
ctrl->setParameter($this->container_obj,
'item_ref_id', $this->getCommandId());
1790 $this->
lng->loadLanguageModule(
'dash');
1791 if (!$this->fav_manager->ifIsFavourite($this->user->getId(), $this->getCommandId())) {
1793 if ($this->checkCommandAccess(
'read',
'', $this->ref_id, $this->type, $this->obj_id)) {
1794 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'addToDesk');
1795 $this->insertCommand($cmd_link, $this->
lng->txt(
'add_to_favourites'));
1798 $cmd_link = $this->
ctrl->getLinkTarget($this->container_obj,
'removeFromDesk');
1799 $this->insertCommand($cmd_link, $this->
lng->txt(
'remove_from_favourites'));
1802 $this->
ctrl->clearParameters($this->container_obj);
1808 if ($this->std_cmd_only) {
1811 $this->insertCommand(
1812 $this->getCommandLink(
'infoScreen'),
1813 $this->
lng->txt(
'info_short'),
1814 $this->getCommandFrame(
'infoScreen'),
1824 if ($this->std_cmd_only || $this->
user->isAnonymous()) {
1828 $this->
lng->loadLanguageModule(
'notes');
1829 $this->
lng->loadLanguageModule(
'tagging');
1830 $cmd_frame = $this->getCommandFrame(
'infoScreen');
1834 if ($this->reference_ref_id) {
1835 $note_ref_id = $this->reference_ref_id;
1838 $js_updater = $header_actions
1839 ?
'il.Object.redrawActionHeader();'
1840 :
'il.Object.redrawListItem(' . $note_ref_id .
')';
1842 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id, $header_actions);
1843 if ($comments_enabled) {
1844 $this->insertCommand(
1846 $this->
lng->txt(
'notes_comments'),
1854 if ($this->notes_enabled) {
1855 $this->insertCommand(
1857 $this->
lng->txt(
'notes'),
1865 if ($this->tags_enabled) {
1866 $this->insertCommand(
1868 $this->
lng->txt(
'tagging_set_tag'),
1886 $this->std_cmd_only || is_null($this->container_obj) ||
1887 !method_exists($this->container_obj,
'getObject') ||
1888 !is_object($this->container_obj->getObject())
1893 $parent_ref_id = $this->container_obj->getObject()->getRefId();
1894 $parent_type = $this->container_obj->getObject()->getType();
1897 if ($this->reference_ref_id) {
1898 $this->
ctrl->setParameterByClass(
'ilconditionhandlergui',
'ref_id', $this->reference_ref_id);
1902 $this->checkCommandAccess(
'write',
'', $parent_ref_id, $parent_type) ||
1903 $this->checkCommandAccess(
'write',
'', $this->ref_id, $this->type)
1905 $this->
ctrl->setParameterByClass(
1906 get_class($this->container_obj),
1908 $this->container_obj->getObject()->getRefId()
1910 $this->
ctrl->setParameterByClass(
1911 get_class($this->container_obj),
1915 $time_limit_link = $this->
ctrl->getLinkTargetByClass(
1916 get_class($this->container_obj),
1917 'editAvailabilityPeriod'
1919 $this->insertCommand($time_limit_link, $this->
lng->txt(
'edit_availability_period'));
1920 $this->
ctrl->clearParameterByClass(
1921 get_class($this->container_obj),
1924 $this->
ctrl->setParameterByClass(
1925 get_class($this->container_obj),
1930 $this->
ctrl->setParameterByClass(
1931 'ilconditionhandlergui',
1935 $this->
ctrl->setParameterByClass(
1936 'ilconditionhandlergui',
1941 $availbility_link = $this->
ctrl->getLinkTargetByClass(
1942 [$this->gui_class_name,
'ilcommonactiondispatchergui',
'ilobjectactivationgui',
'ilconditionhandlergui'],
1946 $this->insertCommand($availbility_link, $this->
lng->txt(
'preconditions'));
1949 if ($this->reference_ref_id) {
1950 $this->
ctrl->setParameterByClass(
'ilconditionhandlergui',
'ref_id', $this->ref_id);
1960 $commands = $this->getCommands();
1961 if (!$this->getCommandsStatus() || $this->commandsNeedToBeHidden($for_header)) {
1962 foreach ($commands as $command) {
1963 if ($command[
'default'] ===
true) {
1964 $this->default_command = $command[
'granted'] ===
true ? $this->createDefaultCommand($command) : [];
1971 $this->
ctrl->setParameterByClass($this->gui_class_name,
'ref_id', $this->ref_id);
1973 $this->current_actions = [];
1974 $this->default_command = [];
1975 $this->prevent_duplicate_commands = [];
1978 $valid_header_commands = [
'mount_webfolder'];
1980 foreach ($commands as $command) {
1981 if ($for_header && !in_array($command[
'cmd'], $valid_header_commands)
1982 || $command[
'granted'] ===
false) {
1986 if ($command[
'default'] !==
true) {
1987 if (!$this->std_cmd_only) {
1990 $this->appendRepositoryFrameParameter($command[
'link']);
1992 $cmd_link = $command[
'link'];
1993 $txt = ($command[
'lang_var'] ==
'')
1995 : $this->
lng->txt($command[
'lang_var']);
1996 $this->insertCommand(
2005 $this->default_command = $this->createDefaultCommand($command);
2010 if (is_array($this->cust_commands)) {
2011 foreach ($this->cust_commands as $command) {
2012 if ($command instanceof
Button) {
2013 $this->current_actions[] = $command;
2017 $this->insertCommand(
2019 $this->
lng->txt($command[
'lang_var']),
2022 $command[
'cmd'] ??
'',
2027 $this->insertLPSettingsCommand();
2030 if ($this->getInfoScreenStatus()) {
2031 $this->insertInfoScreenCommand();
2034 $this->insertLPCommand();
2036 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2038 if ($this->timings_enabled) {
2039 $this->insertTimingsCommand();
2043 if ($this->delete_enabled) {
2044 $this->insertDeleteCommand();
2048 if ($this->link_enabled) {
2049 $this->insertLinkCommand();
2053 if ($this->cut_enabled) {
2054 $this->insertCutCommand();
2058 if ($this->copy_enabled) {
2059 $this->insertCopyCommand();
2063 if ($this->repository_transfer_enabled) {
2064 $this->insertCutCommand(
true);
2065 $this->insertCopyCommand(
true);
2069 if ($this->subscribe_enabled) {
2070 $this->insertSubscribeCommand();
2074 if ($this->multi_download_enabled && $for_header) {
2075 $this->insertMultiDownloadCommand();
2079 if ($this->cut_enabled or $this->link_enabled) {
2080 $this->insertPasteCommand();
2086 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2087 $this->insertCommonSocialCommands($for_header);
2102 && $this->object_properties->getPropertyInfoTabVisibility()) {
2108 public function enableComments(
bool $value,
bool $enable_comments_settings =
true): void
2110 if ($this->
settings->get(
'disable_comments')) {
2114 $this->comments_enabled = $value;
2115 $this->comments_settings_enabled = $enable_comments_settings;
2120 if ($this->
settings->get(
'disable_notes')) {
2124 $this->notes_enabled = $value;
2130 if (!$tags_set->get(
'enable')) {
2133 $this->tags_enabled = $value;
2138 ?
string $text =
null,
2139 bool $categories =
false,
2140 ?array $ctrl_path =
null,
2141 bool $force_rate_parent =
false
2143 $this->rating_enabled = $value;
2145 if ($this->rating_enabled) {
2146 $this->rating_categories_enabled = $categories;
2147 $this->rating_text =
$text;
2148 $this->rating_ctrl_path = $ctrl_path;
2149 $this->force_rate_parent = $force_rate_parent;
2161 if (!$folder_set->get(
'enable_multi_download')) {
2164 $this->multi_download_enabled = $value;
2169 if ($this->std_cmd_only) {
2178 $this->
ctrl->setParameter($this->getContainerObject(),
'type',
'');
2179 $this->
ctrl->setParameter($this->getContainerObject(),
'item_ref_id',
'');
2180 $this->
ctrl->setParameter($this->getContainerObject(),
'active_node',
'');
2186 $hasAdminAccess = $this->
access->checkAccessOfUser(
$user_id,
'crs_admin', $this->
ctrl->getCmd(), $this->requested_ref_id);
2190 if ($hasAdminAccess) {
2191 $cmd = ($this->requested_cmd ==
'enableAdministrationPanel')
2193 :
'enableAdministrationPanel';
2195 $cmd = ($this->requested_cmd ==
'enableMultiDownload')
2197 :
'enableMultiDownload';
2199 $cmd_link = $this->
ctrl->getLinkTarget($this->getContainerObject(), $cmd);
2200 $this->insertCommand($cmd_link, $this->
lng->txt(
'download_multiple_objects'));
2207 if (!$this->getContainerObject()->isActiveAdministrationPanel() || $this->clipboard->hasEntries()) {
2209 in_array($this->type, [
'file',
'fold']) &&
2210 $this->
access->checkAccess(
'read',
'', $ref_id, $this->type)
2212 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_ENABLED;
2214 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_DISABLED;
2217 $this->download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE;
2223 return $this->download_checkbox_state;
2237 if (is_null($tpl)) {
2242 $DIC->notes()->gui()->initJavascript($notes_url);
2250 $tpl->addOnLoadCode(
'il.Object.setRedrawAHUrl("' . $redraw_url .
'");');
2256 $this->sub_obj_type = $type;
2257 $this->sub_obj_id = (
int)
$id;
2263 ?
string $tooltip =
null,
2264 ?
string $onclick =
null,
2265 ?
string $status_text =
null,
2266 ?
string $href =
null
2268 $this->header_icons[
$id] = [
2270 'tooltip' => $tooltip,
2271 'onclick' => $onclick,
2272 'status_text' => $status_text,
2279 $this->header_icons[
$id] = $html;
2284 $this->header_icons[
$id] = [
'glyph' => $glyph,
'onclick' => $onclick];
2295 static function (string
$id) use ($onclick_js): string {
2296 return '$("#' .
$id .
'").on("click", function(event) {'
2298 .
' return false; });';
2305 $this->ajax_hash = $hash;
2310 if ($main_tpl ==
null) {
2311 $main_tpl = $this->main_tpl;
2314 $htpl =
new ilTemplate(
'tpl.header_action.html',
true,
true,
'components/ILIAS/ILIASObject');
2316 $redraw_js =
'il.Object.redrawActionHeader();';
2319 if ($this->tags_enabled) {
2325 $this->
user->getId()
2327 if (count($tags) > 0) {
2328 $this->
lng->loadLanguageModule(
'tagging');
2330 $f = $this->
ui->factory();
2331 $this->addHeaderGlyph(
2333 $f->symbol()->glyph()->tag()
2334 ->withCounter(
$f->counter()->status(count($tags))),
2341 $comments_enabled = $this->isCommentsActivated($this->type, $this->ref_id, $this->obj_id,
true,
false);
2342 if ($this->notes_enabled || $comments_enabled) {
2343 $type = ($this->sub_obj_type ==
'') ? $this->type : $this->sub_obj_type;
2344 $context = $this->notes_service->data()->context($this->obj_id, $this->sub_obj_id, $type);
2345 $cnt[$this->obj_id][Note::PUBLIC] = $this->notes_service->domain()->getNrOfCommentsForContext($context);
2346 $cnt[$this->obj_id][Note::PRIVATE] = $this->notes_service->domain()->getNrOfNotesForContext($context);
2348 $this->notes_enabled &&
2349 isset($cnt[$this->obj_id][Note::PRIVATE]) &&
2350 $cnt[$this->obj_id][Note::PRIVATE] > 0
2352 $f = $this->
ui->factory();
2353 $this->addHeaderGlyph(
2355 $f->symbol()->glyph()->note()
2356 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][Note::PRIVATE])),
2362 $comments_enabled &&
2363 isset($cnt[$this->obj_id][Note::PUBLIC]) &&
2364 $cnt[$this->obj_id][Note::PUBLIC] > 0
2366 $this->
lng->loadLanguageModule(
'notes');
2367 $f = $this->
ui->factory();
2368 $this->addHeaderGlyph(
2370 $f->symbol()->glyph()->comment()
2371 ->withCounter(
$f->counter()->status((
int) $cnt[$this->obj_id][Note::PUBLIC])),
2378 if ($this->rating_enabled) {
2380 $rating_gui->enableCategories($this->rating_categories_enabled);
2382 $rating_gui->setObject($this->obj_id, $this->type);
2383 if ($this->rating_text) {
2384 $rating_gui->setYourRatingText($this->rating_text);
2387 $ajax_hash = $this->force_rate_parent
2390 $this->
ctrl->setParameterByClass(
'ilRatingGUI',
'cadh', $ajax_hash);
2391 $this->
ctrl->setParameterByClass(
'ilRatingGUI',
'rnsb',
true);
2392 if ($this->rating_ctrl_path) {
2393 $rating_gui->setCtrlPath($this->rating_ctrl_path);
2394 $ajax_url = $this->
ctrl->getFormActionByClass($this->rating_ctrl_path,
'saveRating',
'',
true);
2396 $ajax_url = $this->
ctrl->getFormActionByClass(
'ilRatingGUI',
'saveRating',
'',
true);
2398 $main_tpl->
addOnLoadCode(
'il.Object.setRatingUrl("' . $ajax_url .
'");');
2399 $this->addHeaderIconHTML(
2401 $rating_gui->getHTML(
2403 $this->checkCommandAccess(
'read',
'', $this->ref_id, $this->type),
2404 'il.Object.saveRating(%rating%);'
2409 if ($this->header_icons) {
2411 foreach ($this->header_icons as
$id => $attr) {
2414 if (is_array($attr)) {
2415 if (isset($attr[
'glyph']) && $attr[
'glyph']) {
2417 if (!empty($attr[
'onclick'])) {
2419 $this->getHeaderGlyphShyButton($attr[
'glyph'], $attr[
'onclick'])
2422 $html =
'<span class="prop">'
2426 $htpl->setCurrentBlock(
'prop_glyph');
2427 $htpl->setVariable(
'GLYPH', $html);
2428 $htpl->parseCurrentBlock();
2430 if ($attr[
'onclick']) {
2431 $htpl->setCurrentBlock(
'onclick');
2432 $htpl->setVariable(
'PROP_ONCLICK', $attr[
'onclick']);
2433 $htpl->parseCurrentBlock();
2436 if ($attr[
'status_text']) {
2437 $htpl->setCurrentBlock(
'status');
2438 $htpl->setVariable(
'PROP_TXT', $attr[
'status_text']);
2439 $htpl->parseCurrentBlock();
2443 $htpl->setCurrentBlock(
'prop');
2444 if ($attr[
'href'] || $attr[
'onclick']) {
2445 $htpl->setVariable(
'TAG',
'a');
2447 $htpl->setVariable(
'TAG',
'span');
2449 $htpl->setVariable(
'PROP_ID',
$id);
2450 $htpl->setVariable(
'IMG_SRC', $attr[
'img']);
2451 if ($attr[
'href'] !=
'') {
2452 $htpl->setVariable(
'PROP_HREF',
' href="' . $attr[
'href'] .
'" ');
2455 if ($attr[
'tooltip']) {
2456 $htpl->setVariable(
'IMG_ADDITIONAL',
"alt=\"{$attr['tooltip']}\" title=\"{$attr['tooltip']}\"");
2458 $htpl->parseCurrentBlock();
2465 if (
sizeof($chunks)) {
2468 implode(
' ', $chunks) .
' '
2474 $dropdown_label =
'<span class="hidden-xs">' .
2475 $this->
lng->txt(
'actions') .
2477 $dropdown = $this->getCommandsDropdown($dropdown_label,
true);
2480 $this->
ui->renderer()->render($dropdown)
2483 if ($this->cust_modals !== []) {
2484 $htpl->setVariable(
'TRIGGERED_MODALS', $this->
ui->renderer()->render($this->cust_modals));
2487 return $htpl->get();
2498 $base_class = $this->request_wrapper->retrieve(
'baseClass', $this->
refinery->kindlyTo()->string());
2500 (strtolower($base_class) !=
'ilrepositorygui') &&
2501 is_int(strpos($link,
'baseClass=ilRepositoryGUI'))
2503 if ($this->type !=
'frm') {
2513 if ($this->default_command_params) {
2515 foreach ($this->default_command_params as $name => $value) {
2516 $params[] = $name .
'=' . $value;
2522 if (!stristr($default_link,
'?')) {
2523 $default_link = ($default_link .
'?' .
$params);
2525 $default_link = ($default_link .
'&' .
$params);
2528 return $default_link;
2536 if (strstr($link, ilSAHSPresentationGUI::class) ===
false) {
2537 return [$link, $target];
2541 $om = $sahs_obj->getOpenMode();
2542 $width = $sahs_obj->getWidth();
2543 $height = $sahs_obj->getHeight();
2544 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
2547 if ($om !== 0 && !$this->
http->agent()->isMobile()) {
2548 $this->default_command[
'frame'] =
'';
2550 'javascript:void(0); onclick=startSAHS(\'' .
2563 $target = "ilContObj" . $this->ref_id;
2565 return [$link, $target];
2568 public function insertPath(): void
2570 if ($this->getPathStatus() != false) {
2571 if (!$this->path_gui instanceof \ilPathGUI) {
2572 $path_gui = new \ilPathGUI();
2574 $path_gui = $this->path_gui;
2577 $path_gui->enableTextOnly(!$this->path_linked);
2578 $path_gui->setUseImages(false);
2580 $start_node = ROOT_FOLDER_ID;
2581 if ($this->path_start_node) {
2582 $start_node = $this->path_start_node;
2585 $this->tpl->setCurrentBlock('path_item
');
2586 $this->tpl->setVariable('PATH_ITEM
', $path_gui->getPath($start_node, $this->ref_id));
2587 $this->tpl->parseCurrentBlock();
2589 $this->tpl->setCurrentBlock('path
');
2590 $this->tpl->setVariable('TXT_LOCATION
', $this->lng->txt('locator'));
2591 $this->tpl->parseCurrentBlock();
2595 public function insertProgressInfo(): void
2599 public function insertIconsAndCheckboxes(): void
2602 if ($this->getCheckboxStatus()) {
2603 $this->tpl->setCurrentBlock('check');
2604 $this->tpl->setVariable('VAL_ID
', $this->getCommandId());
2605 $this->tpl->setVariable('CHECK_TITLE
', $this->lng->txt('select
') . ' ' . $this->getTitle());
2606 $this->tpl->parseCurrentBlock();
2608 } elseif ($this->getDownloadCheckboxState() != self::DOWNLOAD_CHECKBOX_NONE) {
2609 $this->tpl->setCurrentBlock('check_download
');
2610 $this->tpl->setVariable('CHECK_DOWNLOAD_TITLE
', $this->lng->txt('download
') . ' ' . $this->getTitle());
2611 if ($this->getDownloadCheckboxState() == self::DOWNLOAD_CHECKBOX_ENABLED) {
2612 $this->tpl->setVariable('VAL_ID
', $this->getCommandId());
2614 $this->tpl->setVariable('VAL_VISIBILITY
', 'visibility: hidden;
" disabled="disabled');
2616 $this->tpl->parseCurrentBlock();
2618 } elseif ($this->getExpandStatus()) {
2619 $this->tpl->setCurrentBlock('expand');
2621 if ($this->isExpanded()) {
2622 $this->ctrl->setParameter($this->container_obj, 'expand', -1 * $this->obj_id);
2623 // 'view
' added, see #19922
2624 $this->tpl->setVariable('EXP_HREF
', $this->ctrl->getLinkTarget($this->container_obj, 'view
', $this->getUniqueItemId(true)));
2625 $this->ctrl->clearParameters($this->container_obj);
2626 $this->tpl->setVariable('EXP_IMG
', ilUtil::getImagePath('nav/tree_exp.svg
'));
2627 $this->tpl->setVariable('EXP_ALT
', $this->lng->txt('collapse'));
2629 $this->ctrl->setParameter($this->container_obj, 'expand', $this->obj_id);
2630 // 'view
' added, see #19922
2631 $this->tpl->setVariable('EXP_HREF
', $this->ctrl->getLinkTarget($this->container_obj, 'view
', $this->getUniqueItemId(true)));
2632 $this->ctrl->clearParameters($this->container_obj);
2633 $this->tpl->setVariable('EXP_IMG
', ilUtil::getImagePath('nav/tree_col.svg
'));
2634 $this->tpl->setVariable('EXP_ALT
', $this->lng->txt('expand'));
2637 $this->tpl->parseCurrentBlock();
2641 if ($this->getIconStatus()) {
2643 $this->tpl->touchBlock('i_1
');
2646 $this->tpl->setCurrentBlock('icon
');
2647 $this->tpl->setVariable('ALT_ICON
', $this->buildTranslatedType());
2649 $this->tpl->setVariable(
2651 $this->getTypeIcon()
2653 $this->tpl->parseCurrentBlock();
2657 $this->tpl->touchBlock('d_
' . $cnt);
2663 public function getTypeIcon(): string
2665 return ilObject::getIconForReference(
2669 $this->getIconImageType()
2673 public function insertSubItems(): void
2675 foreach ($this->sub_item_html as $sub_html) {
2676 $this->tpl->setCurrentBlock('subitem
');
2677 $this->tpl->setVariable('SUBITEM
', $sub_html);
2678 $this->tpl->parseCurrentBlock();
2682 public function insertPositionField(): void
2684 if ($this->position_enabled) {
2685 $this->tpl->setCurrentBlock('position
');
2686 $this->tpl->setVariable('POS_ID
', $this->position_field_index);
2687 $this->tpl->setVariable('POS_VAL
', $this->position_value);
2688 $this->tpl->parseCurrentBlock();
2696 public function adminCommandsIncluded(): bool
2698 return $this->adm_commands_included;
2704 public function getListItemHTML(
2710 // this variable stores whether any admin commands
2711 // are included in the output
2712 $this->adm_commands_included = false;
2714 // only for performance exploration
2715 $type = ilObject::_lookupType($obj_id);
2717 $this->initItem($ref_id, $obj_id, $type, $title, $description);
2719 if ($this->rating_enabled) {
2720 if (ilRating::hasRatingInListGUI($this->obj_id, $this->type)) {
2721 $may_rate = $this->checkCommandAccess('read
', '', $this->ref_id, $this->type);
2722 $rating = new ilRatingGUI();
2723 $rating->setObject($this->obj_id, $this->type);
2724 $this->addCustomProperty(
2726 $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
2734 if (!$this->checkCommandAccess('visible
', '', $ref_id, '', $obj_id)) {
2735 $this->resetCustomData();
2740 if ($type == 'file
' and ilObjFileAccess::_isFileHidden($title)) {
2741 $this->resetCustomData();
2746 $this->tpl = new ilTemplate(
2747 static::$tpl_file_name,
2750 static::$tpl_component,
2756 if ($this->getCommandsStatus()) {
2757 if (!$this->getSeparateCommands()) {
2758 $dropdown = $this->getCommandsDropdown($title);
2759 $this->tpl->setVariable(
2760 'COMMAND_SELECTION_LIST
',
2761 $this->ui->renderer()->render($dropdown)
2766 if ($this->getProgressInfoStatus()) {
2767 $this->insertProgressInfo();
2770 // insert title and describtion
2771 $this->insertTitle();
2772 if (!$this->isMode(self::IL_LIST_AS_TRIGGER)) {
2773 if ($this->getDescriptionStatus()) {
2774 $this->insertDescription();
2778 if ($this->getSearchFragmentStatus()) {
2779 $this->insertSearchFragment();
2783 if ($this->getPropertiesStatus()) {
2784 $this->insertProperties();
2787 // notice properties
2788 if ($this->getNoticePropertiesStatus()) {
2789 $this->insertNoticeProperties();
2793 if ($this->getPreconditionsStatus()) {
2794 $this->insertPreconditions();
2798 $this->insertPath();
2800 if ($this->getItemDetailLinkStatus()) {
2801 $this->insertItemDetailLinks();
2804 // icons and checkboxes
2805 $this->insertIconsAndCheckboxes();
2807 // input field for position
2808 $this->insertPositionField();
2811 $this->insertSubItems();
2813 $this->resetCustomData();
2815 $this->tpl->setVariable('DIV_CLASS
', 'ilContainerListItemOuter
');
2816 $this->tpl->setVariable(
2818 'data-list-item-
id=
"' . $this->getUniqueItemId(true) . '" id =
"' . $this->getUniqueItemId(true) . '"'
2820 $this->tpl->setVariable('ADDITIONAL
', $this->getAdditionalInformation());
2822 if (is_object($this->getContainerObject())) {
2823 // #11554 - make sure that internal ids are reset
2824 $this->ctrl->setParameter($this->getContainerObject(), 'item_ref_id
', '');
2827 // if file upload is enabled the content is wrapped by a UI dropzone.
2828 $content = $this->tpl->get();
2829 $file_upload_dropzone = new ilObjFileUploadDropzone($this->ref_id, $content);
2830 if ($this->context === self::CONTEXT_REPOSITORY
2831 && ($this->requested_cmd === "view" || $this->requested_cmd === "" || $this->requested_cmd === "render")
2832 && $file_upload_dropzone->isUploadAllowed($this->type)
2833 && !(new ModeSessionRepository())->isAdminMode()
2835 return $file_upload_dropzone->getDropzoneHtml();
2844 protected function resetCustomData(): void
2847 $this->cust_prop = [];
2848 $this->cust_commands = [];
2849 $this->cust_modals = [];
2850 $this->sub_item_html = [];
2851 $this->position_enabled = false;
2857 public function setParentRefId(int $ref_id): void
2859 $this->parent_ref_id = $ref_id;
2868 public function getUniqueItemId(bool $as_div = false): string
2870 // use correct id for references
2871 $id_ref = $this->ref_id;
2872 if ($this->reference_ref_id > 0) {
2873 $id_ref = $this->reference_ref_id;
2876 // add unique identifier for preconditions (objects can appear twice in same container)
2877 if ($this->condition_depth) {
2878 $id_ref .= '_pc
' . $this->condition_depth;
2882 $id_ref .= '_pref_
' . $this->parent_ref_id;
2887 // action menu [yellow] toggle
2888 return 'lg_div_
' . $id_ref;
2895 public function getCommandsHTML(string $title = ''): string
2897 return $this->ui->renderer()->render($this->getCommandsDropdown($title, false));
2900 private function getCommandsDropdown(string $title, bool $for_header = false): StandardDropdown
2902 $this->populateCommands($for_header);
2903 return $this->ui->factory()
2905 ->standard($this->current_actions)
2906 ->withAriaLabel(sprintf(
2907 $this->lng->txt('actions_for
'),
2908 htmlspecialchars(addslashes($title))
2915 public function isSideBlock(): bool
2920 public function setBoldTitle(bool $bold_title): void
2922 $this->bold_title = $bold_title;
2925 public function isTitleBold(): bool
2927 return $this->bold_title;
2930 public static function preloadCommonProperties(array $obj_ids, int $context): void
2933 $lng = $DIC->language();
2934 $ilSetting = $DIC->settings();
2935 $ilUser = $DIC->user();
2936 $notes_manager = $DIC->notes()->internal()->domain()->notes();
2938 if ($context == self::CONTEXT_REPOSITORY) {
2939 $active_notes = !$ilSetting->get('disable_notes
');
2940 $active_comments = !$ilSetting->get('disable_comments
');
2942 if ($active_comments) {
2943 // needed for action
2944 self::$comments_activation = $DIC->notes()
2947 ->notes()->commentsActiveMultiple($obj_ids);
2950 // properties are optional
2951 if ($ilSetting->get('comments_tagging_in_lists
')) {
2952 if ($active_notes || $active_comments) {
2953 // @todo: should be refactored, see comment in notes db repo
2954 self::$cnt_notes = $notes_manager->countNotesAndCommentsMultipleObjects(
2959 $lng->loadLanguageModule('notes
');
2962 $tags_set = new ilSetting('tags
');
2963 if ($tags_set->get('enable
')) {
2964 $all_users = (bool) $tags_set->get('enable_all_users
');
2966 if (!$ilSetting->get('comments_tagging_in_lists_tags
')) {
2967 self::$cnt_tags = ilTagging::_countTags($obj_ids, $all_users);
2969 $tag_user_id = null;
2971 $tag_user_id = $ilUser->getId();
2973 self::$tags = ilTagging::_getListTagsForObjects($obj_ids, $tag_user_id);
2976 $lng->loadLanguageModule('tagging
');
2980 $lng->loadLanguageModule('rating
');
2983 self::$preload_done = true;
2989 protected function isCommentsActivated(
2993 bool $header_actions,
2994 bool $check_write_access = true
2996 if ($this->comments_enabled) {
2997 if (!$this->comments_settings_enabled) {
3000 if ($check_write_access && $this->checkCommandAccess('write
', '', $ref_id, $type)) {
3003 // fallback to single object check if no preloaded data
3004 // only the repository does preloadCommonProperties() yet
3005 if (!$header_actions && self::$preload_done) {
3006 if (isset(self::$comments_activation[$obj_id]) &&
3007 self::$comments_activation[$obj_id]) {
3010 } elseif ($this->notes_service->domain()->commentsActive($obj_id)) {
3020 public function enableTimings(bool $status): void
3022 $this->timings_enabled = $status;
3028 public function getAsListItem(
3037 // even b tag produced bugs, see #32304
3038 $description = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
3050 $this->enableCommands(true);
3053 $this->populateCommands(false);
3055 $dropdown = $this->getCommandsDropdown($title);
3056 $def_command = $this->getDefaultCommand();
3058 if ($def_command['link'] ?? false) {
3059 list($def_command['link'], $def_command['frame
']) =
3060 $this->modifySAHSlaunch($def_command['link'], $def_command['frame
']);
3061 $new_viewport = !in_array($def_command['frame
'], ['', '_top
', '_self
', '_parent
'], true);
3062 $link = $this->ui->factory()
3064 ->standard($this->getTitle(), $def_command['link'])
3065 ->withOpenInNewViewport($new_viewport);
3066 $list_item = $ui->factory()->item()->standard($link);
3068 $list_item = $ui->factory()->item()->standard($this->getTitle());
3071 if ($description != '') {
3072 $list_item = $list_item->withDescription($description);
3074 $list_item = $list_item->withActions($dropdown)->withLeadIcon(
3075 $this->ui->factory()->symbol()->icon()->custom(
3076 $this->getTypeIcon(),
3077 $this->buildTranslatedType(),
3084 $this->enableComments(true);
3085 $this->enableNotes(true);
3086 $this->enableTags(true);
3087 $this->enableRating(true);
3089 foreach ($this->determineProperties() as $p) {
3090 //if ($p['property'] !== $this->lng->txt('learning_progress
')) {
3091 $l[(string) $p['property']] = (string) $p['value
'];
3094 if (count($l) > 0) {
3095 $list_item = $list_item->withProperties($l);
3104 public function getAsCard(
3110 ): ?RepositoryObject {
3113 $title = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($title);
3114 // even b tag produced bugs, see #32304
3115 $description = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
3127 $user = $this->user;
3128 $access = $this->access;
3130 $this->enableCommands(true);
3133 if ($description !== '') {
3134 $sections[] = $ui->factory()->legacy()->content('<div
class=
"il-multi-line-cap-3">
' . $description . '</div>
');
3137 $this->populateCommands(false);
3139 $def_command = $this->getDefaultCommand();
3141 $dropdown = $this->getCommandsDropdown($title);
3143 // workaround for #26205
3144 // we should get rid of _top links completely and gifure our how
3145 // to manage scorm links better
3146 $def_cmd_frame = ($def_command['frame
'] ?? '');
3147 if ($def_cmd_frame === '_top
') {
3148 $def_cmd_frame = '';
3150 $def_cmd_link = ($def_command['link'] ?? '');
3152 // workaround for scorm
3153 list($modified_link, $def_cmd_frame) =
3154 $this->modifySAHSlaunch($def_cmd_link, $def_cmd_frame);
3156 $image = $this->getTileImage();
3158 if ($def_cmd_link != '') { // #24256
3159 if ($def_cmd_frame !== '' && ($modified_link === $def_cmd_link)) {
3160 $signal = (new SignalGenerator())->create();
3161 $this->main_tpl->addOnLoadCode(
3162 "$(document).on('{$signal->getId()}
', function(event, signalData) {"
3163 . ' window.open(
"' . str_replace(
3167 ) . '",
"' . $def_cmd_frame . '");
'
3171 $image = $image->withAction($signal);
3174 $ui->factory()->button()->shy($title, '')->appendOnClick($signal);
3175 $title = $ui->renderer()->render($button);
3177 $image = $image->withAction($modified_link);
3181 if ($type == 'sess
') {
3183 $title = ':
' . $title;
3185 $app_info = ilSessionAppointment::_lookupAppointment($obj_id);
3186 $title = ilSessionAppointment::_appointmentToString(
3189 (bool) $app_info['fullday
']
3193 $icon = $this->ui->factory()->symbol()->icon()->custom(
3194 $this->getTypeIcon(),
3195 $this->buildTranslatedType(),
3199 // card title action
3200 $card_title_action = '';
3201 if ($def_cmd_link != '' && ($def_cmd_frame == '' || $modified_link != $def_cmd_link)) { // #24256
3202 $card_title_action = $modified_link;
3203 } elseif ($def_cmd_link == '' &&
3204 $this->getInfoScreenStatus() &&
3205 $access->checkAccessOfUser(
3211 $card_title_action = ilLink::_getLink($ref_id);
3212 if ($image->getAction() == '') {
3213 $image = $image->withAction($card_title_action);
3217 $card = $ui->factory()->card()->repositoryObject(
3218 $title . '<span data-list-item-
id=
"' . $this->getUniqueItemId(true) . '"></span>
',
3226 if ($card_title_action != '') {
3227 $card = $card->withTitleAction($card_title_action);
3231 foreach ($this->determineProperties() as $p) {
3232 if (isset($p['alert
']) && $p['alert
'] == true
3233 && isset($p['property']) && $p['property'] !== $this->lng->txt('learning_progress
')) {
3234 $l[(string) $p['property']] = (string) $p['value
'];
3237 if (count($l) > 0) {
3238 $prop_list = $ui->factory()->listing()->descriptive($l);
3239 $sections[] = $prop_list;
3241 if (count($sections) > 0) {
3242 $card = $card->withSections($sections);
3245 $lp = ilLPStatus::getListGUIStatus($obj_id, false);
3246 if (is_array($lp) && array_key_exists('status
', $lp)) {
3247 $percentage = (int) ilLPStatus::_lookupPercentage($obj_id, $this->user->getId());
3248 if ($lp['status
'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
3252 $card = $card->withProgress(
3256 ->mini(100, $percentage)
3263 public function checkInfoPageOnAsynchronousRendering(): bool
3268 private function getTileImage(): Image
3270 return $this->object_properties->getPropertyTileImage()
3271 ->getTileImage()->getImage($this->ui->factory()->image());
3277 public function insertLPCommand(): void
3279 if ($this->std_cmd_only || !$this->lp_cmd_enabled) {
3282 $relevant = ilLPStatus::hasListGUIStatus($this->obj_id);
3284 $cmd_link = $this->getCommandLink('learningProgress
');
3285 $this->insertCommand(
3287 $this->lng->txt('learning_progress
')
3295 private function insertLPSettingsCommand(): void
3297 if (!$this->lp_settings_cmd_enabled
3298 || !ilObjUserTracking::_enabledLearningProgress()
3299 || ilObjectLP::getTypeClass($this->type) === ''
3300 || ! $this->checkCommandAccess('edit_learning_progress
', '', $this->ref_id, $this->type)
3306 $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, 'ref_id
', $this->ref_id);
3307 switch ($this->type) {
3309 switch (ilObjSAHSLearningModule::_lookupSubType($this->obj_id)) {
3311 $scorm_class = ilObjSCORM2004LearningModuleGUI::class;
3314 $scorm_class = ilObjSCORMLearningModuleGUI::class;
3321 $cmd_link = $this->ctrl->getLinkTargetByClass([
3322 ilSAHSEditGUI::class,
3324 ilLearningProgressGUI::class,
3325 ilLPListOfSettingsGUI::class
3330 $cmd_link = $this->ctrl->getLinkTargetByClass([
3331 ilLMEditorGUI::class,
3332 ilObjLearningModuleGUI::class,
3333 ilLearningProgressGUI::class,
3334 ilLPListOfSettingsGUI::class
3339 $cmd_link = $this->ctrl->getLinkTargetByClass([
3340 ilObjLearningSequenceGUI::class,
3341 ilLearningProgressGUI::class,
3342 ilLPListOfSettingsGUI::class
3355 $gui_class = 'ilObj
' . $this->obj_definition->getClassName($this->type) . 'GUI
';
3356 $cmd_link = $this->ctrl->getLinkTargetByClass([
3357 ilRepositoryGUI::class,
3359 ilLearningProgressGUI::class,
3360 ilLPListOfSettingsGUI::class
3372 $this->ctrl->setParameterByClass('ilrepositorygui
', 'ref_id
', $this->requested_ref_id);
3373 if ($cmd_link !== '') {
3374 $this->insertCommand(
3376 $this->lng->txt('listaction_learning_progress_settings
')
3381 private function buildTranslatedType(): string
3383 if ($this->obj_definition->isPlugin($this->getIconImageType())) {
3384 return ilObjectPlugin::lookupTxtById($this->getIconImageType(), 'obj_
' . $this->getIconImageType());
3387 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.
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)
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'))