? ? ? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
5 Aug 2016

When working on the GSOC multilingual project joomla-projects/gsoc16_improved-multi-lingual#57 we needed to implement modals for the menu items.

To test (as the new field is not implemented elsewhere for now), create a simple multilingual site.
Create some menu items in different languages.
Edit a Menu Item, open the Associations Tab.
Instead of the dropdowns to choose a menu item you will now get the same interface as in other components.
Selecting will display a modal with forcedlanguage.
Editing will let edit the associated menu item in a modal.

This new feature will be handy to add for example a new editor_XTD to insert menu item links in contents, change in some cases the menuitem type to the new one, etc.

After patch, one will get:

screen shot 2016-08-01 at 17 05 00

avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2016
Category Administration Components Language & Strings
avatar infograf768 infograf768 - open - 5 Aug 2016
avatar infograf768 infograf768 - change - 5 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2016
Labels Added: ? ?
avatar infograf768 infograf768 - change - 5 Aug 2016
The description was changed
avatar infograf768 infograf768 - change - 5 Aug 2016
Category Administration Components Language & Strings Administration Components Language & Strings Multilanguage
avatar infograf768 infograf768 - change - 5 Aug 2016
The description was changed
avatar 1apweb 1apweb - test_item - 5 Aug 2016 - Tested successfully
avatar 1apweb
1apweb - comment - 5 Aug 2016

I have tested this item successfully on 10aecbf


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11471.

avatar brianteeman brianteeman - test_item - 5 Aug 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 5 Aug 2016

I have tested this item successfully on 10aecbf

Tested and it worked fine

From a usability perspective I was a little confused when I opened the modal to select a menu item and I kept getting empty results no matter which menu I was looking at.

I think it would be helpful if the modal title was changed from

Select or Change Menu Item
to
Select or Change %s Menu Item

where $s is the language

Or something like that


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11471.

avatar andrepereiradasilva
andrepereiradasilva - comment - 5 Aug 2016

From a usability perspective I was a little confused when I opened the modal to select a menu item and I kept getting empty results no matter which menu I was looking at.

I agree with you. But all assocaition button list modals work like this.
I someone does a PR to change that, it need to change in com_content, com_categories, com_contact and com_newsfeeds modals also.

avatar brianteeman
brianteeman - comment - 5 Aug 2016

As I've never worked on a multilingual site other than when testing issues
its not something I came across before but it definitely needs changing

On 5 August 2016 at 12:31, andrepereiradasilva notifications@github.com
wrote:

From a usability perspective I was a little confused when I opened the
modal to select a menu item and I kept getting empty results no matter
which menu I was looking at.

I agree with you. But all assocaition button list modals work like this.
I someone does a PR to change that, it need to change in com_content,
com_categories, com_contact and com_newsfeeds modals also.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11471 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8elJ7cQ8SKz_w7ABOUk2JOwDjtWOks5qcx8ngaJpZM4Jdj8a
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar infograf768
infograf768 - comment - 5 Aug 2016

Do you mean something like:

screen shot 2016-08-05 at 16 27 33

I guess we can do it in another general PR for all components concerned, after this has been merged.

avatar brianteeman
brianteeman - comment - 5 Aug 2016

yes - obviously it is only relevant when doing associations

On 5 August 2016 at 15:32, infograf768 notifications@github.com wrote:

Default of the modal Layout
Do you mean something like:

[image: screen shot 2016-08-05 at 16 27 33]
https://cloud.githubusercontent.com/assets/869724/17439720/a734e5d6-5b29-11e6-8065-b630dcc29328.png

I guess we can do it in another general PR for all components concerned,
after this has neem merged.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11471 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8VCBAy7t6pldEBnzKwc9fQuxLX5Fks5qc0lkgaJpZM4Jdj8a
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar jeckodevelopment jeckodevelopment - change - 5 Aug 2016
Labels Added: ?
avatar jeckodevelopment jeckodevelopment - test_item - 5 Aug 2016 - Tested successfully
avatar jeckodevelopment
jeckodevelopment - comment - 5 Aug 2016

I have tested this item successfully on 10aecbf


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11471.

avatar brianteeman brianteeman - change - 5 Aug 2016
Status Pending Ready to Commit
Labels
avatar alikon alikon - test_item - 6 Aug 2016 - Tested successfully
avatar alikon
alikon - comment - 6 Aug 2016

I have tested this item successfully on 10aecbf


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11471.

avatar joomla-cms-bot joomla-cms-bot - change - 6 Aug 2016
Labels Added: ?
avatar alikon
alikon - comment - 6 Aug 2016

I guess we can do it in another general PR for all components concerned, after this has been merged.

fully agree

one single step at time

avatar brianteeman brianteeman - change - 6 Aug 2016
Labels
avatar brianteeman
brianteeman - comment - 6 Aug 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11471.

avatar infograf768
infograf768 - comment - 6 Aug 2016

FYI, I already have updated this locally here in order to use it wherever the menuitem type is used in core.

It would take care of the differences between associations and other uses, not only for the Modal title but also for the default field (Select a Menu Item OR Default). Cleartrue or false, etc.

