ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMediaPoolExplorerGUI.php
Go to the documentation of this file.
1<?php
2
25{
27 protected \ILIAS\MediaPool\StandardGUIRequest $mep_request;
28 protected ilObjUser $user;
29
30 public function __construct(
31 object $a_parent_obj,
32 string $a_parent_cmd,
33 ilObjMediaPool $a_media_pool
34 ) {
35 global $DIC;
36
37 $this->user = $DIC->user();
38 $this->lng = $DIC->language();
39 $this->ctrl = $DIC->ctrl();
40
41 $this->media_pool = $a_media_pool;
42 parent::__construct("mep_exp", $a_parent_obj, $a_parent_cmd, $a_media_pool->getTree());
43
44 $this->setTypeWhiteList(array("dummy", "fold"));
45 $this->setSkipRootNode(false);
46 $this->setAjax(true);
47 $this->setOrderField("title");
48
49 $this->setNodeOpen($this->tree->readRootId());
50
51 $this->mep_request = $DIC->mediaPool()
52 ->internal()
53 ->gui()
54 ->standardRequest();
55 }
56
60 public function getNodeContent($a_node): string
61 {
62 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
63 return $this->media_pool->getTitle();
64 }
65
66 return $a_node["title"];
67 }
68
72 public function getNodeIcon($a_node): string
73 {
74 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
75 $icon = ilUtil::getImagePath("standard/icon_mep.svg");
76 } else {
77 $icon = ilUtil::getImagePath("standard/icon_" . $a_node["type"] . ".svg");
78 }
79
80 return $icon;
81 }
82
86 public function isNodeHighlighted($a_node): bool
87 {
88 if ($a_node["child"] == $this->mep_request->getItemId() ||
89 ($this->mep_request->getItemId() == 0 && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
90 return true;
91 }
92 return false;
93 }
94
99 public function getNodeHref($a_node): string
100 {
101 $ilCtrl = $this->ctrl;
102
103 $ilCtrl->setParameterByClass(
104 "ilobjmediapoolgui",
105 "ref_id",
106 $this->mep_request->getRefId()
107 );
108 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $a_node["child"]);
109 $ret = $ilCtrl->getLinkTargetByClass("ilobjmediapoolgui", "listMedia", "", false, false);
110 $ilCtrl->setParameterByClass(
111 "ilobjmediapoolgui",
112 "mepitem_id",
113 $this->mep_request->getItemId()
114 );
115 return $ret;
116 }
117
121 protected function getNodeStateToggleCmdClasses($record): array
122 {
123 return [
124 'ilRepositoryGUI',
125 'ilObjMediaPoolGUI',
126 ];
127 }
128}
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjMediaPool $a_media_pool)
ILIAS MediaPool StandardGUIRequest $mep_request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User class.
Explorer class that works on tree objects (Services/Tree)
setOrderField(string $a_val, bool $a_numeric=false)
getNodeId($a_node)
Get id for node.
setTypeWhiteList(array $a_val)
Set type white list.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26