show update message in Extension Manager if available

This commit is contained in:
Gerrit Uitslag 2024-01-30 00:14:36 +01:00
parent 0175e14a9f
commit f4d0426bce
3 changed files with 16 additions and 0 deletions

View File

@ -438,6 +438,16 @@ class helper_plugin_extension_extension extends Plugin
return false;
}
/**
* Get the text of the update message if there is any
*
* @return string|bool The update message if there is any, false otherwise
*/
public function getUpdateMessage()
{
if (!empty($this->remoteInfo['updatemessage'])) return $this->remoteInfo['updatemessage'];
return false;
}
/**
* Get the text of the security warning if there is any

View File

@ -392,6 +392,11 @@ class helper_plugin_extension_list extends Plugin
sprintf($this->getLang('security_warning'), '<bdi>' . hsc($securitywarning) . '</bdi>') .
'</div>';
}
if (($updateMessage = $extension->getUpdateMessage()) !== false) {
$html .= '<div class="msg notify">' .
sprintf($this->getLang('update_message'), '<bdi>' . hsc($updateMessage) . '</bdi>') .
'</div>';
}
if ($extension->updateAvailable()) {
$html .= '<div class="msg notify">' .
sprintf($this->getLang('update_available'), hsc($extension->getLastUpdate())) .

View File

@ -81,6 +81,7 @@ $lang['msg_nooverwrite'] = 'Extension %s already exists so it is no
$lang['missing_dependency'] = '<strong>Missing or disabled dependency:</strong> %s';
$lang['security_issue'] = '<strong>Security Issue:</strong> %s';
$lang['security_warning'] = '<strong>Security Warning:</strong> %s';
$lang['update_message'] = '<strong>Update Message:</strong> %s';
$lang['update_available'] = '<strong>Update:</strong> New version %s is available.';
$lang['wrong_folder'] = '<strong>Plugin installed incorrectly:</strong> Rename plugin directory "%s" to "%s".';
$lang['url_change'] = '<strong>URL changed:</strong> Download URL has changed since last download. Check if the new URL is valid before updating the extension.<br />New: %s<br />Old: %s';