ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestSkillEvaluationToolbarGUI.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 require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
5 require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
6 
14 {
15  const SKILL_PROFILE_PARAM = 'skill_profile';
16 
20  private $ctrl;
21 
25  private $lng;
26 
27  private $parentGUI;
28  private $parentCMD;
29 
31 
33 
35 
37  {
38  $this->ctrl = $ctrl;
39  $this->lng = $lng;
40 
41  $this->parentGUI = $parentGUI;
42  $this->parentCMD = $parentCMD;
43 
45  }
46 
48  {
49  $this->availableSkillProfiles = $availableSkillProfiles;
50  }
51 
52  public function getAvailableSkillProfiles()
53  {
55  }
56 
58  {
59  $this->noSkillProfileOptionEnabled = $noSkillProfileOptionEnabled;
60  }
61 
63  {
65  }
66 
68  {
69  $this->selectedEvaluationMode = $selectedEvaluationMode;
70  }
71 
72  public function getSelectedEvaluationMode()
73  {
75  }
76 
77  public function build()
78  {
79  $this->setFormAction($this->ctrl->getFormAction($this->parentGUI));
80 
81  $select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM);
83  $select->setValue($this->getSelectedEvaluationMode());
84  $this->addInputItem($select, true);
85 
86  $this->addFormButton($this->lng->txt("select"), $this->parentCMD);
87  }
88 
90  {
91  $options = array();
92 
93  if( $this->isNoSkillProfileOptionEnabled() )
94  {
95  $options[0] = $this->lng->txt('tst_all_test_competences');;
96  }
97 
98  foreach($this->getAvailableSkillProfiles() as $skillProfileId => $skillProfileTitle)
99  {
100  $options[$skillProfileId] = "{$this->lng->txt('tst_gap_analysis')}: {$skillProfileTitle}";
101  }
102 
103  return $options;
104  }
105 
106  public static function fetchSkillProfileParam($postData)
107  {
108  if( isset($postData[self::SKILL_PROFILE_PARAM]) )
109  {
110  return (int)$postData[self::SKILL_PROFILE_PARAM];
111  }
112 
113  return 0;
114  }
115 }