ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilMediaPoolExplorerGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
5
15{
19 protected $user;
20
24 public function __construct($a_parent_obj, $a_parent_cmd, $a_media_pool)
25 {
26 global $DIC;
27
28 $this->user = $DIC->user();
29 $this->lng = $DIC->language();
30 $this->ctrl = $DIC->ctrl();
31 $ilUser = $DIC->user();
32
33 $this->media_pool = $a_media_pool;
34 parent::__construct("mep_exp", $a_parent_obj, $a_parent_cmd, $a_media_pool->getTree());
35
36 $this->setTypeWhiteList(array("dummy", "fold"));
37 $this->setSkipRootNode(false);
38 $this->setAjax(true);
39 $this->setOrderField("title");
40
41 $this->setNodeOpen($this->tree->readRootId());
42 }
43
50 public function getNodeContent($a_node)
51 {
53
54 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
55 return $this->media_pool->getTitle();
56 }
57
58 return $a_node["title"];
59 }
60
67 public function getNodeIcon($a_node)
68 {
69 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
70 $icon = ilUtil::getImagePath("icon_mep.svg");
71 } else {
72 $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
73 }
74
75 return $icon;
76 }
77
84 public function isNodeHighlighted($a_node)
85 {
86 if ($a_node["child"] == $_GET["mepitem_id"] ||
87 ($_GET["mepitem_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
88 return true;
89 }
90 return false;
91 }
92
99 public function getNodeHref($a_node)
100 {
102
103 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", (int) $_GET["ref_id"]);
104 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $a_node["child"]);
105 $ret = $ilCtrl->getLinkTargetByClass("ilobjmediapoolgui", "listMedia", "", false, false);
106 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
107 return $ret;
108 }
109
113 protected function getNodeStateToggleCmdClasses($record) : array
114 {
115 return [
116 'ilRepositoryGUI',
117 'ilObjMediaPoolGUI',
118 ];
119 }
120}
user()
Definition: user.php:4
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
setSkipRootNode($a_val)
Set skip root node.
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
Media pool explorer GUI class.
getNodeIcon($a_node)
Get node icon.
__construct($a_parent_obj, $a_parent_cmd, $a_media_pool)
Constructor.
getNodeContent($a_node)
Get node content.
getNodeStateToggleCmdClasses($record)
@inheritDoc
getNodeHref($a_node)
Get href for node.
isNodeHighlighted($a_node)
Is node highlighted?
Explorer class that works on tree objects (Services/Tree)
setTypeWhiteList($a_val)
Set type white list.
getNodeId($a_node)
Get id for node.
setOrderField($a_val, $a_numeric=false)
Set order field.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46