MDL-22015 fixed more string_manager encapsulation issues - use edit form
authorPetr Skoda <skodak@moodle.org>
Wed, 14 Apr 2010 14:42:03 +0000 (14:42 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 14 Apr 2010 14:42:03 +0000 (14:42 +0000)
user/edit_form.php
user/editadvanced_form.php

index df1a4d3..661825c 100644 (file)
@@ -54,8 +54,7 @@ class user_edit_form extends moodleform {
         if ($langsel = $mform->getElementValue('lang')) {
             $lang = reset($langsel);
             // check lang exists
-            if (!file_exists($CFG->dataroot.'/lang/'.$lang) and
-              !file_exists($CFG->dirroot .'/lang/'.$lang)) {
+            if (get_string_manager()->translation_exists($lang, false)) {
                 $lang_el =& $mform->getElement('lang');
                 $lang_el->setValue($CFG->lang);
             }
index b82e739..d22b083 100644 (file)
@@ -74,8 +74,7 @@ class user_editadvanced_form extends moodleform {
         if ($langsel = $mform->getElementValue('lang')) {
             $lang = reset($langsel);
             // check lang exists
-            if (!file_exists($CFG->dataroot.'/lang/'.$lang) and
-              !file_exists($CFG->dirroot .'/lang/'.$lang)) {
+            if (get_string_manager()->translation_exists($lang, false)) {
                 $lang_el =& $mform->getElement('lang');
                 $lang_el->setValue($CFG->lang);
             }