ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 addButtonInstance (ilButton $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...
 
 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...
 
 getHTML ()
 Get toolbar html. More...
 

Data Fields

 $ctrl = null
 
 $tpl = null
 
 $lng = null
 
- Data Fields inherited from ilToolbarGUI
 $items = array()
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $form_target = ""
 
 $form_name = ""
 

Private Member Functions

 getPdfExportLabel ()
 

Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from ilToolbarGUI
 $prevent_double_submission = false
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $ctrl, $lng, and $tpl.

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

Member Function Documentation

◆ build()

ilTestResultsToolbarGUI::build ( )

Definition at line 63 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().

64  {
65  $this->setId('tst_results_toolbar');
66 
67  $this->addButton($this->lng->txt('print'), 'javascript:window.print();');
68 
69  if( strlen($this->getPdfExportLinkTarget()) )
70  {
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  {
81  $this->addButton( $this->lng->txt('certificate'), $this->getCertificateLinkTarget() );
82  }
83 
84  if( strlen($this->getShowBestSolutionsLinkTarget()) )
85  {
86  $this->addSeparator();
87  $this->addButton( $this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget() );
88  }
89  elseif( strlen($this->getHideBestSolutionsLinkTarget()) )
90  {
91  $this->addSeparator();
92  $this->addButton( $this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget() );
93  }
94 
95  if( count($this->getParticipantSelectorOptions()) )
96  {
97  $this->addSeparator();
98 
99  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
100  $sel = new ilSelectInputGUI('', 'active_id');
101  $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption());
102  $this->addInputItem($sel);
103 
104  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
105  $link = ilLinkButton::getInstance(); // always returns a new instance
106  $link->setUrl('#');
107  $link->setId('ilTestResultParticipantJumper');
108  $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false);
109  $this->addButtonInstance($link);
110 
111  $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js');
112  }
113  }
setId($a_val)
Set id.
This class represents a selection list property in a property form.
addButton($a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
Add button to toolbar.
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
addButtonInstance(ilButton $a_button)
Add button instance.
addSeparator()
Add separator.
+ Here is the call graph for this function:

◆ getCertificateLinkTarget()

ilTestResultsToolbarGUI::getCertificateLinkTarget ( )

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

References $certificateLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getHideBestSolutionsLinkTarget ( )

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

References $hideBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getParticipantSelectorOptions()

ilTestResultsToolbarGUI::getParticipantSelectorOptions ( )

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

References $options, and getParticipantSelectorOptions().

Referenced by build().

171  {
172  $options = array($this->lng->txt('tst_res_jump_to_participant_hint_opt'));
173 
174  if( function_exists('array_replace') )
175  {
176  return array_replace($options, $this->getParticipantSelectorOptions());
177  }
178 
179  foreach($this->getParticipantSelectorOptions() as $key => $val)
180  {
181  $options[$key] = $val;
182  }
183 
184  return $options;
185  }
if(!is_array($argv)) $options
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPdfExportLabel()

ilTestResultsToolbarGUI::getPdfExportLabel ( )
private

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

Referenced by build().

116  {
117  return $this->lng->txt('pdf_export');
118  }
+ Here is the caller graph for this function:

◆ getPdfExportLinkTarget()

ilTestResultsToolbarGUI::getPdfExportLinkTarget ( )

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

References $pdfExportLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getShowBestSolutionsLinkTarget ( )

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

References $certificateLinkTarget.

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

◆ setHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setHideBestSolutionsLinkTarget (   $hideBestSolutionsLinkTarget)

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

References $hideBestSolutionsLinkTarget.

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

◆ setParticipantSelectorOptions()

ilTestResultsToolbarGUI::setParticipantSelectorOptions (   $participantSelectorOptions)

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

References $participantSelectorOptions.

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

◆ setPdfExportLinkTarget()

ilTestResultsToolbarGUI::setPdfExportLinkTarget (   $pdfExportLinkTarget)

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

References $pdfExportLinkTarget.

121  {
122  $this->pdfExportLinkTarget = $pdfExportLinkTarget;
123  }

◆ setShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setShowBestSolutionsLinkTarget (   $showBestSolutionsLinkTarget)

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

References $showBestSolutionsLinkTarget.

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

Field Documentation

◆ $certificateLinkTarget

ilTestResultsToolbarGUI::$certificateLinkTarget = null
private

◆ $ctrl

ilTestResultsToolbarGUI::$ctrl = null

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

Referenced by __construct().

◆ $hideBestSolutionsLinkTarget

ilTestResultsToolbarGUI::$hideBestSolutionsLinkTarget = null
private

◆ $lng

ilTestResultsToolbarGUI::$lng = null

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

Referenced by __construct().


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