Fix templates, capitalization and icons in php files

refs #4550
refs #4584
This commit is contained in:
Jannis Moßhammer 2013-08-22 17:27:11 +02:00 committed by Marius Hein
parent 015a914aab
commit 895976550c
25 changed files with 133 additions and 138 deletions

View File

@ -93,7 +93,7 @@ class DbBackendForm extends BaseBackendForm
) )
); );
$this->setSubmitLabel('Save backend'); $this->setSubmitLabel('{{SAVE_ICON}} Save backend');
} }
/** /**

View File

@ -130,7 +130,7 @@ class LdapBackendForm extends BaseBackendForm
) )
); );
$this->setSubmitLabel('Save Backend'); $this->setSubmitLabel('{{SAVE_ICON}} Save Backend');
} }
/** /**

View File

@ -302,7 +302,7 @@ class AuthenticationForm extends Form
$this->addPersistentState(); $this->addPersistentState();
$this->enableConditionalDecorator(); $this->enableConditionalDecorator();
$this->setSubmitLabel('Save Changes'); $this->setSubmitLabel('{{SAVE_ICON}} Save Changes');
} }
/** /**

View File

@ -329,7 +329,7 @@ class GeneralForm extends Form
$this->addDateFormatSettings($global); $this->addDateFormatSettings($global);
$this->addUserPreferencesDialog($preferences); $this->addUserPreferencesDialog($preferences);
$this->setSubmitLabel('Save Changes'); $this->setSubmitLabel('{{SAVE_ICON}} Save Changes');
} }
/** /**

View File

@ -190,7 +190,7 @@ class LoggingForm extends Form
$this->enableAutoSubmit(array('logging_debug_enable')); $this->enableAutoSubmit(array('logging_debug_enable'));
$this->setSubmitLabel('Save Changes'); $this->setSubmitLabel('{{SAVE_ICON}} Save Changes');
} }
/** /**

View File

@ -89,7 +89,7 @@ class AddUrlForm extends Form
$txtCreatePane = new Zend_Form_Element_Text( $txtCreatePane = new Zend_Form_Element_Text(
'pane', 'pane',
array( array(
'label' => 'New dashboard title', 'label' => 'New Dashboard Title',
'required' => true, 'required' => true,
'style' => 'display:inline-block' 'style' => 'display:inline-block'
) )
@ -107,7 +107,7 @@ class AddUrlForm extends Form
$cancelDashboardBtn = new Zend_Form_Element_Submit( $cancelDashboardBtn = new Zend_Form_Element_Submit(
'use_existing_dashboard', 'use_existing_dashboard',
array( array(
'label' => 'X', 'label' => '{{REMOVE_ICON}}',
'required' => false, 'required' => false,
'style' => 'display:inline-block' 'style' => 'display:inline-block'
) )
@ -159,7 +159,7 @@ class AddUrlForm extends Form
'required' => true, 'required' => true,
) )
); );
$this->setSubmitLabel("Add to dashboard"); $this->setSubmitLabel("{{CREATE_ICON}} Add To Dashboard");
} }
} }

View File

@ -223,7 +223,7 @@ class GeneralForm extends Form
$this->addTimezoneSelection($global); $this->addTimezoneSelection($global);
$this->addDateFormatSettings($global); $this->addDateFormatSettings($global);
$this->setSubmitLabel('Save Changes'); $this->setSubmitLabel('{{SAVE_ICON}} Save Changes');
} }
/** /**

View File

@ -49,7 +49,7 @@ class Zend_View_Helper_FormDateTime extends Zend_View_Helper_FormElement
// Is it disabled? // Is it disabled?
$disabled = ''; $disabled = '';
if ($disable) { if ($disabled) {
$disabled = ' disabled="disabled"'; $disabled = ' disabled="disabled"';
} }

View File

@ -143,12 +143,12 @@ class Dashboard implements Widget
if (!@file_put_contents($file, $iniString)) { if (!@file_put_contents($file, $iniString)) {
$error = error_get_last(); $error = error_get_last();
if ($error == null) { if ($error == null) {
$error = 'Unknown error'; $error = 'Unknown Error';
} else { } else {
$error = $error['message']; $error = $error['message'];
} }
Logger::error('Tried to persist dashboard to %s, but got error: %s', $file, $error); Logger::error('Tried to persist dashboard to %s, but got error: %s', $file, $error);
throw new ConfigurationError('Can\'t persist dashboard'); throw new ConfigurationError('Can\'t Persist Dashboard');
} else { } else {
return $this; return $this;
} }

View File

@ -81,14 +81,17 @@ class Component implements Widget
*/ */
private $template =<<<'EOD' private $template =<<<'EOD'
<div class="icinga-container dashboard" icingatitle="{TITLE}" style="{DIMENSION}"> <div class="panel panel-default" style="{DIMENSION}">
<a href="{URL}"> {TITLE}</a> <div class="panel-heading panel-title">
<a class="btn btn-danger btn-mini pull-right" href="{REMOVE_URL}" style="color:black">X</a> <a href="{URL}"> {TITLE}</a>
<button class="btn btn-danger btn-sm pull-right">
<div class="icinga-container" icingaurl="{URL}"> <a href="{REMOVE_URL}" style="color:black">{{REMOVE_ICON}}</a>
<noscript> </button>
<iframe src="{URL}" style="height:100%; width:99%" frameborder="no"></iframe> </div>
</noscript> <div class="panel-body">
<noscript>
<iframe src="{URL}" style="height:100%; width:99%" frameborder="no"></iframe>
</noscript>
</div> </div>
</div> </div>
EOD; EOD;

