进行了一些小优化
This commit is contained in:
+5
-5
@@ -188,11 +188,11 @@ class Center {
|
||||
'priority' => 55,
|
||||
'type' => 'panel',
|
||||
],
|
||||
'notif' => [
|
||||
'msg' => [
|
||||
'label' => __('消息通知', 'aksrt'),
|
||||
'icon' => 'bell',
|
||||
'priority' => 60,
|
||||
'type' => 'link',
|
||||
'type' => 'panel',
|
||||
],
|
||||
'auth' => [
|
||||
'label' => __('官方认证', 'aksrt'),
|
||||
@@ -307,6 +307,9 @@ class Center {
|
||||
if (!in_array('settings', $order, true)) {
|
||||
$order[] = 'settings';
|
||||
}
|
||||
if (!in_array('msg', $order, true)) {
|
||||
$order[] = 'msg';
|
||||
}
|
||||
|
||||
foreach ($order as $key) {
|
||||
if (!isset($definitions[$key])) {
|
||||
@@ -339,9 +342,6 @@ class Center {
|
||||
$this->panels[$key] = $panel;
|
||||
}
|
||||
|
||||
// Notif is a link entry (messages page), not a dashboard panel body.
|
||||
$this->panels['notif'] = $definitions['notif'];
|
||||
|
||||
// Keep stable order by priority.
|
||||
uasort($this->panels, static function (array $a, array $b): int {
|
||||
return ((int) ($a['priority'] ?? 100)) <=> ((int) ($b['priority'] ?? 100));
|
||||
|
||||
Reference in New Issue
Block a user