ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestResultsToolbarGUI Class Reference
+ Inheritance diagram for ilTestResultsToolbarGUI:
+ Collaboration diagram for ilTestResultsToolbarGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilTemplate $tpl, ilLanguage $lng)
 
 build ()
 
 setPdfExportLinkTarget ($pdfExportLinkTarget)
 
 getPdfExportLinkTarget ()
 
 setCertificateLinkTarget ($certificateLinkTarget)
 
 getCertificateLinkTarget ()
 
 setShowBestSolutionsLinkTarget ($showBestSolutionsLinkTarget)
 
 getShowBestSolutionsLinkTarget ()
 
 setHideBestSolutionsLinkTarget ($hideBestSolutionsLinkTarget)
 
 getHideBestSolutionsLinkTarget ()
 
 setParticipantSelectorOptions ($participantSelectorOptions)
 
 getParticipantSelectorOptions ()
 
 getParticipantSelectorOptionsWithHintOption ()
 
 isSkillResultButtonEnabled ()
 
 setSkillResultButtonEnabled ($skillResultButtonEnabled)
 
- Public Member Functions inherited from ilToolbarGUI
 __construct ()
 
 setFormAction ($a_val, $a_multipart=false, $a_target="")
 Set form action (if form action is set, toolbar is wrapped into form tags) More...
 
 getFormAction ()
 Get form action. More...
 
 setLeadingImage ($a_img, $a_alt)
 Set leading image. More...
 
 setHidden ($a_val)
 Set hidden. More...
 
 getHidden ()
 Get hidden. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 addButton ( $a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
 Add button to toolbar. More...
 
 addFormButton ($a_txt, $a_cmd, $a_acc_key="", $a_primary=false, $a_class=false)
 Add form button to toolbar. More...
 
 addInputItem (ilToolbarItem $a_item, $a_output_label=false)
 Add input item. More...
 
 addStickyItem ($a_item, $a_output_label=false)
 Add a sticky item. More...
 
 addButtonInstance (ilButtonBase $a_button)
 Add button instance. More...
 
 addDropDown ($a_txt, $a_dd_html)
 Add input item. More...
 
 addSeparator ()
 Add separator. More...
 
 addText ($a_text)
 Add text. More...
 
 addSpacer ($a_width=null)
 Add spacer. More...
 
 addComponent (\ILIAS\UI\Component\Component $a_comp)
 Add component. More...
 
 addLink ($a_caption, $a_url, $a_disabled=false)
 Add link. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 setFormName ($a_val)
 Set form name. More...
 
 getFormName ()
 Get form name. More...
 
 getGroupedItems ()
 Get all groups (items separated by a separator) More...
 
 getItems ()
 
 setItems ($items)
 

Data Fields

 $ctrl = null
 
 $tpl = null
 
 $lng = null
 
- Data Fields inherited from ilToolbarGUI
 $items = array()
 

Private Member Functions

 getPdfExportLabel ()
 

Private Attributes

 $pdfExportLinkTarget = null
 
 $certificateLinkTarget = null
 
 $showBestSolutionsLinkTarget = null
 
 $hideBestSolutionsLinkTarget = null
 
 $participantSelectorOptions = array()
 
 $skillResultButtonEnabled = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilToolbarGUI
 applyAutoStickyToSingleElement ()
 If the toolbar consists of only one button, make it sticky Note: Atm this is only possible for buttons. More...
 
- Protected Attributes inherited from ilToolbarGUI
 $lng
 
 $id = ''
 
 $form_action = ''
 
 $hidden
 
 $lead_img
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $form_target = ""
 
 $form_name = ""
 
 $prevent_double_submission = false
 
 $sticky_items = array()
 
 $has_separator = false
 
- Static Protected Attributes inherited from ilToolbarGUI
static $instances = 0
 

Detailed Description

Definition at line 13 of file class.ilTestResultsToolbarGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestResultsToolbarGUI::__construct ( ilCtrl  $ctrl,
ilTemplate  $tpl,
ilLanguage  $lng 
)

Definition at line 60 of file class.ilTestResultsToolbarGUI.php.

References $ctrl, $lng, and $tpl.

61  {
62  $this->ctrl = $ctrl;
63  $this->tpl = $tpl;
64  $this->lng = $lng;
65 
66  parent::__construct();
67  }

Member Function Documentation

◆ build()

ilTestResultsToolbarGUI::build ( )

Definition at line 69 of file class.ilTestResultsToolbarGUI.php.

References ilToolbarGUI\addButton(), ilToolbarGUI\addButtonInstance(), ilToolbarGUI\addInputItem(), ilToolbarGUI\addSeparator(), ilTestSkillEvaluationGUI\CMD_SHOW, getCertificateLinkTarget(), getHideBestSolutionsLinkTarget(), ilLinkButton\getInstance(), getParticipantSelectorOptions(), getParticipantSelectorOptionsWithHintOption(), getPdfExportLabel(), getPdfExportLinkTarget(), getShowBestSolutionsLinkTarget(), isSkillResultButtonEnabled(), and ilToolbarGUI\setId().

70  {
71  $this->setId('tst_results_toolbar');
72 
73  if ($this->isSkillResultButtonEnabled()) {
74  require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
75 
76  $link = ilLinkButton::getInstance(); // always returns a new instance
77  $link->setUrl($this->ctrl->getLinkTargetByClass('ilTestSkillEvaluationGUI', ilTestSkillEvaluationGUI::CMD_SHOW));
78  $link->setCaption($this->lng->txt("tst_show_comp_results"), false);
79  $this->addButtonInstance($link);
80 
81  $this->addSeparator();
82  }
83 
84  $this->addButton($this->lng->txt('print'), 'javascript:window.print();');
85 
86  if (strlen($this->getPdfExportLinkTarget())) {
87  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
88  $link = ilLinkButton::getInstance(); // always returns a new instance
89  $link->setUrl($this->getPdfExportLinkTarget());
90  $link->setCaption($this->getPdfExportLabel(), false);
91  $link->setOmitPreventDoubleSubmission(true);
92  $this->addButtonInstance($link);
93  }
94 
95  if (strlen($this->getCertificateLinkTarget())) {
96  $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget());
97  }
98 
99  if (strlen($this->getShowBestSolutionsLinkTarget())) {
100  $this->addSeparator();
101  $this->addButton($this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget());
102  } elseif (strlen($this->getHideBestSolutionsLinkTarget())) {
103  $this->addSeparator();
104  $this->addButton($this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget());
105  }
106 
107  if (count($this->getParticipantSelectorOptions())) {
108  $this->addSeparator();
109 
110  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
111  $sel = new ilSelectInputGUI('', 'active_id');
112  $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption());
113  $this->addInputItem($sel);
114 
115  $link = ilLinkButton::getInstance(); // always returns a new instance
116  $link->setUrl('#');
117  $link->setId('ilTestResultParticipantJumper');
118  $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false);
119  $this->addButtonInstance($link);
120 
121  $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js');
122  }
123  }
setId($a_val)
Set id.
This class represents a selection list property in a property form.
addButtonInstance(ilButtonBase $a_button)
Add button instance.
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
addSeparator()
Add separator.
addButton( $a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
Add button to toolbar.
+ Here is the call graph for this function:

◆ getCertificateLinkTarget()

ilTestResultsToolbarGUI::getCertificateLinkTarget ( )

Definition at line 145 of file class.ilTestResultsToolbarGUI.php.

References $certificateLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getHideBestSolutionsLinkTarget ( )

Definition at line 165 of file class.ilTestResultsToolbarGUI.php.

References $hideBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getParticipantSelectorOptions()

ilTestResultsToolbarGUI::getParticipantSelectorOptions ( )

Definition at line 175 of file class.ilTestResultsToolbarGUI.php.

References $participantSelectorOptions.

Referenced by build(), and getParticipantSelectorOptionsWithHintOption().

+ Here is the caller graph for this function:

◆ getParticipantSelectorOptionsWithHintOption()

ilTestResultsToolbarGUI::getParticipantSelectorOptionsWithHintOption ( )

Definition at line 180 of file class.ilTestResultsToolbarGUI.php.

References $key, $options, array, and getParticipantSelectorOptions().

Referenced by build().

181  {
182  $options = array($this->lng->txt('tst_res_jump_to_participant_hint_opt'));
183 
184  if (function_exists('array_replace')) {
185  return array_replace($options, $this->getParticipantSelectorOptions());
186  }
187 
188  foreach ($this->getParticipantSelectorOptions() as $key => $val) {
189  $options[$key] = $val;
190  }
191 
192  return $options;
193  }
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPdfExportLabel()

ilTestResultsToolbarGUI::getPdfExportLabel ( )
private

Definition at line 125 of file class.ilTestResultsToolbarGUI.php.

Referenced by build().

126  {
127  return $this->lng->txt('pdf_export');
128  }
+ Here is the caller graph for this function:

◆ getPdfExportLinkTarget()

ilTestResultsToolbarGUI::getPdfExportLinkTarget ( )

Definition at line 135 of file class.ilTestResultsToolbarGUI.php.

References $pdfExportLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getShowBestSolutionsLinkTarget ( )

Definition at line 155 of file class.ilTestResultsToolbarGUI.php.

References $showBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ isSkillResultButtonEnabled()

ilTestResultsToolbarGUI::isSkillResultButtonEnabled ( )

Definition at line 195 of file class.ilTestResultsToolbarGUI.php.

References $skillResultButtonEnabled.

Referenced by build().

+ Here is the caller graph for this function:

◆ setCertificateLinkTarget()

ilTestResultsToolbarGUI::setCertificateLinkTarget (   $certificateLinkTarget)

Definition at line 140 of file class.ilTestResultsToolbarGUI.php.

References $certificateLinkTarget.

141  {
142  $this->certificateLinkTarget = $certificateLinkTarget;
143  }

◆ setHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setHideBestSolutionsLinkTarget (   $hideBestSolutionsLinkTarget)

Definition at line 160 of file class.ilTestResultsToolbarGUI.php.

References $hideBestSolutionsLinkTarget.

161  {
162  $this->hideBestSolutionsLinkTarget = $hideBestSolutionsLinkTarget;
163  }

◆ setParticipantSelectorOptions()

ilTestResultsToolbarGUI::setParticipantSelectorOptions (   $participantSelectorOptions)

Definition at line 170 of file class.ilTestResultsToolbarGUI.php.

References $participantSelectorOptions.

171  {
172  $this->participantSelectorOptions = $participantSelectorOptions;
173  }

◆ setPdfExportLinkTarget()

ilTestResultsToolbarGUI::setPdfExportLinkTarget (   $pdfExportLinkTarget)

Definition at line 130 of file class.ilTestResultsToolbarGUI.php.

References $pdfExportLinkTarget.

131  {
132  $this->pdfExportLinkTarget = $pdfExportLinkTarget;
133  }

◆ setShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setShowBestSolutionsLinkTarget (   $showBestSolutionsLinkTarget)

Definition at line 150 of file class.ilTestResultsToolbarGUI.php.

References $showBestSolutionsLinkTarget.

151  {
152  $this->showBestSolutionsLinkTarget = $showBestSolutionsLinkTarget;
153  }

◆ setSkillResultButtonEnabled()

ilTestResultsToolbarGUI::setSkillResultButtonEnabled (   $skillResultButtonEnabled)

Definition at line 200 of file class.ilTestResultsToolbarGUI.php.

References $skillResultButtonEnabled.

201  {
202  $this->skillResultButtonEnabled = $skillResultButtonEnabled;
203  }

Field Documentation

◆ $certificateLinkTarget

ilTestResultsToolbarGUI::$certificateLinkTarget = null
private

◆ $ctrl

ilTestResultsToolbarGUI::$ctrl = null

Definition at line 18 of file class.ilTestResultsToolbarGUI.php.

Referenced by __construct().

◆ $hideBestSolutionsLinkTarget

ilTestResultsToolbarGUI::$hideBestSolutionsLinkTarget = null
private

◆ $lng

ilTestResultsToolbarGUI::$lng = null

Definition at line 28 of file class.ilTestResultsToolbarGUI.php.

Referenced by __construct().

◆ $participantSelectorOptions

ilTestResultsToolbarGUI::$participantSelectorOptions = array()
private

◆ $pdfExportLinkTarget

ilTestResultsToolbarGUI::$pdfExportLinkTarget = null
private

◆ $showBestSolutionsLinkTarget

ilTestResultsToolbarGUI::$showBestSolutionsLinkTarget = null
private

◆ $skillResultButtonEnabled

ilTestResultsToolbarGUI::$skillResultButtonEnabled = false
private

◆ $tpl

ilTestResultsToolbarGUI::$tpl = null

Definition at line 23 of file class.ilTestResultsToolbarGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: