ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 Set cancel button command and text. More...
 
 setConfirm ($a_txt, $a_cmd)
 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.

68  {
69  $this->buttons[] = array(
70  "txt" => $a_txt, "cmd" => $a_cmd);
71  }

◆ 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 122 of file class.ilConfirmationGUI.php.

Referenced by ilTestPassDeletionConfirmationGUI\build(), ilTestSettingsChangeConfirmationGUI\populateParametersFromPost(), and ilTestSettingsChangeConfirmationGUI\populateParametersFromPropertyForm().

123  {
124  $this->hidden_item[] = array("var" => $a_post_var, "value" => $a_value);
125  }
+ 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 105 of file class.ilConfirmationGUI.php.

107  {
108  $this->item[] = array("var" => $a_post_var, "id" => $a_id,
109  "text" => $a_text, "img" => $a_img, "alt" => $a_alt);
110  if ($a_img != "")
111  {
112  $this->use_images = true;
113  }
114  }

◆ 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 132 of file class.ilConfirmationGUI.php.

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

133  {
134  global $lng;
135 
137 
138  include_once("./Services/Utilities/classes/class.ilConfirmationTableGUI.php");
139 
140  // delete/handle items
141  if (count($this->item) > 0)
142  {
143  $ctab = new ilConfirmationTableGUI($this->use_images);
144  $ctab->setData($this->item);
145 
146  // other buttons
147  foreach ($this->buttons as $b)
148  {
149  $ctab->addCommandButton($b["cmd"], $b["txt"]);
150  }
151  $ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt);
152  $ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt);
153  $ctab->setFormAction($this->getFormAction());
154  foreach ($this->hidden_item as $hidden_item)
155  {
156  $ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]);
157  }
158 
159  if($this->form_name)
160  {
161  $ctab->setFormName($this->form_name);
162  }
163 
164  return $ctab->getHTML();
165  }
166  else // simple version, just ask for confirmation
167  {
168  $tb = new ilToolbarGUI();
169  $tb->setPreventDoubleSubmission(true);
170  $tb->setFormAction($this->getFormAction());
171  if($this->hidden_item)
172  {
173  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
174  foreach($this->hidden_item as $hidden_item)
175  {
176  $hiddenInput = new ilHiddenInputGUI($hidden_item['var']);
177  $hiddenInput->setValue($hidden_item['value']);
178  $tb->addInputItem($hiddenInput);
179  }
180  }
181  require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
182  $confirm = ilSubmitButton::getInstance();
183  $confirm->setCommand($this->confirm_cmd);
184  $confirm->setCaption($this->confirm_txt, false);
185 
186  $cancel = ilSubmitButton::getInstance();
187  $cancel->setCommand($this->cancel_cmd);
188  $cancel->setCaption($this->cancel_txt, false);
189 
190  $tb->addButtonInstance($confirm);
191  $tb->addButtonInstance($cancel);
192 
193  return $tb->getHTML();
194  }
195  }
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:40
+ Here is the call graph for this function:

◆ setCancel()

ilConfirmationGUI::setCancel (   $a_txt,
  $a_cmd 
)
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().

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

◆ setConfirm()

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

Set confirmation button command and text.

Parameters
stringconfirmation button text
stringconfirmation button command

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

Referenced by ilTestPassDeletionConfirmationGUI\build().

92  {
93  $this->confirm_txt = $a_txt;
94  $this->confirm_cmd = $a_cmd;
95  }
+ 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 202 of file class.ilConfirmationGUI.php.

203  {
204  $this->form_name = $a_name;
205  }

◆ 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(), 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: