19declare(strict_types=1);
32use InvalidArgumentException;
61 $this->request =
$dic->
repository()->internal()->gui()->standardRequest();
72 $f = $this->dic->ui()->factory();
78 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(
Standard::ROOT, $title);
82 ->withVisibilityCallable($access_helper->isRepositoryVisible())
88 $title = $this->dic->language()->txt(
"mm_repo_tree_view");
90 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
ilUtil::getImagePath(
"standard/icon_reptr.svg"), $title);
93 $ref_id = $this->request->getRefId();
95 $asynch = ($top_node === 0);
97 = $this->mainmenu->complex($this->
if->identifier(
'rep_tree_view'))
102 ->withSupportsAsynchronousLoading($asynch)
108 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
ilUtil::getImagePath(
"standard/icon_lstv.svg"), $title);
111 $entries[] = $this->mainmenu
112 ->complex($this->
if->identifier(
'last_visited'))
113 ->
withTitle($this->dic->language()->txt(
'last_visited'))
114 ->withSupportsAsynchronousLoading(
true)
115 ->withVisibilityCallable($access_helper->isUserLoggedIn($access_helper->isRepositoryReadable()))
119 ->withContentWrapper(
function () use ($p):
Content {
120 return $this->dic->ui()->factory()->legacy()->content($p->renderLastVisited());
123 $title = $this->dic->language()->txt(
"mm_favorites");
124 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
ilUtil::getImagePath(
"standard/icon_fav.svg"), $title);
126 $entries[] = $this->mainmenu->complex($this->
if->identifier(
'mm_pd_sel_items'))
127 ->withSupportsAsynchronousLoading(
true)
130 ->withContentWrapper(
131 static fn(): Legacy =>
136 ->withAvailableCallable(
141 $access_helper->isUserLoggedIn($access_helper->isRepositoryReadable(
142 static function () use (
$dic):
bool {
144 return $pdItemsViewSettings->allViewsEnabled() || $pdItemsViewSettings->enabledSelectedItems();
156 $title =
static function () use (
$dic):
string {
159 $title = (
$nd[
"title"] ===
"ILIAS" ?
$dic->
language()->txt(
"repository") :
$nd[
"title"]);
161 }
catch (InvalidArgumentException
$e) {
165 return $title .
" - " .
$dic->
language()->txt(
"rep_main_page");
168 $action =
static function ():
string {
170 $static_link = (string) (
new StandardURIBuilder(ILIAS_HTTP_PATH))->build(
'',
null, [
'?target=root_1']);
171 }
catch (InvalidArgumentException
$e) {
178 return $this->mainmenu->link($this->
if->identifier(
'rep_main_page'))
186 if (isset($this->dic[
'ilNavigationHistory'])) {
187 $nav_items = $this->dic[
'ilNavigationHistory']->getItems();
195 $f = $this->dic->ui()->factory();
196 foreach ($nav_items as $k => $nav_item) {
201 if (!isset($nav_item[
"ref_id"]) || $this->request->getRefId() === 0
202 || ((
int) $nav_item[
"ref_id"] !== $this->request->getRefId() || !$first)
208 $items[] =
$f->item()->standard(
209 $f->link()->standard($ititle, $nav_item[
"link"])
210 )->withLeadIcon($icon);
215 if (count($items) > 0) {
216 $item_groups[] =
$f->item()->group(
"", $items);
217 $panel =
$f->panel()->secondary()->listing(
"", $item_groups);
218 return $this->dic->ui()->renderer()->render([$panel]);
231 $lng->loadLanguageModule(
"rep");
232 $txt =
$lng->txt(
"rep_no_last_visited_mess");
233 $mbox = $ui->factory()->messageBox()->info(
$txt);
241 $tree =
$DIC->repositoryTree();
242 if ($ref_id <= 0 || $this->request->getBaseClass() ===
"ilAdministrationGUI" || !$tree->isInTree(
$ref_id)) {
245 $DIC->ctrl()->setParameterByClass(
"ilrepositorygui",
"ref_id",
$ref_id);
246 $exp = new \ilRepositoryExplorerGUI(
"ilrepositorygui",
"showRepTree");
247 $exp->setSkipRootNode(
true);
248 return $exp->getHTML() .
"<script>" . $exp->getOnLoadCode() .
"</script>";
Customizing of pimple-DIC for ILIAS.
user()
Get the current user.
language()
Get interface to the i18n service.
settings()
Get the interface to the settings.
Class BasicAccessCheckClosuresSingleton.
Class Link Attention: This is not the same as the \ILIAS\UI\Component\Link\Link.
Interface StaticMainMenuProvider.
Class StandardTopItemsProvider.
Repository related main menu items.
__construct(Container $dic)
@inheritDoc
getNoLastVisitedMessage()
StandardGUIRequest $request
renderRepoTree(int $ref_id)
static init(?ilGlobalTemplateInterface $a_main_tpl=null)
Class ilObject Basic functions for all objects.
static _lookupObjectId(int $ref_id)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
static getTopNodeForRefId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
Util class various functions, usage as namespace.
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 img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
This describes the specific behavior of an ILIAS standard icon.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
withVisibilityCallable(callable $is_visible)
if(!file_exists('../ilias.ini.php'))