Skip to content

Commit

Permalink
monitoring/commands: Fix instance command forms code compliance
Browse files Browse the repository at this point in the history
refs #6593
  • Loading branch information
lippserd committed Sep 12, 2014
1 parent 16bc0e5 commit e5e806a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Expand Up @@ -71,5 +71,4 @@ public function onSuccess(Request $request)
Notification::success(mt('monitoring', 'Disabling host and service notifications..'));
return true;
}

}
Expand Up @@ -59,6 +59,21 @@ public function getStatus()
*/
public function createElements(array $formData = array())
{
if ((bool) $this->status->notifications_enabled) {
$description = sprintf(
'<a title="%s" href="%s" data-base-target="_next">%s</a>',
mt('monitoring', 'Disable notifications for a specific time on a program-wide basis'),
$this->getView()->href('monitoring/process/disable-notifications'),
mt('monitoring', 'Disable temporarily')
);
} elseif ($this->status->disable_notif_expire_time) {
$description = sprintf(
mt('monitoring', 'Notifications will be re-enabled in <strong>%s</strong>'),
$this->getView()->timeUntil($this->status->disable_notif_expire_time)
);
} else {
$description = '';
}
$this->addElements(array(
array(
'checkbox',
Expand Down Expand Up @@ -97,7 +112,18 @@ public function createElements(array $formData = array())
ToggleInstanceFeatureCommand::FEATURE_NOTIFICATIONS,
array(
'label' => mt('monitoring', 'Notifications Enabled'),
'autosubmit' => true
'autosubmit' => true,
'description' => $description,
'decorators' => array(
'ViewHelper',
'Errors',
array(
'Description',
array('tag' => 'span', 'class' => 'feature-instance-notifications', 'escape' => false)
),
'Label',
array('HtmlTag', array('tag' => 'div'))
),
)
),
array(
Expand Down

0 comments on commit e5e806a

Please sign in to comment.