ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilConfirmationGUI Class Reference

Confirmation screen class. More...

+ Inheritance diagram for ilConfirmationGUI:
+ Collaboration diagram for ilConfirmationGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setFormAction ($a_form_action)
 
 getFormAction ()
 
 setHeaderText ($a_headertext)
 Set Set header text. More...
 
 getHeaderText ()
 Get Set header text. More...
 
 addButton ($a_txt, $a_cmd)
 Set cancel button command and text. More...
 
 setCancel ($a_txt, $a_cmd, $a_id="")
 Set cancel button command and text. More...
 
 setConfirm ($a_txt, $a_cmd, $a_id="")
 Set confirmation button command and text. More...
 
 addItem ($a_post_var, $a_id, $a_text, $a_img="", $a_alt="")
 Add row item. More...
 
 addHiddenItem ($a_post_var, $a_value)
 Add hidden item. More...
 
 getHTML ()
 Get confirmation screen HTML. More...
 
 setFormName ($a_name)
 Set form name. More...
 

Private Attributes

 $hidden_item = array()
 
 $item = array()
 
 $use_images = false
 
 $buttons = array()
 
 $form_name
 

Detailed Description

Confirmation screen class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilConfirmationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilConfirmationGUI::__construct ( )

Constructor.

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

28  {
29  }

Member Function Documentation

◆ addButton()

ilConfirmationGUI::addButton (   $a_txt,
  $a_cmd 
)
final

Set cancel button command and text.

Parameters
stringcancel text
stringcancel command

Definition at line 67 of file class.ilConfirmationGUI.php.

References array.

68  {
69  $this->buttons[] = array(
70  "txt" => $a_txt, "cmd" => $a_cmd);
71  }
Create styles array
The data for the language used.

◆ addHiddenItem()

ilConfirmationGUI::addHiddenItem (   $a_post_var,
  $a_value 
)

Add hidden item.

Parameters
stringname of post variable used for id (e.g. "id[]")
mixedvalue

Definition at line 124 of file class.ilConfirmationGUI.php.

References array.

Referenced by ilDclTextRecordFieldModel\addHiddenItemsToConfirmation(), ilDclFileuploadRecordFieldModel\addHiddenItemsToConfirmation(), ilDclMobRecordFieldModel\addHiddenItemsToConfirmation(), ilDclBaseRecordFieldModel\addHiddenItemsToConfirmation(), ilTestPassDeletionConfirmationGUI\build(), ilTestSettingsChangeConfirmationGUI\populateParametersFromPost(), and ilTestSettingsChangeConfirmationGUI\populateParametersFromPropertyForm().

125  {
126  $this->hidden_item[] = array("var" => $a_post_var, "value" => $a_value);
127  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addItem()

ilConfirmationGUI::addItem (   $a_post_var,
  $a_id,
  $a_text,
  $a_img = "",
  $a_alt = "" 
)

Add row item.

Parameters
stringname of post variable used for id (e.g. "id[]")
mixedid value
stringitem text
stringitem image path

Definition at line 107 of file class.ilConfirmationGUI.php.

References array.

109  {
110  $this->item[] = array("var" => $a_post_var, "id" => $a_id,
111  "text" => $a_text, "img" => $a_img, "alt" => $a_alt);
112  if ($a_img != "")
113  {
114  $this->use_images = true;
115  }
116  }
Create styles array
The data for the language used.

◆ getFormAction()

ilConfirmationGUI::getFormAction ( )
final

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

Referenced by getHTML().

37  {
38  return $this->form_action;
39  }
+ Here is the caller graph for this function:

◆ getHeaderText()

ilConfirmationGUI::getHeaderText ( )

Get Set header text.

Returns
string Set header text

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

Referenced by getHTML().

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

◆ getHTML()

ilConfirmationGUI::getHTML ( )
final

Get confirmation screen HTML.

Returns
string HTML code.

Definition at line 134 of file class.ilConfirmationGUI.php.

References $hidden_item, $lng, getFormAction(), getHeaderText(), ilSubmitButton\getInstance(), and ilUtil\sendQuestion().

135  {
136  global $lng;
137 
139 
140  include_once("./Services/Utilities/classes/class.ilConfirmationTableGUI.php");
141 
142  // delete/handle items
143  if (count($this->item) > 0)
144  {
145  $ctab = new ilConfirmationTableGUI($this->use_images);
146  $ctab->setData($this->item);
147 
148  // other buttons
149  foreach ($this->buttons as $b)
150  {
151  $ctab->addCommandButton($b["cmd"], $b["txt"]);
152  }
153  $ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt);
154  $ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt);
155  $ctab->setFormAction($this->getFormAction());
156  foreach ($this->hidden_item as $hidden_item)
157  {
158  $ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]);
159  }
160 
161  if($this->form_name)
162  {
163  $ctab->setFormName($this->form_name);
164  }
165 
166  return $ctab->getHTML();
167  }
168  else // simple version, just ask for confirmation
169  {
170  $tb = new ilToolbarGUI();
171  $tb->setPreventDoubleSubmission(true);
172  $tb->setFormAction($this->getFormAction());
173  if($this->hidden_item)
174  {
175  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
176  foreach($this->hidden_item as $hidden_item)
177  {
178  $hiddenInput = new ilHiddenInputGUI($hidden_item['var']);
179  $hiddenInput->setValue($hidden_item['value']);
180  $tb->addInputItem($hiddenInput);
181  }
182  }
183  require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
184  $confirm = ilSubmitButton::getInstance();
185  $confirm->setCommand($this->confirm_cmd);
186  $confirm->setCaption($this->confirm_txt, false);
187  $confirm->setId($this->confirm_id);
188 
189  $cancel = ilSubmitButton::getInstance();
190  $cancel->setCommand($this->cancel_cmd);
191  $cancel->setCaption($this->cancel_txt, false);
192  $cancel->setId($this->cancel_id);
193 
194  $tb->addStickyItem($confirm);
195  $tb->addStickyItem($cancel);
196 
197  return $tb->getHTML();
198  }
199  }
getHeaderText()
Get Set header text.
This class represents a hidden form property in a property form.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ setCancel()

