ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 include_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  {
52  $lng = $this->lng;
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", "mepitem_id", $a_node["child"]);
104  $ret = $ilCtrl->getLinkTargetByClass("ilobjmediapoolgui", "listMedia");
105  $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
106  return $ret;
107  }
108 }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
getNodeIcon($a_node)
Get node icon.
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.
user()
Definition: user.php:4
setTypeWhiteList($a_val)
Set type white list.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getNodeHref($a_node)
Get href for node.
$ilUser
Definition: imgupload.php:18
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
Explorer class that works on tree objects (Services/Tree)
$ret
Definition: parser.php:6
setOrderField($a_val, $a_numeric=false)
Set order field.
isNodeHighlighted($a_node)
Is node highlighted?
__construct($a_parent_obj, $a_parent_cmd, $a_media_pool)
Constructor.
getNodeContent($a_node)
Get node content.