ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestResultsToolbarGUI Class Reference
+ Inheritance diagram for ilTestResultsToolbarGUI:
+ Collaboration diagram for ilTestResultsToolbarGUI:

Public Member Functions

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

Data Fields

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
- Data Fields inherited from ilToolbarGUI
array $items = array()
 

Private Member Functions

 getPdfExportLabel ()
 

Private Attributes

string $pdfExportLinkTarget = null
 
string $certificateLinkTarget = null
 
string $showBestSolutionsLinkTarget = null
 
string $hideBestSolutionsLinkTarget = null
 
array $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
ilLanguage $lng
 
string $id = ''
 
string $form_action = ''
 
bool $hidden = false
 
array $lead_img
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
string $form_target = ""
 
string $form_name = ""
 
bool $prevent_double_submission = false
 
array $sticky_items = array()
 
bool $has_separator = false
 
ILIAS DI UIServices $ui
 
bool $multipart = false
 
- Static Protected Attributes inherited from ilToolbarGUI
static int $instances = 0
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $ctrl, $tpl, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\ctrl().

37  {
38  $this->ctrl = $ctrl;
39  $this->tpl = $tpl;
41  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilTestResultsToolbarGUI::build ( )

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

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

43  : void
44  {
45  $this->setId('tst_results_toolbar');
46 
47  $this->addButton($this->lng->txt('print'), 'javascript:window.print();');
48 
49  if (strlen($this->getPdfExportLinkTarget())) {
50  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
51  $link = ilLinkButton::getInstance(); // always returns a new instance
52  $link->setUrl($this->getPdfExportLinkTarget());
53  $link->setCaption($this->getPdfExportLabel(), false);
54  $link->setOmitPreventDoubleSubmission(true);
55  $this->addButtonInstance($link);
56  }
57 
58  if (strlen($this->getCertificateLinkTarget())) {
59  $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget());
60  }
61 
62  if (strlen($this->getShowBestSolutionsLinkTarget())) {
63  $this->addSeparator();
64  $this->addButton($this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget());
65  } elseif (strlen($this->getHideBestSolutionsLinkTarget())) {
66  $this->addSeparator();
67  $this->addButton($this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget());
68  }
69 
70  if (count($this->getParticipantSelectorOptions())) {
71  $this->addSeparator();
72 
73  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
74  $sel = new ilSelectInputGUI('', 'active_id');
75  $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption());
76  $this->addInputItem($sel);
77 
78  $link = ilLinkButton::getInstance(); // always returns a new instance
79  $link->setUrl('#');
80  $link->setId('ilTestResultParticipantJumper');
81  $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false);
82  $this->addButtonInstance($link);
83 
84  $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js');
85  }
86  }
addButtonInstance(ilButtonBase $a_button)
Add button instance.
setId(string $a_val)
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')
addInputItem(ilToolbarItem $a_item, bool $a_output_label=false)
+ Here is the call graph for this function:

◆ getCertificateLinkTarget()

ilTestResultsToolbarGUI::getCertificateLinkTarget ( )

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

References $certificateLinkTarget.

Referenced by build().

108  : ?string
109  {
111  }
+ Here is the caller graph for this function:

◆ getHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getHideBestSolutionsLinkTarget ( )

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

References $hideBestSolutionsLinkTarget.

Referenced by build().

128  : ?string
129  {
131  }
+ Here is the caller graph for this function:

◆ getParticipantSelectorOptions()

ilTestResultsToolbarGUI::getParticipantSelectorOptions ( )

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

References $participantSelectorOptions.

Referenced by build(), and getParticipantSelectorOptionsWithHintOption().

138  : array
139  {
141  }
+ Here is the caller graph for this function:

◆ getParticipantSelectorOptionsWithHintOption()

ilTestResultsToolbarGUI::getParticipantSelectorOptionsWithHintOption ( )

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

References ILIAS\LTI\ToolProvider\$key, getParticipantSelectorOptions(), and ILIAS\Repository\lng().

Referenced by build().

143  : array
144  {
145  $options = array($this->lng->txt('tst_res_jump_to_participant_hint_opt'));
146 
147  if (function_exists('array_replace')) {
148  return array_replace($options, $this->getParticipantSelectorOptions());
149  }
150 
151  foreach ($this->getParticipantSelectorOptions() as $key => $val) {
152  $options[$key] = $val;
153  }
154 
155  return $options;
156  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPdfExportLabel()

ilTestResultsToolbarGUI::getPdfExportLabel ( )
private

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

References ILIAS\Repository\lng().

Referenced by build().

88  : string
89  {
90  return $this->lng->txt('pdf_export');
91  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPdfExportLinkTarget()

ilTestResultsToolbarGUI::getPdfExportLinkTarget ( )

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

References $pdfExportLinkTarget.

Referenced by build().

98  : ?string
99  {
101  }
+ Here is the caller graph for this function:

◆ getShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getShowBestSolutionsLinkTarget ( )

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

References $showBestSolutionsLinkTarget.

Referenced by build().

118  : ?string
119  {
121  }
+ Here is the caller graph for this function:

◆ setCertificateLinkTarget()

ilTestResultsToolbarGUI::setCertificateLinkTarget ( string  $certificateLinkTarget)

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

References $certificateLinkTarget.

103  : void
104  {
105  $this->certificateLinkTarget = $certificateLinkTarget;
106  }

◆ setHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setHideBestSolutionsLinkTarget ( string  $hideBestSolutionsLinkTarget)

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

References $hideBestSolutionsLinkTarget.

123  : void
124  {
125  $this->hideBestSolutionsLinkTarget = $hideBestSolutionsLinkTarget;
126  }

◆ setParticipantSelectorOptions()

ilTestResultsToolbarGUI::setParticipantSelectorOptions ( array  $participantSelectorOptions)

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

References $participantSelectorOptions.

133  : void
134  {
135  $this->participantSelectorOptions = $participantSelectorOptions;
136  }

◆ setPdfExportLinkTarget()

ilTestResultsToolbarGUI::setPdfExportLinkTarget ( string  $pdfExportLinkTarget)

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

References $pdfExportLinkTarget.

93  : void
94  {
95  $this->pdfExportLinkTarget = $pdfExportLinkTarget;
96  }

◆ setShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setShowBestSolutionsLinkTarget ( string  $showBestSolutionsLinkTarget)

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

References $showBestSolutionsLinkTarget.

113  : void
114  {
115  $this->showBestSolutionsLinkTarget = $showBestSolutionsLinkTarget;
116  }

Field Documentation

◆ $certificateLinkTarget

string ilTestResultsToolbarGUI::$certificateLinkTarget = null
private

◆ $ctrl

ilCtrl ilTestResultsToolbarGUI::$ctrl

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

Referenced by __construct().

◆ $hideBestSolutionsLinkTarget

string ilTestResultsToolbarGUI::$hideBestSolutionsLinkTarget = null
private

◆ $participantSelectorOptions

array ilTestResultsToolbarGUI::$participantSelectorOptions = array()
private

◆ $pdfExportLinkTarget

string ilTestResultsToolbarGUI::$pdfExportLinkTarget = null
private

◆ $showBestSolutionsLinkTarget

string ilTestResultsToolbarGUI::$showBestSolutionsLinkTarget = null
private

◆ $tpl

ilGlobalTemplateInterface ilTestResultsToolbarGUI::$tpl

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

Referenced by __construct().


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