echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menucountry">'.get_string("country").'</label></div>';
echo '<div class="felement ftext">';
- echo html_writer::select(get_list_of_countries(), "country", $admin->country, array(''=>get_string("selectacountry")."..."));
+ echo html_writer::select(get_string_manager()->get_list_of_countries(), "country", $admin->country, array(''=>get_string("selectacountry")."..."));
echo '</div>';
echo '</div>';
$mform->setType('city', PARAM_MULTILANG);
$mform->setDefault('city', $templateuser->city);
- $mform->addElement('select', 'country', get_string('selectacountry'), get_list_of_countries());
+ $mform->addElement('select', 'country', get_string('selectacountry'), get_string_manager()->get_list_of_countries());
$mform->setDefault('country', $templateuser->country);
$mform->setAdvanced('country');
} else {
- $countries = get_list_of_countries();
+ $countries = get_string_manager()->get_list_of_countries(false);
if (empty($mnethosts)) {
$mnethosts = $DB->get_records('mnet_host', null, 'id', 'id,wwwroot,name');
}
echo $OUTPUT->header();
-$countries = get_list_of_countries();
+$countries = get_string_manager()->get_list_of_countries(true);
foreach ($users as $key => $id) {
$user = $DB->get_record('user', array('id'=>$id), 'id, firstname, lastname, username, email, country, lastaccess, city');
$mform->setDefault('cccity', $USER->city);
$mform->setDefault('ccstate', '');
- $mform->addElement('select', 'cccountry', get_string('country'), get_list_of_countries());
+ $mform->addElement('select', 'cccountry', get_string('country'), get_string_manager()->get_list_of_countries());
$mform->addRule('cccountry', get_string('missingcountry'), 'required', null, 'client');
$mform->setType('cccountry', PARAM_ALPHA);
$mform->setDefault('cccountry', $USER->country);
}
if (!empty($location->country_code)) {
- $countries = get_list_of_countries();
+ $countries = get_string_manager()->get_list_of_countries(true);
if (isset($countries[$location->country_code])) {
// prefer our localized country names
$info[] = $countries[$location->country_code];
if (preg_match('/COUNTRY:\s*([^<]*)/', $ipdata, $matches)) {
if (!empty($matches[1])) {
$countrycode = $matches[1];
- $countries = get_list_of_countries();
+ $countries = get_string_manager()->get_list_of_countries(true);
if (isset($countries[$countrycode])) {
// prefer our localized country names
$info[] = $countries[$countrycode];
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_settings_country_select extends admin_setting_configselect {
- public function __construct($name, $visiblename, $description, $defaultsetting) {
+ protected $includeall;
+ public function __construct($name, $visiblename, $description, $defaultsetting, $includeall=false) {
+ $this->includeall = $includeall;
parent::__construct($name, $visiblename, $description, $defaultsetting, NULL);
}
}
$this->choices = array_merge(
array('0' => get_string('choosedots')),
- get_list_of_countries());
+ get_string_manager()->get_list_of_countries($this->includeall));
return true;
}
}
return get_string_manager()->get_list_of_translations($returnall);
}
-
/**
* Returns a list of currencies in the current language
* @deprecated
return get_string_manager()->get_list_of_currencies();
}
+/**
+ * Returns a list of all enabled country names in the current translation
+ * @deprecated
+ * @return array two-letter country code => translated name.
+ */
+function get_list_of_countries() {
+ debugging('get_list_of_countries() is deprecated, please use get_string_manager()->get_list_of_countries() instead.');
+ return get_string_manager()->get_list_of_countries(false);
+}
+
/**
* @deprecated
*/
return $charsets;
}
-/**
- * Returns a list of all enabled country names in the current translation
- * @return array two-letter country code => translated name.
- */
-function get_list_of_countries() {
- return get_string_manager()->get_list_of_countries(false);
-}
-
/**
* Returns a list of valid and compatible themes
*
$mform->setType('city', PARAM_TEXT);
$mform->addRule('city', get_string('missingcity'), 'required', null, 'server');
- $country = get_list_of_countries();
+ $country = get_string_manager()->get_list_of_countries();
$default_country[''] = get_string('selectacountry');
$country = array_merge($default_country, $country);
$mform->addElement('select', 'country', get_string('country'), $country);
$mform->addRule('city', $strrequired, 'required', null, 'client');
- $choices = get_list_of_countries();
+ $choices = get_string_manager()->get_list_of_countries();
$choices= array(''=>get_string('selectacountry').'...') + $choices;
$mform->addElement('select', 'country', get_string('selectacountry'), $choices);
$mform->addRule('country', $strrequired, 'required', null, 'client');
case 'firstname': return new user_filter_text('firstname', get_string('firstname'), $advanced, 'firstname');
case 'email': return new user_filter_text('email', get_string('email'), $advanced, 'email');
case 'city': return new user_filter_text('city', get_string('city'), $advanced, 'city');
- case 'country': return new user_filter_select('country', get_string('country'), $advanced, 'country', get_list_of_countries(), $USER->country);
+ case 'country': return new user_filter_select('country', get_string('country'), $advanced, 'country', get_string_manager()->get_list_of_countries(), $USER->country);
case 'confirmed': return new user_filter_yesno('confirmed', get_string('confirmed', 'admin'), $advanced, 'confirmed');
case 'profile': return new user_filter_profilefield('profile', get_string('profile'), $advanced);
case 'courserole': return new user_filter_courserole('courserole', get_string('courserole', 'filters'), $advanced);
$bulkoperations = has_capability('moodle/course:bulkmessaging', $context);
- $countries = get_list_of_countries();
+ $countries = get_string_manager()->get_list_of_countries();
$strnever = get_string('never');
$context = get_context_instance(CONTEXT_COURSE, $course->id);
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
- $countries = get_list_of_countries();
+ $countries = get_string_manager()->get_list_of_countries();
/// Get the hidden field list
if (has_capability('moodle/course:viewhiddenuserfields', $context)) {
echo '<table class="list">';
if (! isset($hiddenfields['country']) && $user->country) {
- $countries = get_list_of_countries();
+ $countries = get_string_manager()->get_list_of_countries();
print_row(get_string('country') . ':', $countries[$user->country]);
}