ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilTestRandomQuestionSetSourcePoolDefinitionListToolbarGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
5
13{
19 public $ctrl = null;
20
26 public $lng = null;
27
33 public $questionSetConfigGUI = null;
34
40 public $questionSetConfig = null;
41
43 {
44 $this->ctrl = $ctrl;
45 $this->lng = $lng;
46 $this->questionSetConfigGUI = $questionSetConfigGUI;
47 $this->questionSetConfig = $questionSetConfig;
48
49 parent::__construct();
50 }
51
52 public function build()
53 {
54 $this->setFormAction( $this->ctrl->getFormAction($this->questionSetConfigGUI) );
55
56 if( $this->questionSetConfig->doesSelectableQuestionPoolsExist() )
57 {
59 }
60 }
61
62 private function buildSourcePoolSelectOptionsArray($availablePools)
63 {
64 $sourcePoolSelectOptionArray = array();
65
66 foreach($availablePools as $poolId => $poolData)
67 {
68 $sourcePoolSelectOptionArray[$poolId] = $poolData['title'];
69 }
70
71 return $sourcePoolSelectOptionArray;
72 }
73
75 {
76 $availablePools = $this->questionSetConfig->getSelectableQuestionPools();
77
78 require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
79 $poolSelection = new ilSelectInputGUI(null, 'quest_pool_id');
80 $poolSelection->setOptions($this->buildSourcePoolSelectOptionsArray($availablePools));
81
82 $this->addInputItem($poolSelection, true);
83
84 $this->addFormButton(
85 $this->lng->txt('tst_rnd_quest_set_tb_add_pool_btn'),
87 );
88 }
89}
This class provides processing control methods.
language handling
This class represents a selection list property in a property form.
__construct(ilCtrl $ctrl, ilLanguage $lng, ilTestRandomQuestionSetConfigGUI $questionSetConfigGUI, ilTestRandomQuestionSetConfig $questionSetConfig)
setFormAction($a_val, $a_multipart=false, $a_target="")
Set form action (if form action is set, toolbar is wrapped into form tags)
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
addFormButton($a_txt, $a_cmd, $a_acc_key="", $a_primary=false, $a_class=false)
Add form button to toolbar.