ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestResultsToolbarGUI Class Reference
+ Inheritance diagram for ilTestResultsToolbarGUI:
+ Collaboration diagram for ilTestResultsToolbarGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilGlobalTemplateInterface $tpl, ilLanguage $lng)
 
 build ()
 
 setCertificateLinkTarget (string $certificateLinkTarget)
 
 getCertificateLinkTarget ()
 
 setShowBestSolutionsLinkTarget (string $showBestSolutionsLinkTarget)
 
 getShowBestSolutionsLinkTarget ()
 
 setHideBestSolutionsLinkTarget (string $hideBestSolutionsLinkTarget)
 
 getHideBestSolutionsLinkTarget ()
 
 setParticipantSelectorOptions (array $participantSelectorOptions)
 
 getParticipantSelectorOptions ()
 
 getParticipantSelectorLinksArray ()
 
- 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 Attributes

string $certificateLinkTarget = null
 
string $showBestSolutionsLinkTarget = null
 
string $hideBestSolutionsLinkTarget = null
 
array $participantSelectorOptions = []
 

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $ctrl, $tpl, ILIAS\MetaData\Repository\Validation\Data\__construct(), and ILIAS\Repository\ctrl().

38  {
39  $this->ctrl = $ctrl;
40  $this->tpl = $tpl;
42  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilTestResultsToolbarGUI::build ( )

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

References ilToolbarGUI\$id, ilToolbarGUI\addButton(), ilToolbarGUI\addComponent(), ilToolbarGUI\addSeparator(), getCertificateLinkTarget(), getHideBestSolutionsLinkTarget(), getParticipantSelectorLinksArray(), getParticipantSelectorOptions(), getShowBestSolutionsLinkTarget(), ILIAS\Repository\lng(), ilToolbarGUI\setId(), ILIAS\Repository\ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

44  : void
45  {
46  $this->setId('tst_results_toolbar');
47 
48  $print_button = $this->ui->factory()->button()->standard($this->lng->txt('print'), '')
49  ->withOnLoadCode(fn($id) => "$('#$id').on('click', ()=>{window.print();})");
50  $this->addComponent($print_button);
51 
52  if ($this->getCertificateLinkTarget() !== null
53  && $this->getCertificateLinkTarget() !== '') {
54  $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget());
55  }
56 
57  if ($this->getShowBestSolutionsLinkTarget() !== null
58  && $this->getShowBestSolutionsLinkTarget() !== '') {
59  $this->addSeparator();
60  $this->addButton(
61  $this->lng->txt('tst_btn_show_best_solutions'),
63  );
64  } elseif ($this->getHideBestSolutionsLinkTarget() !== null
65  && $this->getHideBestSolutionsLinkTarget() !== '') {
66  $this->addSeparator();
67  $this->addButton(
68  $this->lng->txt('tst_btn_hide_best_solutions'),
70  );
71  }
72 
73  if (count($this->getParticipantSelectorOptions())) {
74  $this->addSeparator();
75 
76  $dropdown = $this->ui->factory()->dropdown()
77  ->standard($this->getParticipantSelectorLinksArray())
78  ->withLabel($this->lng->txt('tst_res_jump_to_participant_hint_opt'));
79  $this->addComponent($dropdown);
80  }
81  }
addComponent(\ILIAS\UI\Component\Component $a_comp)
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')
+ Here is the call graph for this function:

◆ getCertificateLinkTarget()

ilTestResultsToolbarGUI::getCertificateLinkTarget ( )

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

References $certificateLinkTarget.

Referenced by build().

88  : ?string
89  {
91  }
+ Here is the caller graph for this function:

◆ getHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getHideBestSolutionsLinkTarget ( )

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

References $hideBestSolutionsLinkTarget.

Referenced by build().

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

◆ getParticipantSelectorLinksArray()

ilTestResultsToolbarGUI::getParticipantSelectorLinksArray ( )

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

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

Referenced by build().

123  : array
124  {
125  $options = [];
126  foreach ($this->getParticipantSelectorOptions() as $key => $val) {
127  $options[] = $this->ui->factory()->link()->standard($val, "#participant_active_{$key}");
128  }
129 
130  return $options;
131  }
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:

◆ getParticipantSelectorOptions()

ilTestResultsToolbarGUI::getParticipantSelectorOptions ( )

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

References $participantSelectorOptions.

Referenced by build(), and getParticipantSelectorLinksArray().

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

◆ getShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::getShowBestSolutionsLinkTarget ( )

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

References $showBestSolutionsLinkTarget.

Referenced by build().

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

◆ setCertificateLinkTarget()

ilTestResultsToolbarGUI::setCertificateLinkTarget ( string  $certificateLinkTarget)

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

References $certificateLinkTarget.

83  : void
84  {
85  $this->certificateLinkTarget = $certificateLinkTarget;
86  }

◆ setHideBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setHideBestSolutionsLinkTarget ( string  $hideBestSolutionsLinkTarget)

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

References $hideBestSolutionsLinkTarget.

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

◆ setParticipantSelectorOptions()

ilTestResultsToolbarGUI::setParticipantSelectorOptions ( array  $participantSelectorOptions)

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

References $participantSelectorOptions.

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

◆ setShowBestSolutionsLinkTarget()

ilTestResultsToolbarGUI::setShowBestSolutionsLinkTarget ( string  $showBestSolutionsLinkTarget)

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

References $showBestSolutionsLinkTarget.

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

Field Documentation

◆ $certificateLinkTarget

string ilTestResultsToolbarGUI::$certificateLinkTarget = null
private

◆ $ctrl

ilCtrl ilTestResultsToolbarGUI::$ctrl

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

Referenced by __construct().

◆ $hideBestSolutionsLinkTarget

string ilTestResultsToolbarGUI::$hideBestSolutionsLinkTarget = null
private

◆ $participantSelectorOptions

array ilTestResultsToolbarGUI::$participantSelectorOptions = []
private

◆ $showBestSolutionsLinkTarget

string ilTestResultsToolbarGUI::$showBestSolutionsLinkTarget = null
private

◆ $tpl

ilGlobalTemplateInterface ilTestResultsToolbarGUI::$tpl

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

Referenced by __construct().


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