ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilContainerSelectionExplorer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
28 protected string $target_type;
29
30 public function __construct(
31 string $a_target
32 ) {
33 global $DIC;
34
35 $this->access = $DIC->access();
36 $this->lng = $DIC->language();
37 $tree = $DIC->repositoryTree();
38
39 parent::__construct($a_target);
40
41 $this->tree = $tree;
42 $this->root_id = $this->tree->readRootId();
43 $this->order_column = "title";
44
45 $this->setSessionExpandVariable("ref_repexpand");
46
47 $this->addFilter("root");
48 $this->addFilter("cat");
49 $this->addFilter("grp");
50 $this->addFilter("crs");
51
53 $this->setFiltered(true);
55
56 $this->checkPermissions(true);
57 }
58
59 public function setTargetType(string $a_type): void
60 {
61 $this->target_type = $a_type;
62 }
63
64 public function getTargetType(): string
65 {
66 return $this->target_type;
67 }
68
69 public function isClickable(string $type, int $ref_id = 0): bool
70 {
71 return ($this->getTargetType() === $type && $this->access->checkAccess('visible', '', $ref_id));
72 }
73
74 public function isVisible($a_ref_id, string $a_type): bool
75 {
76 $ilAccess = $this->access;
77
78 return $ilAccess->checkAccess('visible', '', (int)$a_ref_id);
79 }
80
81 public function formatHeader(ilTemplate $tpl, $a_obj_id, array $a_option): void
82 {
84
85 $tpl = new ilTemplate("tpl.tree.html", true, true, "components/ILIAS/UIComponent/Explorer");// TODO PHP8-REVIEW Why is this overwritten? Are you sure this is correct?
86
87 $tpl->setCurrentBlock("text");
88 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
90
91 $this->output .= $tpl->get();
92 }
93}
const IL_FM_POSITIVE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
formatHeader(ilTemplate $tpl, $a_obj_id, array $a_option)
class for explorer view in admin frame
addFilter(string $a_item)
checkPermissions(bool $a_check)
setFilterMode(int $a_mode=IL_FM_NEGATIVE)
setSessionExpandVariable(string $a_var_name="expand")
setTitleLength(int $a_length)
ilLanguage $lng
setFiltered(bool $a_bool)
ilGlobalTemplateInterface $tpl
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const TITLE_LENGTH
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
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)
$ref_id
Definition: ltiauth.php:66
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26