ilConfirmationGUI::setCancel (   $a_txt,
  $a_cmd,
  $a_id = "" 
)
final

Set cancel button command and text.

Parameters
stringcancel text
stringcancel command

Definition at line 79 of file class.ilConfirmationGUI.php.

Referenced by ilTestPassDeletionConfirmationGUI\build(), and ilTestAnswerOptionalQuestionsConfirmationGUI\build().

80  {
81  $this->cancel_txt = $a_txt;
82  $this->cancel_cmd = $a_cmd;
83  $this->cancel_id = $a_id;
84  }
+ Here is the caller graph for this function:

◆ setConfirm()

ilConfirmationGUI::setConfirm (   $a_txt,
  $a_cmd,
  $a_id = "" 
)
final

Set confirmation button command and text.

Parameters
stringconfirmation button text
stringconfirmation button command

Definition at line 92 of file class.ilConfirmationGUI.php.

Referenced by ilTestPassDeletionConfirmationGUI\build(), and ilTestAnswerOptionalQuestionsConfirmationGUI\build().

93  {
94  $this->confirm_txt = $a_txt;
95  $this->confirm_cmd = $a_cmd;
96  $this->confirm_id = $a_id;
97  }
+ Here is the caller graph for this function:

◆ setFormAction()

ilConfirmationGUI::setFormAction (   $a_form_action)
final

Definition at line 31 of file class.ilConfirmationGUI.php.

Referenced by ilTestPassDeletionConfirmationGUI\__construct(), ilCalendarAppointmentGUI\cancelBooking(), ilCalendarAppointmentGUI\confirmRegister(), and ilCalendarAppointmentGUI\confirmUnregister().

32  {
33  $this->form_action = $a_form_action;
34  }
+ Here is the caller graph for this function:

◆ setFormName()

ilConfirmationGUI::setFormName (   $a_name)

Set form name.

Parameters
string$a_name

Definition at line 206 of file class.ilConfirmationGUI.php.

207  {
208  $this->form_name = $a_name;
209  }

◆ setHeaderText()

ilConfirmationGUI::setHeaderText (   $a_headertext)

Set Set header text.

Parameters
string$a_headertextSet header text

Definition at line 46 of file class.ilConfirmationGUI.php.

Referenced by ilTestPassDeletionConfirmationGUI\build(), ilTestAnswerOptionalQuestionsConfirmationGUI\build(), and ilTestSettingsChangeConfirmationGUI\build().

47  {
48  $this->headertext = $a_headertext;
49  }
+ Here is the caller graph for this function:

Field Documentation

◆ $buttons

ilConfirmationGUI::$buttons = array()
private

Definition at line 20 of file class.ilConfirmationGUI.php.

◆ $form_name

ilConfirmationGUI::$form_name
private

Definition at line 21 of file class.ilConfirmationGUI.php.

◆ $hidden_item

ilConfirmationGUI::$hidden_item = array()
private

Definition at line 17 of file class.ilConfirmationGUI.php.

Referenced by getHTML().

◆ $item

ilConfirmationGUI::$item = array()
private

◆ $use_images

ilConfirmationGUI::$use_images = false
private

Definition at line 19 of file class.ilConfirmationGUI.php.


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