Preferences: Rename `showBenchmark' to `show_benchmark'

We use underscore_case notation for all configuration keys.

refs #4952
This commit is contained in:
Eric Lippmann 2014-06-02 13:33:55 +02:00
parent 93829bde92
commit a379502b15
2 changed files with 9 additions and 9 deletions

View File

@ -261,10 +261,10 @@ class GeneralForm extends Form
$this->addElement( $this->addElement(
'checkbox', 'checkbox',
'showBenchmark', 'show_benchmark',
array( array(
'label' => 'Use benchmark', 'label' => 'Use benchmark',
'value' => $this->getUserPreferences()->get('app.showBenchmark') 'value' => $this->getUserPreferences()->get('app.show_benchmark')
) )
); );
} }
@ -278,11 +278,11 @@ class GeneralForm extends Form
{ {
$values = $this->getValues(); $values = $this->getValues();
return array( return array(
'app.language' => $values['default_language'] ? null : $values['language'], 'app.language' => $values['default_language'] ? null : $values['language'],
'app.timezone' => $values['default_timezone'] ? null : $values['timezone'], 'app.timezone' => $values['default_timezone'] ? null : $values['timezone'],
'app.dateFormat' => $values['default_date_format'] ? null : $values['date_format'], 'app.dateFormat' => $values['default_date_format'] ? null : $values['date_format'],
'app.timeFormat' => $values['default_time_format'] ? null : $values['time_format'], 'app.timeFormat' => $values['default_time_format'] ? null : $values['time_format'],
'app.showBenchmark' => $values['showBenchmark'] === '1' ? true : false 'app.show_benchmark' => $values['show_benchmark'] === '1' ? true : false
); );
} }
} }

View File

@ -399,9 +399,9 @@ class ActionController extends Zend_Controller_Action
} }
if ($user = $this->getRequest()->getUser()) { 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 // 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'); Benchmark::measure('Response ready');
$layout->benchmark = $this->renderBenchmark(); $layout->benchmark = $this->renderBenchmark();
} }