From 2a543bb5ae5f5430131894fe3dd7098192977c08 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 23 Jan 2015 16:03:29 +0100 Subject: [PATCH 1/4] Rename the preference setting `type' to `store' refs #8234 --- application/forms/Config/General/ApplicationConfigForm.php | 6 ++---- library/Icinga/User/Preferences/PreferencesStore.php | 6 +++--- modules/setup/application/forms/PreferencesPage.php | 2 +- modules/setup/library/Setup/Steps/GeneralConfigStep.php | 6 +++--- modules/setup/library/Setup/WebWizard.php | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/application/forms/Config/General/ApplicationConfigForm.php b/application/forms/Config/General/ApplicationConfigForm.php index 8f718ccdf..f59454ff3 100644 --- a/application/forms/Config/General/ApplicationConfigForm.php +++ b/application/forms/Config/General/ApplicationConfigForm.php @@ -4,10 +4,8 @@ namespace Icinga\Forms\Config\General; -use DateTimeZone; use Icinga\Application\Icinga; use Icinga\Data\ResourceFactory; -use Icinga\Util\Translator; use Icinga\Web\Form; @@ -46,7 +44,7 @@ class ApplicationConfigForm extends Form $this->addElement( 'select', - 'preferences_type', + 'preferences_store', array( 'required' => true, 'autosubmit' => true, @@ -58,7 +56,7 @@ class ApplicationConfigForm extends Form ) ) ); - if (isset($formData['preferences_type']) && $formData['preferences_type'] === 'db') { + if (isset($formData['preferences_store']) && $formData['preferences_store'] === 'db') { $backends = array(); foreach (ResourceFactory::getResourceConfigs()->toArray() as $name => $resource) { if ($resource['type'] === 'db') { diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index c2cba0c41..a9d9ec033 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -26,7 +26,7 @@ use Icinga\Data\Db\DbConnection; * // Create a INI store * $store = PreferencesStore::create( * new ConfigObject( - * 'type' => 'ini', + * 'store' => 'ini', * 'config_path' => '/path/to/preferences' * ), * $user // Instance of \Icinga\User @@ -117,9 +117,9 @@ abstract class PreferencesStore */ public static function create(ConfigObject $config, User $user) { - if (($type = $config->type) === null) { + if (($type = $config->store) === null) { throw new ConfigurationError( - 'Preferences configuration is missing the type directive' + 'Preferences configuration is missing the store directive' ); } diff --git a/modules/setup/application/forms/PreferencesPage.php b/modules/setup/application/forms/PreferencesPage.php index 07e011ee1..83f036498 100644 --- a/modules/setup/application/forms/PreferencesPage.php +++ b/modules/setup/application/forms/PreferencesPage.php @@ -70,7 +70,7 @@ class PreferencesPage extends Form $this->addElement( 'select', - 'type', + 'store', array( 'required' => true, 'label' => $this->translate('User Preference Storage Type'), diff --git a/modules/setup/library/Setup/Steps/GeneralConfigStep.php b/modules/setup/library/Setup/Steps/GeneralConfigStep.php index ee9e2c581..39c160628 100644 --- a/modules/setup/library/Setup/Steps/GeneralConfigStep.php +++ b/modules/setup/library/Setup/Steps/GeneralConfigStep.php @@ -29,7 +29,7 @@ class GeneralConfigStep extends Step $config[$section][$property] = $value; } - $config['preferences']['type'] = $this->data['preferencesType']; + $config['preferences']['store'] = $this->data['preferencesStore']; if (isset($this->data['preferencesResource'])) { $config['preferences']['resource'] = $this->data['preferencesResource']; } @@ -58,11 +58,11 @@ class GeneralConfigStep extends Step $generalHtml = '' . '