1
0
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:
Ryan Cramer
2017-03-07 09:03:58 -05:00
parent d7d392fe95
commit f32593adfa
3 changed files with 7 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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);
} }
}; };

File diff suppressed because one or more lines are too long