The icons used with the various dashboard titles are created from a language string :(
joomla-cms/administrator/language/en-GB/en-GB.com_cpanel.ini
Lines 13 to 14 in eaa4f48
They really should not be as a css class is not a language string.
Labels |
Added:
?
|
Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
@chmst
As you introduced this in the new backend template, can you figure another way?
b04e550#diff-038a8497dd9ef101525de218e0877ae9
If I understand well, the only reason why it is not harcoded is because it was desired that 3pds be able to create custom Presets where the heading of the custom CPanel dashboard would fit a specific non-core extension.
Taking into account all the issues we have with this new feature and mod_submenu, I suggest this part of the new admin template to be refactored.
I am quite confused by the code in this file.
In which cases can we get $parts[1]
from $parts = explode('.', $extension);
?
After clarification, i.e. what kind of custom dashboard/presets (i.e. non-core ones) for which we need all that code instead of simply hardcoding $icon value depending on the default possible core dashboards, we could simplify the file and get rid of the lang strings for $icon.
As much as I dont like hard coding anything - with the current code base that's the only option I can see to handle this.
Note:
2 strings missing if we do not change this code.
COM_CPANEL_DASHBOARD_PRIVACY_TITLE="Privacy Dashboard"
COM_CPANEL_DASHBOARD_PRIVACY_ICON="lock"
As much as I dont like hard coding anything - with the current code base that's the only option I can see to handle this.
The icon is always used for ToolbarHelper::title
So it is not as if we were hardcoding it specially for this case.
Example for articles manager where $icon
is stack article
:
ToolbarHelper::title(Text::_('COM_CONTENT_ARTICLES_TITLE'), 'stack article');
Then the code needs to be improved to be able to work without using a language string to set a class
Can this be used
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-09-10 10:12:52 |
Closed_By | ⇒ | franz-wohlkoenig |
Agree. See
$keyIcon = $prefix . $sectionkey . '_ICON';
and$icon = Text::_($keyIcon);