User tests: Successful: Unsuccessful:
For TinyMCE plugin I have changed the access check, to use "usergroup" instead of "viewlevel", as @infograf768 sugested.
It seems better idea than use "viewlevel".
How it works now:
Each Set can be assigned to multiple Usergroups.
In case if user assigned to multiple groups, and each of these group has different Sets, then will be used last one allowed Set (order: 3, 2, 1, 0).
Also I have made small changes to allow to use Old parameters, where it possible, for avoid some BC problem. Fallback possible only for the params that available in the Set form.
test usergroup
Make user in specific group, then play with TinyMCE plugin access option, try to edit the toolbar. And make sure the changes applies to assigned group.
test BC
easy way I found:
Use old site Joomla 3.6, and copy to Joomla 3.7 the values of the params
column from #__extensions
table (for plg_editors_tinymce
extension).
And make sure the plugin use the params by default.
as part of #11926
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Labels |
Added:
?
|
@fedik
While we test this find here my patch for B/C (obviously done with your former code)
https://www.dropbox.com/s/4fv1vhlkjqsyv6v/tiny_BC.diff?dl=0
You forgot to change the label of the 'set' parameter "Access" to be :
"Assign set to groups"
or even a shorter label:
"Assign set to"
@infograf768 oh it is heavy, it is very heavy
@infograf768 oh it is heavy, it is very heavy
?
yes, heavy, but does not cost in terms of performance and prevents using the conditional each time it is necessary
Tested this PR and it is working good.
Set 2 for author, set 1 for Editor
A user both as Author and Editor will get the Editor layout
Remark:
I am not sure the presets should be pre-assigned to any user group as these may have changed drastically in one's site.
It could be by default for a new install imho (in joomla.sql)
I could save a set without any Usergroup chosen: shall we accept this?
Let's test further:
With @ggppdk we were wondering what to do when we have
Authors 1, Authors 2: TinyMCE-Set 1
Authors 3, Authors 4: TinyMCE-Set 2
and a user is in both Author 1 and Author 4
(Used Author, but it could be anything else)
All Authors user groups being at the same level in the hierarchy.
I was thinking that the only solution would be to use the Set/Layout with the highest number (or the lowest depending on discussion).
What do you think?
Hint: to test B/C with my .diff (which can be applied OK after this PR is applied), install a 3.6.5 and copy the tinyMCE params, then paste them in staging.
oh it is heavy, it is very heavy
@Fedik
It terms of performance it costs zero
so i guess with term "heavy",
you speak of all the old code appearing inside tinymce.php
We can simply only add 1 "if" statement that checks for old configuration, inside tinymce.php,
and move the old code into a legacy.php file (or similar name) and load it
[EDIT]
@Fedik
If you agree with the above, can you do it ? (since you have best knowledge of us on the tinymce code and it should take little of your time)
so i guess with term "heavy", you speak of all the old code appearing inside tinymce.php
yeap, this
And it will remain there forever
But I think I will use it.
I am not sure the presets should be pre-assigned to any user group as these may have changed drastically in one's site.
It could be by default for a new install imho
It is pre-assigned only for new (like a default value). If user change this options it will not be changed. So no need SQL.
I could save a set without any Usergroup chosen: shall we accept this?
It not a problem, it just will be ignored. And in future we can use them when assign the set to "specific user", in user profile parameters.
I was thinking that the only solution would be to use the Set/Layout with the highest number (or the lowest depending on discussion).
If I right understood your question: In case if user assigned to multiple groups, and each of these group has different Sets, then will be used lowest Set.
Order is next (by default):
0 - admin level
1 - manager level
all > 1 - public level
The checking for this is here
If I right understood your question: In case if user assigned to multiple groups, and each of these group has different Sets, then will be used lowest Set.
Let me explain further:
Here are my groups: At the same level we have Author, Author 1, Author 2 and Author 3
My user is assigned to Author 1 and Author 3
In Tiny I have 2 specific sets:
Set 3 is assigned to Author 2 and Author 3
(It is a simple set + the Special character icon (The Omega)
Set 2 is assigned to Author and Author 1 (It has the LTR and RTL icons)
I log in frontend with this user and Create a new article.
It looks like it is the group id that is used first. (Author 1)
Now I change the Tiny Set3 and include Author 1 instead of Author 2.
I.e. we have 2 sets including Author 1
When logging in frontend the user still gets the Set 2:
Last, I use in both sets only the Author 1
And I still get Set2
This is what I was concerned with: which is the criteria that will load one specific set instead of the other?
@infograf768 the reason why you have got Set 2, is what I told, always will be used lower one. When multiple Set share groupX then will be used the lower available Set. (the same happens when User assigned to multiple different groups, which assigned to the different sets)
Ideally, a different sets should not share the same group.
It would be cool to allow to assign the group only once, then you would not get such confusing. But it tricky thing. Maybe I try some day/year
ok, I have added onDisplayLegacy
for BC. Please test
maybe I should add deprecate tag also?
ok, I will add, a bit later
Category | Front End Plugins | ⇒ | Administration Language & Strings Front End Plugins |
Labels |
Added:
?
|
Category | Front End Plugins Administration Language & Strings | ⇒ | Administration Language & Strings JavaScript External Library Front End Plugins |
I have improved the group select, now the group can be selected only once per the set.
Warning is a bit simple.
What about:
PLG_TINY_LEGACY_WARNING="The <a href="_QQ_"%s"_QQ_">TinyMCE Editor Plugin</a> was updated. It is for now using your legacy parameters. By editing the plugin, you can now assign various layouts to specific user groups."
The warning is missing imho when editing the plugin itself (someone may save its parameters without setting them as desired)
Not sure we should limit the message display to twice. I just would not limit it.
I have updated the message, thanks @infograf768
And now it also displayed for the plugin configuration.
About limit the message display, let's vote?
for me no much difference
And better English for the message if anybody desires.
What about the following?
The <a href="_QQ_"%s"_QQ_">TinyMCE Editor Plugin</a> has been updated. At the moment, it uses your legacy configuration. By editing the plugin, you can now assign various layouts to specific user groups.
better indeed!
updated
I have tested this item
@Fedik @AlexRed I think we can get this in now and then look deeper into the UI
There is an error in your PR.
Using return $this->onDisplayLegacy($name, $content, $width, $height, $col, $row, $buttons, $id, $asset, $author);
should only depend on $this->params->exists('mode') && $this->params->exists('alignment')
It is for the message that it should depend on
$app->isClient('administrator')
and && $config_warn_count < 2
Therefore the code should be imho:
// Check for old params for B/C
$config_warn_count = $app->getUserState('plg_editors_tinymce.config_legacy_warn_count', 0);
if ($this->params->exists('mode') && $this->params->exists('alignment'))
{
if ($app->isClient('administrator') && $config_warn_count < 2)
{
$link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $this->getPluginId());
$app->enqueueMessage(JText::sprintf('PLG_TINY_LEGACY_WARNING', $link), 'warning');
$app->setUserState('plg_editors_tinymce.config_legacy_warn_count', ++$config_warn_count);
}
return $this->onDisplayLegacy($name, $content, $width, $height, $col, $row, $buttons, $id, $asset, $author);
}
I have tested this item
I have tested this item
Works,
one second
I want to move $config_warn_count = $app->getUserState('plg_editors_tinymce.config_legacy_warn_count', 0);
under $this->params->exists('mode') && $this->params->exists('alignment')
Thanks! RTC
Can you merge so that we can go on improving this new feature?
Status | Pending | ⇒ | Ready to Commit |
rtc
I want to move $config_warn_count = $app->getUserState('plg_editors_tinymce.config_legacy_warn_count', 0); under $this->params->exists('mode') && $this->params->exists('alignment')
let's do that in another PR as we anyway need to correct some cs (spaces instead of tabs in setoptions.xml, others.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-12-30 08:46:35 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
It seems Travis failed because UFO? was near