User tests: Successful: Unsuccessful:
The string
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE=""
should NOT have been deleted! ( see #12467 )
When the value is not set it automatically loads the Languages forums page with the correct text
For en-GB it gives
When value is set to the correct language forum (for example 19
for French, it loads the French Language forum.
Category | ⇒ | Administration Language & Strings |
Status | New | ⇒ | Pending |
@franz-wohlkoenig
yes you get that because we kept the string in fr-FR although it is deleted in en-GB. That is how I found it was missing in en-GB.
It is necessary to have the string as it shows to Translation Teams. For example TTs using crowdin will not even know it exists...
remark the comment above the missing string in en-GB.mod_menu.ini:
; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in https://forum.joomla.org/. Use something like 'Official english forum'.
But no string below...
Can be merged on review.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-02 15:49:48 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
?
|
@infograf768 IMHO this PR is wrong see code
joomla-cms/administrator/components/com_menus/presets/joomla.xml
Lines 480 to 487 in 2ba24eb
@infograf768 This has been changed as part of #16451.
Another good idea would be to replace the link to the subforum in forum.joomla.org with a link to an external community forum. This would be useful if the .org subforum is less active then the external forum.
The new custom admin menus have also broken the mod_menu parameter forum_url
Another good idea would be to replace the link to the subforum in forum.joomla.org with a link to an external community forum.
We never allowed that as it would allow Translators to give an advantage to their own site. It's part of the policy with Translation Teams.
The mod_menu forum_url
parameter was created to let custom distribs add such a link, or users to add or modify this. Not the TTs.
Before the custom admin menus and presets we had in enabled
if ($forum_url = $params->get('forum_url'))
{
$menu->addChild(
new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
);
}
$debug = $lang->setDebug(false);
if ($lang->hasKey('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') && JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') != '')
{
$forum_url = 'http://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
$lang->setDebug($debug);
$menu->addChild(
new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
);
}
@izharaazmi
Please look at that urgently.
It looks like we can't load mod_menu strings in langforum.php.
If we could manage to do that, we could at least not modify that part of the strings.
We would just have to modify langforum.php this way
$forumId = (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
if (empty($forumId))
{
$forumId = 511;
}
$forum_url = 'https://forum.joomla.org/viewforum.php?f=' . $forumId;
JFactory::getApplication()->redirect($forum_url);
and take off
COM_ADMIN_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE="511"
Otherwise, we will revert this PR, then make a new PR where the comments in mod_menu.ini are modified and add a comment in com_admin.ini new strings, then inform TTs.
We also need to correct the problem with the mod_menu forum_url
parameter.
Still working on it though.
@infograf768 I'm traveling right now. I'll see to it tomorrow when at desk.
For the custom lang forum, keeping this PR, we can do in helpforum.php
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JFactory::getLanguage()->load('mod_menu', JPATH_ADMINISTRATOR, null, false, true);
$forumId = (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
if (empty($forumId))
{
$forumId = 511;
}
$forum_url = 'https://forum.joomla.org/viewforum.php?f=' . $forumId;
JFactory::getApplication()->redirect($forum_url);
and take off the com_admin string
This will load the mod_menu string correctly.
@wojsmol
Can you install the French language and make this modification?
Then use French as backend language.
It should now load the French forum directly as we have the string in fr-FR
For the mod_menu param, it is another story.
@infograf768 This works as described.
@infograf768 sorry that I don't understand what we are trying to achieve here. Can you please summarise it for me. Thank you.
@wojsmol
Thanks for testing.
@izharaazmi
I started working on the custom forum url depending on the module parameter.
To do this I added a customforum.php
in com_admin/views/help/
and modified the default presets.
One issue remains: How to prevent displaying that submenu when the module parameter is empty.
See:
help.diff.zip
@izharaazmi
siesta now. will explain all later
Yeah right. I'll think about that and come up with a solution hopefully.
We have 2 issues.
langforum.php
and the new string COM_ADMIN_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE
you did not remark (although you deleted it) that the string MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE
already existed and was used by TTs to link to their forum.joomla.org specific language forum.The patch I propose above #17836 (comment) solves that issue.
There is no reason to create a new string as we have an already existing one. Was only necessary to load the mod_menu.ini file.
Setting the string to "" in en-GB (done with this already merged PR) is covered by the patch if the string remains unchanged by some TTs.
The comment in the mod_menu.ini file has also to be modified:
; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in https://forum.joomla.org/. Use something like 'Official english forum'.
as the logic has changed, i.e. one now always get that link, whether it is to the specific language forum (19 for French) or the part of the forum (511) displaying all language forums.
This was done via the code in .../administrator/modules/mod_menu/tmpl/default_enabled.php
if ($forum_url = $params->get('forum_url'))
{
$menu->addChild(
new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
);
}
That link may also be added or suggested by 3pd extensions.
For example it can be https://www.akeebabackup.com/documentation.html
This is what I started working on in the .zip diff I posted above and where I could not find a simple way to not display the Custom Forum submenu when the field is empty.
in mod_menu.ini, we have
; the string below will be used if the localised sample data contains a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Administrator Menu module contains a URL
MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM="Custom Support Forum"
Hope this helps understand.
Thank you @infograf768, for the details and now I understand it clear.
I recently came across 'com_pagebuilder' and another component (can't recall the name) that injected its menu in admin menu prior to J3.7 admin menu manager. Looks like now its not possible (or not easy) to do that anymore.
So I was wondering whether we should allow such things or not. If yes, then should there be a plugin event trigger that can allow us to manipulate menu items via plugin logic.
If we choose to go that way, the same could be useful for this too. Otherwise, I'd try to find something better. Please advise.
@izharaazmi
For the moment, I will make a PR to solve the first issue as we must get this in 3.8.0
For the second issue, can't you devise a way to display such a conditional in your code to allow displaying or not one of the <menuitem
in the presets?
In my zip above, I added
<menuitem
type="url"
target="_blank"
title="MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM"
link="index.php?option=com_admin&view=help&layout=customforum"
class="class:help-forum"
scope="help"
/>
and the conditional is the same as in the proposed new customforum.php
$module = JModuleHelper::getModule('mod_menu');
$params = new JRegistry($module->params);
if ($params->get('forum_url'))
etc.
Sure, I must get that work.
Please test #17857
@wojsmol
@izharaazmi
as we have to get this urgently in staging
@izharaazmi
How does it go with the second issue? It is a regression.
I've solved the hiding item conditionally issue. However, I'd be able to do
the PR on Friday only.
Got same Menu as shown in above Screenshot for French Lang. without Pull Request: