Skip to content

Commit

Permalink
Preferences: Rename showBenchmark' to show_benchmark'
Browse files Browse the repository at this point in the history
We use underscore_case notation for all configuration keys.

refs #4952
  • Loading branch information
lippserd committed Jun 2, 2014
1 parent 93829bd commit a379502
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions application/forms/Preference/GeneralForm.php
Expand Up @@ -261,10 +261,10 @@ public function create()

$this->addElement(
'checkbox',
'showBenchmark',
'show_benchmark',
array(
'label' => 'Use benchmark',
'value' => $this->getUserPreferences()->get('app.showBenchmark')
'value' => $this->getUserPreferences()->get('app.show_benchmark')
)
);
}
Expand All @@ -278,11 +278,11 @@ public function getPreferences()
{
$values = $this->getValues();
return array(
'app.language' => $values['default_language'] ? null : $values['language'],
'app.timezone' => $values['default_timezone'] ? null : $values['timezone'],
'app.dateFormat' => $values['default_date_format'] ? null : $values['date_format'],
'app.timeFormat' => $values['default_time_format'] ? null : $values['time_format'],
'app.showBenchmark' => $values['showBenchmark'] === '1' ? true : false
'app.language' => $values['default_language'] ? null : $values['language'],
'app.timezone' => $values['default_timezone'] ? null : $values['timezone'],
'app.dateFormat' => $values['default_date_format'] ? null : $values['date_format'],
'app.timeFormat' => $values['default_time_format'] ? null : $values['time_format'],
'app.show_benchmark' => $values['show_benchmark'] === '1' ? true : false
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions library/Icinga/Web/Controller/ActionController.php
Expand Up @@ -399,9 +399,9 @@ public function postDispatch()
}

if ($user = $this->getRequest()->getUser()) {
// Cast preference app.showBenchmark to bool because preferences loaded from a preferences storage are
// Cast preference app.show_benchmark to bool because preferences loaded from a preferences storage are
// always strings
if ((bool) $user->getPreferences()->get('app.showBenchmark', false) === true) {
if ((bool) $user->getPreferences()->get('app.show_benchmark', false) === true) {
Benchmark::measure('Response ready');
$layout->benchmark = $this->renderBenchmark();
}
Expand Down

0 comments on commit a379502

Please sign in to comment.