ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 (ilToolbarItem $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...
 
 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
 $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.

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

References $ctrl, $lng, and $tpl.

Member Function Documentation

◆ build()

ilTestResultsToolbarGUI::build ( )

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

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

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().

+ Here is the call graph for this function:

◆ getCertificateLinkTarget()

ilTestResultsToolbarGUI::getCertificateLinkTarget ( )

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

References $certificateLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getHideBestSolutionsLinkTarget ( )

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

References $hideBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getParticipantSelectorOptions()

ilTestResultsToolbarGUI::getParticipantSelectorOptions ( )

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

188 {
189 $options = array($this->lng->txt('tst_res_jump_to_participant_hint_opt'));
190
191 if( function_exists('array_replace') )
192 {
193 return array_replace($options, $this->getParticipantSelectorOptions());
194 }
195
196 foreach($this->getParticipantSelectorOptions() as $key => $val)
197 {
198 $options[$key] = $val;
199 }
200
201 return $options;
202 }
if(!is_array($argv)) $options

References $options, and getParticipantSelectorOptions().

Referenced by build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPdfExportLabel()

ilTestResultsToolbarGUI::getPdfExportLabel ( )
private

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

133 {
134 return $this->lng->txt('pdf_export');
135 }

Referenced by build().

+ Here is the caller graph for this function:

◆ getPdfExportLinkTarget()

ilTestResultsToolbarGUI::getPdfExportLinkTarget ( )

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

References $pdfExportLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ getShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getShowBestSolutionsLinkTarget ( )

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

References $showBestSolutionsLinkTarget.

Referenced by build().

+ Here is the caller graph for this function:

◆ isSkillResultButtonEnabled()

ilTestResultsToolbarGUI::isSkillResultButtonEnabled ( )

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

148 {
149 $this->certificateLinkTarget = $certificateLinkTarget;
150 }

References $certificateLinkTarget.

◆ setHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setHideBestSolutionsLinkTarget (   $hideBestSolutionsLinkTarget)

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

168 {
169 $this->hideBestSolutionsLinkTarget = $hideBestSolutionsLinkTarget;
170 }

References $hideBestSolutionsLinkTarget.

◆ setParticipantSelectorOptions()

ilTestResultsToolbarGUI::setParticipantSelectorOptions (   $participantSelectorOptions)

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

178 {
179 $this->participantSelectorOptions = $participantSelectorOptions;
180 }

References $participantSelectorOptions.

◆ setPdfExportLinkTarget()

ilTestResultsToolbarGUI::setPdfExportLinkTarget (   $pdfExportLinkTarget)

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

138 {
139 $this->pdfExportLinkTarget = $pdfExportLinkTarget;
140 }

References $pdfExportLinkTarget.

◆ setShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setShowBestSolutionsLinkTarget (   $showBestSolutionsLinkTarget)

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

158 {
159 $this->showBestSolutionsLinkTarget = $showBestSolutionsLinkTarget;
160 }

References $showBestSolutionsLinkTarget.

◆ setSkillResultButtonEnabled()

ilTestResultsToolbarGUI::setSkillResultButtonEnabled (   $skillResultButtonEnabled)

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

210 {
211 $this->skillResultButtonEnabled = $skillResultButtonEnabled;
212 }

References $skillResultButtonEnabled.

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: