Add alt-text to icon_images
Print alt-text as title and alt-attribute in the helper class and add the alt-column to the backend query. refs #9300
This commit is contained in:
parent
87a46ea5b1
commit
598ef1e8f4
|
@ -54,6 +54,7 @@ class Monitoring_HostsController extends Controller
|
|||
{
|
||||
$this->hostList->setColumns(array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_name',
|
||||
'host_state',
|
||||
'host_problem',
|
||||
|
@ -96,6 +97,7 @@ class Monitoring_HostsController extends Controller
|
|||
$this->view->checkNowForm = $checkNowForm;
|
||||
$this->hostList->setColumns(array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_name',
|
||||
'host_state',
|
||||
'host_problem',
|
||||
|
|
|
@ -70,6 +70,7 @@ class Monitoring_ListController extends Controller
|
|||
$this->setAutorefreshInterval(10);
|
||||
$query = $this->backend->select()->from('hostStatus', array_merge(array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_name',
|
||||
'host_display_name',
|
||||
'host_state' => $stateColumn,
|
||||
|
@ -162,6 +163,7 @@ class Monitoring_ListController extends Controller
|
|||
'service_attempt',
|
||||
'service_last_state_change' => $stateChangeColumn,
|
||||
'service_icon_image',
|
||||
'service_icon_image_alt',
|
||||
'service_is_flapping',
|
||||
'service_state_type',
|
||||
'service_handled',
|
||||
|
|
|
@ -51,12 +51,14 @@ class Monitoring_ServicesController extends Controller
|
|||
{
|
||||
$this->serviceList->setColumns(array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_name',
|
||||
'host_output',
|
||||
'host_state',
|
||||
'host_problem',
|
||||
'host_handled',
|
||||
'service_icon_image',
|
||||
'service_icon_image_alt',
|
||||
'service_description',
|
||||
'service_state',
|
||||
'service_problem',
|
||||
|
@ -96,12 +98,14 @@ class Monitoring_ServicesController extends Controller
|
|||
$this->view->checkNowForm = $checkNowForm;
|
||||
$this->serviceList->setColumns(array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_name',
|
||||
'host_output',
|
||||
'host_state',
|
||||
'host_problem',
|
||||
'host_handled',
|
||||
'service_icon_image',
|
||||
'service_icon_image_alt',
|
||||
'service_output',
|
||||
'service_description',
|
||||
'service_state',
|
||||
|
|
|
@ -25,7 +25,14 @@ class Zend_View_Helper_IconImage extends Zend_View_Helper_Abstract
|
|||
public function host($object)
|
||||
{
|
||||
if ($object->host_icon_image && ! preg_match('/[\'"]/', $object->host_icon_image)) {
|
||||
return $this->view->icon($this->view->resolveMacros($object->host_icon_image, $object));
|
||||
return $this->view->img(
|
||||
'img/icons/' . $this->view->resolveMacros($object->host_icon_image, $object),
|
||||
null,
|
||||
array(
|
||||
'alt' => $object->host_icon_image_alt,
|
||||
'title' => $object->host_icon_image_alt
|
||||
)
|
||||
);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
@ -39,7 +46,14 @@ class Zend_View_Helper_IconImage extends Zend_View_Helper_Abstract
|
|||
public function service($object)
|
||||
{
|
||||
if ($object->service_icon_image && ! preg_match('/[\'"]/', $object->service_icon_image)) {
|
||||
return $this->view->icon($this->view->resolveMacros($object->service_icon_image, $object));
|
||||
return $this->view->img(
|
||||
'img/icons/' . $this->view->resolveMacros($object->service_icon_image, $object),
|
||||
null,
|
||||
array(
|
||||
'alt' => $object->service_icon_image_alt,
|
||||
'title' => $object->service_icon_image_alt
|
||||
)
|
||||
);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ class StatusQuery extends IdoQuery
|
|||
'host_address' => 'h.address',
|
||||
'host_ipv4' => 'INET_ATON(h.address)',
|
||||
'host_icon_image' => 'h.icon_image',
|
||||
'host_icon_image_alt' => 'h.icon_image_alt',
|
||||
'host_action_url' => 'h.action_url',
|
||||
'host_notes_url' => 'h.notes_url'
|
||||
),
|
||||
|
@ -176,6 +177,7 @@ class StatusQuery extends IdoQuery
|
|||
'service_description' => 'so.name2',
|
||||
'service_display_name' => 's.display_name',
|
||||
'service_icon_image' => 's.icon_image',
|
||||
'service_icon_image_alt' => 's.icon_image_alt',
|
||||
'service_action_url' => 's.action_url',
|
||||
'service_notes_url' => 's.notes_url',
|
||||
'object_type' => '(\'service\')'
|
||||
|
|
|
@ -40,7 +40,6 @@ class ServiceStatus extends DataView
|
|||
'service_unhandled',
|
||||
'service_output',
|
||||
'service_last_state_change',
|
||||
'service_icon_image',
|
||||
'service_long_output',
|
||||
'service_is_flapping',
|
||||
'service_state_type',
|
||||
|
@ -60,7 +59,6 @@ class ServiceStatus extends DataView
|
|||
'service_last_notification',
|
||||
'service_check_command',
|
||||
'service_current_notification_number',
|
||||
'host_icon_image',
|
||||
'host_acknowledged',
|
||||
'host_output',
|
||||
'host_long_output',
|
||||
|
|
|
@ -90,6 +90,7 @@ class Host extends MonitoredObject
|
|||
{
|
||||
$columns = array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_acknowledged',
|
||||
'host_action_url',
|
||||
'host_active_checks_enabled',
|
||||
|
|
|
@ -107,6 +107,7 @@ class Service extends MonitoredObject
|
|||
{
|
||||
return $this->backend->select()->from('serviceStatus', array(
|
||||
'host_icon_image',
|
||||
'host_icon_image_alt',
|
||||
'host_acknowledged',
|
||||
'host_active_checks_enabled',
|
||||
'host_address',
|
||||
|
@ -120,6 +121,7 @@ class Service extends MonitoredObject
|
|||
'host_passive_checks_enabled',
|
||||
'host_state',
|
||||
'service_icon_image',
|
||||
'service_icon_image_alt',
|
||||
'service_acknowledged',
|
||||
'service_action_url',
|
||||
'service_active_checks_enabled',
|
||||
|
|
Loading…
Reference in New Issue