mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
parent
c6b61617ee
commit
66305bd79a
@ -211,7 +211,11 @@ class Dashboard extends AbstractWidget
|
|||||||
$this->tabs->add(
|
$this->tabs->add(
|
||||||
$key,
|
$key,
|
||||||
array(
|
array(
|
||||||
'title' => $pane->getTitle(),
|
'title' => sprintf(
|
||||||
|
t('Show %s', 'dashboard.pane.tooltip'),
|
||||||
|
$pane->getTitle()
|
||||||
|
),
|
||||||
|
'label' => $pane->getTitle(),
|
||||||
'url' => clone($url),
|
'url' => clone($url),
|
||||||
'urlParams' => array($this->tabParam => $key)
|
'urlParams' => array($this->tabParam => $key)
|
||||||
)
|
)
|
||||||
|
@ -52,7 +52,7 @@ class Dashlet extends UserWidget
|
|||||||
private $template =<<<'EOD'
|
private $template =<<<'EOD'
|
||||||
|
|
||||||
<div class="container" data-icinga-url="{URL}">
|
<div class="container" data-icinga-url="{URL}">
|
||||||
<h1><a href="{FULL_URL}" data-base-target="col1">{TITLE}</a></h1>
|
<h1><a href="{FULL_URL}" aria-label="{TOOLTIP}" title="{TOOLTIP}" data-base-target="col1">{TITLE}</a></h1>
|
||||||
<noscript>
|
<noscript>
|
||||||
<iframe src="{IFRAME_URL}" style="height:100%; width:99%" frameborder="no"></iframe>
|
<iframe src="{IFRAME_URL}" style="height:100%; width:99%" frameborder="no"></iframe>
|
||||||
</noscript>
|
</noscript>
|
||||||
@ -183,38 +183,21 @@ EOD;
|
|||||||
'{URL}',
|
'{URL}',
|
||||||
'{IFRAME_URL}',
|
'{IFRAME_URL}',
|
||||||
'{FULL_URL}',
|
'{FULL_URL}',
|
||||||
'{TITLE}',
|
'{TOOLTIP}',
|
||||||
'{REMOVE}'
|
'{TITLE}'
|
||||||
);
|
);
|
||||||
|
|
||||||
$replaceTokens = array(
|
$replaceTokens = array(
|
||||||
$url,
|
$url,
|
||||||
$iframeUrl,
|
$iframeUrl,
|
||||||
$url->getUrlWithout(array('view', 'limit')),
|
$url->getUrlWithout(array('view', 'limit')),
|
||||||
$view->escape($this->getTitle()),
|
sprintf($view->translate('Show %s', 'dashboard.dashlet.tooltip'), $view->escape($this->getTitle())),
|
||||||
$this->getRemoveLink()
|
$view->escape($this->getTitle())
|
||||||
);
|
);
|
||||||
|
|
||||||
return str_replace($searchTokens, $replaceTokens, $this->template);
|
return str_replace($searchTokens, $replaceTokens, $this->template);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Render the form for removing a dashboard elemetn
|
|
||||||
*
|
|
||||||
* @return string The html representation of the form
|
|
||||||
*/
|
|
||||||
protected function getRemoveLink()
|
|
||||||
{
|
|
||||||
return sprintf(
|
|
||||||
'<a data-base-target="main" href="%s">%s</a>',
|
|
||||||
Url::fromPath('dashboard/remove-dashlet', array(
|
|
||||||
'dashlet' => $this->getTitle(),
|
|
||||||
'pane' => $this->pane->getTitle()
|
|
||||||
)),
|
|
||||||
t('Remove')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a @see Dashlet instance from the given Zend config, using the provided title
|
* Create a @see Dashlet instance from the given Zend config, using the provided title
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user