ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilWorkspaceFolderExplorer Class Reference
+ Inheritance diagram for ilWorkspaceFolderExplorer:
+ Collaboration diagram for ilWorkspaceFolderExplorer:

Public Member Functions

 __construct ($a_target, $a_user_id)
 Constructor 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 public. More...
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 overwritten method from base class 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,...) 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 private More...
 
 setShowDetails ($s_details)
 set details mode 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="")
 
 hasFolders ($a_node_id)
 
 getParentNode ($a_node_id)
 
 getOutput ()
 
- Public Member Functions inherited from ilExplorer
 __construct ($a_target)
 Constructor 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 public More...
 
 setOrderDirection ($a_direction)
 set the order direction public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string 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 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 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 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 private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id private More...
 
 addFilter ($a_item)
 adds item to the filter public More...
 
 delFilter ($a_item)
 removes item from the filter 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,...) private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter public More...
 
 checkFilter ($a_item)
 check if item is in filter private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array private More...
 

Data Fields

 $user_id
 
 $root_id
 
 $allowed_types
 
- Data Fields inherited from ilExplorer
 $id
 
 $ilias
 
 $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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceFolderExplorer::__construct (   $a_target,
  $a_user_id 
)

Constructor public.

Parameters
stringscriptname
intuser_id

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

References array.

65  {
66  parent::__construct($a_target);
67  $this->tree = new ilWorkspaceTree($a_user_id);
68  $this->root_id = $this->tree->readRootId();
69  $this->user_id = $a_user_id;
70  $this->allowed_types= array ('wfld', 'wsrt');
71  $this->enablesmallmode = false;
72  }
Tree handler for personal workspace.
Create styles array
The data for the language used.

Member Function Documentation

◆ buildDescription()

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

overwritten method from base class buid decription

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

288  {
289  if ($this->show_details=='y' && !empty($a_desc))
290  {
291  return $a_desc;
292 
293  }
294  else
295  {
296  return "";
297  }
298  }

◆ buildFrameTarget()

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

overwritten method from base class buid link target

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

260  {
261  return '';
262  }

◆ buildLinkTarget()

ilWorkspaceFolderExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

overwritten method from base class get link target

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

References $a_type, and $ilCtrl.

Referenced by formatHeader().

238  {
239  global $ilCtrl;
240 
241  switch ($a_type)
242  {
243  case "wsrt":
244  $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "wsp_id", $a_node_id);
245  return $ilCtrl->getLinkTargetByClass("ilobjworkspacerootfoldergui", "");
246 
247  case "wfld":
248  $ilCtrl->setParameterByClass("ilobjworkspacefoldergui", "wsp_id", $a_node_id);
249  return $ilCtrl->getLinkTargetByClass("ilobjworkspacefoldergui", "");
250 
251  default:
252  return;
253  }
254  }
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ formatHeader()

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

overwritten method from base class public

Parameters
integerobj_id
integerarray options
Returns
string

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

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

178  {
179  global $lng, $ilCtrl;
180 
181  $title = $lng->txt("wsp_personal_workspace");
182 
183  $tpl->setCurrentBlock("icon");
184  $tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath("icon_wsrt.svg"));
185  $tpl->setVariable("TXT_ALT_IMG", $title);
186  $tpl->parseCurrentBlock();
187 
188  $tpl->setCurrentBlock("link");
189  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($this->root_id, "wsrt"));
190  $tpl->setVariable("TITLE", $title);
191 
192  // highlighting
193  $style_class = $this->getNodeStyleClass($this->root_id, "wsrt");
194  if ($style_class != "")
195  {
196  $tpl->setVariable("A_CLASS", ' class="'.$style_class.'" ' );
197  }
198 
199  $tpl->parseCurrentBlock();
200  }
getNodeStyleClass($a_id, $a_type)
get style class for node
global $tpl
Definition: ilias.php:8
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)
global $lng
Definition: privfeed.php:17
buildLinkTarget($a_node_id, $a_type)
overwritten method from base class get link target
+ Here is the call graph for this function:

◆ getEnableSmallMode()

ilWorkspaceFolderExplorer::getEnableSmallMode ( )

Get Enable Small Mode.

Returns
boolean Enable Small Mode

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

90  {
91  return $this->enablesmallmode;
92  }

◆ getImageAlt()

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

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

References $a_type, and $lng.

301  {
302  global $lng;
303 
304  return $lng->txt("icon")." ".$lng->txt($a_type);
305  }
$a_type
Definition: workflow.php:93
global $lng
Definition: privfeed.php:17

◆ getOutput()

ilWorkspaceFolderExplorer::getOutput ( )

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

