Cleanup preferences, add them to the menu

This commit is contained in:
Thomas Gelf 2014-03-07 17:02:43 +00:00
parent 9963a21236
commit 13f827a0ef
5 changed files with 24 additions and 26 deletions

View File

@ -1,15 +1,18 @@
[Dashboard]
title = "Dashboard"
url = "dashboard"
icon = "img/icons/dashboard.png"
priority = 10
title = "Dashboard"
url = "dashboard"
icon = "img/icons/dashboard.png"
priority = 10
[System]
icon = img/icons/configuration.png
priority = 200
[System.Configuration]
title = "Configuration"
url = "config/index"
title = "Configuration"
url = "config"
[System.Preferences]
title = "Preferences"
url = "preference"

View File

@ -49,9 +49,8 @@ class PreferenceController extends BasePreferenceController
public static function createProvidedTabs()
{
return array(
'preference' => new Tab(
'general' => new Tab(
array(
'name' => 'general',
'title' => 'General settings',
'url' => Url::fromPath('/preference')
)
@ -65,6 +64,7 @@ class PreferenceController extends BasePreferenceController
public function indexAction()
{
$form = new GeneralForm();
$this->getTabs()->activate('general');
$form->setConfiguration(IcingaConfig::app())
->setRequest($this->getRequest());
if ($form->isSubmittedAndValid()) {

View File

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

View File

@ -1,15 +1,7 @@
<div class="controls">
<?= $this->tabs->render($this); ?>
<?php if (isset($this->successMessage)) : ?>
<div class="alert alert-success">
<h4>{{SUCCESS_ICON}} <?= $this->successMessage ?></h4>
</div>
<?php endif; ?>
<?php if (isset($this->exceptionMessage)): ?>
<div class="alert alert-danger">
<h4>Could not update preferences due to an internal exception (<?= $this->exceptionMessage ?>)</h4>
</div>
<?php endif; ?>
<div class="content">
<?= $this->form ?>
</div>

View File

@ -1,15 +1,18 @@
[Dashboard]
title = "Dashboard"
url = "dashboard"
icon = "img/icons/dashboard.png"
priority = 10
title = "Dashboard"
url = "dashboard"
icon = "img/icons/dashboard.png"
priority = 10
[System]
icon = img/icons/configuration.png
priority = 200
[System.Configuration]
title = "Configuration"
url = "config/index"
title = "Configuration"
url = "config"
[System.Preferences]
title = "Preferences"
url = "preference"