ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setCols ($a_cols)
 Set Cols. More...
 
 getCols ()
 Get Cols. More...
 
 setRows ($a_rows)
 Set Rows. More...
 
 getRows ()
 Get Rows. More...
 
 setMaxNumOfChars ($a_number)
 Set Maximum number of characters allowed. More...
 
 getMaxNumOfChars ()
 Get Maximum number of characters allowed. More...
 
 setMinNumOfChars ($a_number)
 Set Minimum number of characters allowed. More...
 
 getMinNumOfChars ()
 Get Minimum number of characters allowed. More...
 
 setUseRte ($a_usert, $version='')
 Set Use Rich Text Editing. More...
 
 getUseRte ()
 Get Use Rich Text Editing. More...
 
 addPlugin ($a_plugin)
 Add RTE plugin. More...
 
 removePlugin ($a_plugin)
 Remove RTE plugin. More...
 
 addButton ($a_button)
 Add RTE button. More...
 
 removeButton ($a_button)
 Remove RTE button. More...
 
 setRTESupport ($obj_id, $obj_type, $module, $cfg_template=null, $hide_switch=false, $version=null)
 Set RTE support for a special module. More...
 
 removeRTESupport ()
 Remove RTE support for a special module. More...
 
 setRteTags ($a_rtetags)
 Set Valid RTE Tags. More...
 
 getRteTags ()
 Get Valid RTE Tags. More...
 
 setRteTagSet ($a_set_name)
 Set Set of Valid RTE Tags. More...
 
 getRteTagSet ($a_set_name)
 Get Set of Valid RTE Tags. More...
 
 getRteTagString ()
 RTE Tag string. More...
 
 setUseTagsForRteOnly ($a_val)
 Set use tags for RTE only (default is true) More...
 
 getUseTagsForRteOnly ()
 Get use tags for RTE only (default is true) More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 usePurifier ($a_flag=null)
 Setter/Getter for the html purifier usage. More...
 
 setPurifier (ilHtmlPurifierInterface $Purifier)
 Setter for the html purifier. More...
 
 getPurifier ()
 Getter for the html purifier. More...
 
 setRTERootBlockElement ($a_root_block_element)
 Setter for the TinyMCE root block element. More...
 
 getRTERootBlockElement ()
 Getter for the TinyMCE root block element. More...
 
 disableButtons ($a_button)
 Sets buttons which should be disabled in TinyMCE. More...
 
 getDisabledButtons ($as_array=true)
 Returns the disabled TinyMCE buttons. More...
 
 getInitialRteWidth ()
 
 setInitialRteWidth ($initial_rte_width)
 
 isCharLimited ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

Protected Attributes

 $value
 
 $cols
 
 $rows
 
 $usert
 
 $rtetags
 
 $plugins
 
 $removeplugins
 
 $buttons
 
 $rtesupport
 
 $use_tags_for_rte_only = true
 
 $max_num_chars
 
 $min_num_chars
 
 $initial_rte_width = 795
 
 $disabled_buttons = array()
 
 $usePurifier = false
 
 $Purifier = null
 
 $root_block_element = null
 
 $rte_tag_set
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $DIC, array, setRteTagSet(), and ilFormPropertyGUI\setType().

131  {
132  global $DIC;
133 
134  $this->lng = $DIC->language();
135  parent::__construct($a_title, $a_postvar);
136  $this->setType("textarea");
137  $this->setRteTagSet("standard");
138  $this->plugins = array();
139  $this->removeplugins = array();
140  $this->buttons = array();
141  $this->rteSupport = array();
142  }
global $DIC
Definition: saml.php:7
setRteTagSet($a_set_name)
Set Set of Valid RTE Tags.
setType($a_type)
Set Type.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Member Function Documentation

◆ addButton()

ilTextAreaInputGUI::addButton (   $a_button)

Add RTE button.

Parameters
string$a_buttonButton name

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

293  {
294  $this->buttons[$a_button] = $a_button;
295  }

◆ addPlugin()

ilTextAreaInputGUI::addPlugin (   $a_plugin)

Add RTE plugin.

Parameters
string$a_pluginPlugin name

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

