mirror of
https://github.com/unraid/webgui.git
synced 2026-05-05 01:09:25 -05:00
Plugin manager: add ALERT message function
A plugin file may include a <ALERT> tag which displays a markdown formatted message when a new version is available. Use this to give instructions or warnings to users before the upgrade is done.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/php -q
|
||||
<?PHP
|
||||
// Copyright 2005-2021, Lime Technology
|
||||
// Copyright 2005-2022, Lime Technology
|
||||
// License: GPLv2 only
|
||||
//
|
||||
// Program updates made by Bergware International (April 2020)
|
||||
@@ -228,6 +228,12 @@ function plugin($method, $plugin_file, &$error) {
|
||||
return trim($xml->CHANGES);
|
||||
}
|
||||
|
||||
// alert message
|
||||
if ($method == 'alert') {
|
||||
if (!$xml->ALERT) return false;
|
||||
return trim($xml->ALERT);
|
||||
}
|
||||
|
||||
// check if $method is an attribute
|
||||
if (!in_array($method, $methods)) {
|
||||
foreach ($xml->attributes() as $key => $value) {
|
||||
@@ -477,7 +483,7 @@ if ($method == 'install') {
|
||||
echo "plugin: installed Unraid version is too high, require at most version $max\n";
|
||||
if (dirname($plugin_file) == "$boot") {
|
||||
move($plugin_file, "$boot-error");
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
$plugin = basename($plugin_file);
|
||||
|
||||
Reference in New Issue
Block a user