New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] [JLayout] merge two equal JLayouts for iconclass into one new JLayout for iconclass #30470
[4.0] [JLayout] merge two equal JLayouts for iconclass into one new JLayout for iconclass #30470
Conversation
Clearly the current code is not optimal but is merging the layouts the solution? I thought the whole point of layouts was that they were single purpose and could be overridden. Doesn't this change prevent that? |
@brianteeman This PR reduces duplicate code but keeps the possibility to override the origin. content of |
Files being identical is a consequence of the layouts concept. Can the button still be overridden separately to the toolbar? |
yes.. I haven't deleted both files. The only echo the new layout. You can override button/iconclass to your own template and go wild in the code. Same goed for toolbar/iconclass |
# Conflicts: # libraries/src/HTML/Helpers/JGrid.php
@hans2103 much better now - thanks |
nice to have @hans2103 working with me to take this project to the next step. |
I have tested this item ✅ successfully on a62d5b5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
1 similar comment
I have tested this item ✅ successfully on a62d5b5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
I have tested this item ✅ successfully on 1b4e36b and now merged with this pr so will close them. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
I have tested this item ✅ successfully on 0d1156a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
I like this PHP7 operator Co-authored-by: Quy <quy@fluxbb.org>
# Conflicts: # layouts/joomla/content/info_block/category.php
…103/joomla-cms into feature/layouthelper-for-dry-icons
merged recent 4.0-dev updates and solved merge conflict |
I have tested this item ✅ successfully on b00f232 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
2 similar comments
I have tested this item ✅ successfully on b00f232 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
I have tested this item ✅ successfully on b00f232 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30470. |
Thanks |
…Layout for iconclass (joomla#30470) * 🎨 merge two equal JLayouts into one new JLayout * replace hard coded icon to call for JLayout * replace icon mapping to call for JLayout * add icon protected to layout * icon protected moved to jlayout iconclass * remove fas * add icon trash to mapping * add parameter to check if html should be rendered or icon class only * simplify php * replace massive if-then-elseif-then by switch * merge duplicate outcome fa-times * be consistent * simplify switch thx @Quy * copy changes from https://github.com/joomla/joomla-cms/pull/30468/files * copy changes from https://github.com/joomla/joomla-cms/pull/30468/files * remove setting icon to itself * copy changes from joomla#30468 * change to use layout * Update libraries/src/HTML/Helpers/ActionsDropdown.php Co-authored-by: Richard Fath <richard67@users.noreply.github.com> * use LayoutHelper in function * let default html output be true, instead of false * Update layouts/joomla/icon/iconclass.php I like this PHP7 operator Co-authored-by: Quy <quy@fluxbb.org> Co-authored-by: Troy T. Hall <programming@hallhome.us> Co-authored-by: Richard Fath <richard67@users.noreply.github.com> Co-authored-by: Quy <quy@fluxbb.org>
This PR has influence on #30468 and #30464
Summary of Changes
This PR will prevent duplicate code.
Both
layouts/joomla/button/iconclass.php
andlayouts/joomla/toolbar/iconclass.php
are the same.Merging both will make our code a bit DRY
Testing Instructions
Apply the PR and go to Joomla administrator or Joomla frontend and look for icons on buttons or in a toolbar.
There should be no change visible before or after applying the PR.
Actual result BEFORE applying this Pull Request
Buttons in the toolbar have icons
Expected result AFTER applying this Pull Request
Buttons in the toolbar have icons
Documentation Changes Required
The newly created Layout
joomla.icon.iconclass
has two parametersExamples
call for className and as HTML output
this will render
call for className and className output
this will render
call for stateName and as HTML output
this will render
call for stateName and as className output
this will render