From 71a4c1099d8319d8c4b40fdb6f723129fc17dc99 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Thu, 26 May 2022 10:39:16 +0000 Subject: [PATCH] * Adjust the prompt text for plugin expiration. --- module/extension/model.php | 17 +++++++++++++---- module/misc/lang/en.php | 3 ++- module/misc/lang/zh-cn.php | 3 ++- module/user/control.php | 2 +- module/user/view/login.html.php | 14 ++++++++++---- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/module/extension/model.php b/module/extension/model.php index 12f89ef04d..2a17a5e7ae 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -914,14 +914,15 @@ class extensionModel extends model /** * Get plugins that are about to expire or have expired. * + * @param bool $category * @access public - * @return array() + * @return array */ - public function getExpiringPlugins() + public function getExpiringPlugins($category = false) { $extensions = $this->getLocalExtensions('installed'); - $plugins = array(); + $plugins = $category ? array('expiring' => array(), 'expired' => array()) : array(); $today = helper::today(); foreach($extensions as $extension) { @@ -929,7 +930,15 @@ class extensionModel extends model if(!empty($expiredDate)) { $dateDiff = helper::diffDate($expiredDate, $today); - if($dateDiff == 30 or $dateDiff == 14 or $dateDiff <= 7) $plugins[] = $extension->name; + if($category) + { + if($dateDiff == 30 or $dateDiff == 14 or ($dateDiff <= 7 and $dateDiff >= 0)) $plugins['expiring'][] = $extension->name; + if($dateDiff <= -1) $plugins['expired'][] = $extension->name; + } + else + { + if($dateDiff == 30 or $dateDiff == 14 or $dateDiff <= 7) $plugins[] = $extension->name; + } } } return $plugins; diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 63388026e6..99fae3f206 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -74,7 +74,8 @@ $lang->misc->remind = 'New feature reminders'; $lang->misc->expiredTipsTitle = 'Dear system administrator, hello:'; $lang->misc->expiredCountTips = 'There are %s plug-ins in the system that will expire soon. To avoid affecting your regular use, please get in touch with the administrator to renew or uninstall them in time.'; -$lang->misc->expiredPluginTips = 'The plug-ins that will expire are: %s.'; +$lang->misc->expiredPluginTips = 'Expired plugins are: %s; '; +$lang->misc->expiringPluginTips = 'The plug-ins that will expire are: %s.'; $lang->misc->expiredTipsForAdmin = 'There are %s plug-ins in the current system that will expire soon. To avoid affecting the regular use of the function, please renew or uninstall them in the system background plug-in management as soon as possible.'; $lang->misc->noticeRepair = "