View File

@ -51,7 +51,6 @@ class BasketAction implements Tabextension
'basket', 'basket',
array( array(
'title' => 'URL Basket', 'title' => 'URL Basket',
'icon' => 'img/classic/basket.png',
'url' => Url::fromPath('basket/add'), 'url' => Url::fromPath('basket/add'),
'urlParams' => array( 'urlParams' => array(
'url' => Url::fromRequest()->getRelativeUrl() 'url' => Url::fromRequest()->getRelativeUrl()

View File

@ -52,8 +52,7 @@ class DashboardAction implements Tabextension
$tabs->addAsDropdown( $tabs->addAsDropdown(
'dashboard', 'dashboard',
array( array(
'title' => 'Add to Dashboard', 'title' => '{{DASHBOARD_ICON}} Add To Dashboard',
'iconCls' => 'dashboard',
'url' => Url::fromPath('dashboard/addurl'), 'url' => Url::fromPath('dashboard/addurl'),
'urlParams' => array( 'urlParams' => array(
'url' => Url::fromRequest()->getRelativeUrl() 'url' => Url::fromRequest()->getRelativeUrl()

View File

@ -64,20 +64,17 @@ class OutputFormat implements Tabextension
private $supportedTypes = array( private $supportedTypes = array(
self::TYPE_PDF => array( self::TYPE_PDF => array(
'name' => 'pdf', 'name' => 'pdf',
'title' => 'PDF', 'title' => '{{PDF_ICON}} PDF',
'icon' => 'img/classic/application-pdf.png',
'urlParams' => array('filetype' => 'pdf') 'urlParams' => array('filetype' => 'pdf')
), ),
self::TYPE_CSV => array( self::TYPE_CSV => array(
'name' => 'csv', 'name' => 'csv',
'title' => 'CSV', 'title' => '{{CSV_ICON}} CSV',
'icon' => 'img/classic/application-csv.png',
'urlParams' => array('filetype' => 'csv') 'urlParams' => array('filetype' => 'csv')
), ),
self::TYPE_JSON => array( self::TYPE_JSON => array(
'name' => 'json', 'name' => 'json',
'title' => 'JSON', 'title' => '{{JSON_ICON}} JSON',
'icon' => 'img/classic/application-json.png',
'urlParams' => array('filetype' => 'json') 'urlParams' => array('filetype' => 'json')
) )
); );

View File

@ -126,7 +126,7 @@ class Monitoring_CommandController extends ModuleActionController
$targetInfo = $targetConfig->current(); // Take the very first section $targetInfo = $targetConfig->current(); // Take the very first section
if ($targetInfo === false) { if ($targetInfo === false) {
throw new ConfigurationError("Not any instances are configured yet"); throw new ConfigurationError("No instances are configured yet");
} else { } else {
$this->target = new CommandPipe($targetInfo); $this->target = new CommandPipe($targetInfo);
} }
@ -247,7 +247,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Disable active checks')); $form->setSubmitLabel(t('Disable Active Checks'));
$form->addNote(t('Disable active checks for this object.')); $form->addNote(t('Disable active checks for this object.'));
$this->setForm($form); $this->setForm($form);
@ -356,7 +356,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Stop accepting passive checks')); $form->setSubmitLabel(t('Stop Accepting Passive Checks'));
$form->addNote(t('Passive checks for this object will be omitted.')); $form->addNote(t('Passive checks for this object will be omitted.'));
$this->setForm($form); $this->setForm($form);
@ -374,7 +374,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Start accepting passive checks')); $form->setSubmitLabel(t('Start Accepting Passive Checks'));
$form->addNote(t('Passive checks for this object will be accepted.')); $form->addNote(t('Passive checks for this object will be accepted.'));
$this->setForm($form); $this->setForm($form);
@ -392,7 +392,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Disable notifications')); $form->setSubmitLabel(t('Disable Notifications'));
$form->addNote(t('Notifications for this object will be disabled.')); $form->addNote(t('Notifications for this object will be disabled.'));
$this->setForm($form); $this->setForm($form);
@ -409,7 +409,7 @@ class Monitoring_CommandController extends ModuleActionController
{ {
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Enable notifications')); $form->setSubmitLabel(t('Enable Notifications'));
$form->addNote(t('Notifications for this object will be enabled.')); $form->addNote(t('Notifications for this object will be enabled.'));
$this->setForm($form); $this->setForm($form);
@ -478,7 +478,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host')); $this->setSupportedParameters(array('host'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Remove downtime(s)')); $form->setSubmitLabel(t('Remove Downtime(s)'));
$form->addNote(t('Remove downtime(s) from this host and its services.')); $form->addNote(t('Remove downtime(s) from this host and its services.'));
$this->setForm($form); $this->setForm($form);
@ -496,7 +496,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host')); $this->setSupportedParameters(array('host'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Disable notifications')); $form->setSubmitLabel(t('Disable Notifications'));
$form->addNote(t('Notifications for this host and its services will be disabled.')); $form->addNote(t('Notifications for this host and its services will be disabled.'));
$this->setForm($form); $this->setForm($form);
@ -515,7 +515,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host')); $this->setSupportedParameters(array('host'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Enable notifications')); $form->setSubmitLabel(t('Enable Notifications'));
$form->addNote(t('Notifications for this host and its services will be enabled.')); $form->addNote(t('Notifications for this host and its services will be enabled.'));
$this->setForm($form); $this->setForm($form);
@ -559,7 +559,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host')); $this->setSupportedParameters(array('host'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Disable active checks')); $form->setSubmitLabel(t('Disable Active Checks'));
$form->addNote(t('Disable active checks for this host and its services.')); $form->addNote(t('Disable active checks for this host and its services.'));
$this->setForm($form); $this->setForm($form);
@ -578,7 +578,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host')); $this->setSupportedParameters(array('host'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Enable active checks')); $form->setSubmitLabel(t('Enable Active Checks'));
$form->addNote(t('Enable active checks for this host and its services.')); $form->addNote(t('Enable active checks for this host and its services.'));
$this->setForm($form); $this->setForm($form);
@ -597,7 +597,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Disable event handler')); $form->setSubmitLabel(t('Disable Event Handler'));
$form->addNote(t('Disable event handler for this object.')); $form->addNote(t('Disable event handler for this object.'));
$this->setForm($form); $this->setForm($form);
@ -615,7 +615,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Enable event handler')); $form->setSubmitLabel(t('Enable Event Handler'));
$form->addNote(t('Enable event handler for this object.')); $form->addNote(t('Enable event handler for this object.'));
$this->setForm($form); $this->setForm($form);
@ -633,7 +633,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Disable flapping detection')); $form->setSubmitLabel(t('Disable Flapping Detection'));
$form->addNote(t('Disable flapping detection for this object.')); $form->addNote(t('Disable flapping detection for this object.'));
$this->setForm($form); $this->setForm($form);
@ -651,7 +651,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Enable flapping detection')); $form->setSubmitLabel(t('Enable Flapping Detection'));
$form->addNote(t('Enable flapping detection for this object.')); $form->addNote(t('Enable flapping detection for this object.'));
$this->setForm($form); $this->setForm($form);
@ -686,7 +686,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Reset attributes')); $form->setSubmitLabel(t('Reset Attributes'));
$form->addNote(t('Reset modified attributes to its default.')); $form->addNote(t('Reset modified attributes to its default.'));
$this->setForm($form); $this->setForm($form);
@ -721,7 +721,7 @@ class Monitoring_CommandController extends ModuleActionController
$this->setSupportedParameters(array('host', 'service')); $this->setSupportedParameters(array('host', 'service'));
$form = new CommandForm(); $form = new CommandForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Remove problem acknowledgement')); $form->setSubmitLabel(t('Remove Problem Acknowledgement'));
$form->addNote(t('Remove problem acknowledgement for this object.')); $form->addNote(t('Remove problem acknowledgement for this object.'));
$this->setForm($form); $this->setForm($form);
@ -757,9 +757,9 @@ class Monitoring_CommandController extends ModuleActionController
$form = new CommandWithIdentifierForm(); $form = new CommandWithIdentifierForm();
$form->setRequest($this->getRequest()); $form->setRequest($this->getRequest());
$form->setSubmitLabel(t('Delete downtime')); $form->setSubmitLabel(t('Delete Downtime'));
$form->setFieldName('downtimeid'); $form->setFieldName('downtimeid');
$form->setFieldLabel(t('Downtime id')); $form->setFieldLabel(t('Downtime Id'));
$form->addNote(t('Delete a single downtime with the id shown above')); $form->addNote(t('Delete a single downtime with the id shown above'));
$this->setForm($form); $this->setForm($form);

View File

@ -397,8 +397,7 @@ class Monitoring_ShowController extends ModuleActionController
$tabs->add( $tabs->add(
'host', 'host',
array( array(
'title' => 'Host', 'title' => '{{HOST_ICON}} Host',
'icon' => 'img/classic/server.png',
'url' => 'monitoring/show/host', 'url' => 'monitoring/show/host',
'urlParams' => $params, 'urlParams' => $params,
) )
@ -407,8 +406,7 @@ class Monitoring_ShowController extends ModuleActionController
$tabs->add( $tabs->add(
'services', 'services',
array( array(
'title' => 'Services', 'title' => '{{SERVICE_ICON}} Services',
'icon' => 'img/classic/service.png',
'url' => 'monitoring/show/services', 'url' => 'monitoring/show/services',
'urlParams' => $params, 'urlParams' => $params,
) )
@ -418,8 +416,7 @@ class Monitoring_ShowController extends ModuleActionController
$tabs->add( $tabs->add(
'service', 'service',
array( array(
'title' => 'Service', 'title' => '{{SERVICE_ICON}} Service',
'icon' => 'img/classic/service.png',
'url' => 'monitoring/show/service', 'url' => 'monitoring/show/service',
'urlParams' => $params, 'urlParams' => $params,
) )
@ -428,8 +425,7 @@ class Monitoring_ShowController extends ModuleActionController
$tabs->add( $tabs->add(
'history', 'history',
array( array(
'title' => 'History', 'title' => '{{HISTORY_ICON}} History',
'icon' => 'img/classic/history.gif',
'url' => 'monitoring/show/history', 'url' => 'monitoring/show/history',
'urlParams' => $params, 'urlParams' => $params,
) )

View File

@ -94,7 +94,7 @@ class CommentForm extends CommandForm
) )
); );
$this->setSubmitLabel(t('Post comment')); $this->setSubmitLabel(t('Post Comment'));
parent::create(); parent::create();
} }

View File

@ -57,7 +57,7 @@ class DelayNotificationForm extends CommandForm
'text', 'text',
'minutes', 'minutes',
array( array(
'label' => t('Notification Delay (minutes from now)'), 'label' => t('Notification Delay (Minutes From Now)'),
'style' => 'width: 80px;', 'style' => 'width: 80px;',
'value' => 0, 'value' => 0,
'required' => true, 'required' => true,

View File

@ -199,7 +199,7 @@ class EditBackendForm extends Form
'checkbox', 'checkbox',
'backend_disable', 'backend_disable',
array( array(
'label' => 'Disable this Backend', 'label' => 'Disable This Backend',
'required' => true, 'required' => true,
'value' => $this->backend->disabled 'value' => $this->backend->disabled
) )
@ -260,7 +260,7 @@ class EditBackendForm extends Form
return; return;
} }
$this->addDisableButton(); $this->addDisableButton();
$this->setSubmitLabel('Save Changes'); $this->setSubmitLabel('{{SAVE_ICON}} Save Changes');
} }
/** /**

View File

@ -77,6 +77,6 @@ class ConfirmRemovalForm extends Form
'required' => true 'required' => true
) )
); );
$this->setSubmitLabel('Confirm Removal'); $this->setSubmitLabel('{{REMOVE_ICON}} Confirm Removal');
} }
} }

View File

@ -154,7 +154,7 @@ class EditInstanceForm extends Form
'helptext' => 'The file path where the icinga commandpipe can be found' 'helptext' => 'The file path where the icinga commandpipe can be found'
) )
); );
$this->setSubmitLabel('Save'); $this->setSubmitLabel('{{SAVE_ICON}} Save');
} }
/** /**

View File

@ -80,7 +80,7 @@ class Zend_View_Helper_MonitoringCommands extends Zend_View_Helper_Abstract
$out .= '<div class="clearfix"></div>'; $out .= '<div class="clearfix"></div>';
if ($type === Meta::TYPE_FULL) { if ($type === Meta::TYPE_FULL) {
return '<div class="command-container">'. $out. '</div>'; return '<div>'. $out. '</div>';
} }
return $out; return $out;

View File

@ -37,12 +37,12 @@ class Zend_View_Helper_MonitoringFlags extends Zend_View_Helper_Abstract
* @var string[] * @var string[]
*/ */
private static $keys = array( private static $keys = array(
'passive_checks_enabled' => 'Passive checks', 'passive_checks_enabled' => 'Passive Checks',
'active_checks_enabled' => 'Active checks', 'active_checks_enabled' => 'Active Checks',
'obsessing' => 'Obsessing', 'obsessing' => 'Obsessing',
'notifications_enabled' => 'Notifications', 'notifications_enabled' => 'Notifications',
'event_handler_enabled' => 'Event handler', 'event_handler_enabled' => 'Event Handler',
'flap_detection_enabled' => 'Flap detection', 'flap_detection_enabled' => 'Flap Detection',
); );
/** /**

View File

@ -115,149 +115,149 @@ class Meta
*/ */
private static $commandInformation = array( private static $commandInformation = array(
self::CMD_DISABLE_ACTIVE_CHECKS => array( self::CMD_DISABLE_ACTIVE_CHECKS => array(
'Disable active checks for this %s', // Long description (mandatory) 'Disable Active Checks For This %s', // Long description (mandatory)
'Disable active checks', // Short description (mandatory) 'Disable Active Checks', // Short description (mandatory)
'', // Icon anything (optional) '', // Icon anything (optional)
'' // Button css cls (optional) '' // Button css cls (optional)
), ),
self::CMD_ENABLE_ACTIVE_CHECKS => array( self::CMD_ENABLE_ACTIVE_CHECKS => array(
'Enable active checks for this %s', 'Enable Active Checks For This %s',
'Enable active checks', 'Enable Active Checks',
'' ''
), ),
self::CMD_RESCHEDULE_NEXT_CHECK => array( self::CMD_RESCHEDULE_NEXT_CHECK => array(
'Reschedule next service check', 'Reschedule Next Service Check',
'Recheck', 'Recheck',
'', '',
'btn-success' 'btn-success'
), ),
self::CMD_SUBMIT_PASSIVE_CHECK_RESULT => array( self::CMD_SUBMIT_PASSIVE_CHECK_RESULT => array(
'Submit passive check result', 'Submit Passive Check Result',
'Submit check result', 'Submit Check Result',
'' ''
), ),
self::CMD_STOP_OBSESSING => array( self::CMD_STOP_OBSESSING => array(
'Stop obsessing over this %s', 'Stop Obsessing Over This %s',
'Stop obsessing', 'Stop Obsessing',
'' ''
), ),
self::CMD_START_OBSESSING => array( self::CMD_START_OBSESSING => array(
'Start obsessing over this %s', 'Start Obsessing Over This %s',
'Start obsessing', 'Start Obsessing',
'' ''
), ),
self::CMD_STOP_ACCEPTING_PASSIVE_CHECKS => array( self::CMD_STOP_ACCEPTING_PASSIVE_CHECKS => array(
'Stop accepting passive check for this %s', 'Stop Accepting Passive Checks For This %s',
'Stop passive checks', 'Stop Passive Checks',
'' ''
), ),
self::CMD_START_ACCEPTING_PASSIVE_CHECKS => array( self::CMD_START_ACCEPTING_PASSIVE_CHECKS => array(
'Start accepting passive check for this %s', 'Start Accepting Passive Checks For This %s',
'Start passive checks', 'Start Passive Checks',
'' ''
), ),
self::CMD_DISABLE_NOTIFICATIONS => array( self::CMD_DISABLE_NOTIFICATIONS => array(
'Disable notifications for this %s', 'Disable Notifications For This %s',
'Disable notifications', 'Disable Notifications',
'' ''
), ),
self::CMD_ENABLE_NOTIFICATIONS => array( self::CMD_ENABLE_NOTIFICATIONS => array(
'Enable notifications for this %s', 'Enable Notifications For This %s',
'Enable notifications', 'Enable Notifications',
'' ''
), ),
self::CMD_SEND_CUSTOM_NOTIFICATION => array( self::CMD_SEND_CUSTOM_NOTIFICATION => array(
'Send custom %s notification', 'Send Custom %s Notification',
'Send notification', 'Send Notification',
'' ''
), ),
self::CMD_SCHEDULE_DOWNTIME => array( self::CMD_SCHEDULE_DOWNTIME => array(
'Schedule downtime for this %s', 'Schedule Downtime For This %s',
'Schedule downtime', 'Schedule Downtime',
'' ''
), ),
self::CMD_SCHEDULE_DOWNTIMES_TO_ALL => array( self::CMD_SCHEDULE_DOWNTIMES_TO_ALL => array(
'Schedule downtime for this %s and all services', 'Schedule Downtime For This %s And All Services',
'Schedule services downtime', 'Schedule Services Downtime',
'' ''
), ),
self::CMD_REMOVE_DOWNTIMES_FROM_ALL => array( self::CMD_REMOVE_DOWNTIMES_FROM_ALL => array(
'Remove downtime(s) for this %s and all services', 'Remove Downtime(s) For This %s And All Services',
'Remove downtime(s)', 'Remove Downtime(s)',
'' ''
), ),
self::CMD_DISABLE_NOTIFICATIONS_FOR_ALL => array( self::CMD_DISABLE_NOTIFICATIONS_FOR_ALL => array(
'Disable notification for all service on this %s', 'Disable Notification For All Service On This %s',
'Disable service notifications', 'Disable Service Notifications',
'' ''
), ),
self::CMD_ENABLE_NOTIFICATIONS_FOR_ALL => array( self::CMD_ENABLE_NOTIFICATIONS_FOR_ALL => array(
'Enable notification for all service on this %s', 'Enable Notification For All Service On This %s',
'Enable service notifications', 'Enable Service Notifications',
'' ''
), ),
self::CMD_RESCHEDULE_NEXT_CHECK_TO_ALL => array( self::CMD_RESCHEDULE_NEXT_CHECK_TO_ALL => array(
'Schedule a check of all service on this %s', 'Schedule a Check Of All Service On This %s',
'Recheck all services', 'Recheck All Services',
'', '',
'btn-success' 'btn-success'
), ),
self::CMD_DISABLE_ACTIVE_CHECKS_FOR_ALL => array( self::CMD_DISABLE_ACTIVE_CHECKS_FOR_ALL => array(
'Disable checks for all services on this %s', 'Disable Checks For All Services On This %s',
'Disable service checks', 'Disable Service Checks',
'' ''
), ),
self::CMD_ENABLE_ACTIVE_CHECKS_FOR_ALL => array( self::CMD_ENABLE_ACTIVE_CHECKS_FOR_ALL => array(
'Enable checks for all services on this %s', 'Enable Checks For All Services On This %s',
'Enable service checks', 'Enable Service Checks',
'' ''
), ),
self::CMD_DISABLE_EVENT_HANDLER => array( self::CMD_DISABLE_EVENT_HANDLER => array(
'Disable event handler for this %s', 'Disable Event Handler For This %s',
'Disable event handler', 'Disable Event Handler',
'' ''
), ),
self::CMD_ENABLE_EVENT_HANDLER => array( self::CMD_ENABLE_EVENT_HANDLER => array(
'Enable event handler for this %s', 'Enable Event Handler For This %s',
'Enable event handler', 'Enable Event Handler',
'' ''
), ),
self::CMD_DISABLE_FLAP_DETECTION => array( self::CMD_DISABLE_FLAP_DETECTION => array(
'Disable flap detection for this %s', 'Disable Flap Detection For This %s',
'Disable flap detection', 'Disable Flap Detection',
'' ''
), ),
self::CMD_ENABLE_FLAP_DETECTION => array( self::CMD_ENABLE_FLAP_DETECTION => array(
'Enable flap detection for this %s', 'Enable Flap Detection For This %s',
'Enable flap detection', 'Enable Flap Detection',
'' ''
), ),
self::CMD_ADD_COMMENT => array( self::CMD_ADD_COMMENT => array(
'Add new %s comment', 'Add New %s Comment',
'Add comment', 'Add Comment',
'' ''
), ),
self::CMD_RESET_ATTRIBUTES => array( self::CMD_RESET_ATTRIBUTES => array(
'Reset modified attributes', 'Reset Modified Attributes',
'Reset attributes', 'Reset Attributes',
'', '',
'btn-danger' 'btn-danger'
), ),
self::CMD_ACKNOWLEDGE_PROBLEM => array( self::CMD_ACKNOWLEDGE_PROBLEM => array(
'Acknowledge %s problem', 'Acknowledge %s Problem',
'Acknowledge', 'Acknowledge',
'', '',
'btn-warning' 'btn-warning'
), ),
self::CMD_REMOVE_ACKNOWLEDGEMENT => array( self::CMD_REMOVE_ACKNOWLEDGEMENT => array(
'Remove %s acknowledgement', 'Remove %s Acknowledgement',
'Remove acknowledgement', 'Remove Acknowledgement',
'', '',
'btn-warning' 'btn-warning'
), ),
self::CMD_DELAY_NOTIFICATION => array( self::CMD_DELAY_NOTIFICATION => array(
'Delay next %s notification', 'Delay Next %s Notification',
'Delay notification', 'Delay Notification',
'' ''
), ),
); );
@ -778,6 +778,7 @@ class Meta
private function buildInterfaceConfiguration(array $commands, $objectType) private function buildInterfaceConfiguration(array $commands, $objectType)
{ {
$out = array(); $out = array();
$objectType = ucfirst($objectType);
foreach ($commands as $index => $commandId) { foreach ($commands as $index => $commandId) {
$command = new \stdClass(); $command = new \stdClass();

View File

@ -71,7 +71,7 @@ class MonitoringCommandsTest extends \PHPUnit_Framework_TestCase {
$html = $helper->monitoringCommands($object, Meta::TYPE_SMALL); $html = $helper->monitoringCommands($object, Meta::TYPE_SMALL);
$this->assertContains('Remove acknowledgement', $html); $this->assertContains('Remove Acknowledgement', $html);
$this->assertContains('Recheck', $html); $this->assertContains('Recheck', $html);
$this->assertNotContains('Obsess', $html); $this->assertNotContains('Obsess', $html);
$this->assertNotContains('Enable', $html); $this->assertNotContains('Enable', $html);

View File

@ -25,12 +25,12 @@ class MonitoringFlagsTest extends \PHPUnit_Framework_TestCase
$this->assertCount(6, $returnArray); $this->assertCount(6, $returnArray);
$expected = array( $expected = array(
'Passive checks' => false, 'Passive Checks' => false,
'Active checks' => false, 'Active Checks' => false,
'Obsessing' => true, 'Obsessing' => true,
'Notifications' => false, 'Notifications' => false,
'Event handler' => true, 'Event Handler' => true,
'Flap detection' => true 'Flap Detection' => true
); );
$this->assertEquals($expected, $returnArray); $this->assertEquals($expected, $returnArray);
@ -53,12 +53,12 @@ class MonitoringFlagsTest extends \PHPUnit_Framework_TestCase
$this->assertCount(6, $returnArray); $this->assertCount(6, $returnArray);
$expected = array( $expected = array(
'Passive checks' => false, 'Passive Checks' => false,
'Active checks' => true, 'Active Checks' => true,
'Obsessing' => false, 'Obsessing' => false,
'Notifications' => true, 'Notifications' => true,
'Event handler' => true, 'Event Handler' => true,
'Flap detection' => false 'Flap Detection' => false
); );
$this->assertEquals($expected, $returnArray); $this->assertEquals($expected, $returnArray);
@ -79,12 +79,12 @@ class MonitoringFlagsTest extends \PHPUnit_Framework_TestCase
$this->assertCount(6, $returnArray); $this->assertCount(6, $returnArray);
$expected = array( $expected = array(
'Passive checks' => false, 'Passive Checks' => false,
'Active checks' => true, 'Active Checks' => true,
'Obsessing' => true, 'Obsessing' => true,
'Notifications' => false, 'Notifications' => false,
'Event handler' => false, 'Event Handler' => false,
'Flap detection' => false 'Flap Detection' => false
); );
$this->assertEquals($expected, $returnArray); $this->assertEquals($expected, $returnArray);
@ -103,12 +103,12 @@ class MonitoringFlagsTest extends \PHPUnit_Framework_TestCase
$this->assertCount(6, $returnArray); $this->assertCount(6, $returnArray);
$expected = array( $expected = array(
'Passive checks' => false, 'Passive Checks' => false,
'Active checks' => false, 'Active Checks' => false,
'Obsessing' => false, 'Obsessing' => false,
'Notifications' => false, 'Notifications' => false,
'Event handler' => false, 'Event Handler' => false,
'Flap detection' => false 'Flap Detection' => false
); );
$this->assertEquals($expected, $returnArray); $this->assertEquals($expected, $returnArray);