Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choose editor in forum and quick reply #3318

Merged
merged 1 commit into from
Jul 28, 2018
Merged

Conversation

SimSync
Copy link
Contributor

@SimSync SimSync commented Jul 25, 2018

New prefs for forum: editor & quickreply
editor makes it possible to choose between bbcode or tinymce (if installed and html enabled)
quickreply gives the option to choose between the standard textarea or the choosen editor (from pref editor)

New prefs for forum: editor & quickreply
editor makes it possible to choose between bbcode or tinymce (if installed and html enabled)
quickreply gives the option to choose between the standard textarea or the choosen editor (from pref editor)
if (self::getPref('wysiwyg',false) != true)
{
return false;
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. I'm not a fan of this code here though. Using e107::wysiwyg(false); in the forum plugin should be enough to disable it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work. I tried it already. Look at the bbarea() function, where wysiwyg() is called and you see that any previous change will be overwritten.
Changing the wysiwyg(true) in bbarea to wysiwyg() is also a bad idea, because wysiwyg() is saving the last setting in the registry, which means that the bbarea will not be replaced by tinymce system wide when wysiwyg(false) is called anywhere in the code.
As a systemwide change is not what I want to achieve, I had to add some code that checks for the current plugin and to return a value without touching the global settings in the registry.

@@ -183,6 +183,9 @@ class forum_ui extends e_admin_ui
'popular' => array('title' => FORLAN_55, 'type'=>'number', 'data' => 'int','help'=>FORLAN_56),
'postspage' => array('title' => FORLAN_57, 'type'=>'number', 'data' => 'int','help'=>FORLAN_58),
'threadspage' => array('title' => FORLAN_186, 'type'=>'number', 'data' => 'int','help'=>FORLAN_187),

'editor' => array('title' => 'Post editor', 'type' => 'dropdown', 'data' => 'str', 'readParms' => array(), 'writeParms' => array('optArray' => array(), 'defaultValue' => 'default'), 'help' => 'Which editor should be used to create/edit posts?'),
'quickreply' => array('title' => 'Quick replay editor', 'type' => 'dropdown', 'data' => 'str', 'readParms' => array(), 'writeParms' => array('optArray' => array(), 'defaultValue' => 'default'), 'help' => '')
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there should be a pref for 'quick reply' . The whole idea behind quick-reply was that there is no formatting. (that's what makes it quick). When formatting is required, then people should use the 'reply' button. I'm guessing removing this will also remove the need to change line 405 of the template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally always modded the v1 forum to have bbcode in the quick reply field... And I could imagine, I was not alone. With this setting, the admin can decide if he/she wants a simple textarea or the chosen editor. Default is the textarea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay 👍

@CaMer0n CaMer0n merged commit 3701765 into e107inc:master Jul 28, 2018
CaMer0n added a commit that referenced this pull request Jul 28, 2018
@SimSync SimSync deleted the forum_editor branch July 29, 2018 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants