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

Public Member Functions

 __construct (protected UIRenderer $ui_renderer)
 
 getModalId ()
 
 setModalId (string $modal_id)
 
 getHeaderText ()
 
 setHeaderText (string $header_text)
 
 getConfirmationText ()
 
 setConfirmationText (string $confirmation_text)
 
 getConfirmationCheckboxName ()
 
 setConfirmationCheckboxName (string $confirmation_checkbox_name)
 
 getConfirmationCheckboxLabel ()
 
 setConfirmationCheckboxLabel (string $confirmation_checkbox_label)
 
 getButtons ()
 
 addButton (StandardButton|PrimaryButton|ilLinkButton $button)
 
 getParameters ()
 
 addParameter (ilHiddenInputGUI $hidden_input_gui)
 
 isConfirmationCheckboxRequired ()
 
 buildBody ()
 
 getHTML ()
 

Protected Attributes

string $modal_id = ''
 
string $header_text = ''
 
string $confirmation_text = ''
 
string $confirmation_checkbox_name = ''
 
string $confirmation_checkbox_label = ''
 
array $buttons = []
 
array $parameters = []
 

Detailed Description

Definition at line 33 of file class.ilTestPlayerConfirmationModal.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestPlayerConfirmationModal::__construct ( protected UIRenderer  $ui_renderer)

Definition at line 51 of file class.ilTestPlayerConfirmationModal.php.

53  {
54  }

Member Function Documentation

◆ addButton()

ilTestPlayerConfirmationModal::addButton ( StandardButton|PrimaryButton|ilLinkButton  $button)

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

115  {
116  $this->buttons[] = $button;
117  }

◆ addParameter()

ilTestPlayerConfirmationModal::addParameter ( ilHiddenInputGUI  $hidden_input_gui)

Definition at line 127 of file class.ilTestPlayerConfirmationModal.php.

128  {
129  $this->parameters[] = $hidden_input_gui;
130  }

◆ buildBody()

ilTestPlayerConfirmationModal::buildBody ( )

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

References getButtons(), getConfirmationCheckboxLabel(), getConfirmationCheckboxName(), getConfirmationText(), getParameters(), and isConfirmationCheckboxRequired().

Referenced by getHTML().

137  : string
138  {
139  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
140 
141  if ($this->isConfirmationCheckboxRequired()) {
142  $tpl->setCurrentBlock('checkbox');
143  $tpl->setVariable('CONFIRMATION_CHECKBOX_NAME', $this->getConfirmationCheckboxName());
144  $tpl->setVariable('CONFIRMATION_CHECKBOX_LABEL', $this->getConfirmationCheckboxLabel());
145  $tpl->parseCurrentBlock();
146  }
147 
148  foreach ($this->getParameters() as $parameter) {
149  $tpl->setCurrentBlock('hidden_inputs');
150  $tpl->setVariable('HIDDEN_INPUT', $parameter->getToolbarHTML());
151  $tpl->parseCurrentBlock();
152  }
153 
154  foreach ($this->getButtons() as $button) {
155  $tpl->setCurrentBlock('buttons');
156  if ($button instanceof StandardButton || $button instanceof PrimaryButton) {
157  $button_str = $this->ui_renderer->render($button);
158  } elseif ($button instanceof ilLinkButton) {
159  $button_str = $button->render();
160  }
161 
162  $tpl->setVariable('BUTTON', $button_str);
163  $tpl->parseCurrentBlock();
164  }
165 
166  $tpl->setVariable('CONFIRMATION_TEXT', $this->getConfirmationText());
167 
168  return $tpl->get();
169  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getButtons()

ilTestPlayerConfirmationModal::getButtons ( )
Returns
[]

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

References $buttons.

Referenced by buildBody().

109  : array
110  {
111  return $this->buttons;
112  }
+ Here is the caller graph for this function:

◆ getConfirmationCheckboxLabel()

ilTestPlayerConfirmationModal::getConfirmationCheckboxLabel ( )

Definition at line 96 of file class.ilTestPlayerConfirmationModal.php.

References $confirmation_checkbox_label.

Referenced by buildBody(), and isConfirmationCheckboxRequired().

96  : string
97  {
99  }
+ Here is the caller graph for this function:

◆ getConfirmationCheckboxName()

ilTestPlayerConfirmationModal::getConfirmationCheckboxName ( )

Definition at line 86 of file class.ilTestPlayerConfirmationModal.php.

References $confirmation_checkbox_name.

Referenced by buildBody(), and isConfirmationCheckboxRequired().

86  : string
87  {
89  }
+ Here is the caller graph for this function:

◆ getConfirmationText()

ilTestPlayerConfirmationModal::getConfirmationText ( )

Definition at line 76 of file class.ilTestPlayerConfirmationModal.php.

References $confirmation_text.

Referenced by buildBody().

76  : string
77  {
79  }
+ Here is the caller graph for this function:

◆ getHeaderText()

ilTestPlayerConfirmationModal::getHeaderText ( )

Definition at line 66 of file class.ilTestPlayerConfirmationModal.php.

References $header_text.

Referenced by getHTML().

66  : string
67  {
68  return $this->header_text;
69  }
+ Here is the caller graph for this function:

◆ getHTML()

ilTestPlayerConfirmationModal::getHTML ( )

Definition at line 171 of file class.ilTestPlayerConfirmationModal.php.

References buildBody(), getHeaderText(), ilModalGUI\getInstance(), and getModalId().

171  : string
172  {
173  $modal = ilModalGUI::getInstance();
174  $modal->setId($this->getModalId());
175  $modal->setHeading($this->getHeaderText());
176  $modal->setBody($this->buildBody());
177  return $modal->getHTML();
178  }
static getInstance()
+ Here is the call graph for this function:

◆ getModalId()

ilTestPlayerConfirmationModal::getModalId ( )

Definition at line 56 of file class.ilTestPlayerConfirmationModal.php.

References $modal_id.

Referenced by getHTML().

56  : string
57  {
58  return $this->modal_id;
59  }
+ Here is the caller graph for this function:

◆ getParameters()

ilTestPlayerConfirmationModal::getParameters ( )
Returns
ilHiddenInputGUI[]

Definition at line 122 of file class.ilTestPlayerConfirmationModal.php.

References $parameters.

Referenced by buildBody().

122  : array
123  {
124  return $this->parameters;
125  }
+ Here is the caller graph for this function:

◆ isConfirmationCheckboxRequired()

ilTestPlayerConfirmationModal::isConfirmationCheckboxRequired ( )

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

References getConfirmationCheckboxLabel(), and getConfirmationCheckboxName().

Referenced by buildBody().

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

◆ setConfirmationCheckboxLabel()

ilTestPlayerConfirmationModal::setConfirmationCheckboxLabel ( string  $confirmation_checkbox_label)

Definition at line 101 of file class.ilTestPlayerConfirmationModal.php.

References $confirmation_checkbox_label.

102  {
103  $this->confirmation_checkbox_label = $confirmation_checkbox_label;
104  }

◆ setConfirmationCheckboxName()

ilTestPlayerConfirmationModal::setConfirmationCheckboxName ( string  $confirmation_checkbox_name)

Definition at line 91 of file class.ilTestPlayerConfirmationModal.php.

References $confirmation_checkbox_name.

92  {
93  $this->confirmation_checkbox_name = $confirmation_checkbox_name;
94  }

◆ setConfirmationText()

ilTestPlayerConfirmationModal::setConfirmationText ( string  $confirmation_text)

Definition at line 81 of file class.ilTestPlayerConfirmationModal.php.

References $confirmation_text.

82  {
83  $this->confirmation_text = $confirmation_text;
84  }

◆ setHeaderText()

ilTestPlayerConfirmationModal::setHeaderText ( string  $header_text)

Definition at line 71 of file class.ilTestPlayerConfirmationModal.php.

References $header_text.

72  {
73  $this->header_text = $header_text;
74  }

◆ setModalId()

ilTestPlayerConfirmationModal::setModalId ( string  $modal_id)

Definition at line 61 of file class.ilTestPlayerConfirmationModal.php.

References $modal_id.

62  {
63  $this->modal_id = $modal_id;
64  }

Field Documentation

◆ $buttons

array ilTestPlayerConfirmationModal::$buttons = []
protected

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

Referenced by getButtons().

◆ $confirmation_checkbox_label

string ilTestPlayerConfirmationModal::$confirmation_checkbox_label = ''
protected

◆ $confirmation_checkbox_name

string ilTestPlayerConfirmationModal::$confirmation_checkbox_name = ''
protected

◆ $confirmation_text

string ilTestPlayerConfirmationModal::$confirmation_text = ''
protected

◆ $header_text

string ilTestPlayerConfirmationModal::$header_text = ''
protected

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

Referenced by getHeaderText(), and setHeaderText().

◆ $modal_id

string ilTestPlayerConfirmationModal::$modal_id = ''
protected

Definition at line 35 of file class.ilTestPlayerConfirmationModal.php.

Referenced by getModalId(), and setModalId().

◆ $parameters

array ilTestPlayerConfirmationModal::$parameters = []
protected

Definition at line 49 of file class.ilTestPlayerConfirmationModal.php.

Referenced by getParameters().


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