Merge branch 'wip-MDL-51283-master' of git://github.com/marinaglancy/moodle
authorDavid Monllao <davidm@moodle.com>
Tue, 2 Feb 2016 09:40:39 +0000 (17:40 +0800)
committerDavid Monllao <davidm@moodle.com>
Tue, 2 Feb 2016 09:40:39 +0000 (17:40 +0800)
1  2 
user/editlib.php

diff --combined user/editlib.php
@@@ -284,17 -284,11 +284,17 @@@ function useredit_shared_definition(&$m
      }
  
      $strrequired = get_string('required');
 +    $stringman = get_string_manager();
  
      // Add the necessary names.
      foreach (useredit_get_required_name_fields() as $fullname) {
          $mform->addElement('text', $fullname,  get_string($fullname),  'maxlength="100" size="30"');
 -        $mform->addRule($fullname, $strrequired, 'required', null, 'client');
 +        if ($stringman->string_exists('missing'.$fullname, 'core')) {
 +            $strmissingfield = get_string('missing'.$fullname, 'core');
 +        } else {
 +            $strmissingfield = $strrequired;
 +        }
 +        $mform->addRule($fullname, $strmissingfield, 'required', null, 'client');
          $mform->setType($fullname, PARAM_NOTAGS);
      }
  
      if (core_tag_tag::is_enabled('core', 'user') and empty($USER->newadminuser)) {
          $mform->addElement('header', 'moodle_interests', get_string('interests'));
          $mform->addElement('tags', 'interests', get_string('interestslist'),
-             array('display' => 'noofficial', 'itemtype' => 'user', 'component' => 'core'));
+             array('itemtype' => 'user', 'component' => 'core'));
          $mform->addHelpButton('interests', 'interestslist');
      }