From 489db61206bf187830934dad3d099bcb0748b00c Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Wed, 16 Sep 2015 13:10:10 +0800 Subject: [PATCH] MDL-51427 user: correctly use strings for phone1 and phone2 Thanks to Olumuyiwa Taiwo for original patch --- admin/auth_config.php | 4 ++-- blocks/myprofile/block_myprofile.php | 2 +- blocks/myprofile/lang/en/block_myprofile.php | 4 ++-- mod/url/locallib.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/auth_config.php b/admin/auth_config.php index e1a0fb08c8c..ae379674fb8 100644 --- a/admin/auth_config.php +++ b/admin/auth_config.php @@ -146,8 +146,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts, // If custom field then pick name from database. $fieldshortname = str_replace('profile_field_', '', $fieldname); $fieldname = $customfieldname[$fieldshortname]->name; - } elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) { - $fieldname = get_string($matches[1]) . ' ' . $matches[2]; + } elseif ($fieldname == 'phone1') { + $fieldname = get_string('phone'); } elseif ($fieldname == 'url') { $fieldname = get_string('webpage'); } else { diff --git a/blocks/myprofile/block_myprofile.php b/blocks/myprofile/block_myprofile.php index cd82a6eaf2e..8c9278201e4 100644 --- a/blocks/myprofile/block_myprofile.php +++ b/blocks/myprofile/block_myprofile.php @@ -133,7 +133,7 @@ class block_myprofile extends block_base { if(!empty($this->config->display_phone2) && !empty($USER->phone2)) { $this->content->text .= '
'; - $this->content->text .= get_string('phone').': ' . s($USER->phone2); + $this->content->text .= get_string('phone2').': ' . s($USER->phone2); $this->content->text .= '
'; } diff --git a/blocks/myprofile/lang/en/block_myprofile.php b/blocks/myprofile/lang/en/block_myprofile.php index 57dc5d7947a..e238b1ee5cc 100644 --- a/blocks/myprofile/lang/en/block_myprofile.php +++ b/blocks/myprofile/lang/en/block_myprofile.php @@ -34,8 +34,8 @@ $string['display_skype'] = 'Display Skype'; $string['display_yahoo'] = 'Display Yahoo'; $string['display_aim'] = 'Display AIM'; $string['display_msn'] = 'Display MSN'; -$string['display_phone1'] = 'Display phone number 1'; -$string['display_phone2'] = 'Display phone number 2'; +$string['display_phone1'] = 'Display phone'; +$string['display_phone2'] = 'Display mobile phone'; $string['display_institution'] = 'Display institution'; $string['display_address'] = 'Display address'; $string['display_firstaccess'] = 'Display first access'; diff --git a/mod/url/locallib.php b/mod/url/locallib.php index 2342ab5dc12..32a7bc42ac4 100644 --- a/mod/url/locallib.php +++ b/mod/url/locallib.php @@ -421,8 +421,8 @@ function url_get_variable_options($config) { 'userfullname' => get_string('fullnameuser'), 'useremail' => get_string('email'), 'usericq' => get_string('icqnumber'), - 'userphone1' => get_string('phone').' 1', - 'userphone2' => get_string('phone2').' 2', + 'userphone1' => get_string('phone'), + 'userphone2' => get_string('phone2'), 'userinstitution' => get_string('institution'), 'userdepartment' => get_string('department'), 'useraddress' => get_string('address'),