ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWorkspaceFolderExplorer Class Reference

Explorer View for Workspace Folders. More...

+ Inheritance diagram for ilWorkspaceFolderExplorer:
+ Collaboration diagram for ilWorkspaceFolderExplorer:

Public Member Functions

 __construct ($a_target, $a_user_id)
 Constructor @access public. More...
 
 setEnableSmallMode ($a_enablesmallmode)
 Set Enable Small Mode. More...
 
 getEnableSmallMode ()
 Get Enable Small Mode. More...
 
 setOutput ($a_parent, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Overwritten method from class.Explorer.php to avoid checkAccess selects recursive method @access public. More...
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 overwritten method from base class @access public More...
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) @access private More...
 
 buildLinkTarget ($a_node_id, $a_type)
 overwritten method from base class get link target More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 overwritten method from base class buid link target More...
 
 setAllowedTypes ($a_types)
 set the alowed object types @access private More...
 
 setShowDetails ($s_details)
 set details mode @access public More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 overwritten method from base class buid decription More...
 
 getImageAlt ($a_def, $a_type="", $a_obj_id="")
 get image alt text More...
 
 hasFolders ($a_node_id)
 
 getParentNode ($a_node_id)
 
 getOutput ()
 Creates output recursive method @access public. More...
 
- Public Member Functions inherited from ilExplorer
 __construct ($a_target)
 Constructor @access public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column @access public More...
 
 setOrderDirection ($a_direction)
 set the order direction @access public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string @access public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string @access public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method @access public. More...
 
 modifyChilds ($a_parent_id, $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method @access public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject ($tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method @access private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter @access private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view @access private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING @access private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id @access private More...
 
 addFilter ($a_item)
 adds item to the filter @access public More...
 
 delFilter ($a_item)
 removes item from the filter @access public More...
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) @access private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter @access public More...
 
 checkFilter ($a_item)
 check if item is in filter @access private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array @access private More...
 

Data Fields

 $user_id
 
 $root_id
 
 $allowed_types
 
- Data Fields inherited from ilExplorer
 $id
 
 $output
 
 $format_options
 
 $tree
 
 $target
 
 $target_get
 
 $params_get
 
 $expanded
 
 $order_column
 
 $order_direction = "asc"
 
 $expand_target
 
 $rbac_check
 
 $output_icons
 
 $expand_variable
 
 $is_clickable
 
 $post_sort
 
 $filtered = false
 
 $filter_mode
 
 $expand_all = false
 
 $root_id = null
 
 $use_standard_frame = false
 

Protected Attributes

 $ctrl
 
- Protected Attributes inherited from ilExplorer
 $obj_definition
 
 $error
 
 $rbacsystem
 
 $tpl
 
 $lng
 

Detailed Description

Explorer View for Workspace Folders.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 10 of file class.ilWorkspaceFolderExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceFolderExplorer::__construct (   $a_target,
  $a_user_id 
)

Constructor @access public.

Parameters
stringscriptname
intuser_id

Definition at line 44 of file class.ilWorkspaceFolderExplorer.php.

45 {
46 global $DIC;
47
48 $this->lng = $DIC->language();
49 $this->ctrl = $DIC->ctrl();
50 $this->tpl = $DIC["tpl"];
51 parent::__construct($a_target);
52 $this->tree = new ilWorkspaceTree($a_user_id);
53 $this->root_id = $this->tree->readRootId();
54 $this->user_id = $a_user_id;
55 $this->allowed_types = array('wfld', 'wsrt');
56 $this->enablesmallmode = false;
57 }
Tree handler for personal workspace.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildDescription()

ilWorkspaceFolderExplorer::buildDescription (   $a_desc,
  $a_id,
  $a_type 
)

overwritten method from base class buid decription

Reimplemented from ilExplorer.

Definition at line 257 of file class.ilWorkspaceFolderExplorer.php.

258 {
259 if ($this->show_details == 'y' && !empty($a_desc)) {
260 return $a_desc;
261 } else {
262 return "";
263 }
264 }

◆ buildFrameTarget()

ilWorkspaceFolderExplorer::buildFrameTarget (   $a_type,
  $a_child = 0,
  $a_obj_id = 0 
)

overwritten method from base class buid link target

Reimplemented from ilExplorer.

Definition at line 229 of file class.ilWorkspaceFolderExplorer.php.

230 {
231 return '';
232 }

◆ buildLinkTarget()

ilWorkspaceFolderExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

overwritten method from base class get link target

Reimplemented from ilExplorer.

Definition at line 208 of file class.ilWorkspaceFolderExplorer.php.

209 {
211
212 switch ($a_type) {
213 case "wsrt":
214 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "wsp_id", $a_node_id);
215 return $ilCtrl->getLinkTargetByClass("ilobjworkspacerootfoldergui", "");
216
217 case "wfld":
218 $ilCtrl->setParameterByClass("ilobjworkspacefoldergui", "wsp_id", $a_node_id);
219 return $ilCtrl->getLinkTargetByClass("ilobjworkspacefoldergui", "");
220
221 default:
222 return;
223 }
224 }
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92

