Public Member Functions | Protected Member Functions | Private Attributes

ilConfirmationGUI Class Reference
[Services/Utilities]

Confirmation screen class. More...

Public Member Functions

 __construct ()
 Constructor.
 setFormAction ($a_form_action)
 getFormAction ()
 setHeaderText ($a_headertext)
 Set Set header text.
 getHeaderText ()
 Get Set header text.
 setCancel ($a_txt, $a_cmd)
 setConfirm ($a_txt, $a_cmd)
 addItem ($a_post_var, $a_id, $a_text, $a_img="")
 Add row item.
 addHiddenItem ($a_post_var, $a_value)
 Add hidden item.
 getHTML ()
 Get confirmation screen HTML.

Protected Member Functions

 fillRowColor (&$a_tpl, $a_placeholder="CSS_ROW")

Private Attributes

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

Detailed Description

Confirmation screen class.

Author:
Alex Killing <alex.killing@gmx.de>
Version:
$Id$

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


Constructor & Destructor Documentation

ilConfirmationGUI::__construct (  ) 

Constructor.

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

        {
        }


Member Function Documentation

ilConfirmationGUI::addHiddenItem ( a_post_var,
a_value 
)

Add hidden item.

Parameters:
string name of post variable used for id (e.g. "id[]")
mixed value

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

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

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

Add row item.

Parameters:
string name of post variable used for id (e.g. "id[]")
mixed id value
string item text
string item image path

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

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

ilConfirmationGUI::fillRowColor ( &$  a_tpl,
a_placeholder = "CSS_ROW" 
) [final, protected]

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

Referenced by getHTML().

        {
                $this->css_row = ($this->css_row != "tblrow1")
                        ? "tblrow1"
                        : "tblrow2";
                $a_tpl->setVariable($a_placeholder, $this->css_row);
        }

Here is the caller graph for this function:

ilConfirmationGUI::getFormAction (  )  [final]

Definition at line 53 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 73 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 124 of file class.ilConfirmationGUI.php.

References $hidden_item, $item, $lng, $tpl, fillRowColor(), getFormAction(), and getHeaderText().

        {
                global $lng;
                
                $tpl = new ilTemplate("tpl.confirmation.html", true, true, "Services/Utilities");

                // cancel/confirm buttons
                $tpl->setCurrentBlock("cmd");
                $tpl->setVariable("TXT_CMD", $this->confirm_txt);
                $tpl->setVariable("CMD", $this->confirm_cmd);
                $tpl->parseCurrentBlock();
                $tpl->setCurrentBlock("cmd");
                $tpl->setVariable("TXT_CMD", $this->cancel_txt);
                $tpl->setVariable("CMD", $this->cancel_cmd);
                $tpl->parseCurrentBlock();
                
                // output items
                foreach ($this->item as $item)
                {
                        if ($this->use_images)
                        {
                                if ($item["img"] != "")
                                {
                                        $tpl->setCurrentBlock("img_cell");
                                        $tpl->setVariable("IMG_ITEM", $item["img"]);
                                        $tpl->parseCurrentBlock();
                                }
                                else
                                {
                                        $tpl->touchBlock("blank_cell");
                                }
                        }
                        $tpl->setCurrentBlock("item_row");
                        $this->fillRowColor($tpl);
                        $tpl->setVariable("TXT_ITEM", $item["text"]);
                        $tpl->setVariable("VAR_ITEM", $item["var"]);
                        $tpl->setVariable("ID", $item["id"]);
                        $tpl->parseCurrentBlock();
                }
                
                foreach ($this->hidden_item as $hidden_item)
                {
                        $tpl->setCurrentBlock("hidden_item_row");
                        $tpl->setVariable("VAR_HIDDEN_VAR", $hidden_item["var"]);
                        $tpl->setVariable("VAR_HIDDEN_VALUE", $hidden_item["value"]);
                        $tpl->parseCurrentBlock();
                }
                
                $tpl->setVariable("FORMACTION", $this->getFormAction());
                $tpl->setVariable("TXT_HEADER", $this->getHeaderText());
                
                if ($this->use_images)
                {
                        $tpl->setVariable("ROW_SPAN", 2);
                }
                else
                {
                        $tpl->setVariable("ROW_SPAN", 1);
                }
        
                return $tpl->get();
        }

Here is the call graph for this function:

ilConfirmationGUI::setCancel ( a_txt,
a_cmd 
) [final]

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

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

ilConfirmationGUI::setConfirm ( a_txt,
a_cmd 
) [final]

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

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

ilConfirmationGUI::setFormAction ( a_form_action  )  [final]

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

        {
                $this->form_action = $a_form_action;
        }

ilConfirmationGUI::setHeaderText ( a_headertext  ) 

Set Set header text.

Parameters:
string $a_headertext Set header text

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

        {
                $this->headertext = $a_headertext;
        }


Field Documentation

ilConfirmationGUI::$hidden_item = array() [private]

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

Referenced by getHTML().

ilConfirmationGUI::$item = array() [private]

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

Referenced by getHTML().

ilConfirmationGUI::$use_images = false [private]

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


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