References $html, and $tpl.

318  {
319  global $tpl;
320 
321  $html = parent::getOutput();
322  $tpl->setBodyClass("std");
323  return $html;
324  }
global $tpl
Definition: ilias.php:8
$html
Definition: example_001.php:87

◆ getParentNode()

ilWorkspaceFolderExplorer::getParentNode (   $a_node_id)

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

313  {
314  return $this->tree->getParentId($a_node_id);
315  }

◆ hasFolders()

ilWorkspaceFolderExplorer::hasFolders (   $a_node_id)

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

308  {
309  return sizeof($this->tree->getChildsByType($a_node_id, "wfld"));
310  }

◆ setAllowedTypes()

ilWorkspaceFolderExplorer::setAllowedTypes (   $a_types)

set the alowed object types private

Parameters
arrayarraye of object types

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

270  {
271  $this->allowed_types = $a_types;
272  }

◆ setEnableSmallMode()

ilWorkspaceFolderExplorer::setEnableSmallMode (   $a_enablesmallmode)

Set Enable Small Mode.

Parameters
boolean$a_enablesmallmodeEnable Small Mode

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

80  {
81  $this->enablesmallmode = $a_enablesmallmode;
82  }

◆ 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,...) private

Parameters
stringpipe-separated integer

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

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

209  {
210  if ($a_node_id == "")
211  {
212  $a_node_id = $this->root_id;
213  }
214 
215  // IF ISN'T SET CREATE SESSION VARIABLE
216  if(!is_array($_SESSION[$this->expand_variable]))
217  {
219  }
220  // IF $_GET["expand"] is positive => expand this node
221  if($a_node_id > 0 && !in_array($a_node_id,$_SESSION[$this->expand_variable]))
222  {
223  array_push($_SESSION[$this->expand_variable],$a_node_id);
224  }
225  // IF $_GET["expand"] is negative => compress this node
226  if($a_node_id < 0)
227  {
228  $key = array_keys($_SESSION[$this->expand_variable],-(int) $a_node_id);
229  unset($_SESSION[$this->expand_variable][$key[0]]);
230  }
231  $this->expanded = $_SESSION[$this->expand_variable];
232  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.

◆ 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 public.

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

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

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

104  {
105  global $lng;
106  static $counter = 0;
107 
108  if ($objects = $this->tree->getChilds($a_parent,"type DESC,title"))
109  {
110  $tab = ++$a_depth - 2;
111 
112  foreach ($objects as $key => $object)
113  {
114  if (!in_array($object["type"],$this->allowed_types))
115  {
116  continue;
117  }
118 
119  //ask for FILTER
120  if ($object["child"] != $this->root_id)
121  {
122  //$data = $this->tree->getParentNodeData($object["child"]);
123  $parent_index = $this->getIndex($object);
124  }
125 
126  $this->format_options["$counter"]["parent"] = $object["parent"];
127  $this->format_options["$counter"]["child"] = $object["child"];
128  $this->format_options["$counter"]["title"] = $object["title"];
129  $this->format_options["$counter"]["description"] = $object["description"];
130  $this->format_options["$counter"]["type"] = $object["type"];
131  $this->format_options["$counter"]["depth"] = $tab;
132  $this->format_options["$counter"]["container"] = false;
133  $this->format_options["$counter"]["visible"] = true;
134 
135  // Create prefix array
136  for ($i = 0; $i < $tab; ++$i)
137  {
138  $this->format_options["$counter"]["tab"][] = 'blank';
139  }
140  // only if parent is expanded and visible, object is visible
141  if ($object["child"] != $this->root_id and (!in_array($object["parent"],$this->expanded)
142  or !$this->format_options["$parent_index"]["visible"]))
143  {
144  $this->format_options["$counter"]["visible"] = false;
145  }
146 
147  // if object exists parent is container
148  if ($object["child"] != $this->root_id)
149  {
150  $this->format_options["$parent_index"]["container"] = true;
151 
152  if (in_array($object["parent"],$this->expanded))
153  {
154  $this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
155  }
156  else
157  {
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 private
$counter
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 public...
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ setShowDetails()

ilWorkspaceFolderExplorer::setShowDetails (   $s_details)

set details mode public

Parameters
stringy or n

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

279  {
280  $this->show_details = $s_details;
281  }

Field Documentation

◆ $allowed_types

ilWorkspaceFolderExplorer::$allowed_types

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

◆ $root_id

ilWorkspaceFolderExplorer::$root_id

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

Referenced by setExpand().

◆ $user_id

ilWorkspaceFolderExplorer::$user_id

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


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