ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

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 }
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

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

Referenced by getHTML().

+ 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.

218 {
219 $button = ilLinkButton::getInstance();
220
221 $button->setUrl('#');
222 $button->setId($buttonId);
223
224 return $button;
225 }
static getInstance()
Factory.

References ilLinkButton\getInstance().

+ 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.

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.

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

+ 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.

166 {
167 return strlen($this->getConfirmationCheckboxName()) && strlen($this->getConfirmationCheckboxLabel());
168 }

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.

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

References $confirmationCheckboxLabel.

◆ setConfirmationCheckboxName()

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

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

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

References $confirmationCheckboxName.

◆ setConfirmationText()

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

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

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

References $confirmationText.

◆ setHeaderText()

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

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

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

References $headerText.

◆ setModalId()

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

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

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

References $modalId.

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: