? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
29 Aug 2017

Currently we have a column for the language on all list views and a field to select the language on all edit views

This PR removes them when you are on a non multilingual site. This simplifies the UI and removes a useless field when creating content

Parts

  • Lists
  • Forms
  • Filters
  • Search tools

After PR and non multilingual

screenshotr10-20-00

screenshotr10-20-55

Before PR and After PR and multilingual

screenshotr10-22-36

screenshotr10-22-46

Test instructions

You don't need to install multiple languages. It is enough to enable the System - Language Filter plugin.
When enabled you will have language columns, sorts and filters AND language fields on item creation
When not enabled you never see the language columns

Thanks

@infograf768 @mbabker @wilsonge

942c685 29 Aug 2017 avatar brianteeman typo
avatar joomla-cms-bot joomla-cms-bot - change - 29 Aug 2017
Category Administration com_banners com_categories com_contact com_content com_fields com_installer com_menus com_modules
avatar brianteeman brianteeman - open - 29 Aug 2017
avatar brianteeman brianteeman - change - 29 Aug 2017
Status New Pending
avatar brianteeman brianteeman - edited - 29 Aug 2017
avatar brianteeman brianteeman - change - 29 Aug 2017
The description was changed
avatar brianteeman brianteeman - change - 29 Aug 2017
Labels Added: ?
3e3c97f 29 Aug 2017 avatar brianteeman tabs
avatar wilsonge
wilsonge - comment - 30 Aug 2017

@infograf768 can you confirm you are happy with this now?

avatar C-Lodder
C-Lodder - comment - 31 Aug 2017

Just a question. In the Html.php files, you're using the following:

if (!\JLanguageMultilang::isEnabled())
{
	unset($this->activeFilters['language']);
	$this->filterForm->removeField('language', 'filter');
}

which unsets the language filters.

Rather than doing this, why not only set the language filters if a multilingual site is detected?

Surely this would reduce the amount of code that's being added, by only needing to add it in one place (perhaps JForm), rather than every component.

avatar infograf768
infograf768 - comment - 31 Aug 2017

Can't apply with eclipse the changes to com_tags/tmpl/tags/default.php
I have seen some other issues, like admin modules language field not displaying when editing such a module.
Going on my tests.

avatar infograf768
infograf768 - comment - 31 Aug 2017

Concerning admin modules language field, the issue comes from
/layouts/joomla/edit/global.php
Where the language field is globally disabled, but should not for admin modules (when parameter set to yes).

It is easily solved in the layout by fetching com_modules params, but it would be an exception in a layout that is meant to be "Global".
@wilsonge
What do you think? We could maybe change the field name to lang or adminlang, modify related code and do the same in 3.8.0.

ADD: changing the field name is not enough it seems

avatar infograf768
infograf768 - comment - 31 Aug 2017

Is missing in this PR the language assignment for the template styles.
When not multilang, we should have

diff --git a/administrator/components/com_templates/View/Style/Html.php b/administrator/components/com_templates/View/Style/Html.php
index fa9d411..7f1a3e0 100644
--- a/administrator/components/com_templates/View/Style/Html.php
+++ b/administrator/components/com_templates/View/Style/Html.php
@@ -72,4 +72,10 @@
 		}
 
+		if (!\JLanguageMultilang::isEnabled() && $this->item->client_id == 0)
+		{
+			$this->form->setFieldAttribute('home', 'type', 'radio');
+			$this->form->setFieldAttribute('home', 'class', 'switcher');
+		}
+
 		$this->addToolbar();
 

which will give
screen shot 2017-08-31 at 12 50 25

instead of

screen shot 2017-08-31 at 12 52 29

avatar brianteeman
brianteeman - comment - 31 Aug 2017

Thanks for your feedback - really helps - I will work through it all now and update the pr

avatar brianteeman
brianteeman - comment - 31 Aug 2017

@infograf768 has the code for the language field in the admin modules been merged?

avatar brianteeman
brianteeman - comment - 31 Aug 2017

@infograf768 I have made the change to the template as requested - thanks for the code.

For another PR but I guess that the template styles should be refactored to add a language column in the list view AND now that we have admin module language assignment there is no reason not to have admin template language assignment

avatar infograf768
infograf768 - comment - 31 Aug 2017

For another PR but I guess that the template styles should be refactored to add a language column in the list view

It exists in the form of a Default column where the lang flag is displayed if it exists.
Screenshot in staging (I am not on a specific OS with the right php version at the time of writing this)

screen shot 2017-08-31 at 18 20 42

For admin templates styles set to a specific language, that would be a new feature but it looks like it is first a matter of modifying the field in style_administrator.xml and then make sure that value is used to load the right template depending on admin language.

For this PR, remains to solve the issue concerning admin modules language field.
Looking into it right now but we may need help on this.
Give me until tomorrow if no one finds a solution.

avatar infograf768
infograf768 - comment - 31 Aug 2017

I have a solution by using a specific new layout admin_modules.php in layout/joomla/edit/
Will post here tomorrow.

avatar infograf768
infograf768 - comment - 1 Sep 2017

@brianteeman
Here we go.
Add this file, once decompressed, in layout/joomla/edit/

admin_modules.php.zip

Then modify edit.php

diff --git a/administrator/components/com_modules/tmpl/module/edit.php b/administrator/components/com_modules/tmpl/module/edit.php
index e37a257..649bf58 100644
--- a/administrator/components/com_modules/tmpl/module/edit.php
+++ b/administrator/components/com_modules/tmpl/module/edit.php
@@ -149,5 +149,9 @@
 
 						?>
-						<?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
+						<?php if ($this->item->client_id == 0) : ?>
+							<?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
+						<?php else : ?>
+							<?php echo JLayoutHelper::render('joomla.edit.admin_modules', $this); ?>
+						<?php endif; ?>
 					</div>
 				</div>

To test, set Language Filtering for administrator modules in Modules Options.

avatar brianteeman
brianteeman - comment - 1 Sep 2017

thanks - will look at it later today etc

avatar brianteeman
brianteeman - comment - 1 Sep 2017

To test, set Language Filtering for administrator modules in Modules Options.

That was the bit I was missing when I was trying to test this

avatar brianteeman
brianteeman - comment - 1 Sep 2017

@infograf768 can you confirm that administrator module language filtering is working BEFORE this PR. I see the option to enable it but it will not save a setting
screenshotr08-02-18

avatar brianteeman
brianteeman - comment - 1 Sep 2017

I must misunderstand something about the admin module filtering because even with staging i dont see any difference to the admin modules

avatar infograf768
infograf768 - comment - 1 Sep 2017

The difference when setting Language filtering to Yes is

  1. The language column displays in the Modules Manager when filtered by administrator.
  2. The language field displays when editing an administrator module

Now, take for example the Logged-in Users admin module and set its language to fr-FR (the language must be available in admin)
Look at Control Panel when you are using en-GB as back-end language.
The module does not display.
Change its language to All: it will display whatever the language.
Set its language to en-GB, it will display only when en-GB is back-end language.

avatar infograf768
infograf768 - comment - 1 Sep 2017

You can manually install fr-fr by using this pack
http://joomlacode.org/gf/download/frsrelease/20459/164046/fr-FR_joomla_lang_full_3.7.5v2.zip

It contains a necessary correction for its fr-FR.localise.php concerning usage of JString

avatar brianteeman
brianteeman - comment - 1 Sep 2017

@infograf768 - silly me i didnt have a second language installed. Thanks for your patience I can proceed now

avatar infograf768
infograf768 - comment - 2 Sep 2017

i suggest to add the code i proposed so that we can merge this before more changes in the modified files

avatar brianteeman
brianteeman - comment - 4 Sep 2017

@infograf768 why not add
if (!JModuleHelper::isAdminMultilang())
in the global layout?

avatar infograf768
infograf768 - comment - 4 Sep 2017

@brianteeman
2 reasons:

  1. As the file name says, it is a Global edit layout. We do use specific edit layouts for quite a few matters. Here it concerns only administrator modules.
  2. I do not see anyway how using if (!JModuleHelper::isAdminMultilang()) in global would help as it is totally independent from JLanguageMultilang::isEnabled().
avatar brianteeman
brianteeman - comment - 4 Sep 2017
  1. yes it is global and it makes sense to me to put it there it is DRY. we might even expand the usage of something like isAdminMultilang in the future such as templates

  2. Yes i know they are not related. I think you misunderstood my comment

avatar infograf768
infograf768 - comment - 4 Sep 2017

Yes i know they are not related. I think you misunderstood my comment

i think i did in fact. i even tried a few lines of code without any success as that conditional has to specifically target admin modules.
the solution i proposed is the only one i found. if we implement adminlanguage for backend templates and need a specific layout, then we will also have to add it. nothing wrong with that.

avatar infograf768
infograf768 - comment - 4 Sep 2017

plus. in fact that for templates, it would be a new parameter and the helper would be the template helper and not the module helper...

avatar C-Lodder
C-Lodder - comment - 26 Sep 2017

Anything happening with this? Ready to test or still on discussion?

avatar brianteeman
brianteeman - comment - 26 Sep 2017

yes i have to fix the conflicts and one last filter. Its the work I was almost doing at the sprint until my laptop died.

avatar brianteeman
brianteeman - comment - 4 Dec 2017

closed see #18972

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Dec 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-12-04 13:18:32
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 4 Dec 2017
Closed_Date 2017-12-04 13:18:32 2017-12-04 13:18:33
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 4 Dec 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Dec 2017

Add a Comment

Login with GitHub to post a comment