ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilSolutionExplorer.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 /*
5 * Solution Explorer for question pools
6 *
7 * @author Helmut Schottmüller <helmut.schottmueller@mac.com>
8 * @version $Id$
9 *
10 * @ingroup ModulesTestQuestionPool
11 */
12 
13 include_once "./Services/UIComponent/Explorer/classes/class.ilExplorer.php";
14 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
15 
17 {
18 
24  var $root_id;
25  var $output;
26  var $ctrl;
27 
29  var $ref_id;
31 
37  public function __construct($a_target, $a_target_class)
38  {
39  global $tree,$ilCtrl;
40 
41  $this->ctrl = $ilCtrl;
42  $this->target_class = $a_target_class;
43  parent::__construct($a_target);
44  $this->tree = $tree;
45  $this->root_id = $this->tree->readRootId();
46  $this->order_column = "title";
47 
48  $this->setSessionExpandVariable("expand_sol");
49 
50  // add here all container objects
51  $this->addFilter("root");
52  $this->addFilter("cat");
53  $this->addFilter("grp");
54  $this->addFilter("fold");
55  $this->addFilter("crs");
56 
58  $this->setFiltered(true);
59  }
60 
64  public function expandPathByRefId($ref_id)
65  {
69  global $tree;
70 
71  if(!$_SESSION[$this->expand_variable])
72  {
74  }
75 
76  $path = $tree->getPathId($ref_id);
77  foreach((array)$path as $node_id)
78  {
79  if(!in_array($node_id, $_SESSION[$this->expand_variable]))
80  $_SESSION[$this->expand_variable][] = $node_id;
81  }
82 
83  $this->expanded = $_SESSION[$this->expand_variable];
84  }
85 
87  {
88  $this->selectable_type = $a_type;
89  }
90  function setRefId($a_ref_id)
91  {
92  $this->ref_id = $a_ref_id;
93  }
94 
95 
96  function buildLinkTarget($a_node_id, $a_type)
97  {
98  if($a_type == $this->selectable_type)
99  {
100  $this->ctrl->setParameterByClass($this->target_class,'source_id',$a_node_id);
101  return $this->ctrl->getLinkTargetByClass($this->target_class,'linkChilds');
102  }
103  else
104  {
105  $this->ctrl->setParameterByClass($this->target_class,"ref_id",$this->ref_id);
106  return $this->ctrl->getLinkTargetByClass($this->target_class,'addSolutionHint');
107  }
108 
109  }
110 
111  function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
112  {
113  return '';
114  }
115 
116  function isClickable($a_type, $a_ref_id = 0)
117  {
118  return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
119  }
120 
121  function showChilds($a_ref_id)
122  {
123  global $rbacsystem;
124 
125  if ($a_ref_id == 0)
126  {
127  return true;
128  }
129 
130  if ($rbacsystem->checkAccess("read", $a_ref_id))
131  {
132  return true;
133  }
134  else
135  {
136  return false;
137  }
138  }
139 
140 } // END class ilSolutionExplorer
$path
Definition: aliased.php:25
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
$_SESSION["AccountId"]
__construct($a_target, $a_target_class)
Constructor public.
isClickable($a_type, $a_ref_id=0)
const IL_FM_POSITIVE
setFiltered($a_bool)
active/deactivate the filter public
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
Create styles array
The data for the language used.
Class ilExplorer class for explorer view in admin frame.
buildLinkTarget($a_node_id, $a_type)
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)