From a379502b157c1dcc60000721635d5495d275b58d Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 2 Jun 2014 13:33:55 +0200 Subject: [PATCH] Preferences: Rename `showBenchmark' to `show_benchmark' We use underscore_case notation for all configuration keys. refs #4952 --- application/forms/Preference/GeneralForm.php | 14 +++++++------- library/Icinga/Web/Controller/ActionController.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/application/forms/Preference/GeneralForm.php b/application/forms/Preference/GeneralForm.php index 512b54689a..4ed2149459 100644 --- a/application/forms/Preference/GeneralForm.php +++ b/application/forms/Preference/GeneralForm.php @@ -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') ) ); } @@ -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 ); } } diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 6d78dac3ad..3761cfa8a8 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -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(); }