Public Member Functions | Protected Attributes

ilCheckboxInputGUI Class Reference
[Services/Form]

This class represents a checkbox property in a property form. More...

Inheritance diagram for ilCheckboxInputGUI:
Collaboration diagram for ilCheckboxInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setChecked ($a_checked)
 Set Checked.
 getChecked ()
 Get Checked.
 setOptionTitle ($a_optiontitle)
 Set Option Title (optional).
 getOptionTitle ()
 Get Option Title (optional).
 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.

Protected Attributes

 $value = "1"
 $checked
 $optiontitle = ""

Detailed Description

This class represents a checkbox property in a property form.

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

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


Constructor & Destructor Documentation

ilCheckboxInputGUI::__construct ( a_title = "",
a_postvar = "" 
)

Constructor.

Parameters:
string $a_title Title
string $a_postvar Post Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 43 of file class.ilCheckboxInputGUI.php.

References ilFormPropertyGUI::setType().

        {
                parent::__construct($a_title, $a_postvar);
                $this->setType("checkbox");
        }

Here is the call graph for this function:


Member Function Documentation

ilCheckboxInputGUI::checkInput (  ) 

Check input, strip slashes etc.

set alert, if input is not ok.

Returns:
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 128 of file class.ilCheckboxInputGUI.php.

References $lng, $ok, ilSubEnabledFormPropertyGUI::checkSubItemsInput(), ilFormPropertyGUI::getPostVar(), and ilUtil::stripSlashes().

        {
                global $lng;
                
                $_POST[$this->getPostVar()] = 
                        ilUtil::stripSlashes($_POST[$this->getPostVar()]);

                $ok = $this->checkSubItemsInput();
                return $ok;
        }

Here is the call graph for this function:

ilCheckboxInputGUI::getChecked (  ) 

Get Checked.

Returns:
boolean Checked

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

Referenced by insert().

        {
                return $this->checked;
        }

Here is the caller graph for this function:

ilCheckboxInputGUI::getOptionTitle (  ) 

Get Option Title (optional).

Returns:
string Option Title (optional)

Definition at line 104 of file class.ilCheckboxInputGUI.php.

Referenced by insert().

        {
                return $this->optiontitle;
        }

Here is the caller graph for this function:

ilCheckboxInputGUI::getValue (  ) 

Get Value.

Returns:
string Value

Definition at line 64 of file class.ilCheckboxInputGUI.php.

Referenced by insert().

        {
                return $this->value;
        }

Here is the caller graph for this function:

ilCheckboxInputGUI::insert ( &$  a_tpl  ) 

Insert property html.

Definition at line 143 of file class.ilCheckboxInputGUI.php.

References getChecked(), ilFormPropertyGUI::getFieldId(), getOptionTitle(), ilFormPropertyGUI::getPostVar(), and getValue().

        {
                $a_tpl->setCurrentBlock("prop_checkbox");
                $a_tpl->setVariable("POST_VAR", $this->getPostVar());
                $a_tpl->setVariable("ID", $this->getFieldId());
                $a_tpl->setVariable("PROPERTY_VALUE", $this->getValue());
                $a_tpl->setVariable("OPTION_TITLE", $this->getOptionTitle());
                if ($this->getChecked())
                {
                        $a_tpl->setVariable("PROPERTY_CHECKED",
                                'checked="checked"');
                }
                $a_tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilCheckboxInputGUI::setChecked ( a_checked  ) 

Set Checked.

Parameters:
boolean $a_checked Checked

Definition at line 74 of file class.ilCheckboxInputGUI.php.

Referenced by setValueByArray().

        {
                $this->checked = $a_checked;
        }

Here is the caller graph for this function:

ilCheckboxInputGUI::setOptionTitle ( a_optiontitle  ) 

Set Option Title (optional).

Parameters:
string $a_optiontitle Option Title (optional)

Definition at line 94 of file class.ilCheckboxInputGUI.php.

        {
                $this->optiontitle = $a_optiontitle;
        }

ilCheckboxInputGUI::setValue ( a_value  ) 

Set Value.

Parameters:
string $a_value Value

Definition at line 54 of file class.ilCheckboxInputGUI.php.

        {
                $this->value = $a_value;
        }

ilCheckboxInputGUI::setValueByArray ( a_values  ) 

Set value by array.

Parameters:
object $a_item Item

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

References ilFormPropertyGUI::getPostVar(), ilSubEnabledFormPropertyGUI::getSubItems(), and setChecked().

        {
                $this->setChecked($a_values[$this->getPostVar()]);
                foreach($this->getSubItems() as $item)
                {
                        $item->setValueByArray($a_values);
                }
        }

Here is the call graph for this function:


Field Documentation

ilCheckboxInputGUI::$checked [protected]

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

ilCheckboxInputGUI::$optiontitle = "" [protected]

Definition at line 35 of file class.ilCheckboxInputGUI.php.

ilCheckboxInputGUI::$value = "1" [protected]

Definition at line 33 of file class.ilCheckboxInputGUI.php.


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