diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-25 02:14:44 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-25 02:14:44 +0400 |
commit | d467c9a46d2ca36f459e59d9a496be24c759836d (patch) | |
tree | 6e3709274fe0fdbd2e5b676ae5a4a2aedbbaa58c /core/Settings | |
parent | 979e2894ff49d3b4be0acb06e98310b1a6b71169 (diff) |
refs #4126 added some tests, fixed some bugs and moved some methods where they belong to not have a circular dependency
Diffstat (limited to 'core/Settings')
-rw-r--r-- | core/Settings/Setting.php | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/core/Settings/Setting.php b/core/Settings/Setting.php index 00efc9d876..be2420b86f 100644 --- a/core/Settings/Setting.php +++ b/core/Settings/Setting.php @@ -27,14 +27,14 @@ abstract class Setting * * @var string */ - public $type = Settings::TYPE_STRING; + public $type = null; /** * Defines which field type should be displayed on the setting page. * * @var string */ - public $field = Settings::FIELD_TEXT; + public $field = null; /** * An array of field attributes that will be added as HTML attributes to the HTML form field. @@ -161,30 +161,4 @@ abstract class Setting return $this->key; } - public function getDefaultType($field) - { - $defaultTypes = array( - Settings::FIELD_TEXT => Settings::TYPE_STRING, - Settings::FIELD_TEXTAREA => Settings::TYPE_STRING, - Settings::FIELD_PASSWORD => Settings::TYPE_STRING, - Settings::FIELD_CHECKBOX => Settings::TYPE_BOOL, - Settings::FIELD_MULTI_SELECT => Settings::TYPE_ARRAY, - Settings::FIELD_SINGLE_SELECT => Settings::TYPE_STRING, - ); - - return $defaultTypes[$field]; - } - - public function getDefaultField($type) - { - $defaultFields = array( - Settings::TYPE_INT => Settings::FIELD_TEXT, - Settings::TYPE_FLOAT => Settings::FIELD_TEXT, - Settings::TYPE_STRING => Settings::FIELD_TEXT, - Settings::TYPE_BOOL => Settings::FIELD_CHECKBOX, - Settings::TYPE_ARRAY => Settings::FIELD_MULTI_SELECT, - ); - - return $defaultFields[$type]; - } } |