ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilConfirmationGUI Class Reference

Confirmation screen class. More...

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

Public Member Functions

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

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

ilConfirmationGUI::__construct ( )

Constructor.

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

Referenced by ilTestSettingsChangeConfirmationGUI\__construct().

{
}

+ Here is the caller graph for this function:

Member Function Documentation

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.

{
$this->buttons[] = array(
"txt" => $a_txt, "cmd" => $a_cmd);
}
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().

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

+ Here is the caller graph for this function:

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.

{
$this->item[] = array("var" => $a_post_var, "id" => $a_id,
"text" => $a_text, "img" => $a_img, "alt" => $a_alt);
if ($a_img != "")
{
$this->use_images = true;
}
}
ilConfirmationGUI::getFormAction ( )
final

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

Referenced by getHTML().

{
return $this->form_action;
}

+ Here is the caller graph for this function:

ilConfirmationGUI::getHeaderText ( )

Get Set header text.

Returns
string Set header text

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

Referenced by getHTML().

{
return $this->headertext;
}

+ Here is the caller graph for this function:

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().

{
global $lng;
include_once("./Services/Utilities/classes/class.ilConfirmationTableGUI.php");
// delete/handle items
if (count($this->item) > 0)
{
$ctab = new ilConfirmationTableGUI($this->use_images);
$ctab->setData($this->item);
// other buttons
foreach ($this->buttons as $b)
{
$ctab->addCommandButton($b["cmd"], $b["txt"]);
}
$ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt);
$ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt);
$ctab->setFormAction($this->getFormAction());
foreach ($this->hidden_item as $hidden_item)
{
$ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]);
}
if($this->form_name)
{
$ctab->setFormName($this->form_name);
}
return $ctab->getHTML();
}
else // simple version, just ask for confirmation
{
$tb = new ilToolbarGUI();
$tb->setPreventDoubleSubmission(true);
$tb->setFormAction($this->getFormAction());
if($this->hidden_item)
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
foreach($this->hidden_item as $hidden_item)
{
$hiddenInput = new ilHiddenInputGUI($hidden_item['var']);
$hiddenInput->setValue($hidden_item['value']);
$tb->addInputItem($hiddenInput);
}
}
require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
$confirm->setCommand($this->confirm_cmd);
$confirm->setCaption($this->confirm_txt, false);
$cancel->setCommand($this->cancel_cmd);
$cancel->setCaption($this->cancel_txt, false);
$tb->addButtonInstance($confirm);
$tb->addButtonInstance($cancel);
return $tb->getHTML();
}
}

+ Here is the call graph for this function:

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().

{
$this->cancel_txt = $a_txt;
$this->cancel_cmd = $a_cmd;
}

+ Here is the caller graph for this function:

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().

{
$this->confirm_txt = $a_txt;
$this->confirm_cmd = $a_cmd;
}

+ Here is the caller graph for this function:

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().

{
$this->form_action = $a_form_action;
}

+ Here is the caller graph for this function:

ilConfirmationGUI::setFormName (   $a_name)

Set form name.

Parameters
string$a_name

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

{
$this->form_name = $a_name;
}
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().

{
$this->headertext = $a_headertext;
}

+ Here is the caller graph for this function:

Field Documentation

ilConfirmationGUI::$buttons = array()
private

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

ilConfirmationGUI::$form_name
private

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

ilConfirmationGUI::$hidden_item = array()
private

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

Referenced by getHTML().

ilConfirmationGUI::$item = array()
private
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: