WYSIWYG Option Type 1.0.0

License Agreement
Freie Lizenz
Website
https://hanashi.dev
Supported Versions
WoltLab Suite 3.0
WoltLab Suite 3.1

This extension adds the WYSIWYG editor as an option type to the WSC.

This extension adds the WYSIWYG editor as option type to WoltLab Suite 3. Other extensions can refer to this extension.

Using the Option Type

WYSIWYG editor

In this example the option my_option and the category my_category are called, replace these two names accordingly. In your option.xml insert the following between <options> and </options>.

XML: option.xml
  1. <option name="my_option">
  2. <categoryname>my_category</categoryname>
  3. <optiontype>TextareaWysiwyg</optiontype>
  4. </option>


In the PHP code you can now access the option as follows:

PHP
  1. $processor = new \wcf\system\html\output\HtmlOutputProcessor();
  2. $processor->process(MY_OPTION, 'dev.hanashi.wsc.textareawysiwyg.message', 0);
  3. echo $processor->getHTML();

WYSIWYG editor with i18n support

In this example the option my_option_i18n and the category my_category are called, replace these two names accordingly. In your option.xml insert the following between <options> and </options>.

XML: option.xml
  1. <option name="my_option_i18n">
  2. <categoryname>my_category</categoryname>
  3. <optiontype>TextareaWysiwygI18n</optiontype>
  4. <supporti18n>1</supporti18n>
  5. </option>


In the PHP code you can now access the option as follows:

PHP
  1. $value = \wcf\system\WCF::getLanguage()->get(MY_OPTION_I18N);
  2. $processor = new \wcf\system\html\output\HtmlOutputProcessor();
  3. $processor->process($value, 'dev.hanashi.wsc.textareawysiwyg.message', 0);
  4. echo $processor->getHTML();

  • Version 1.0.0