References $a_type, $ctrl, and $ilCtrl.

Referenced by formatHeader().

+ Here is the caller graph for this function:

◆ formatHeader()

ilWorkspaceFolderExplorer::formatHeader (   $tpl,
  $a_obj_id,
  $a_option 
)

overwritten method from base class @access public

Parameters
integerobj_id
integerarray options
Returns
string

Reimplemented from ilExplorer.

Definition at line 152 of file class.ilWorkspaceFolderExplorer.php.

153 {
156
157 $title = $lng->txt("personal_resources");
158
159 $tpl->setCurrentBlock("icon");
160 $tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath("icon_wsrt.svg"));
161 $tpl->setVariable("TXT_ALT_IMG", $title);
162 $tpl->parseCurrentBlock();
163
164 $tpl->setCurrentBlock("link");
165 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($this->root_id, "wsrt"));
166 $tpl->setVariable("TITLE", $title);
167
168 // highlighting
169 $style_class = $this->getNodeStyleClass($this->root_id, "wsrt");
170 if ($style_class != "") {
171 $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
172 }
173
174 $tpl->parseCurrentBlock();
175 }
getNodeStyleClass($a_id, $a_type)
get style class for node
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
buildLinkTarget($a_node_id, $a_type)
overwritten method from base class get link target

References $ctrl, $ilCtrl, ilExplorer\$lng, ilExplorer\$tpl, buildLinkTarget(), ilUtil\getImagePath(), and ilExplorer\getNodeStyleClass().

+ Here is the call graph for this function:

◆ getEnableSmallMode()

ilWorkspaceFolderExplorer::getEnableSmallMode ( )

Get Enable Small Mode.

Returns
boolean Enable Small Mode

Definition at line 74 of file class.ilWorkspaceFolderExplorer.php.

75 {
76 return $this->enablesmallmode;
77 }

◆ getImageAlt()

ilWorkspaceFolderExplorer::getImageAlt (   $a_default_text,
  $a_type = "",
  $a_obj_id = "" 
)

get image alt text

Reimplemented from ilExplorer.

Definition at line 266 of file class.ilWorkspaceFolderExplorer.php.

267 {
269
270 return $lng->txt("icon") . " " . $lng->txt($a_type);
271 }

References $a_type, and ilExplorer\$lng.

◆ getOutput()

ilWorkspaceFolderExplorer::getOutput ( )

Creates output recursive method @access public.

Returns
string

Reimplemented from ilExplorer.

Definition at line 283 of file class.ilWorkspaceFolderExplorer.php.

284 {
286
287 $html = parent::getOutput();
288 $tpl->setBodyClass("std");
289 return $html;
290 }

References ilExplorer\$tpl.

◆ getParentNode()

ilWorkspaceFolderExplorer::getParentNode (   $a_node_id)

Definition at line 278 of file class.ilWorkspaceFolderExplorer.php.

279 {
280 return $this->tree->getParentId($a_node_id);
281 }

◆ hasFolders()

ilWorkspaceFolderExplorer::hasFolders (   $a_node_id)

Definition at line 273 of file class.ilWorkspaceFolderExplorer.php.

274 {
275 return sizeof($this->tree->getChildsByType($a_node_id, "wfld"));
276 }

◆ setAllowedTypes()

ilWorkspaceFolderExplorer::setAllowedTypes (   $a_types)

set the alowed object types @access private

Parameters
arrayarraye of object types

Definition at line 239 of file class.ilWorkspaceFolderExplorer.php.

240 {
241 $this->allowed_types = $a_types;
242 }

◆ setEnableSmallMode()

ilWorkspaceFolderExplorer::setEnableSmallMode (   $a_enablesmallmode)

Set Enable Small Mode.

Parameters
boolean$a_enablesmallmodeEnable Small Mode

Definition at line 64 of file class.ilWorkspaceFolderExplorer.php.

65 {
66 $this->enablesmallmode = $a_enablesmallmode;
67 }

◆ setExpand()

ilWorkspaceFolderExplorer::setExpand (   $a_node_id)

set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) @access private

Parameters
stringpipe-separated integer

Reimplemented from ilExplorer.

Definition at line 183 of file class.ilWorkspaceFolderExplorer.php.

