-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Plugin Modal: Apply (save) button + normalize #18913
Conversation
JFactory::getDocument()->addScriptDeclaration(" | ||
Joomla.submitbutton = function(task) | ||
{ | ||
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) { | ||
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let the curly brace on the same line as the if
, javascript doesn't have the same code style as PHP
JFactory::getDocument()->addScriptDeclaration(" | ||
Joomla.submitbutton = function(task) | ||
{ | ||
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) { | ||
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
>> ===
$input = JFactory::getApplication()->input; | ||
|
||
// In case of modal | ||
$isModal = $input->get('layout') == 'modal' ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
>> ===
Thanks @C-Lodder, changes made as pointed out by you :) |
I have tested this item ✅ successfully on 95a6d3b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18913. |
Thanks for testing @ladyjer :) This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18913. |
|
||
if (task !== 'plugin.apply') { | ||
if (self !== top ) { | ||
window.top.setTimeout('window.parent.location = window.top.location.href', 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 34-36: Fix whitespace. Use tabs.
Test fine here, waiting for cs to mark it such. |
@Quy @infograf768 Fixed, not sure why my own code style checker didn't 'catch' these. Thanks for reporting and testing! |
I have tested this item ✅ successfully on cc34df8 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18913. |
RTC. Thanks. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18913. |
Pull Request for Issue # .
Summary of Changes
This PR normalizes the plugin modal as currently used in com_redirect. It also adds a [save] button to the modal footer.
Testing Instructions
1.1 disable the plg_redirect
1.2 go to component / Redirect
1.3 in the error message click on the link: "Redirect System Plugin"
[A]
2.1 change plugin status in modal to 'enabled'
2.2 change Collect URLs to 'disabled'
2.3 click on [Save] button (the modal should stay open)
2.4 click on [Close] button
[B]
Expected result
[A] The modal should open and should be same size / form / shape / etc. as other modals (like edit article in menu single article
[B] after closing the modal, the com_redirect page should refresh and the error message must be replaced with a Notice 'The Redirect Plugin is enabled. The 'Collect URLs' option in the Redirect System Plugin is disabled. Error page URLs will not be collected by this component.'
If you did not change the Collect URLs vanlue to 'disabled' there will be no warning / notice.
Actual result
[A] modal is small (width and heigth) the other modals
[B] There is no [Save] button, just a [Close] and [Save & Close] button
Documentation Changes Required
None