ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. 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, 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.
+ 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, 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 mbstring extension is mandatory for 5.4
456  $chars_entered = mb_strlen(strip_tags(str_replace($to_replace, $replace_to, $_POST[$this->getPostVar()])));
457 
458  if ($this->getMaxNumOfChars() && ($chars_entered > $this->getMaxNumOfChars())) {
459  $this->setAlert($lng->txt("msg_input_char_limit_max"));
460 
461  return false;
462  } elseif ($this->getMinNumOfChars() && ($chars_entered < $this->getMinNumOfChars())) {
463  $this->setAlert($lng->txt("msg_input_char_limit_min"));
464 
465  return false;
466  }
467  }
468 
469  return $this->checkSubItemsInput();
470  }
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.
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 673 of file class.ilTextAreaInputGUI.php.

674  {
675  if (is_array($a_button)) {
676  $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
677  } else {
678  $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
679  }
680 
681  return $this;
682  }

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

References $disabled_buttons.

Referenced by insert().

693  {
694  if (!$as_array) {
695  return implode(',', $this->disabled_buttons);
696  } else {
698  }
699  }
+ Here is the caller graph for this function:

◆ getInitialRteWidth()

ilTextAreaInputGUI::getInitialRteWidth ( )
Returns
int

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

References $initial_rte_width.

Referenced by insert().

705  {
707  }
+ 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 636 of file class.ilTextAreaInputGUI.php.

References $Purifier.

Referenced by checkInput().

637  {
638  return $this->Purifier;
639  }
+ 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 660 of file class.ilTextAreaInputGUI.php.

References $root_block_element.

Referenced by insert().

661  {
663  }
+ 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 477 of file class.ilTextAreaInputGUI.php.

References ilFormPropertyGUI\$lng, ilRTE\_getRTEClassname(), 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().

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

References getMaxNumOfChars(), and getMinNumOfChars().

Referenced by checkInput(), and insert().

718  {
719  if ($this->getMaxNumOfChars() || $this->getMinNumOfChars()) {
720  return true;
721  }
722 
723  return false;
724  }
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.

Referenced by ilObjLearningSequenceSettingsGUI\initRTEInput().

283  {
284  $this->removeplugins[$a_plugin] = $a_plugin;
285  }
+ Here is the caller graph for this function:

◆ removeRTESupport()

ilTextAreaInputGUI::removeRTESupport ( )

Remove RTE support for a special module.

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

323  {
324  $this->rteSupport = array();
325  }

◆ setCols()

◆ setInitialRteWidth()

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

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

References $initial_rte_width.

713  {
714  $this->initial_rte_width = $initial_rte_width;
715  }

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

References $Purifier.

625  {
626  $this->Purifier = $Purifier;
627  return $this;
628  }

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

649  {
650  $this->root_block_element = $a_root_block_element;
651  return $this;
652  }

◆ 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, and $version.

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
$version
Definition: build.php:27

◆ 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 ilObjLearningSequenceSettingsGUI\initRTEInput(), and 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(), and ilObjLearningSequenceSettingsGUI\initRTEInput().

249  {
250  $this->usert = $a_usert;
251 
252  if (strlen($version)) {
253  $this->rteSupport['version'] = $version;
254  }
255  }
$version
Definition: build.php:27
+ 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 assClozeTestGUI\addBasicQuestionFormProperties(), assQuestionGUI\addBasicQuestionFormProperties(), ilUserProfile\addStandardFieldsToForm(), ilAdvancedMDFieldDefinition\addToFieldDefinitionForm(), ilOrgUnitTypeFormGUI\addTranslationInputs(), ilStudyProgrammeTypeFormGUI\addTranslationInputs(), ilCourseRegistrationGUI\fillRegistrationType(), ilGroupRegistrationGUI\fillRegistrationType(), ilSurveyParticipantsGUI\importExternalMailRecipientsFromTextFormObject(), ilPageLayoutAdministrationGUI\initAddPageLayoutForm(), ilObjMDSettingsGUI\initCopyrightEditForm(), ilObjFileAccessSettingsGUI\initDownloadingSettingsForm(), ilObjSurveyQuestionPoolGUI\initEditForm(), ilRemoteObjectBaseGUI\initEditForm(), ilDidacticTemplateSettingsGUI\initEditTemplate(), ilCalendarAppointmentGUI\initForm(), ilPageLayoutGUI\initForm(), ilAdvancedMDSettingsGUI\initForm(), ilObjSessionGUI\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(), ilTestScoringGUI\saveReturnManScoringParticipantScreen(), 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 607 of file class.ilTextAreaInputGUI.php.

References $usePurifier.

Referenced by checkInput().

608  {
609  if (null === $a_flag) {
610  return $this->usePurifier;
611  }
612 
613  $this->usePurifier = $a_flag;
614  return $this;
615  }
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:
= array(
"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: