ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

123 {
124 $this->hidden_item[] = array("var" => $a_post_var, "value" => $a_value);
125 }

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

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

37 {
38 return $this->form_action;
39 }

Referenced by getHTML().

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

57 {
58 return $this->headertext;
59 }

Referenced by getHTML().

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

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->addStickyItem($confirm);
191 $tb->addStickyItem($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 getInstance()
Factory.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
global $lng
Definition: privfeed.php:40

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

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

80 {
81 $this->cancel_txt = $a_txt;
82 $this->cancel_cmd = $a_cmd;
83 }

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

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

92 {
93 $this->confirm_txt = $a_txt;
94 $this->confirm_cmd = $a_cmd;
95 }

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

+ Here is the caller graph for this function:

◆ setFormAction()

ilConfirmationGUI::setFormAction (   $a_form_action)
final

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

32 {
33 $this->form_action = $a_form_action;
34 }

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

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

47 {
48 $this->headertext = $a_headertext;
49 }

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

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