Public Member Functions | Protected Attributes

ilTextAreaInputGUI Class Reference
[Services/Form]

This class represents a text area property in a property form. More...

Inheritance diagram for ilTextAreaInputGUI:
Collaboration diagram for ilTextAreaInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setCols ($a_cols)
 Set Cols.
 getCols ()
 Get Cols.
 setRows ($a_rows)
 Set Rows.
 getRows ()
 Get Rows.
 setUseRte ($a_usert)
 Set Use Rich Text Editing.
 getUseRte ()
 Get Use Rich Text Editing.
 setRteTags ($a_rtetags)
 Set Valid RTE Tags.
 getRteTags ()
 Get Valid RTE Tags.
 setRteTagSet ($a_set_name)
 Set Set of Valid RTE Tags.
 getRteTagSet ($a_set_name)
 Get Set of Valid RTE Tags.
 getRteTagString ()
 RTE Tag string.
 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.

Protected Attributes

 $value
 $cols
 $rows
 $usert
 $rtetags
 $rte_tag_set

Detailed Description

This class represents a text area property in a property form.

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

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


Constructor & Destructor Documentation

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

Constructor.

Parameters:
string $a_title Title
string $a_postvar Post Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 77 of file class.ilTextAreaInputGUI.php.

References setRteTagSet(), and ilFormPropertyGUI::setType().

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

Here is the call graph for this function:


Member Function Documentation

ilTextAreaInputGUI::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 235 of file class.ilTextAreaInputGUI.php.

References $lng, ilSubEnabledFormPropertyGUI::checkSubItemsInput(), ilFormPropertyGUI::getPostVar(), ilFormPropertyGUI::getRequired(), getRteTagString(), getUseRte(), ilFormPropertyGUI::setAlert(), and ilUtil::stripSlashes().

        {
                global $lng;
                
                include_once("./classes/class.ilObjAdvancedEditing.php");
                
                $_POST[$this->getPostVar()] = ($this->getUseRte())
                        ? ilUtil::stripSlashes($_POST[$this->getPostVar()], true,
                                $this->getRteTagString())
                        : ilUtil::stripSlashes($_POST[$this->getPostVar()]);

                if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
                {
                        $this->setAlert($lng->txt("msg_input_is_required"));

                        return false;
                }
                return $this->checkSubItemsInput();
        }

Here is the call graph for this function:

ilTextAreaInputGUI::getCols (  ) 

Get Cols.

Returns:
int Cols

Definition at line 119 of file class.ilTextAreaInputGUI.php.