184 {
185 if ($a_node_id == "") {
186 $a_node_id = $this->root_id;
187 }
188
189 // IF ISN'T SET CREATE SESSION VARIABLE
190 if (!is_array($_SESSION[$this->expand_variable])) {
192 }
193 // IF $_GET["expand"] is positive => expand this node
194 if ($a_node_id > 0 && !in_array($a_node_id, $_SESSION[$this->expand_variable])) {
195 array_push($_SESSION[$this->expand_variable], $a_node_id);
196 }
197 // IF $_GET["expand"] is negative => compress this node
198 if ($a_node_id < 0) {
199 $key = array_keys($_SESSION[$this->expand_variable], -(int) $a_node_id);
200 unset($_SESSION[$this->expand_variable][$key[0]]);
201 }
202 $this->expanded = $_SESSION[$this->expand_variable];
203 }
$_SESSION["AccountId"]

References $_SESSION, ilExplorer\$expand_variable, and $root_id.

◆ setOutput()

ilWorkspaceFolderExplorer::setOutput (   $a_parent,
  $a_depth = 1,
  $a_obj_id = 0,
  $a_highlighted_subtree = false 
)

Overwritten method from class.Explorer.php to avoid checkAccess selects recursive method @access public.

Parameters
integerparent_node_id where to start from (default=0, 'root')
integerdepth level where to start (default=1)
Returns
string

Reimplemented from ilExplorer.

Definition at line 88 of file class.ilWorkspaceFolderExplorer.php.

89 {
91 static $counter = 0;
92
93 if ($objects = $this->tree->getChilds($a_parent, "type DESC,title")) {
94 $tab = ++$a_depth - 2;
95
96 foreach ($objects as $key => $object) {
97 if (!in_array($object["type"], $this->allowed_types)) {
98 continue;
99 }
100
101 //ask for FILTER
102 if ($object["child"] != $this->root_id) {
103 //$data = $this->tree->getParentNodeData($object["child"]);
104 $parent_index = $this->getIndex($object);
105 }
106
107 $this->format_options["$counter"]["parent"] = $object["parent"];
108 $this->format_options["$counter"]["child"] = $object["child"];
109 $this->format_options["$counter"]["title"] = $object["title"];
110 $this->format_options["$counter"]["description"] = $object["description"];
111 $this->format_options["$counter"]["type"] = $object["type"];
112 $this->format_options["$counter"]["depth"] = $tab;
113 $this->format_options["$counter"]["container"] = false;
114 $this->format_options["$counter"]["visible"] = true;
115
116 // Create prefix array
117 for ($i = 0; $i < $tab; ++$i) {
118 $this->format_options["$counter"]["tab"][] = 'blank';
119 }
120 // only if parent is expanded and visible, object is visible
121 if ($object["child"] != $this->root_id and (!in_array($object["parent"], $this->expanded)
122 or !$this->format_options["$parent_index"]["visible"])) {
123 $this->format_options["$counter"]["visible"] = false;
124 }
125
126 // if object exists parent is container
127 if ($object["child"] != $this->root_id) {
128 $this->format_options["$parent_index"]["container"] = true;
129
130 if (in_array($object["parent"], $this->expanded)) {
131 $this->format_options["$parent_index"]["tab"][($tab - 2)] = 'minus';
132 } else {
133 $this->format_options["$parent_index"]["tab"][($tab - 2)] = 'plus';
134 }
135 }
136
137 ++$counter;
138
139 // Recursive
140 $this->setOutput($object["child"], $a_depth);
141 } //foreach
142 } //if
143 } //function
getIndex($a_data)
get index of format_options array from specific ref_id,parent_id @access private
setOutput($a_parent, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
Overwritten method from class.Explorer.php to avoid checkAccess selects recursive method @access publ...
$i
Definition: metadata.php:24

References $i, ilExplorer\$lng, $tab, ilExplorer\getIndex(), and setOutput().

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShowDetails()

ilWorkspaceFolderExplorer::setShowDetails (   $s_details)

set details mode @access public

Parameters
stringy or n

Definition at line 248 of file class.ilWorkspaceFolderExplorer.php.

249 {
250 $this->show_details = $s_details;
251 }

Field Documentation

◆ $allowed_types

ilWorkspaceFolderExplorer::$allowed_types

Definition at line 36 of file class.ilWorkspaceFolderExplorer.php.

◆ $ctrl

ilWorkspaceFolderExplorer::$ctrl
protected

Definition at line 15 of file class.ilWorkspaceFolderExplorer.php.

Referenced by buildLinkTarget(), and formatHeader().

◆ $root_id

ilWorkspaceFolderExplorer::$root_id

Definition at line 29 of file class.ilWorkspaceFolderExplorer.php.

Referenced by setExpand().

◆ $user_id

ilWorkspaceFolderExplorer::$user_id

Definition at line 22 of file class.ilWorkspaceFolderExplorer.php.


The documentation for this class was generated from the following file: