? ?
avatar brianteeman
brianteeman
8 Sep 2019

The icons used with the various dashboard titles are created from a language string :(

$icon = Text::_('COM_CPANEL_DASHBOARD_BASE_ICON');

COM_CPANEL_DASHBOARD_CONTENT_ICON="fa fa-file-alt"
COM_CPANEL_DASHBOARD_CONTENT_TITLE="Content Dashboard"

They really should not be as a css class is not a language string.

avatar brianteeman brianteeman - open - 8 Sep 2019
avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Sep 2019
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 8 Sep 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Sep 2019
Labels Added: ?
avatar infograf768
infograf768 - comment - 8 Sep 2019

Agree. See $keyIcon = $prefix . $sectionkey . '_ICON'; and
$icon = Text::_($keyIcon);

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Sep 2019
Status New Discussion
avatar infograf768
infograf768 - comment - 8 Sep 2019

@chmst
As you introduced this in the new backend template, can you figure another way?
b04e550#diff-038a8497dd9ef101525de218e0877ae9

avatar chmst
chmst - comment - 9 Sep 2019

I agree that this is bad. But have no idea how to resolve this.
The icon for the dashboard is not stored in the database, in this view we have the name of the component here, nothing else.

@Hackwar can you help here?

avatar infograf768
infograf768 - comment - 9 Sep 2019

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.

avatar infograf768
infograf768 - comment - 10 Sep 2019

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.

avatar brianteeman
brianteeman - comment - 10 Sep 2019

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.

avatar infograf768
infograf768 - comment - 10 Sep 2019

Note:
2 strings missing if we do not change this code.

COM_CPANEL_DASHBOARD_PRIVACY_TITLE="Privacy Dashboard"
COM_CPANEL_DASHBOARD_PRIVACY_ICON="lock"
avatar infograf768
infograf768 - comment - 10 Sep 2019

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');

avatar infograf768
infograf768 - comment - 10 Sep 2019

Bugsquad discussion:
@Hackwar is against any change, including setting a different behavior (hard coding $icon) for core.
The feature is supposed to cope with specific dashboards created by 3pd.

avatar brianteeman
brianteeman - comment - 10 Sep 2019

Then the code needs to be improved to be able to work without using a language string to set a class

avatar brianteeman
brianteeman - comment - 10 Sep 2019

Can this be used

* Method to get the CSS class name for an icon identifier or create one if

avatar infograf768
infograf768 - comment - 10 Sep 2019

I made a PR hardcoding icons as this is specific to Toolbarhelper::title()
PLT will decide.

See: #26252

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 10 Sep 2019

Closed as having Pull Request #26252

avatar franz-wohlkoenig franz-wohlkoenig - close - 10 Sep 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 10 Sep 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-09-10 10:12:52
Closed_By franz-wohlkoenig

Add a Comment

Login with GitHub to post a comment