Referenced by insert().

        {
                return $this->cols;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::getRows (  ) 

Get Rows.

Returns:
int Rows

Definition at line 139 of file class.ilTextAreaInputGUI.php.

Referenced by insert().

        {
                return $this->rows;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::getRteTags (  ) 

Get Valid RTE Tags.

Returns:
array Valid RTE Tags

Definition at line 179 of file class.ilTextAreaInputGUI.php.

Referenced by getRteTagString(), and insert().

        {
                return $this->rtetags;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::getRteTagSet ( a_set_name  ) 

Get Set of Valid RTE Tags.

Returns:
array Set name "standard", "extended", "extended_img", "extended_table", "extended_table_img", "full"

Definition at line 201 of file class.ilTextAreaInputGUI.php.

        {
                return $this->rte_tag_set[$a_set_name];
        }

ilTextAreaInputGUI::getRteTagString (  ) 

RTE Tag string.

Definition at line 210 of file class.ilTextAreaInputGUI.php.

References getRteTags().

Referenced by checkInput().

        {
                $result = "";
                foreach ($this->getRteTags() as $tag)
                {
                        $result .= "<$tag>";
                }
                return $result;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTextAreaInputGUI::getUseRte (  ) 

Get Use Rich Text Editing.

Returns:
int Use Rich Text Editing

Definition at line 159 of file class.ilTextAreaInputGUI.php.

Referenced by checkInput(), and insert().

        {
                return $this->usert;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::getValue (  ) 

Get Value.

Returns:
string Value

Definition at line 99 of file class.ilTextAreaInputGUI.php.

Referenced by insert().

        {
                return $this->value;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::insert ( &$  a_tpl  ) 

Insert property html.

Returns:
int Size

Definition at line 260 of file class.ilTextAreaInputGUI.php.

References ilRTE::_getRTEClassname(), getCols(), ilFormPropertyGUI::getDisabled(), ilFormPropertyGUI::getFieldId(), ilFormPropertyGUI::getPostVar(), getRows(), getRteTags(), getUseRte(), getValue(), and ilUtil::prepareFormOutput().

        {
                if ($this->getUseRte())
                {
                        include_once "./Services/RTE/classes/class.ilRTE.php";
                        $rtestring = ilRTE::_getRTEClassname();
                        include_once "./Services/RTE/classes/class.$rtestring.php";
                        $rte = new $rtestring();
                        
                        // @todo: Check this.
                        $rte->addPlugin("emotions");
                        $rte->addCustomRTESupport(0, "", $this->getRteTags());
                        
                        $a_tpl->touchBlock("prop_ta_w");
                        $a_tpl->setCurrentBlock("prop_textarea");
                        $a_tpl->setVariable("ROWS", $this->getRows());
                }
                else
                {
                        $a_tpl->touchBlock("no_rteditor");
                        $a_tpl->setCurrentBlock("prop_ta_c");
                        $a_tpl->setVariable("COLS", $this->getCols());
                        $a_tpl->parseCurrentBlock();
                        
                        $a_tpl->setCurrentBlock("prop_textarea");
                        $a_tpl->setVariable("ROWS", $this->getRows());
                }
                $a_tpl->setVariable("POST_VAR",
                        ilUtil::prepareFormOutput($this->getPostVar()));
                $a_tpl->setVariable("ID", $this->getFieldId());
                if($this->getDisabled())
                {
                        $a_tpl->setVariable('DISABLED','disabled="disabled" ');
                }
                $a_tpl->setVariable("PROPERTY_VALUE", $this->getValue());
                $a_tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilTextAreaInputGUI::setCols ( a_cols  ) 

Set Cols.

Parameters:
int $a_cols Cols

Definition at line 109 of file class.ilTextAreaInputGUI.php.

        {
                $this->cols = $a_cols;
        }

ilTextAreaInputGUI::setRows ( a_rows  ) 

Set Rows.

Parameters:
int $a_rows Rows

Definition at line 129 of file class.ilTextAreaInputGUI.php.

        {
                $this->rows = $a_rows;
        }

ilTextAreaInputGUI::setRteTags ( a_rtetags  ) 

Set Valid RTE Tags.

Parameters:
array $a_rtetags Valid RTE Tags

Definition at line 169 of file class.ilTextAreaInputGUI.php.

Referenced by setRteTagSet().

        {
                $this->rtetags = $a_rtetags;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::setRteTagSet ( a_set_name  ) 

Set Set of Valid RTE Tags.

Returns:
array Set name "standard", "extended", "extended_img", "extended_table", "extended_table_img", "full"

Definition at line 190 of file class.ilTextAreaInputGUI.php.

References setRteTags().

Referenced by __construct().

        {
                $this->setRteTags($this->rte_tag_set[$a_set_name]);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTextAreaInputGUI::setUseRte ( a_usert  ) 

Set Use Rich Text Editing.

Parameters:
int $a_usert Use Rich Text Editing

Definition at line 149 of file class.ilTextAreaInputGUI.php.

        {
                $this->usert = $a_usert;
        }

ilTextAreaInputGUI::setValue ( a_value  ) 

Set Value.

Parameters:
string $a_value Value

Definition at line 89 of file class.ilTextAreaInputGUI.php.

Referenced by setValueByArray().

        {
                $this->value = $a_value;
        }

Here is the caller graph for this function:

ilTextAreaInputGUI::setValueByArray ( a_values  ) 

Set value by array.

Parameters:
array $a_values value array

Definition at line 225 of file class.ilTextAreaInputGUI.php.

References ilFormPropertyGUI::getPostVar(), and setValue().

        {
                $this->setValue($a_values[$this->getPostVar()]);
        }

Here is the call graph for this function:


Field Documentation

ilTextAreaInputGUI::$cols [protected]

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

ilTextAreaInputGUI::$rows [protected]

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

ilTextAreaInputGUI::$rte_tag_set [protected]
Initial value:
 array(
                "standard" => array ("strong", "em", "u", "ol", "li", "ul", "p", "div",
                        "i", "b", "code", "sup", "sub", "pre", "strike", "gap"),
                "extended" => array (
                        "a","blockquote","br","cite","code","div","em","h1","h2","h3",
                        "h4","h5","h6","hr","li","ol","p",
                        "pre","span","strike","strong","sub","sup","u","ul",
                        "i", "b", "gap"),
                "extended_img" => array (
                        "a","blockquote","br","cite","code","div","em","h1","h2","h3",
                        "h4","h5","h6","hr","img","li","ol","p",
                        "pre","span","strike","strong","sub","sup","u","ul",
                        "i", "b", "gap"),
                "extended_table" => array (
                        "a","blockquote","br","cite","code","div","em","h1","h2","h3",
                        "h4","h5","h6","hr","li","ol","p",
                        "pre","span","strike","strong","sub","sup","table","td",
                        "tr","u","ul", "i", "b", "gap"),
                "extended_table_img" => array (
                        "a","blockquote","br","cite","code","div","em","h1","h2","h3",
                        "h4","h5","h6","hr","img","li","ol","p",
                        "pre","span","strike","strong","sub","sup","table","td",
                        "tr","u","ul", "i", "b", "gap"),
                "full" => array (
                        "a","blockquote","br","cite","code","div","em","h1","h2","h3",
                        "h4","h5","h6","hr","img","li","ol","p",
                        "pre","span","strike","strong","sub","sup","table","td",
                        "tr","u","ul","ruby","rbc","rtc","rb","rt","rp", "i", "b", "gap"))

Definition at line 41 of file class.ilTextAreaInputGUI.php.

ilTextAreaInputGUI::$rtetags [protected]

Definition at line 39 of file class.ilTextAreaInputGUI.php.

ilTextAreaInputGUI::$usert [protected]

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

ilTextAreaInputGUI::$value [protected]

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


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