ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilFileSelectorGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14include_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
16{
23 function __construct($a_target, $a_par_class = "ilpcfilelistgui")
24 {
25 global $tree,$ilCtrl;
26
27 $this->ctrl =& $ilCtrl;
28 $this->parent_class = $a_par_class;
29 parent::ilExplorer($a_target);
30
31 $this->force_open_path = array();
32 if ($_GET["ref_id"] > 0)
33 {
34 $this->force_open_path = $tree->getPathId($_GET["ref_id"]);
35 }
36 $this->setFrameTarget("");
37 }
38
39 function setSelectableTypes($a_types)
40 {
41 $this->selectable_types = $a_types;
42 }
43
44 function setRefId($a_ref_id)
45 {
46 $this->ref_id = $a_ref_id;
47 }
48
49 function buildLinkTarget($a_node_id, $a_type)
50 {
51 global $ilCtrl;
52
53 $ilCtrl->setParameterByClass($this->parent_class, "subCmd", "selectFile");
54 $ilCtrl->setParameterByClass($this->parent_class, "file_ref_id", $a_node_id);
55 $link = $ilCtrl->getLinkTargetByClass($this->parent_class, $_GET["cmd"]);
56
57 return $link;
58 }
59
60
64 function isClickable($a_type, $a_ref_id)
65 {
66 global $ilUser, $ilAccess;
67
68 if ($a_type == "file" &&
69 $ilAccess->checkAccess("write", "", $a_ref_id))
70 {
71 return true;
72 }
73 false;
74 }
75
79 function showChilds($a_ref_id)
80 {
81 global $ilAccess;
82
83 if ($a_ref_id == 0)
84 {
85 return true;
86 }
87
88 if ($ilAccess->checkAccess("read", "", $a_ref_id))
89 {
90 return true;
91 }
92 else
93 {
94 return false;
95 }
96 }
97
98
106 function formatHeader(&$tpl, $a_obj_id,$a_option)
107 {
108 global $lng, $ilias;
109
110 $tpl->setCurrentBlock("icon");
111 $tpl->setVariable("ICON_IMAGE" , ilUtil::getImagePath("icon_root.svg"));
112 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("repository"));
113 $tpl->parseCurrentBlock();
114
115 $tpl->setCurrentBlock("text");
116 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
117 $tpl->parseCurrentBlock();
118
119 //$tpl->setCurrentBlock("row");
120 //$tpl->parseCurrentBlock();
121
122 $tpl->touchBlock("element");
123
124 }
125
129 function forceExpanded($a_obj_id)
130 {
131 if (in_array($a_obj_id, $this->force_open_path))
132 {
133 return true;
134 }
135 return false;
136 }
137
138}
139?>
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
Class ilExplorer class for explorer view in admin frame.
setFrameTarget($a_target)
set target frame or not frame?
Select file for being added into file lists.
__construct($a_target, $a_par_class="ilpcfilelistgui")
Constructor @access public.
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
isClickable($a_type, $a_ref_id)
Item clickable?
formatHeader(&$tpl, $a_obj_id, $a_option)
overwritten method from base class @access public
showChilds($a_ref_id)
Show childs y/n?
forceExpanded($a_obj_id)
force expansion of node
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
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15