mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 18:24:57 +02:00
Fix issue processwire/processwire-issues#188 to provide more detailed warning message when installing module that doesn't meet requirements
This commit is contained in:
@@ -649,7 +649,7 @@ class ProcessModule extends Process {
|
|||||||
if($summary) $summary = "<p class='module-summary'>$summary</p>";
|
if($summary) $summary = "<p class='module-summary'>$summary</p>";
|
||||||
$buttons = '';
|
$buttons = '';
|
||||||
$confirmDeleteJS = "return confirm('" . sprintf($this->_('Delete %s?'), $name) . "')";
|
$confirmDeleteJS = "return confirm('" . sprintf($this->_('Delete %s?'), $name) . "')";
|
||||||
$confirmInstallJS = "return confirm('" . sprintf($this->_('Installing may cause problems. Are you sure you want to install?'), $name) . "')";
|
$confirmInstallJS = "return confirm('" . sprintf($this->_('Module requirements are not fulfilled so installing may cause problems. Are you sure you want to install?'), $name) . "')";
|
||||||
$editUrl = "edit?name={$name}";
|
$editUrl = "edit?name={$name}";
|
||||||
|
|
||||||
if(!$installed) {
|
if(!$installed) {
|
||||||
|
@@ -386,15 +386,18 @@ var ProcessWireAdmin = {
|
|||||||
|
|
||||||
if(typeof ProcessWire != "undefined") {
|
if(typeof ProcessWire != "undefined") {
|
||||||
ProcessWire.confirm = function(message, func) {
|
ProcessWire.confirm = function(message, func) {
|
||||||
if(typeof vex != "undefined") {
|
if(typeof vex != "undefined" && typeof func != "undefined") {
|
||||||
vex.dialog.confirm({
|
vex.dialog.confirm({
|
||||||
message: message,
|
message: message,
|
||||||
callback: function(v) {
|
callback: function(v) {
|
||||||
if(v) func();
|
if(v) func();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else if(typeof func != "undefined") {
|
||||||
if(confirm(message)) func();
|
if(confirm(message)) func();
|
||||||
|
} else {
|
||||||
|
// regular JS confirm behavior
|
||||||
|
return confirm(message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
2
wire/templates-admin/scripts/main.min.js
vendored
2
wire/templates-admin/scripts/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user