ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 $DIC;
40 $tree = $DIC['tree'];
41 $ilCtrl = $DIC['ilCtrl'];
42
43 $this->ctrl = $ilCtrl;
44 $this->target_class = $a_target_class;
45 parent::__construct($a_target);
46 $this->tree = $tree;
47 $this->root_id = $this->tree->readRootId();
48 $this->order_column = "title";
49
50 $this->setSessionExpandVariable("expand_sol");
51
52 // add here all container objects
53 $this->addFilter("root");
54 $this->addFilter("cat");
55 $this->addFilter("grp");
56 $this->addFilter("fold");
57 $this->addFilter("crs");
58
60 $this->setFiltered(true);
61 }
62
66 public function expandPathByRefId($ref_id)
67 {
71 global $DIC;
72 $tree = $DIC['tree'];
73
74 if (!$_SESSION[$this->expand_variable]) {
76 }
77
78 $path = $tree->getPathId($ref_id);
79 foreach ((array) $path as $node_id) {
80 if (!in_array($node_id, $_SESSION[$this->expand_variable])) {
82 }
83 }
84
85 $this->expanded = $_SESSION[$this->expand_variable];
86 }
87
88 public function setSelectableType($a_type)
89 {
90 $this->selectable_type = $a_type;
91 }
92 public function setRefId($a_ref_id)
93 {
94 $this->ref_id = $a_ref_id;
95 }
96
97
98 public function buildLinkTarget($a_node_id, $a_type)
99 {
100 if ($a_type == $this->selectable_type) {
101 $this->ctrl->setParameterByClass($this->target_class, 'source_id', $a_node_id);
102 return $this->ctrl->getLinkTargetByClass($this->target_class, 'linkChilds');
103 } else {
104 $this->ctrl->setParameterByClass($this->target_class, "ref_id", $this->ref_id);
105 return $this->ctrl->getLinkTargetByClass($this->target_class, 'addSolutionHint');
106 }
107 }
108
109 public function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
110 {
111 return '';
112 }
113
114 public function isClickable($a_type, $a_ref_id = 0)
115 {
116 return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
117 }
118
119 public function showChilds($a_ref_id)
120 {
121 global $DIC;
122 $rbacsystem = $DIC['rbacsystem'];
123
124 if ($a_ref_id == 0) {
125 return true;
126 }
127
128 if ($rbacsystem->checkAccess("read", $a_ref_id)) {
129 return true;
130 } else {
131 return false;
132 }
133 }
134} // 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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46