ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilGlossarySelectorGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
5 
15 {
19  protected $ctrl;
20 
24  protected $user;
25 
29  protected $access;
30 
37  public function __construct($a_target, $a_par_class = "")
38  {
39  global $DIC;
40 
41  $this->tree = $DIC->repositoryTree();
42  $this->user = $DIC->user();
43  $this->access = $DIC->access();
44  $this->lng = $DIC->language();
45  $tree = $DIC->repositoryTree();
46  $ilCtrl = $DIC->ctrl();
47 
48  $this->ctrl = $ilCtrl;
49  $this->parent_class = $a_par_class;
50  parent::__construct($a_target);
51  }
52 
53  public function setSelectableTypes($a_types)
54  {
55  $this->selectable_types = $a_types;
56  }
57 
58  public function setRefId($a_ref_id)
59  {
60  $this->ref_id = $a_ref_id;
61  }
62 
63  public function buildLinkTarget($a_node_id, $a_type)
64  {
66 
67  //$ilCtrl->setParameterByClass($this->parent_class, "subCmd", "selectGlossary");
68  $ilCtrl->setParameterByClass($this->parent_class, "glo_ref_id", $a_node_id);
69  $link = $ilCtrl->getLinkTargetByClass($this->parent_class, "selectGlossary");
70 
71  return $link;
72  }
73 
74 
78  public function isClickable($a_type, $a_ref_id = 0)
79  {
81  $ilAccess = $this->access;
82 
83  if ($a_type == "glo" &&
84  $ilAccess->checkAccess("read", "", $a_ref_id)) {
85  return true;
86  }
87  return false;
88  }
89 
93  public function showChilds($a_ref_id)
94  {
95  $ilAccess = $this->access;
96 
97  if ($a_ref_id == 0) {
98  return true;
99  }
100 
101  if ($ilAccess->checkAccess("read", "", $a_ref_id)) {
102  return true;
103  } else {
104  return false;
105  }
106  }
107 
108 
116  public function formatHeader($tpl, $a_obj_id, $a_option)
117  {
118  $lng = $this->lng;
119 
120  $tpl->setCurrentBlock("icon");
121  $tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath("icon_root.svg"));
122  $tpl->setVariable("TXT_ALT_IMG", $lng->txt("repository"));
123  $tpl->parseCurrentBlock();
124 
125  $tpl->setCurrentBlock("text");
126  $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
127  $tpl->parseCurrentBlock();
128 
129  //$tpl->setCurrentBlock("row");
130  //$tpl->parseCurrentBlock();
131 
132  $tpl->touchBlock("element");
133  }
134 } // END class ilFileSelectorGUI
Select file for being added into file lists.
formatHeader($tpl, $a_obj_id, $a_option)
overwritten method from base class public
buildLinkTarget($a_node_id, $a_type)
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
isClickable($a_type, $a_ref_id=0)
Item clickable?
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
Class ilExplorer class for explorer view in admin frame.
__construct($a_target, $a_par_class="")
Constructor public.
showChilds($a_ref_id)
Show childs y/n?