mirror of
https://github.com/e107inc/e107.git
synced 2025-07-27 01:40:22 +02:00
@@ -3628,7 +3628,7 @@ class e107
|
|||||||
/**
|
/**
|
||||||
* Set or Retrieve WYSIWYG active status. (replaces constant e_WYSIWYG)
|
* Set or Retrieve WYSIWYG active status. (replaces constant e_WYSIWYG)
|
||||||
* @param bool $val if null, return current value, otherwise set value to registry
|
* @param bool $val if null, return current value, otherwise set value to registry
|
||||||
* @return bool|mixed|void
|
* @return bool|mixed
|
||||||
*/
|
*/
|
||||||
public static function wysiwyg($val=null)
|
public static function wysiwyg($val=null)
|
||||||
{
|
{
|
||||||
@@ -3638,27 +3638,6 @@ class e107
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (defined('e_CURRENT_PLUGIN') && e_CURRENT_PLUGIN != '')
|
|
||||||
{
|
|
||||||
$editor = e107::getPlugPref(e_CURRENT_PLUGIN, 'editor', 'default');
|
|
||||||
if ($editor != 'default' && $editor != 'bbcode' && !e107::isInstalled($editor))
|
|
||||||
{
|
|
||||||
$editor = 'default';
|
|
||||||
}
|
|
||||||
switch ($editor)
|
|
||||||
{
|
|
||||||
case 'bbcode':
|
|
||||||
return false;
|
|
||||||
case 'tinymce4':
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(is_null($val))
|
if(is_null($val))
|
||||||
{
|
{
|
||||||
return self::getRegistry('core/e107/wysiwyg');
|
return self::getRegistry('core/e107/wysiwyg');
|
||||||
|
@@ -2302,12 +2302,15 @@ class e_form
|
|||||||
/**
|
/**
|
||||||
* Bbcode Area. Name, value, template, media-Cat, size, options array eg. counter
|
* Bbcode Area. Name, value, template, media-Cat, size, options array eg. counter
|
||||||
* IMPORTANT: $$mediaCat is also used is the media-manager category identifier
|
* IMPORTANT: $$mediaCat is also used is the media-manager category identifier
|
||||||
* @param $name
|
* @param string $name
|
||||||
* @param $value
|
* @param mixed $value
|
||||||
* @param $template
|
* @param string $template
|
||||||
* @param $mediaCat _common
|
* @param string $mediaCat _common
|
||||||
* @param $size : small | medium | large
|
* @param string $size : small | medium | large
|
||||||
* @param $options array();
|
* @param array $options array();
|
||||||
|
* @param bool $options['wysiwyg'] when set to false will disable wysiwyg if active.
|
||||||
|
* @param string $options['class'] override class.
|
||||||
|
* @param string $options['id']
|
||||||
*/
|
*/
|
||||||
function bbarea($name, $value, $template = '', $mediaCat='_common', $size = 'large', $options = array())
|
function bbarea($name, $value, $template = '', $mediaCat='_common', $size = 'large', $options = array())
|
||||||
{
|
{
|
||||||
@@ -2349,8 +2352,22 @@ class e_form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// auto-height support
|
// auto-height support
|
||||||
$options['class'] = 'tbox bbarea '.($size ? ' '.$size : '').' e-wysiwyg e-autoheight form-control';
|
|
||||||
$bbbar = '';
|
$bbbar = '';
|
||||||
|
$wysiwyg = null;
|
||||||
|
$wysiwygClass = ' e-wysiwyg';
|
||||||
|
|
||||||
|
if(isset($options['wysiwyg']))
|
||||||
|
{
|
||||||
|
$wysiwyg = $options['wysiwyg'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($wysiwyg === false)
|
||||||
|
{
|
||||||
|
$wysiwygClass = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$options['class'] = 'tbox bbarea '.($size ? ' '.$size : '').$wysiwygClass.' e-autoheight form-control';
|
||||||
|
|
||||||
|
|
||||||
if (isset($options['id']) && !empty($options['id']))
|
if (isset($options['id']) && !empty($options['id']))
|
||||||
@@ -2363,7 +2380,7 @@ class e_form
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(e107::wysiwyg(true) === false) // bbarea loaded, so activate wysiwyg (if enabled in preferences)
|
if(e107::wysiwyg(true) === false || $wysiwyg === false) // bbarea loaded, so activate wysiwyg (if enabled in preferences)
|
||||||
{
|
{
|
||||||
$options['other'] = "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);' {$height}";
|
$options['other'] = "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);' {$height}";
|
||||||
}
|
}
|
||||||
@@ -2379,7 +2396,7 @@ class e_form
|
|||||||
<div class='field-spacer'><!-- --></div>\n";
|
<div class='field-spacer'><!-- --></div>\n";
|
||||||
|
|
||||||
|
|
||||||
if(e107::wysiwyg() === true)
|
if(e107::wysiwyg() === true && $wysiwyg !== false)
|
||||||
{
|
{
|
||||||
$eParseList = e107::getConfig()->get('e_parse_list');
|
$eParseList = e107::getConfig()->get('e_parse_list');
|
||||||
|
|
||||||
|
@@ -229,16 +229,19 @@ if(!deftrue('OLD_FORUMADMIN'))
|
|||||||
$this->checkOrder();
|
$this->checkOrder();
|
||||||
|
|
||||||
|
|
||||||
$this->prefs['editor']['writeParms']['optArray']['default'] = 'System editor';
|
$this->prefs['editor']['writeParms']['optArray']['default'] = 'System default'; //todo LAN
|
||||||
$this->prefs['editor']['writeParms']['optArray']['bbcode'] = 'BBCode';
|
$this->prefs['editor']['writeParms']['optArray']['bbcode'] = 'BBCode';
|
||||||
|
|
||||||
|
//@ global pref should override plugins due to security considerations and allowance of posting html.
|
||||||
|
/*
|
||||||
if (e107::isInstalled('tinymce4'))
|
if (e107::isInstalled('tinymce4'))
|
||||||
{
|
{
|
||||||
$this->prefs['editor']['writeParms']['optArray']['tinymce4'] = 'TinyMCE';
|
$this->prefs['editor']['writeParms']['optArray']['tinymce4'] = 'TinyMCE';
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$this->prefs['quickreply']['writeParms']['optArray'] = array(
|
$this->prefs['quickreply']['writeParms']['optArray'] = array(
|
||||||
'default' => 'Textarea',
|
'default' => 'Textarea', //todo LAN
|
||||||
'wysiwyg' => 'Editor'
|
'wysiwyg' => 'Rich Text Editor' //TODO LAN
|
||||||
);
|
);
|
||||||
|
|
||||||
if(e107::isInstalled('poll') == false)
|
if(e107::isInstalled('poll') == false)
|
||||||
|
@@ -177,7 +177,11 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
|||||||
$text = '';
|
$text = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return e107::getForm()->bbarea('post',$text,'forum');
|
$editor = $this->forum->prefs->get('editor');
|
||||||
|
|
||||||
|
$wysiwyg = ($editor === 'bbcode') ? false : null;
|
||||||
|
|
||||||
|
return e107::getForm()->bbarea('post',$text,'forum','_common','large', array('wysiwyg' => $wysiwyg));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user