Hook/TopBar: Rework interface for monitoring top bar

refs #6929
This commit is contained in:
Marius Hein 2014-08-27 11:28:31 +02:00
parent b7ae66b496
commit 88698cb05d
3 changed files with 6 additions and 8 deletions

View File

@ -31,11 +31,11 @@ class LayoutController extends ActionController
{
$topbarHtmlParts = array();
/** @var Hook\Layout\TopBar $hook */
/** @var Hook\TopBarHook $hook */
$hook = null;
foreach (Hook::all('TopBar') as $hook) {
$topbarHtmlParts[] = $hook->getHtml($this->getRequest(), $this->view);
$topbarHtmlParts[] = $hook->getHtml($this->getRequest());
}
$this->view->topbarHtmlParts = $topbarHtmlParts;

View File

@ -10,15 +10,14 @@ use Zend_View;
/**
* Hook to extend topbar items
*/
abstract class TopBarHook
abstract class TopBarHook extends WebBaseHook
{
/**
* Function to generate top bar content
*
* @param Request $request
* @param Zend_View $view
*
* @return string
*/
abstract public function getHtml($request, $view);
abstract public function getHtml($request);
}

View File

@ -18,11 +18,10 @@ class TopBar extends TopBarHook
* Function to generate top bar content
*
* @param Request $request
* @param Zend_View $view
*
* @return string
*/
public function getHtml($request, $view)
public function getHtml($request)
{
$hostSummary = StatusSummaryView::fromRequest(
$request,
@ -50,7 +49,7 @@ class TopBar extends TopBarHook
)
)->getQuery()->fetchRow();
return $view->partial(
return $this->getView()->partial(
'layout/topbar.phtml',
'monitoring',
array(