Drop obsolete class Icinga\Web\Menu\BadgeMenuItemRenderer

refs #2338
This commit is contained in:
Johannes Meyer 2018-04-27 14:11:03 +02:00
parent 059088c089
commit 571b34c8cd
1 changed files with 0 additions and 67 deletions

View File

@ -1,67 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Menu;
use Icinga\Web\Menu;
abstract class BadgeMenuItemRenderer extends MenuItemRenderer
{
const STATE_OK = 'ok';
const STATE_CRITICAL = 'critical';
const STATE_WARNING = 'warning';
const STATE_PENDING = 'pending';
const STATE_UNKNOWN = 'unknown';
/**
* Defines the color of the badge
*
* @return string
*/
abstract public function getState();
/**
* The amount of items to display in the badge
*
* @return int
*/
abstract public function getCount();
/**
* The tooltip title
*
* @return string
*/
abstract public function getTitle();
/**
* Renders the html content of a single menu item
*
* @param Menu $menu
*
* @return string
*/
public function render(Menu $menu)
{
return '<div class="clearfix">' . $this->renderBadge() . $this->createLink($menu) . '</div>';
}
/**
* Render the badge
*
* @return string
*/
protected function renderBadge()
{
if ($count = $this->getCount()) {
$view = $this->getView();
return sprintf(
'<span title="%s" class="badge pull-right state-%s">%s</span>',
$view->escape($this->getTitle()),
$view->escape($this->getState()),
$count
);
}
return '';
}
}