ILIAS  release_8 Revision v8.24
class.ilTestQuestionPoolSelectorExplorer.php
Go to the documentation of this file.
1<?php
2
26{
27 protected $availableQuestionPools = array();
28
29 public function __construct($targetGUI, $roundtripCMD, $selectCMD)
30 {
31 parent::__construct($targetGUI, $roundtripCMD, $targetGUI, $selectCMD);
32
33 $this->setTypeWhiteList(array('grp', 'cat', 'crs', 'fold', 'qpl'));
34 $this->setClickableTypes(array('qpl'));
35 $this->setSelectMode('', false);
36 $this->selection_par = 'quest_pool_ref';
37 }
38
39 public function getAvailableQuestionPools(): array
40 {
42 }
43
45 {
46 $this->availableQuestionPools = $availableQuestionPools;
47 }
48
49 public function isAvailableQuestionPool($qplRefId): bool
50 {
51 /* @var ilObjectDataCache $objCache */
52 $objCache = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilObjDataCache'] : $GLOBALS['ilObjDataCache'];
53
54 $qplObjId = $objCache->lookupObjId((int) $qplRefId);
55 return in_array($qplObjId, $this->getAvailableQuestionPools());
56 }
57
58 public function isNodeClickable($a_node): bool
59 {
60 if ($a_node['type'] != 'qpl') {
61 return parent::isNodeClickable($a_node);
62 }
63
64 return $this->isAvailableQuestionPool($a_node['child']);
65 }
66
67 public function isNodeVisible($a_node): bool
68 {
69 if ($a_node['type'] != 'qpl') {
70 return parent::isNodeVisible($a_node);
71 }
72
73 return $this->isAvailableQuestionPool($a_node['child']);
74 }
75}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSelectMode(string $a_postvar, bool $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
Explorer for selecting repository items.
__construct($targetGUI, $roundtripCMD, $selectCMD)
setTypeWhiteList(array $a_val)
Set type white list.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc