ILIAS  release_4-4 Revision
ilShopRepositoryExplorer Class Reference
+ Inheritance diagram for ilShopRepositoryExplorer:
+ Collaboration diagram for ilShopRepositoryExplorer:

Public Member Functions

 __construct ($a_target, $a_top_node=0)
 
 setForceOpenPath ($a_path)
 set force open path More...
 
 buildLinkTarget ($a_node_id, $a_type)
 note: most of this stuff is used by ilCourseContentInterface too More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path More...
 
 isClickable ($a_type, $a_ref_id, $a_obj_id=0)
 
 showChilds ($a_ref_id, $a_obj_id=0)
 
 isVisible ($a_ref_id, $a_type)
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 overwritten method from base class public More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes More...
 
 forceExpanded ($a_node)
 Force expansion of node. More...
 
- Public Member Functions inherited from ilExplorer
 ilExplorer ($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

 $root_id
 
 $output
 
 $ctrl
 
- 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 9 of file class.ilShopRepositoryExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilShopRepositoryExplorer::__construct (   $a_target,
  $a_top_node = 0 
)
Parameters
$a_target
int$a_top_node

Definition at line 24 of file class.ilShopRepositoryExplorer.php.

References $ilCtrl, ilExplorer\$tree, ilExplorer\addFilter(), IL_FM_POSITIVE, ilExplorer\setFiltered(), ilExplorer\setFilterMode(), and ilExplorer\setSessionExpandVariable().

25  {
26  global $tree, $ilCtrl;
27 
28  $this->ctrl = $ilCtrl;
29 
30  $this->force_open_path = array();
31 
32  parent::ilExplorer($a_target);
33  $this->tree = $tree;
34  $this->root_id = $this->tree->readRootId();
35  $this->order_column = "title";
36  $this->frame_target = false;
37  $this->setSessionExpandVariable("repexpand");
38  #$this->setTitle($lng->txt("overview"));
39 
40 # Es sollen nur container angezeigt werden, die entweder als container (z.B. Kurse) kaufbar sind oder kaufbare Objekte enthalten können!
41 
42 /* if ($ilSetting->get("repository_tree_pres") == "" ||
43  ($ilSetting->get("rep_tree_limit_grp_crs") && $a_top_node == 0))
44  {*/
45  $this->addFilter("root");
46  $this->addFilter("cat");
47  $this->addFilter('catr');
48  $this->addFilter("grp");
49  $this->addFilter("icrs");
50  $this->addFilter("crs");
51  $this->addFilter('crsr');
52  $this->addFilter('rcrs');
53 
54 # $this->addFilter("file");
55 # $this->addFilter("tst");
56 # $this->addFilter("exc");
57  $this->setFiltered(true);
59 /* }
60  else if ($ilSetting->get("repository_tree_pres") == "all_types")
61  {
62  foreach ($objDefinition->getAllRBACObjects() as $rtype)
63  {
64  $this->addFilter($rtype);
65  }
66  $this->setFiltered(true);
67  $this->setFilterMode(IL_FM_POSITIVE);
68  }*/
69  }
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
const IL_FM_POSITIVE
setFiltered($a_bool)
active/deactivate the filter public
global $ilCtrl
Definition: ilias.php:18
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
+ Here is the call graph for this function:

Member Function Documentation

◆ buildLinkTarget()

ilShopRepositoryExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

note: most of this stuff is used by ilCourseContentInterface too

Definition at line 82 of file class.ilShopRepositoryExplorer.php.

References $_GET, $ilCtrl, and ilLink\_getStaticLink().

83  {
84  global $ilCtrl;
85  switch($a_type)
86  {
87 
88  case "cat":
89  return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
90 
91  case "catr":
92  return "ilias.php?cmd=redirect&baseClass=ilshopcontroller&ref_id=".$a_node_id;
93 
94  case "grp":
95  return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
96 
97  case "crs":
98  return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
99 
100  case "crsr":
101  return "ilias.php?cmd=redirect&baseClass=ilshopcontroller&ref_id=".$a_node_id;
102 
103  case "icrs":
104  $ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $a_node_id);
105  $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjilinccoursegui"), "");
106  $ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $_GET["ref_id"]);
107  return $link;
108 
109  case 'rcrs':
110  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
111  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
112  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
113  return $link;
114 
115  default:
116  include_once('./Services/Link/classes/class.ilLink.php');
117  return ilLink::_getStaticLink($a_node_id, $a_type, true);
118 
119  }
120  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ forceExpanded()

ilShopRepositoryExplorer::forceExpanded (   $a_node)

Force expansion of node.

Parameters

Definition at line 403 of file class.ilShopRepositoryExplorer.php.