273  {
274  $this->plugins[$a_plugin] = $a_plugin;
275  }

◆ checkInput()

ilTextAreaInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

References $_POST, ilFormPropertyGUI\$lng, array, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getMaxNumOfChars(), getMinNumOfChars(), ilFormPropertyGUI\getPostVar(), getPurifier(), ilFormPropertyGUI\getRequired(), getRteTagString(), getUseRte(), getUseTagsForRteOnly(), isCharLimited(), ilFormPropertyGUI\setAlert(), ilUtil\stripOnlySlashes(), ilUtil\stripSlashes(), ilFormPropertyGUI\stripSlashesAddSpaceFallback(), and usePurifier().

422  {
423  $lng = $this->lng;
424  include_once("./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
425 
426  if ($this->usePurifier() && $this->getPurifier()) {
428  $_POST[$this->getPostVar()] = $this->getPurifier()->purify($_POST[$this->getPostVar()]);
429  } else {
430  $allowed = $this->getRteTagString();
431  if ($this->plugins["latex"] == "latex" && !is_int(strpos($allowed, "<span>"))) {
432  $allowed.= "<span>";
433  }
434  $_POST[$this->getPostVar()] = ($this->getUseRte() || !$this->getUseTagsForRteOnly())
435  ? ilUtil::stripSlashes($_POST[$this->getPostVar()], true, $allowed)
436  : $this->stripSlashesAddSpaceFallback($_POST[$this->getPostVar()]);
437  }
438 
439  $_POST[$this->getPostVar()] = self::removeProhibitedCharacters($_POST[$this->getPostVar()]);
440 
441  if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
442  $this->setAlert($lng->txt("msg_input_is_required"));
443 
444  return false;
445  }
446 
447  if ($this->isCharLimited()) {
448  //avoid whitespace surprises. #20630, #20674
449  $ascii_whitespaces = chr(194) . chr(160);
450  $ascii_breaklines = chr(13) . chr(10);
451 
452  $to_replace = array($ascii_whitespaces, $ascii_breaklines, "&lt;", "&gt;", "&amp;");
453  $replace_to = array(' ', '', "_", "_", "_");
454 
455  #20630
456  if (function_exists('mb_strlen')) {
457  $chars_entered = mb_strlen(strip_tags(str_replace($to_replace, $replace_to, $_POST[$this->getPostVar()])));
458  } else {
459  $chars_entered = strlen(strip_tags(str_replace($to_replace, $replace_to, $_POST[$this->getPostVar()])));
460  }
461 
462  if ($this->getMaxNumOfChars() && ($chars_entered > $this->getMaxNumOfChars())) {
463  $this->setAlert($lng->txt("msg_input_char_limit_max"));
464 
465  return false;
466  } elseif ($this->getMinNumOfChars() && ($chars_entered < $this->getMinNumOfChars())) {
467  $this->setAlert($lng->txt("msg_input_char_limit_min"));
468 
469  return false;
470  }
471  }
472 
473  return $this->checkSubItemsInput();
474  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
getRteTagString()
RTE Tag string.
getUseRte()
Get Use Rich Text Editing.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getMinNumOfChars()
Get Minimum number of characters allowed.
Create styles array
The data for the language used.
usePurifier($a_flag=null)
Setter/Getter for the html purifier usage.
getMaxNumOfChars()
Get Maximum number of characters allowed.
stripSlashesAddSpaceFallback($a_str)
Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727.
getUseTagsForRteOnly()
Get use tags for RTE only (default is true)
$_POST["username"]
getPurifier()
Getter for the html purifier.
+ Here is the call graph for this function:

◆ disableButtons()

ilTextAreaInputGUI::disableButtons (   $a_button)

Sets buttons which should be disabled in TinyMCE.

Parameters
mixed$a_buttonEither a button string or an array of button strings
Returns
ilTextAreaInputGUI Instance of ilTextAreaInputGUI public

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

References array.

678  {
679  if (is_array($a_button)) {
680  $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
681  } else {
682  $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
683  }
684 
685  return $this;
686  }
Create styles array
The data for the language used.

◆ getCols()

ilTextAreaInputGUI::getCols ( )

Get Cols.

Returns
int Cols

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

References $cols.

Referenced by insert().

182  {
183  return $this->cols;
184  }
+ Here is the caller graph for this function:

◆ getDisabledButtons()

ilTextAreaInputGUI::getDisabledButtons (   $as_array = true)

Returns the disabled TinyMCE buttons.

Parameters
boolean$as_arrayShould the disabled buttons be returned as a string or as an array
Returns
Array Array of disabled buttons public

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

References $disabled_buttons.

Referenced by insert().

697  {
698  if (!$as_array) {
699  return implode(',', $this->disabled_buttons);
700  } else {
702  }
703  }
+ Here is the caller graph for this function:

◆ getInitialRteWidth()

ilTextAreaInputGUI::getInitialRteWidth ( )
Returns
int

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

References $initial_rte_width.

Referenced by insert().

709  {
711  }
+ Here is the caller graph for this function:

◆ getMaxNumOfChars()

ilTextAreaInputGUI::getMaxNumOfChars ( )

Get Maximum number of characters allowed.

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

References $max_num_chars.

Referenced by checkInput(), insert(), and isCharLimited().

220  {
221  return $this->max_num_chars;
222  }
+ Here is the caller graph for this function:

◆ getMinNumOfChars()

ilTextAreaInputGUI::getMinNumOfChars ( )

Get Minimum number of characters allowed.

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

References $min_num_chars.

Referenced by checkInput(), insert(), and isCharLimited().

238  {
239  return $this->min_num_chars;
240  }
+ Here is the caller graph for this function:

◆ getPurifier()

ilTextAreaInputGUI::getPurifier ( )

Getter for the html purifier.

Returns
ilHtmlPurifierInterface Instance of ilHtmlPurifierInterface public

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

References $Purifier.

Referenced by checkInput().

641  {
642  return $this->Purifier;
643  }
+ Here is the caller graph for this function:

◆ getRows()

ilTextAreaInputGUI::getRows ( )

Get Rows.

Returns
int Rows

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

References $rows.

Referenced by insert().

202  {
203  return $this->rows;
204  }
+ Here is the caller graph for this function:

◆ getRTERootBlockElement()

ilTextAreaInputGUI::getRTERootBlockElement ( )

Getter for the TinyMCE root block element.

Returns
string Root block element of TinyMCE public

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

References $root_block_element.

Referenced by insert().

665  {
667  }
+ Here is the caller graph for this function:

◆ getRteTags()

ilTextAreaInputGUI::getRteTags ( )

Get Valid RTE Tags.

Returns
array Valid RTE Tags

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

References $rtetags.

Referenced by getRteTagString(), and insert().

343  {
344  return $this->rtetags;
345  }
+ Here is the caller graph for this function:

◆ getRteTagSet()

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

Referenced by insert().

365  {
366  return $this->rte_tag_set[$a_set_name];
367  }
+ Here is the caller graph for this function:

◆ getRteTagString()

ilTextAreaInputGUI::getRteTagString ( )

RTE Tag string.

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

References $result, $tag, and getRteTags().

Referenced by checkInput().

374  {
375  $result = "";
376  foreach ($this->getRteTags() as $tag) {
377  $result .= "<$tag>";
378  }
379  return $result;
380  }
$result
getRteTags()
Get Valid RTE Tags.
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUseRte()

ilTextAreaInputGUI::getUseRte ( )

Get Use Rich Text Editing.

Returns
int Use Rich Text Editing

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

References $usert.

Referenced by checkInput(), and insert().

263  {
264  return $this->usert;
265  }
+ Here is the caller graph for this function:

◆ getUseTagsForRteOnly()

ilTextAreaInputGUI::getUseTagsForRteOnly ( )

Get use tags for RTE only (default is true)

Returns
boolean use tags for RTE only

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

References $use_tags_for_rte_only.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getValue()

ilTextAreaInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by insert().

160  {
161  return $this->value;
162  }
+ Here is the caller graph for this function:

◆ insert()

ilTextAreaInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

References ilFormPropertyGUI\$lng, ilRTE\_getRTEClassname(), array, getCols(), ilFormPropertyGUI\getDisabled(), getDisabledButtons(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getHiddenTag(), getInitialRteWidth(), getMaxNumOfChars(), getMinNumOfChars(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getRows(), getRTERootBlockElement(), getRteTags(), getRteTagSet(), getUseRte(), getValue(), isCharLimited(), and ilUtil\prepareFormOutput().

482  {
483  $lng = $this->lng;
484 
485  $ttpl = new ilTemplate("tpl.prop_textarea.html", true, true, "Services/Form");
486 
487  // disabled rte
488  if ($this->getUseRte() && $this->getDisabled()) {
489  $ttpl->setCurrentBlock("disabled_rte");
490  $ttpl->setVariable("DR_VAL", $this->getValue());
491  $ttpl->parseCurrentBlock();
492  } else {
493  if ($this->getUseRte()) {
494  $rtestring = ilRTE::_getRTEClassname();
495  include_once "./Services/RTE/classes/class.$rtestring.php";
496  $rte = new $rtestring($this->rteSupport['version']);
497 
498  $rte->setInitialWidth($this->getInitialRteWidth());
499 
500  // @todo: Check this.
501  $rte->addPlugin("emotions");
502  foreach ($this->plugins as $plugin) {
503  if (strlen($plugin)) {
504  $rte->addPlugin($plugin);
505  }
506  }
507  foreach ($this->removeplugins as $plugin) {
508  if (strlen($plugin)) {
509  $rte->removePlugin($plugin);
510  }
511  }
512 
513  foreach ($this->buttons as $button) {
514  if (strlen($button)) {
515  $rte->addButton($button);
516  }
517  }
518 
519  $rte->disableButtons($this->getDisabledButtons());
520 
521  if ($this->getRTERootBlockElement() !== null) {
522  $rte->setRTERootBlockElement($this->getRTERootBlockElement());
523  }
524 
525  if (count($this->rteSupport) >= 3) {
526  $rte->addRTESupport($this->rteSupport["obj_id"], $this->rteSupport["obj_type"], $this->rteSupport["module"], false, $this->rteSupport['cfg_template'], $this->rteSupport['hide_switch']);
527  } else {
528  // disable all plugins for mini-tagset
529  if (!array_diff($this->getRteTags(), $this->getRteTagSet("mini"))) {
530  $rte->removeAllPlugins();
531 
532  // #13603 - "paste from word" is essential
533  $rte->addPlugin("paste");
534 
535  // #11980 - p-tag is mandatory but we do not want the icons it comes with
536  $rte->disableButtons(array("anchor", "justifyleft", "justifycenter",
537  "justifyright", "justifyfull", "formatselect", "removeformat",
538  "cut", "copy", "paste", "pastetext")); // JF, 2013-12-09
539  }
540 
541  $rte->addCustomRTESupport(0, "", $this->getRteTags());
542  }
543 
544  $ttpl->touchBlock("prop_ta_w");
545  $ttpl->setCurrentBlock("prop_textarea");
546  $ttpl->setVariable("ROWS", $this->getRows());
547  } else {
548  $ttpl->touchBlock("no_rteditor");
549 
550  if ($this->getCols() > 5) {
551  $ttpl->setCurrentBlock("prop_ta_c");
552  $ttpl->setVariable("COLS", $this->getCols());
553  $ttpl->parseCurrentBlock();
554  } else {
555  $ttpl->touchBlock("prop_ta_w");
556  }
557 
558  $ttpl->setCurrentBlock("prop_textarea");
559  $ttpl->setVariable("ROWS", $this->getRows());
560  }
561  if (!$this->getDisabled()) {
562  $ttpl->setVariable(
563  "POST_VAR",
564  $this->getPostVar()
565  );
566  }
567  $ttpl->setVariable("ID", $this->getFieldId());
568  if ($this->getDisabled()) {
569  $ttpl->setVariable('DISABLED', 'disabled="disabled" ');
570  }
571  $ttpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
572 
573  if ($this->getRequired()) {
574  $ttpl->setVariable("REQUIRED", "required=\"required\"");
575  }
576 
577  if ($this->isCharLimited()) {
578  $ttpl->setVariable("MAXCHARS", $this->getMaxNumOfChars());
579  $ttpl->setVariable("MINCHARS", $this->getMinNumOfChars());
580 
581  $lng->toJS("form_chars_remaining");
582  }
583 
584  $ttpl->parseCurrentBlock();
585  }
586 
587  if ($this->isCharLimited()) {
588  $ttpl->setVariable("FEEDBACK_MAX_LIMIT", $this->getMaxNumOfChars());
589  $ttpl->setVariable("FEEDBACK_ID", $this->getFieldId());
590  $ttpl->setVariable("CHARS_REMAINING", $lng->txt("form_chars_remaining"));
591  }
592 
593  if ($this->getDisabled()) {
594  $ttpl->setVariable(
595  "HIDDEN_INPUT",
596  $this->getHiddenTag($this->getPostVar(), $this->getValue())
597  );
598  }
599  $a_tpl->setCurrentBlock("prop_generic");
600  $a_tpl->setVariable("PROP_GENERIC", $ttpl->get());
601  $a_tpl->parseCurrentBlock();
602  }
static _getRTEClassname()
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getHiddenTag($a_post_var, $a_value)
Get hidden tag (used for disabled properties)
getPostVar()
Get Post Variable.
getRteTags()
Get Valid RTE Tags.
getRTERootBlockElement()
Getter for the TinyMCE root block element.
getRteTagSet($a_set_name)
Get Set of Valid RTE Tags.
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
getUseRte()
Get Use Rich Text Editing.
getMinNumOfChars()
Get Minimum number of characters allowed.
Create styles array
The data for the language used.
getMaxNumOfChars()
Get Maximum number of characters allowed.
getDisabledButtons($as_array=true)
Returns the disabled TinyMCE buttons.
+ Here is the call graph for this function:

◆ isCharLimited()

ilTextAreaInputGUI::isCharLimited ( )

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

References getMaxNumOfChars(), and getMinNumOfChars().

Referenced by checkInput(), and insert().

722  {
723  if ($this->getMaxNumOfChars() || $this->getMinNumOfChars()) {
724  return true;
725  }
726 
727  return false;
728  }
getMinNumOfChars()
Get Minimum number of characters allowed.
getMaxNumOfChars()
Get Maximum number of characters allowed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeButton()

ilTextAreaInputGUI::removeButton (   $a_button)

Remove RTE button.

Parameters
string$a_buttonButton name

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

303  {
304  unset($this->buttons[$a_button]);
305  }

◆ removePlugin()

ilTextAreaInputGUI::removePlugin (   $a_plugin)

Remove RTE plugin.

Parameters
string$a_pluginPlugin name

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

283  {
284  $this->removeplugins[$a_plugin] = $a_plugin;
285  }

◆ removeRTESupport()

ilTextAreaInputGUI::removeRTESupport ( )

Remove RTE support for a special module.

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

References array.

323  {
324  $this->rteSupport = array();
325  }
Create styles array
The data for the language used.

◆ setCols()

◆ setInitialRteWidth()

ilTextAreaInputGUI::setInitialRteWidth (   $initial_rte_width)
Parameters
int$initial_rte_width

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

References $initial_rte_width.

717  {
718  $this->initial_rte_width = $initial_rte_width;
719  }

◆ setMaxNumOfChars()

ilTextAreaInputGUI::setMaxNumOfChars (   $a_number)

Set Maximum number of characters allowed.

Parameters
int$a_numberCharacters

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

212  {
213  $this->max_num_chars = $a_number;
214  }

◆ setMinNumOfChars()

ilTextAreaInputGUI::setMinNumOfChars (   $a_number)

Set Minimum number of characters allowed.

Parameters
int$a_numberCharacters

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

230  {
231  $this->min_num_chars = $a_number;
232  }

◆ setPurifier()

ilTextAreaInputGUI::setPurifier ( ilHtmlPurifierInterface  $Purifier)

Setter for the html purifier.

Parameters
ilHtmlPurifierInterfaceInstance of ilHtmlPurifierInterface
Returns
ilTextAreaInputGUI Instance of ilTextAreaInputGUI public

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

References $Purifier.

629  {
630  $this->Purifier = $Purifier;
631  return $this;
632  }

◆ setRows()

◆ setRTERootBlockElement()

ilTextAreaInputGUI::setRTERootBlockElement (   $a_root_block_element)

Setter for the TinyMCE root block element.

Parameters
string$a_root_block_elementroot block element
Returns
ilTextAreaInputGUI Instance of ilTextAreaInputGUI public

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

653  {
654  $this->root_block_element = $a_root_block_element;
655  return $this;
656  }

◆ setRTESupport()

ilTextAreaInputGUI::setRTESupport (   $obj_id,
  $obj_type,
  $module,
  $cfg_template = null,
  $hide_switch = false,
  $version = null 
)

Set RTE support for a special module.

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

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

References $module, $version, and array.

315  {
316  $this->rteSupport = array("obj_id" => $obj_id, "obj_type" => $obj_type, "module" => $module, 'cfg_template' => $cfg_template, 'hide_switch' => $hide_switch, 'version' => $version);
317  }
if($modEnd===false) $module
Definition: module.php:59
Create styles array
The data for the language used.

◆ setRteTags()

ilTextAreaInputGUI::setRteTags (   $a_rtetags)

Set Valid RTE Tags.

Parameters
array$a_rtetagsValid RTE Tags

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

Referenced by setRteTagSet().

333  {
334  $this->rtetags = $a_rtetags;
335  }
+ Here is the caller graph for this function:

◆ setRteTagSet()

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

References setRteTags().

Referenced by __construct().

354  {
355  $this->setRteTags($this->rte_tag_set[$a_set_name]);
356  }
setRteTags($a_rtetags)
Set Valid RTE Tags.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUseRte()

ilTextAreaInputGUI::setUseRte (   $a_usert,
  $version = '' 
)

Set Use Rich Text Editing.

Parameters
int$a_usertUse Rich Text Editing
string$version

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

References $version.

Referenced by ilDclTableEditGUI\initForm().

249  {
250  $this->usert = $a_usert;
251 
252  if (strlen($version)) {
253  $this->rteSupport['version'] = $version;
254  }
255  }
+ Here is the caller graph for this function:

◆ setUseTagsForRteOnly()

ilTextAreaInputGUI::setUseTagsForRteOnly (   $a_val)

Set use tags for RTE only (default is true)

Parameters
boolean$a_valuse tags for RTE only

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

388  {
389  $this->use_tags_for_rte_only = $a_val;
390  }

◆ setValue()

ilTextAreaInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

Referenced by ilCourseContentGUI\__showUserAcceptanceTable(), assClozeTestGUI\addBasicQuestionFormProperties(), assQuestionGUI\addBasicQuestionFormProperties(), ilUserProfile\addStandardFieldsToForm(), ilAdvancedMDFieldDefinition\addToFieldDefinitionForm(), ilOrgUnitTypeFormGUI\addTranslationInputs(), ilStudyProgrammeTypeFormGUI\addTranslationInputs(), ilTestScoringGUI\buildManScoringParticipantForm(), ilCourseRegistrationGUI\fillRegistrationType(), ilGroupRegistrationGUI\fillRegistrationType(), ilSurveyParticipantsGUI\importExternalMailRecipientsFromTextFormObject(), ilPageLayoutAdministrationGUI\initAddPageLayoutForm(), ilObjMDSettingsGUI\initCopyrightEditForm(), ilObjFileAccessSettingsGUI\initDownloadingSettingsForm(), ilObjSurveyQuestionPoolGUI\initEditForm(), ilRemoteObjectBaseGUI\initEditForm(), ilObjCourseGUI\initEditForm(), ilDidacticTemplateSettingsGUI\initEditTemplate(), ilCalendarAppointmentGUI\initForm(), ilPageLayoutGUI\initForm(), ilAdvancedMDSettingsGUI\initForm(), ilObjSessionGUI\initForm(), ilObjGroupGUI\initForm(), ilObjRoleTemplateGUI\initFormRoleTemplate(), ilObjLinkResourceGUI\initFormSettings(), ilCourseObjectivesGUI\initFormTitle(), ilObjCourseGUI\initInfoEditor(), ilObjUserFolderGUI\initNewAccountMailForm(), ilObjSCORM2004LearningModuleGUI\initPropertiesForm(), ilObjSurveyGUI\initPropertiesForm(), ilObjMediaCastGUI\initSettingsForm(), ilChatroomAdminSmileyGUI\initSmiliesEditForm(), assErrorTextGUI\populateQuestionSpecificFormPart(), assOrderingHorizontalGUI\populateQuestionSpecificFormPart(), ilObjSCORMLearningModuleGUI\properties(), ilObjOrgUnitSettingsFormGUI\saveObject(), setValueByArray(), ilMailFormGUI\showForm(), and assQuestionGUI\suggestedsolution().

150  {
151  $this->value = $a_value;
152  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilTextAreaInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

References ilFormPropertyGUI\getPostVar(), ilSubEnabledFormPropertyGUI\getSubItems(), and setValue().

408  {
409  $this->setValue($a_values[$this->getPostVar()]);
410 
411  foreach ($this->getSubItems() as $item) {
412  $item->setValueByArray($a_values);
413  }
414  }
getPostVar()
Get Post Variable.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ usePurifier()

ilTextAreaInputGUI::usePurifier (   $a_flag = null)

Setter/Getter for the html purifier usage.

Parameters
boolean$a_flagUse purifier or not
Returns
mixed Returns instance of ilTextAreaInputGUI or boolean public

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

References $usePurifier.

Referenced by checkInput().

612  {
613  if (null === $a_flag) {
614  return $this->usePurifier;
615  }
616 
617  $this->usePurifier = $a_flag;
618  return $this;
619  }
usePurifier($a_flag=null)
Setter/Getter for the html purifier usage.
+ Here is the caller graph for this function:

Field Documentation

◆ $buttons

ilTextAreaInputGUI::$buttons
protected

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

◆ $cols

ilTextAreaInputGUI::$cols
protected

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

Referenced by getCols().

◆ $disabled_buttons

ilTextAreaInputGUI::$disabled_buttons = array()
protected

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

Referenced by getDisabledButtons().

◆ $initial_rte_width

ilTextAreaInputGUI::$initial_rte_width = 795
protected

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

Referenced by getInitialRteWidth(), and setInitialRteWidth().

◆ $max_num_chars

ilTextAreaInputGUI::$max_num_chars
protected

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

Referenced by getMaxNumOfChars().

◆ $min_num_chars

ilTextAreaInputGUI::$min_num_chars
protected

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

Referenced by getMinNumOfChars().

◆ $plugins

ilTextAreaInputGUI::$plugins
protected

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

◆ $Purifier

ilTextAreaInputGUI::$Purifier = null
protected

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

Referenced by getPurifier(), and setPurifier().

◆ $removeplugins

ilTextAreaInputGUI::$removeplugins
protected

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

◆ $root_block_element

ilTextAreaInputGUI::$root_block_element = null
protected

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

Referenced by getRTERootBlockElement().

◆ $rows

ilTextAreaInputGUI::$rows
protected

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

Referenced by getRows().

◆ $rte_tag_set

ilTextAreaInputGUI::$rte_tag_set
protected
Initial value:
"mini" => array("strong", "em", "u", "ol", "li", "ul", "blockquote", "a", "p", "span", "br"),
"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 93 of file class.ilTextAreaInputGUI.php.

◆ $rtesupport

ilTextAreaInputGUI::$rtesupport
protected

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

◆ $rtetags

ilTextAreaInputGUI::$rtetags
protected

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

Referenced by getRteTags().

◆ $use_tags_for_rte_only

ilTextAreaInputGUI::$use_tags_for_rte_only = true
protected

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

Referenced by getUseTagsForRteOnly().

◆ $usePurifier

ilTextAreaInputGUI::$usePurifier = false
protected

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

Referenced by usePurifier().

◆ $usert

ilTextAreaInputGUI::$usert
protected

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

Referenced by getUseRte().

◆ $value

ilTextAreaInputGUI::$value
protected

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

Referenced by getValue().


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