ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
13include_once "./Services/UIComponent/Explorer/classes/class.ilExplorer.php";
14include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
15
17{
18
26 var $ctrl;
27
31
37 function ilSolutionExplorer($a_target, $a_target_class)
38 {
39 global $tree,$ilCtrl;
40
41 $this->ctrl = $ilCtrl;
42 $this->target_class = $a_target_class;
43 parent::ilExplorer($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]))
81 }
82
83 $this->expanded = $_SESSION[$this->expand_variable];
84 }
85
86 function setSelectableType($a_type)
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)
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
$_SESSION["AccountId"]
const IL_FM_POSITIVE
Class ilExplorer class for explorer view in admin frame.
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter @access public
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
setFiltered($a_bool)
active/deactivate the filter @access public
showChilds($a_ref_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
isClickable($a_type, $a_ref_id)
check if links for certain object type are activated
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
ilSolutionExplorer($a_target, $a_target_class)
Constructor @access public.
global $ilCtrl
Definition: ilias.php:18
$path
Definition: index.php:22