mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-26 03:09:10 +02:00
DashboardSettings: Don't add Add Dashlet
as a dropdown menu anymore
This commit is contained in:
parent
faebd29271
commit
ff90450b70
@ -4,13 +4,29 @@
|
||||
namespace Icinga\Web\Widget\Tabextension;
|
||||
|
||||
use Icinga\Web\Url;
|
||||
use Icinga\Web\Dashboard\Dashboard;
|
||||
use Icinga\Web\Widget\Tabs;
|
||||
use ipl\Web\Widget\Icon;
|
||||
use ipl\Web\Widget\Link;
|
||||
|
||||
/**
|
||||
* Dashboard settings
|
||||
*/
|
||||
class DashboardSettings implements Tabextension
|
||||
{
|
||||
/** @var array|null url params to be attached to the dropdown menus. */
|
||||
private $urlParam;
|
||||
|
||||
/**
|
||||
* DashboardSettings constructor.
|
||||
*
|
||||
* @param array $urlParam
|
||||
*/
|
||||
public function __construct(array $urlParam = [])
|
||||
{
|
||||
$this->urlParam = $urlParam;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply this tabextension to the provided tabs
|
||||
*
|
||||
@ -18,22 +34,15 @@ class DashboardSettings implements Tabextension
|
||||
*/
|
||||
public function apply(Tabs $tabs)
|
||||
{
|
||||
$tabs->addAsDropdown(
|
||||
'dashboard_add',
|
||||
array(
|
||||
'icon' => 'dashboard',
|
||||
'label' => t('Add Dashlet'),
|
||||
'url' => Url::fromPath('dashboard/new-dashlet')
|
||||
)
|
||||
);
|
||||
|
||||
$tabs->addAsDropdown(
|
||||
$url = Url::fromPath(Dashboard::BASE_ROUTE . '/settings');
|
||||
$url = empty($this->urlParam) ? $url : $url->addParams($this->urlParam);
|
||||
$tabs->add(
|
||||
'dashboard_settings',
|
||||
array(
|
||||
'icon' => 'dashboard',
|
||||
'label' => t('Settings'),
|
||||
'url' => Url::fromPath('dashboard/settings')
|
||||
)
|
||||
[
|
||||
'icon' => 'service',
|
||||
'url' => (string) $url,
|
||||
'priority' => -100
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user