ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
24 public $root_id;
25 public $output;
26 public $ctrl;
27
29 public $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]) {
73 }
74
75 $path = $tree->getPathId($ref_id);
76 foreach ((array) $path as $node_id) {
77 if (!in_array($node_id, $_SESSION[$this->expand_variable])) {
79 }
80 }
81
82 $this->expanded = $_SESSION[$this->expand_variable];
83 }
84
85 public function setSelectableType($a_type)
86 {
87 $this->selectable_type = $a_type;
88 }
89 public function setRefId($a_ref_id)
90 {
91 $this->ref_id = $a_ref_id;
92 }
93
94
95 public function buildLinkTarget($a_node_id, $a_type)
96 {
97 if ($a_type == $this->selectable_type) {
98 $this->ctrl->setParameterByClass($this->target_class, 'source_id', $a_node_id);
99 return $this->ctrl->getLinkTargetByClass($this->target_class, 'linkChilds');
100 } else {
101 $this->ctrl->setParameterByClass($this->target_class, "ref_id", $this->ref_id);
102 return $this->ctrl->getLinkTargetByClass($this->target_class, 'addSolutionHint');
103 }
104 }
105
106 public function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
107 {
108 return '';
109 }
110
111 public function isClickable($a_type, $a_ref_id = 0)
112 {
113 return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
114 }
115
116 public function showChilds($a_ref_id)
117 {
118 global $rbacsystem;
119
120 if ($a_ref_id == 0) {
121 return true;
122 }
123
124 if ($rbacsystem->checkAccess("read", $a_ref_id)) {
125 return true;
126 } else {
127 return false;
128 }
129 }
130} // END class ilSolutionExplorer
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
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...
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
isClickable($a_type, $a_ref_id=0)
check if links for certain object type are activated
__construct($a_target, $a_target_class)
Constructor @access public.
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92