ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
48 public function getNodeContent($a_node)
49 {
51
52 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
53 return $this->media_pool->getTitle();
54 }
55
56 return $a_node["title"];
57 }
58
65 public function getNodeIcon($a_node)
66 {
67 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
68 $icon = ilUtil::getImagePath("icon_mep.svg");
69 } else {
70 $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
71 }
72
73 return $icon;
74 }
75
82 public function isNodeHighlighted($a_node)
83 {
84 if ($a_node["child"] == $_GET["mepitem_id"] ||
85 ($_GET["mepitem_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
86 return true;
87 }
88 return false;
89 }
90
97 public function getNodeHref($a_node)
98 {
100
101 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $a_node["child"]);
102 $ret = $ilCtrl->getLinkTargetByClass("ilobjmediapoolgui", "listMedia");
103 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
104 return $ret;
105 }
106}
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.
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.
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
$ret
Definition: parser.php:6
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18