ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
- 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()
 

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 55 of file class.ilTestResultsToolbarGUI.php.

References $ctrl, $lng, and $tpl.

56  {
57  $this->ctrl = $ctrl;
58  $this->tpl = $tpl;
59  $this->lng = $lng;
60 
61  parent::__construct();
62  }

Member Function Documentation

◆ build()

ilTestResultsToolbarGUI::build ( )

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

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

65  {
66  $this->setId('tst_results_toolbar');
67 
68  $this->addButton($this->lng->txt('print'), 'javascript:window.print();');
69 
70  if (strlen($this->getPdfExportLinkTarget())) {
71  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
72  $link = ilLinkButton::getInstance(); // always returns a new instance
73  $link->setUrl($this->getPdfExportLinkTarget());
74  $link->setCaption($this->getPdfExportLabel(), false);
75  $link->setOmitPreventDoubleSubmission(true);
76  $this->addButtonInstance($link);
77  }
78 
79  if (strlen($this->getCertificateLinkTarget())) {
80  $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget());
81  }
82 
83  if (strlen($this->getShowBestSolutionsLinkTarget())) {
84  $this->addSeparator();
85  $this->addButton($this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget());
86  } elseif (strlen($this->getHideBestSolutionsLinkTarget())) {
87  $this->addSeparator();
88  $this->addButton($this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget());
89  }
90 
91  if (count($this->getParticipantSelectorOptions())) {
92  $this->addSeparator();
93 
94  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
95  $sel = new ilSelectInputGUI('', 'active_id');
96  $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption());
97  $this->addInputItem($sel);
98 
99  $link = ilLinkButton::getInstance(); // always returns a new instance
100  $link->setUrl('#');
101  $link->setId('ilTestResultParticipantJumper');
102  $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false);
103  $this->addButtonInstance($link);
104 
105  $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js');
106  }
107  }
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 129 of file class.ilTestResultsToolbarGUI.php.

References $certificateLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getHideBestSolutionsLinkTarget ( )

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

References $hideBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getParticipantSelectorOptions()

ilTestResultsToolbarGUI::getParticipantSelectorOptions ( )

Definition at line 159 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 164 of file class.ilTestResultsToolbarGUI.php.

References $key, PHPMailer\PHPMailer\$options, and getParticipantSelectorOptions().

Referenced by build().

165  {
166  $options = array($this->lng->txt('tst_res_jump_to_participant_hint_opt'));
167 
168  if (function_exists('array_replace')) {
169  return array_replace($options, $this->getParticipantSelectorOptions());
170  }
171 
172  foreach ($this->getParticipantSelectorOptions() as $key => $val) {
173  $options[$key] = $val;
174  }
175 
176  return $options;
177  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPdfExportLabel()

ilTestResultsToolbarGUI::getPdfExportLabel ( )
private

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

Referenced by build().

110  {
111  return $this->lng->txt('pdf_export');
112  }
+ Here is the caller graph for this function:

◆ getPdfExportLinkTarget()

ilTestResultsToolbarGUI::getPdfExportLinkTarget ( )

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

References $pdfExportLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getShowBestSolutionsLinkTarget ( )

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

References $showBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ setCertificateLinkTarget()

ilTestResultsToolbarGUI::setCertificateLinkTarget (   $certificateLinkTarget)

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

References $certificateLinkTarget.

125  {
126  $this->certificateLinkTarget = $certificateLinkTarget;
127  }

◆ setHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setHideBestSolutionsLinkTarget (   $hideBestSolutionsLinkTarget)

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

References $hideBestSolutionsLinkTarget.

145  {
146  $this->hideBestSolutionsLinkTarget = $hideBestSolutionsLinkTarget;
147  }

◆ setParticipantSelectorOptions()

ilTestResultsToolbarGUI::setParticipantSelectorOptions (   $participantSelectorOptions)

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

References $participantSelectorOptions.

155  {
156  $this->participantSelectorOptions = $participantSelectorOptions;
157  }

◆ setPdfExportLinkTarget()

ilTestResultsToolbarGUI::setPdfExportLinkTarget (   $pdfExportLinkTarget)

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

References $pdfExportLinkTarget.

Referenced by ilParticipantsTestResultsGUI\createUserResults().

115  {
116  $this->pdfExportLinkTarget = $pdfExportLinkTarget;
117  }
+ Here is the caller graph for this function:

◆ setShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setShowBestSolutionsLinkTarget (   $showBestSolutionsLinkTarget)

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

References $showBestSolutionsLinkTarget.

135  {
136  $this->showBestSolutionsLinkTarget = $showBestSolutionsLinkTarget;
137  }

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

◆ $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: