ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilWorkspaceFolderExplorer Class Reference
+ 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

Definition at line 35 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 69 of file class.ilWorkspaceFolderExplorer.php.

70 {
71 global $DIC;
72
73 $this->lng = $DIC->language();
74 $this->ctrl = $DIC->ctrl();
75 $this->tpl = $DIC["tpl"];
76 parent::__construct($a_target);
77 $this->tree = new ilWorkspaceTree($a_user_id);
78 $this->root_id = $this->tree->readRootId();
79 $this->user_id = $a_user_id;
80 $this->allowed_types= array('wfld', 'wsrt');
81 $this->enablesmallmode = false;
82 }
Tree handler for personal workspace.
global $DIC
Definition: saml.php:7

References $DIC.

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 282 of file class.ilWorkspaceFolderExplorer.php.

283 {
284 if ($this->show_details=='y' && !empty($a_desc)) {
285 return $a_desc;
286 } else {
287 return "";
288 }
289 }

◆ 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 254 of file class.ilWorkspaceFolderExplorer.php.

255 {
256 return '';
257 }

◆ buildLinkTarget()

ilWorkspaceFolderExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

overwritten method from base class get link target

Reimplemented from ilExplorer.

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

234 {
236
237 switch ($a_type) {
238 case "wsrt":
239 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "wsp_id", $a_node_id);
240 return $ilCtrl->getLinkTargetByClass("ilobjworkspacerootfoldergui", "");
241
242 case "wfld":
243 $ilCtrl->setParameterByClass("ilobjworkspacefoldergui", "wsp_id", $a_node_id);
244 return $ilCtrl->getLinkTargetByClass("ilobjworkspacefoldergui", "");
245
246 default:
247 return;
248 }
249 }
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 177 of file class.ilWorkspaceFolderExplorer.php.

178 {
181
182 $title = $lng->txt("wsp_personal_workspace");
183
184 $tpl->setCurrentBlock("icon");
185 $tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath("icon_wsrt.svg"));
186 $tpl->setVariable("TXT_ALT_IMG", $title);
187 $tpl->parseCurrentBlock();
188
189 $tpl->setCurrentBlock("link");
190 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($this->root_id, "wsrt"));
191 $tpl->setVariable("TITLE", $title);
192
193 // highlighting
194 $style_class = $this->getNodeStyleClass($this->root_id, "wsrt");
195 if ($style_class != "") {
196 $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
197 }
198
199 $tpl->parseCurrentBlock();
200 }
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, $title, 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 99 of file class.ilWorkspaceFolderExplorer.php.

100 {
101 return $this->enablesmallmode;
102 }

◆ getImageAlt()

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

get image alt text

Reimplemented from ilExplorer.

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

292 {
294
295 return $lng->txt("icon") . " " . $lng->txt($a_type);
296 }

References $a_type, and ilExplorer\$lng.

◆ getOutput()

ilWorkspaceFolderExplorer::getOutput ( )

Creates output recursive method @access public.

Returns
string

Reimplemented from ilExplorer.

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

309 {
311
312 $html = parent::getOutput();
313 $tpl->setBodyClass("std");
314 return $html;
315 }
$html
Definition: example_001.php:87

References $html, and ilExplorer\$tpl.

◆ getParentNode()

ilWorkspaceFolderExplorer::getParentNode (   $a_node_id)

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

304 {
305 return $this->tree->getParentId($a_node_id);
306 }

◆ hasFolders()

ilWorkspaceFolderExplorer::hasFolders (   $a_node_id)

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

299 {
300 return sizeof($this->tree->getChildsByType($a_node_id, "wfld"));
301 }

◆ setAllowedTypes()

ilWorkspaceFolderExplorer::setAllowedTypes (   $a_types)

set the alowed object types @access private

Parameters
arrayarraye of object types

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

265 {
266 $this->allowed_types = $a_types;
267 }

◆ setEnableSmallMode()

ilWorkspaceFolderExplorer::setEnableSmallMode (   $a_enablesmallmode)

Set Enable Small Mode.

Parameters
boolean$a_enablesmallmodeEnable Small Mode

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

90 {
91 $this->enablesmallmode = $a_enablesmallmode;
92 }

◆ 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 208 of file class.ilWorkspaceFolderExplorer.php.

209 {
210 if ($a_node_id == "") {
211 $a_node_id = $this->root_id;
212 }
213
214 // IF ISN'T SET CREATE SESSION VARIABLE
215 if (!is_array($_SESSION[$this->expand_variable])) {
217 }
218 // IF $_GET["expand"] is positive => expand this node
219 if ($a_node_id > 0 && !in_array($a_node_id, $_SESSION[$this->expand_variable])) {
220 array_push($_SESSION[$this->expand_variable], $a_node_id);
221 }
222 // IF $_GET["expand"] is negative => compress this node
223 if ($a_node_id < 0) {
224 $key = array_keys($_SESSION[$this->expand_variable], -(int) $a_node_id);
225 unset($_SESSION[$this->expand_variable][$key[0]]);
226 }
227 $this->expanded = $_SESSION[$this->expand_variable];
228 }
$_SESSION["AccountId"]
$key
Definition: croninfo.php:18

References $_SESSION, ilExplorer\$expand_variable, $key, 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 113 of file class.ilWorkspaceFolderExplorer.php.

114 {
116 static $counter = 0;
117
118 if ($objects = $this->tree->getChilds($a_parent, "type DESC,title")) {
119 $tab = ++$a_depth - 2;
120
121 foreach ($objects as $key => $object) {
122 if (!in_array($object["type"], $this->allowed_types)) {
123 continue;
124 }
125
126 //ask for FILTER
127 if ($object["child"] != $this->root_id) {
128 //$data = $this->tree->getParentNodeData($object["child"]);
129 $parent_index = $this->getIndex($object);
130 }
131
132 $this->format_options["$counter"]["parent"] = $object["parent"];
133 $this->format_options["$counter"]["child"] = $object["child"];
134 $this->format_options["$counter"]["title"] = $object["title"];
135 $this->format_options["$counter"]["description"] = $object["description"];
136 $this->format_options["$counter"]["type"] = $object["type"];
137 $this->format_options["$counter"]["depth"] = $tab;
138 $this->format_options["$counter"]["container"] = false;
139 $this->format_options["$counter"]["visible"] = true;
140
141 // Create prefix array
142 for ($i = 0; $i < $tab; ++$i) {
143 $this->format_options["$counter"]["tab"][] = 'blank';
144 }
145 // only if parent is expanded and visible, object is visible
146 if ($object["child"] != $this->root_id and (!in_array($object["parent"], $this->expanded)
147 or !$this->format_options["$parent_index"]["visible"])) {
148 $this->format_options["$counter"]["visible"] = false;
149 }
150
151 // if object exists parent is container
152 if ($object["child"] != $this->root_id) {
153 $this->format_options["$parent_index"]["container"] = true;
154
155 if (in_array($object["parent"], $this->expanded)) {
156 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
157 } else {
158 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'plus';
159 }
160 }
161
162 ++$counter;
163
164 // Recursive
165 $this->setOutput($object["child"], $a_depth);
166 } //foreach
167 } //if
168 } //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...
$counter
$i
Definition: disco.tpl.php:19

References $counter, $i, $key, 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 273 of file class.ilWorkspaceFolderExplorer.php.

274 {
275 $this->show_details = $s_details;
276 }

Field Documentation

◆ $allowed_types

ilWorkspaceFolderExplorer::$allowed_types

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

◆ $ctrl

ilWorkspaceFolderExplorer::$ctrl
protected

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

Referenced by buildLinkTarget(), and formatHeader().

◆ $root_id

ilWorkspaceFolderExplorer::$root_id

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

Referenced by setExpand().

◆ $user_id

ilWorkspaceFolderExplorer::$user_id

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


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