Created
February 11, 2014 22:11
-
-
Save nickvergessen/8945292 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/phpBB/config/profilefields.yml b/phpBB/config/profilefields.yml | |
index 5a861a4..d12a1f8 100644 | |
--- a/phpBB/config/profilefields.yml | |
+++ b/phpBB/config/profilefields.yml | |
@@ -80,3 +80,12 @@ services: | |
- @user | |
tags: | |
- { name: profilefield.type } | |
+ | |
+ profilefields.type.url: | |
+ class: phpbb\profilefields\type\type_url | |
+ arguments: | |
+ - @request | |
+ - @template | |
+ - @user | |
+ tags: | |
+ - { name: profilefield.type } | |
diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php | |
index 726a9ba..c764dbc 100644 | |
--- a/phpBB/language/en/acp/profile.php | |
+++ b/phpBB/language/en/acp/profile.php | |
@@ -96,6 +96,7 @@ $lang = array_merge($lang, array( | |
'FIELD_TEXT' => 'Textarea', | |
'FIELD_TYPE' => 'Field type', | |
'FIELD_TYPE_EXPLAIN' => 'You are not able to change the field type later.', | |
+ 'FIELD_URL' => 'URL (Link)', | |
'FIELD_VALIDATION' => 'Field validation', | |
'FIRST_OPTION' => 'First option', | |
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php | |
index 6f392d6..3536613 100644 | |
--- a/phpBB/language/en/ucp.php | |
+++ b/phpBB/language/en/ucp.php | |
@@ -209,6 +209,7 @@ $lang = array_merge($lang, array( | |
'FIELD_INVALID_CHARS_ALPHA_ONLY' => 'The field “%s” has invalid characters, only alphanumeric characters are allowed.', | |
'FIELD_INVALID_CHARS_SPACERS_ONLY' => 'The field “%s” has invalid characters, only alphanumeric, space or -+_[] characters are allowed.', | |
'FIELD_INVALID_DATE' => 'The field “%s” has an invalid date.', | |
+ 'FIELD_INVALID_URL' => 'The field “%s” has an invalid url.', | |
'FIELD_INVALID_VALUE' => 'The field “%s” has an invalid value.', | |
'FOE_MESSAGE' => 'Message from foe', | |
diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php | |
index b89faca..8a93980 100644 | |
--- a/phpBB/phpbb/profilefields/type/type_int.php | |
+++ b/phpBB/phpbb/profilefields/type/type_int.php | |
@@ -61,7 +61,7 @@ class type_int extends type_base | |
0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" size="5" value="' . $field_data['field_length'] . '" />'), | |
1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" size="5" value="' . $field_data['field_minlen'] . '" />'), | |
2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" size="5" value="' . $field_data['field_maxlen'] . '" />'), | |
- 3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => '<input type="post" name="field_default_value" value="' . $field_data['field_default_value'] . '" />'), | |
+ 3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => '<input type="number" name="field_default_value" value="' . $field_data['field_default_value'] . '" />'), | |
); | |
return $options; | |
diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php | |
index 9d241c4..9dada59 100644 | |
--- a/phpBB/phpbb/profilefields/type/type_string.php | |
+++ b/phpBB/phpbb/profilefields/type/type_string.php | |
@@ -109,7 +109,7 @@ class type_string extends type_string_common | |
$default_value = $profile_row['lang_default_value']; | |
$profile_row['field_value'] = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value, true) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]); | |
- $this->template->assign_block_vars('string', array_change_key_case($profile_row, CASE_UPPER)); | |
+ $this->template->assign_block_vars($this->get_name_short(), array_change_key_case($profile_row, CASE_UPPER)); | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment