ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestPlayerConfirmationModal Class Reference
+ Collaboration diagram for ilTestPlayerConfirmationModal:

Public Member Functions

 getModalId ()
 
 setModalId ($modalId)
 
 getHeaderText ()
 
 setHeaderText ($headerText)
 
 getConfirmationText ()
 
 setConfirmationText ($confirmationText)
 
 getConfirmationCheckboxName ()
 
 setConfirmationCheckboxName ($confirmationCheckboxName)
 
 getConfirmationCheckboxLabel ()
 
 setConfirmationCheckboxLabel ($confirmationCheckboxLabel)
 
 getButtons ()
 
 addButton (ilLinkButton $button)
 
 getParameters ()
 
 addParameter (ilHiddenInputGUI $hiddenInputGUI)
 
 isConfirmationCheckboxRequired ()
 
 buildBody ()
 
 getHTML ()
 
 buildModalButtonInstance ($buttonId)
 

Protected Attributes

 $modalId = ''
 
 $headerText = ''
 
 $confirmationText = ''
 
 $confirmationCheckboxName = ''
 
 $confirmationCheckboxLabel = ''
 
 $buttons = array()
 
 $parameters = array()
 

Detailed Description

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

Member Function Documentation

◆ addButton()

ilTestPlayerConfirmationModal::addButton ( ilLinkButton  $button)
Parameters
ilLinkButton$button

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

142  {
143  $this->buttons[] = $button;
144  }

◆ addParameter()

ilTestPlayerConfirmationModal::addParameter ( ilHiddenInputGUI  $hiddenInputGUI)
Parameters
ilHiddenInputGUI$hiddenInputGUI

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

158  {
159  $this->parameters[] = $hiddenInputGUI;
160  }

◆ buildBody()

ilTestPlayerConfirmationModal::buildBody ( )
Returns
string

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

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

Referenced by getHTML().

174  {
175  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
176 
177  if ($this->isConfirmationCheckboxRequired()) {
178  $tpl->setCurrentBlock('checkbox');
179  $tpl->setVariable('CONFIRMATION_CHECKBOX_NAME', $this->getConfirmationCheckboxName());
180  $tpl->setVariable('CONFIRMATION_CHECKBOX_LABEL', $this->getConfirmationCheckboxLabel());
181  $tpl->parseCurrentBlock();
182  }
183 
184  foreach ($this->getParameters() as $parameter) {
185  $tpl->setCurrentBlock('hidden_inputs');
186  $tpl->setVariable('HIDDEN_INPUT', $parameter->getToolbarHTML());
187  $tpl->parseCurrentBlock();
188  }
189 
190  foreach ($this->getButtons() as $button) {
191  $tpl->setCurrentBlock('buttons');
192  $tpl->setVariable('BUTTON', $button->render());
193  $tpl->parseCurrentBlock();
194  }
195 
196  $tpl->setVariable('CONFIRMATION_TEXT', $this->getConfirmationText());
197 
198  return $tpl->get();
199  }
$tpl
Definition: ilias.php:10
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildModalButtonInstance()

ilTestPlayerConfirmationModal::buildModalButtonInstance (   $buttonId)
Parameters
string$buttonId
Returns
ilLinkButton

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

References ilLinkButton\getInstance().

218  {
219  $button = ilLinkButton::getInstance();
220 
221  $button->setUrl('#');
222  $button->setId($buttonId);
223 
224  return $button;
225  }
+ Here is the call graph for this function:

◆ getButtons()

ilTestPlayerConfirmationModal::getButtons ( )
Returns
ilLinkButton[]

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

References $buttons.

Referenced by buildBody().

+ Here is the caller graph for this function:

◆ getConfirmationCheckboxLabel()

ilTestPlayerConfirmationModal::getConfirmationCheckboxLabel ( )
Returns
string

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

References $confirmationCheckboxLabel.

Referenced by buildBody(), and isConfirmationCheckboxRequired().

+ Here is the caller graph for this function:

◆ getConfirmationCheckboxName()

ilTestPlayerConfirmationModal::getConfirmationCheckboxName ( )
Returns
string

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

References $confirmationCheckboxName.

Referenced by buildBody(), and isConfirmationCheckboxRequired().

+ Here is the caller graph for this function:

◆ getConfirmationText()

ilTestPlayerConfirmationModal::getConfirmationText ( )
Returns
string

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

References $confirmationText.

Referenced by buildBody().

+ Here is the caller graph for this function:

◆ getHeaderText()

ilTestPlayerConfirmationModal::getHeaderText ( )
Returns
string

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

References $headerText.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHTML()

ilTestPlayerConfirmationModal::getHTML ( )
Returns
string

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

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

205  {
206  $modal = ilModalGUI::getInstance();
207  $modal->setId($this->getModalId());
208  $modal->setHeading($this->getHeaderText());
209  $modal->setBody($this->buildBody());
210  return $modal->getHTML();
211  }
static getInstance()
Get instance.
+ Here is the call graph for this function:

◆ getModalId()

ilTestPlayerConfirmationModal::getModalId ( )
Returns
string

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

References $modalId.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getParameters()

ilTestPlayerConfirmationModal::getParameters ( )
Returns
ilHiddenInputGUI[]

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

References $parameters.

Referenced by buildBody().

+ Here is the caller graph for this function:

◆ isConfirmationCheckboxRequired()

ilTestPlayerConfirmationModal::isConfirmationCheckboxRequired ( )
Returns
bool

Definition at line 165 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 (   $confirmationCheckboxLabel)
Parameters
string$confirmationCheckboxLabel

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

References $confirmationCheckboxLabel.

126  {
127  $this->confirmationCheckboxLabel = $confirmationCheckboxLabel;
128  }

◆ setConfirmationCheckboxName()

ilTestPlayerConfirmationModal::setConfirmationCheckboxName (   $confirmationCheckboxName)
Parameters
string$confirmationCheckboxName

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

References $confirmationCheckboxName.

110  {
111  $this->confirmationCheckboxName = $confirmationCheckboxName;
112  }

◆ setConfirmationText()

ilTestPlayerConfirmationModal::setConfirmationText (   $confirmationText)
Parameters
string$confirmationText

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

References $confirmationText.

94  {
95  $this->confirmationText = $confirmationText;
96  }

◆ setHeaderText()

ilTestPlayerConfirmationModal::setHeaderText (   $headerText)
Parameters
string$headerText

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

References $headerText.

78  {
79  $this->headerText = $headerText;
80  }

◆ setModalId()

ilTestPlayerConfirmationModal::setModalId (   $modalId)
Parameters
string$modalId

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

References $modalId.

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

Field Documentation

◆ $buttons

ilTestPlayerConfirmationModal::$buttons = array()
protected

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

Referenced by getButtons().

◆ $confirmationCheckboxLabel

ilTestPlayerConfirmationModal::$confirmationCheckboxLabel = ''
protected

◆ $confirmationCheckboxName

ilTestPlayerConfirmationModal::$confirmationCheckboxName = ''
protected

◆ $confirmationText

ilTestPlayerConfirmationModal::$confirmationText = ''
protected

◆ $headerText

ilTestPlayerConfirmationModal::$headerText = ''
protected

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

Referenced by getHeaderText(), and setHeaderText().

◆ $modalId

ilTestPlayerConfirmationModal::$modalId = ''
protected

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

Referenced by getModalId(), and setModalId().

◆ $parameters

ilTestPlayerConfirmationModal::$parameters = array()
protected

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

Referenced by getParameters().


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