forked from Public/pics
AdminMenu: add error count to badge iff count > 0
This commit is contained in:
parent
01822cdccf
commit
3cf281b24d
@ -15,9 +15,10 @@ class AdminMenu extends Menu
|
|||||||
if (!$user->isAdmin())
|
if (!$user->isAdmin())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->items[] = [
|
$this->items[0] = [
|
||||||
'label' => 'Admin',
|
'label' => 'Admin',
|
||||||
'icon' => 'gear',
|
'icon' => 'gear',
|
||||||
|
'badge' => ErrorLog::getCount(),
|
||||||
'subs' => [
|
'subs' => [
|
||||||
[
|
[
|
||||||
'uri' => '/managealbums/',
|
'uri' => '/managealbums/',
|
||||||
@ -43,6 +44,9 @@ class AdminMenu extends Menu
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($this->items[0]['badge'] == 0)
|
||||||
|
unset($this->items[0]['badge']);
|
||||||
|
|
||||||
foreach ($this->items as $i => $item)
|
foreach ($this->items as $i => $item)
|
||||||
{
|
{
|
||||||
if (isset($item['uri']))
|
if (isset($item['uri']))
|
||||||
|
Loading…
Reference in New Issue
Block a user