diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2014-01-17 09:55:52 +0100 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2014-01-17 09:55:52 +0100 |
| commit | 9653764fb15de3e3126466c98525c121a8a3ac0b (patch) | |
| tree | b683891efe0421e4966ad062d8261195be0533a6 /phpBB/phpbb/profilefields | |
| parent | 0bdec35cd4127cd4f1e96b9a77340580c6045423 (diff) | |
| download | forums-9653764fb15de3e3126466c98525c121a8a3ac0b.tar forums-9653764fb15de3e3126466c98525c121a8a3ac0b.tar.gz forums-9653764fb15de3e3126466c98525c121a8a3ac0b.tar.bz2 forums-9653764fb15de3e3126466c98525c121a8a3ac0b.tar.xz forums-9653764fb15de3e3126466c98525c121a8a3ac0b.zip | |
[ticket/11201] Move field type depending preparation of the options to class
PHPBB3-11201
Diffstat (limited to 'phpBB/phpbb/profilefields')
| -rw-r--r-- | phpBB/phpbb/profilefields/type/type_bool.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/profilefields/type/type_date.php | 8 | ||||
| -rw-r--r-- | phpBB/phpbb/profilefields/type/type_dropdown.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/profilefields/type/type_int.php | 8 | ||||
| -rw-r--r-- | phpBB/phpbb/profilefields/type/type_interface.php | 9 | ||||
| -rw-r--r-- | phpBB/phpbb/profilefields/type/type_string_common.php | 10 |
6 files changed, 55 insertions, 0 deletions
diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php index a3291d5ce1..f27c5af1ee 100644 --- a/phpBB/phpbb/profilefields/type/type_bool.php +++ b/phpBB/phpbb/profilefields/type/type_bool.php @@ -229,4 +229,14 @@ class type_bool implements type_interface return $field_data; } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + $exclude_options[1][] = 'lang_options'; + + return $this->request->variable('lang_options', array(''), true); + } } diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php index c76c7e1d49..37b8db2779 100644 --- a/phpBB/phpbb/profilefields/type/type_date.php +++ b/phpBB/phpbb/profilefields/type/type_date.php @@ -271,4 +271,12 @@ class type_date implements type_interface return $field_data; } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + return $this->request->variable('lang_options', '', true); + } } diff --git a/phpBB/phpbb/profilefields/type/type_dropdown.php b/phpBB/phpbb/profilefields/type/type_dropdown.php index 4313f0e64c..25671c88fa 100644 --- a/phpBB/phpbb/profilefields/type/type_dropdown.php +++ b/phpBB/phpbb/profilefields/type/type_dropdown.php @@ -222,4 +222,14 @@ class type_dropdown implements type_interface return $field_data; } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + $exclude_options[1][] = 'lang_options'; + + return $this->request->variable('lang_options', '', true); + } } diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php index 9901f61795..35f021f0fa 100644 --- a/phpBB/phpbb/profilefields/type/type_int.php +++ b/phpBB/phpbb/profilefields/type/type_int.php @@ -196,4 +196,12 @@ class type_int implements type_interface return $field_data; } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + return $this->request->variable('lang_options', '', true); + } } diff --git a/phpBB/phpbb/profilefields/type/type_interface.php b/phpBB/phpbb/profilefields/type/type_interface.php index 9390c4171b..f8d5c46239 100644 --- a/phpBB/phpbb/profilefields/type/type_interface.php +++ b/phpBB/phpbb/profilefields/type/type_interface.php @@ -113,4 +113,13 @@ interface type_interface * @return array Returns the language options we need to generate */ public function get_language_options_input($field_data); + + /** + * Allows exclusion of options in single steps of the creation process + * + * @param array $exclude_options Array with options that should be excluded in the steps + * @param array $visibility_options Array with options responsible for the fields visibility + * @return mixed Returns the provided language options + */ + public function prepare_options_form(&$exclude_options, &$visibility_options); } diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php index 88ca905aee..a6145e910b 100644 --- a/phpBB/phpbb/profilefields/type/type_string_common.php +++ b/phpBB/phpbb/profilefields/type/type_string_common.php @@ -122,4 +122,14 @@ abstract class type_string_common return $field_data; } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + $exclude_options[1][] = 'lang_default_value'; + + return $this->request->variable('lang_options', '', true); + } } |