It means there would be, among other necessary changes in various xml(s), some changes (conditionals) in the ROOT/administrator/components/com_menus/models/fields/modal/menu.php file which is created in this PR.

diff --git a/administrator/components/com_menus/models/fields/modal/menu.php b/administrator/components/com_menus/models/fields/modal/menu.php
index afe8d9f..a4c00f1 100644
--- a/administrator/components/com_menus/models/fields/modal/menu.php
+++ b/administrator/components/com_menus/models/fields/modal/menu.php
@@ -88,8 +88,16 @@
            $scriptClear = true;

+           if (isset($this->element['language']))
+           {
+               $clearField = htmlspecialchars(JText::_('COM_MENUS_SELECT_A_MENUITEM', true), ENT_COMPAT, 'UTF-8');
+           }
+           else
+           {
+               $clearField = htmlspecialchars(JText::_('JDEFAULT', true), ENT_COMPAT, 'UTF-8');
+           }
+
            $script[] = '   function jClearMenu(id) {';
            $script[] = '       document.getElementById(id + "_id").value = "";';
-           $script[] = '       document.getElementById(id + "_name").value = "' .
-               htmlspecialchars(JText::_('COM_MENUS_SELECT_A_MENUITEM', true), ENT_COMPAT, 'UTF-8') . '";';
+           $script[] = '       document.getElementById(id + "_name").value = "' . $clearField . '";';
            $script[] = '       jQuery("#"+id + "_clear").addClass("hidden");';
            $script[] = '       if (document.getElementById(id + "_edit")) {';
@@ -117,4 +125,9 @@
            $linkItems .= '&forcedLanguage=' . $this->element['language'];
            $linkItem  .= '&forcedLanguage=' . $this->element['language'];
+           $modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM') . ' (' . $this->element['label'] . ')';
+       }
+       else
+       {
+           $modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM');
        }

@@ -144,5 +157,12 @@
        if (empty($title))
        {
-           $title = JText::_('COM_MENUS_SELECT_A_MENUITEM');
+           if (isset($this->element['language']))
+           {
+               $title = JText::_('COM_MENUS_SELECT_A_MENUITEM', true);
+           }
+           else
+           {
+               $title = JText::_('JDEFAULT');
+           }
        }

@@ -195,5 +215,5 @@
            'menuSelect' . $this->id . 'Modal',
            array(
-               'title'       => JText::_('COM_MENUS_CHANGE_MENUITEM'),
+               'title'       => $modalTitle,
                'url'         => $urlSelect,
                'height'      => '400px',

As the milestone is not set, I think it is better to wait to make such a full PR.
What do you think?

avatar brianteeman
brianteeman - comment - 6 Aug 2016

As it is a new feature the milestone will be 3.7

avatar infograf768
infograf768 - comment - 15 Aug 2016

@andrepereiradasilva
while making a POC for a new editor_xtd
/plugins/editors-xtd/menu/menu.php
I had to change the modal to
data-uri="<?php echo 'index.php?Itemid=' . $item->id; ?>"
instead of
data-uri="<?php echo $this->escape(JRoute::_('index.php?Itemid=' . $item->id)); ?>"
as otherwise I was getting administrator/ in the link.

The new plugin works now fine here.

If I remember well, you did something about using JRoute in admin when targeting site.
I just wonder if we really need JRoute anyway here as I add the language in the plugin with:

$js = "
        function jSelectMenuItem(id, title, tree, object, uri, language)
        {
            var thislang = '';
            if (language !== '')
            {
                var thislang = '&lang=';
            }
            var tag = '<a href=\"' + uri + thislang + language + '\">' + title + '</a>';
            jInsertEditorText(tag, '" . $name . "');
            jModalClose();
        }";
avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Aug 2016

If I remember well, you did something about using JRoute in admin when targeting site.

yes i made one for that #11060

avatar infograf768
infograf768 - comment - 16 Aug 2016

As we do not need a JRoute in our case and we do need to know if we are or not in multilang and if the language of the menu item is set to a content language, I modified the PR to fit.

To test how the new menu editor-xtd works, unzip this in the editors-xtd and discover it.
You will get a new button (without language strings) in TinyMCE when editing content. Just choose a menu item and look at the source in the editor.
Save and test in frontend.
Test in multilang and monolang.
menu.zip

avatar wilsonge
wilsonge - comment - 19 Aug 2016

Merged into 3.7.x with 1f48268

avatar wilsonge wilsonge - change - 19 Aug 2016
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2016-08-19 13:44:45
Closed_By wilsonge
avatar infograf768
infograf768 - comment - 20 Aug 2016

@wilsonge
I guess I now have to target 3.7.0 for the remaining improvements possible grace to this PR.
[Title of modal, new editors-xtd feature, using the new field type instead of menuitem where possible.]

avatar joomla-cms-bot joomla-cms-bot - change - 20 Aug 2016
Labels Removed: ?
avatar infograf768
infograf768 - comment - 20 Aug 2016

Folks, please use 3.7.x branch and test
#11694

Add a Comment

Login with GitHub to post a comment