404  {
405  if (in_array($a_node, $this->force_open_path))
406  {
407  return true;
408  }
409  return false;
410  }

◆ formatHeader()

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

overwritten method from base class public

Parameters
integera_obj_id
integerarray options
Returns
string

Definition at line 296 of file class.ilShopRepositoryExplorer.php.

References $lng, $path, $tpl, ilExplorer\$tree, and ilObject\_getIcon().

297  {
298  global $lng, $tree;
299 
300  // custom icons
301  /*
302  if ($this->ilias->getSetting("custom_icons"))
303  {
304  require_once("./Services/Container/classes/class.ilContainer.php");
305  if (($path = ilContainer::_lookupIconPath($a_obj_id, "tiny")) == "")
306  {
307  $path = ilUtil::getImagePath("icon_root_s.png");
308  }
309  }*/
310 
311  $path = ilObject::_getIcon($a_obj_id, "tiny", "root");
312 
313  $tpl->setCurrentBlock("icon");
314  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
315  $title = $nd["title"];
316 
317  if ($title == "ILIAS")
318  {
319  $title = $lng->txt("repository");
320  }
321 
322  $tpl->setVariable("ICON_IMAGE", $path);
323  $tpl->setVariable("TXT_ALT_IMG", $lng->txt("icon")." ".$title);
324  $tpl->parseCurrentBlock();
325 
326  $tpl->setCurrentBlock("link");
327  $tpl->setVariable("TITLE", $title);
328  $tpl->setVariable("LINK_TARGET", "ilias.php?baseClass=ilshopcontroller&ref_id=1");
329 
330  #$tpl->setVariable("TARGET", " target=\"_self\"");
331  $tpl->parseCurrentBlock();
332 
333  $tpl->setCurrentBlock("element");
334  $tpl->parseCurrentBlock();
335  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ getImage()

ilShopRepositoryExplorer::getImage (   $a_name,
  $a_type = "",
  $a_obj_id = "" 
)

get image path

Definition at line 125 of file class.ilShopRepositoryExplorer.php.

References ilObject\_getIcon().

126  {
127  if ($a_type != "")
128  {
129  return ilObject::_getIcon($a_obj_id, "tiny", $a_type);
130  }
131 
132  return parent::getImage($a_name);
133  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
+ Here is the call graph for this function:

◆ isClickable()

ilShopRepositoryExplorer::isClickable (   $a_type,
  $a_ref_id,
  $a_obj_id = 0 
)

Definition at line 135 of file class.ilShopRepositoryExplorer.php.

References $ilUser, $query, $res, $row, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObjGlossary\_lookupOnline(), and DB_FETCHMODE_OBJECT.

136  {
137  global $rbacsystem,$ilDB,$ilUser,$ilAccess;
138 
139  if(!ilConditionHandler::_checkAllConditionsOfTarget($a_ref_id,$a_obj_id))
140  {
141  return false;
142  }
143 
144  switch ($a_type)
145  {
146  case "crs":
147  return $ilAccess->checkAccess("read", "", $a_ref_id);
148 
149  // visible groups can allways be clicked; group processing decides
150  // what happens next
151  case "grp":
152  return true;
153 
154  case 'tst':
155  if(!$rbacsystem->checkAccess("read", $a_ref_id))
156  {
157  return false;
158  }
159 
160  $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s",$a_obj_id);
161  $res = $ilDB->query($query);
162  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
163  {
164  return (bool) $row->complete;
165  }
166  return false;
167 
168  case 'svy':
169  if(!$rbacsystem->checkAccess("read", $a_ref_id))
170  {
171  return false;
172  }
173 
174  $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s",$a_obj_id);
175  $res = $ilDB->query($query);
176  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
177  {
178  return (bool) $row->complete;
179  }
180  return false;
181 
182  // media pools can only be edited
183  case "mep":
184  if ($rbacsystem->checkAccess("read", $a_ref_id))
185  {
186  return true;
187  }
188  else
189  {
190  return false;
191  }
192  break;
193 
194  case 'crsr':
195  case 'catr':
196  include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
198 
199 
200  // all other types are only clickable, if read permission is given
201  default:
202  if ($rbacsystem->checkAccess("read", $a_ref_id))
203  {
204  // check if lm is online
205  if ($a_type == "lm")
206  {
207  include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
208  $lm_obj =& new ilObjLearningModule($a_ref_id);
209  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write',$a_ref_id)))
210  {
211  return false;
212  }
213  }
214  // check if fblm is online
215  if ($a_type == "htlm")
216  {
217  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
218  $lm_obj =& new ilObjFileBasedLM($a_ref_id);
219  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write',$a_ref_id)))
220  {
221  return false;
222  }
223  }
224  // check if fblm is online
225  if ($a_type == "sahs")
226  {
227  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
228  $lm_obj =& new ilObjSAHSLearningModule($a_ref_id);
229  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write',$a_ref_id)))
230  {
231  return false;
232  }
233  }
234  // check if glossary is online
235  if ($a_type == "glo")
236  {
237  $obj_id = ilObject::_lookupObjectId($a_ref_id);
238  include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
239  if((!ilObjGlossary::_lookupOnline($obj_id)) &&
240  (!$rbacsystem->checkAccess('write',$a_ref_id)))
241  {
242  return false;
243  }
244  }
245 
246  return true;
247  }
248  else
249  {
250  return false;
251  }
252  break;
253  }
254  }
Class ilObjLearningModule.
File Based Learning Module (HTML) object.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static _lookupObjectId($a_ref_id)
lookup object id
_checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _isAccessible($a_ref_id)
Check if target is accessible and not deleted.
global $ilUser
Definition: imgupload.php:15
_lookupOnline($a_id)
check wether content object is online
Class ilObjSCORMLearningModule.
+ Here is the call graph for this function:

◆ isVisible()

ilShopRepositoryExplorer::isVisible (   $a_ref_id,
  $a_type 
)

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

References ilExplorer\$tree.

279  {
280  global $ilAccess,$tree;
281 
282  if(!$ilAccess->checkAccess('visible', '', $a_ref_id))
283  {
284  return false;
285  }
286  return true;
287  }

◆ setForceOpenPath()

ilShopRepositoryExplorer::setForceOpenPath (   $a_path)

set force open path

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

75  {
76  $this->force_open_path = $a_path;
77  }

◆ showChilds()

ilShopRepositoryExplorer::showChilds (   $a_ref_id,
  $a_obj_id = 0 
)

Definition at line 256 of file class.ilShopRepositoryExplorer.php.

References ilConditionHandler\_checkAllConditionsOfTarget().

257  {
258  global $rbacsystem;
259 
260  if ($a_ref_id == 0)
261  {
262  return true;
263  }
264  if(!ilConditionHandler::_checkAllConditionsOfTarget($a_ref_id,$a_obj_id))
265  {
266  return false;
267  }
268  if ($rbacsystem->checkAccess("read", $a_ref_id))
269  {
270  return true;
271  }
272  else
273  {
274  return false;
275  }
276  }
_checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
+ Here is the call graph for this function:

◆ sortNodes()

ilShopRepositoryExplorer::sortNodes (   $a_nodes,
  $a_parent_obj_id 
)

sort nodes

public

Parameters

Definition at line 344 of file class.ilShopRepositoryExplorer.php.

References $t, ilContainerSorting\_getInstance(), and ilObject\_lookupType().

345  {
346  global $objDefinition;
347 
348  if ($a_parent_obj_id > 0)
349  {
350  $parent_type = ilObject::_lookupType($a_parent_obj_id);
351  }
352  else
353  {
354  $parent_type = "dummy";
355  $this->type_grps["dummy"] = array("root" => "dummy");
356  }
357 
358  if (empty($this->type_grps[$parent_type]))
359  {
360  $this->type_grps[$parent_type] =
361  $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
362  }
363  $group = array();
364 
365  foreach ($a_nodes as $node)
366  {
367  $g = $objDefinition->getGroupOfObj($node["type"]);
368  if ($g == "")
369  {
370  $g = $node["type"];
371  }
372  $group[$g][] = $node;
373  }
374 
375  $nodes = array();
376  foreach ($this->type_grps[$parent_type] as $t => $g)
377  {
378  if (is_array($group[$t]))
379  {
380  // do we have to sort this group??
381  include_once("./Services/Container/classes/class.ilContainer.php");
382  include_once("./Services/Container/classes/class.ilContainerSorting.php");
383  $sort = ilContainerSorting::_getInstance($a_parent_obj_id);
384  $group = $sort->sortItems($group);
385 
386  foreach ($group[$t] as $k => $item)
387  {
388  $nodes[] = $item;
389  }
390  }
391  }
392 
393  return $nodes;
394  //return parent::sortNodes($a_nodes,$a_parent_obj_id);
395  }
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getInstance($a_obj_id)
get instance by obj_id
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilShopRepositoryExplorer::$ctrl

Definition at line 18 of file class.ilShopRepositoryExplorer.php.

◆ $output

ilShopRepositoryExplorer::$output

Definition at line 17 of file class.ilShopRepositoryExplorer.php.

◆ $root_id

ilShopRepositoryExplorer::$root_id

Definition at line 16 of file class.ilShopRepositoryExplorer.php.


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