ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTextAreaInputGUI Class Reference

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.
 addPlugin ($a_plugin)
 Add RTE plugin.
 removePlugin ($a_plugin)
 Remove RTE plugin.
 addButton ($a_button)
 Add RTE button.
 removeButton ($a_button)
 Remove RTE button.
 setRTESupport ($obj_id, $obj_type, $module)
 Set RTE support for a special module.
 removeRTESupport ()
 Remove RTE support for a special module.
 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.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 setSubformMode ($a_subformmode)
 Set Subform Mode.
 getSubformMode ()
 Get Subform Mode.
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
- Public Member Functions inherited from ilFormPropertyGUI
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.

Protected Attributes

 $value
 $cols
 $rows
 $usert
 $rtetags
 $plugins
 $buttons
 $rtesupport
 $rte_tag_set
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 $subformmode = "bottom"
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

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

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

ilTextAreaInputGUI::addButton (   $a_button)

Add RTE button.

Parameters
string$a_buttonButton name

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

{
$this->buttons[$a_button] = $a_button;
}
ilTextAreaInputGUI::addPlugin (   $a_plugin)

Add RTE plugin.

Parameters
string$a_pluginPlugin name

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

{
$this->plugins[$a_plugin] = $a_plugin;
}
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 301 of file class.ilTextAreaInputGUI.php.

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

{
global $lng;
include_once("./Services/AdvancedEditing/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 125 of file class.ilTextAreaInputGUI.php.

References $cols.

Referenced by insert().

{
return $this->cols;
}

+ Here is the caller graph for this function:

ilTextAreaInputGUI::getRows ( )

Get Rows.

Returns
int Rows

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

References $rows.

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

References $rtetags.

Referenced by getRteTagString(), and insert().

{
}

+ 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 267 of file class.ilTextAreaInputGUI.php.

{
return $this->rte_tag_set[$a_set_name];
}
ilTextAreaInputGUI::getRteTagString ( )

RTE Tag string.

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

References $result, and 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 165 of file class.ilTextAreaInputGUI.php.

References $usert.

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

References $value.

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 326 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");
foreach ($this->plugins as $plugin)
{
if (strlen($plugin))
{
$rte->addPlugin($plugin);
}
}
foreach ($this->buttons as $button)
{
if (strlen($button))
{
$rte->addButton($button);
}
}
if (count($this->rteSupport) == 3)
{
$rte->addRTESupport($this->rteSupport["obj_id"], $this->rteSupport["obj_type"], $this->rteSupport["module"]);
}
else
{
$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");
if ($this->getCols() > 5)
{
$a_tpl->setCurrentBlock("prop_ta_c");
$a_tpl->setVariable("COLS", $this->getCols());
$a_tpl->parseCurrentBlock();
}
else
{
$a_tpl->touchBlock("prop_ta_w");
}
$a_tpl->setCurrentBlock("prop_textarea");
$a_tpl->setVariable("ROWS", $this->getRows());
}
$a_tpl->setVariable("POST_VAR",
$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::removeButton (   $a_button)

Remove RTE button.

Parameters
string$a_buttonButton name

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

{
unset($this->buttons[$a_button]);
}
ilTextAreaInputGUI::removePlugin (   $a_plugin)

Remove RTE plugin.

Parameters
string$a_pluginPlugin name

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

{
unset($this->plugins[$a_plugin]);
}
ilTextAreaInputGUI::removeRTESupport ( )

Remove RTE support for a special module.

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

{
$this->rteSupport = array();
}
ilTextAreaInputGUI::setCols (   $a_cols)

Set Cols.

Parameters
int$a_colsCols

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

Referenced by ilObjWikiGUI\initSettingsForm().

{
$this->cols = $a_cols;
}

+ Here is the caller graph for this function:

ilTextAreaInputGUI::setRows (   $a_rows)

Set Rows.

Parameters
int$a_rowsRows

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

Referenced by ilObjPaymentSettingsGUI\generalSettingsObject(), and ilObjUserGUI\initForm().

{
$this->rows = $a_rows;
}

+ Here is the caller graph for this function:

ilTextAreaInputGUI::setRTESupport (   $obj_id,
  $obj_type,
  $module 
)

Set RTE support for a special module.

Parameters
int$obj_idObject ID
string$obj_typeObject Type
string$moduleILIAS module

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

{
$this->rteSupport = array("obj_id" => $obj_id, "obj_type" => $obj_type, "module" => $module);
}
ilTextAreaInputGUI::setRteTags (   $a_rtetags)

Set Valid RTE Tags.

Parameters
array$a_rtetagsValid RTE Tags

Definition at line 235 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 256 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_usertUse Rich Text Editing

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

{
$this->usert = $a_usert;
}
ilTextAreaInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 291 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::$buttons
protected

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

ilTextAreaInputGUI::$cols
protected

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

Referenced by getCols().

ilTextAreaInputGUI::$plugins
protected

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

ilTextAreaInputGUI::$rows
protected

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

Referenced by getRows().

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

ilTextAreaInputGUI::$rtesupport
protected

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

ilTextAreaInputGUI::$rtetags
protected

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

Referenced by getRteTags().

ilTextAreaInputGUI::$usert
protected

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

Referenced by getUseRte().

ilTextAreaInputGUI::$value
protected

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

Referenced by getValue().


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