authentication MDL-18273 Custom Authentication Plugin title can be retrieved from specific language file, merged from 19

This commit is contained in:
jerome
2009-05-14 07:03:27 +00:00
parent dc247e5232
commit 2a274f2a93
6 changed files with 18 additions and 12 deletions
+1 -4
View File
@@ -41,10 +41,7 @@ if ($hassiteconfig
$authbyname = array();
foreach ($auths as $auth) {
$strauthname = get_string("auth_{$auth}title", "auth");
if ($strauthname == "[[auth_{$auth}title]]") {
$strauthname = get_string("auth_{$auth}title", "auth_{$auth}");
}
$strauthname = auth_get_plugin_title($auth);
$authbyname[$strauthname] = $auth;
}
ksort($authbyname);
+1 -1
View File
@@ -979,7 +979,7 @@ function uu_allowed_auths() {
$plugins = get_enabled_auth_plugins();
$choices = array();
foreach ($plugins as $plugin) {
$choices[$plugin] = get_string('auth_'.$plugin.'title', 'auth');
$choices[$plugin] = auth_get_plugin_title ($plugin);
}
return $choices;
+1 -5
View File
@@ -360,11 +360,7 @@ class auth_plugin_base {
* Return the properly translated human-friendly title of this auth plugin
*/
function get_title() {
$authtitle = get_string("auth_{$this->authtype}title", "auth");
if ($authtitle == "[[auth_{$this->authtype}title]]") {
$authtitle = get_string("auth_{$this->authtype}title", "auth_{$this->authtype}");
}
return $authtitle;
return auth_get_plugin_title($this->authtype);
}
/**
+13
View File
@@ -7324,5 +7324,18 @@ class html_list_progress_trace extends moodle_progress_trace {
}
}
/**
* Return the authentication plugin title
* @param string $authtype plugin type
* @return string
*/
function auth_get_plugin_title ($authtype) {
$authtitle = get_string("auth_{$authtype}title", "auth");
if ($authtitle == "[[auth_{$authtype}title]]") {
$authtitle = get_string("auth_{$authtype}title", "auth_{$authtype}");
}
return $authtitle;
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>
+1 -1
View File
@@ -27,7 +27,7 @@ class user_editadvanced_form extends moodleform {
$modules = get_list_of_plugins('auth');
$auth_options = array();
foreach ($modules as $module) {
$auth_options[$module] = get_string("auth_$module"."title", "auth");
$auth_options[$module] = auth_get_plugin_title ($module);
}
$mform->addElement('select', 'auth', get_string('chooseauthmethod','auth'), $auth_options);
$mform->setHelpButton('auth', array('authchange', get_string('chooseauthmethod','auth')));
+1 -1
View File
@@ -118,7 +118,7 @@ class user_filtering {
$plugins = get_list_of_plugins('auth');
$choices = array();
foreach ($plugins as $auth) {
$choices[$auth] = get_string("auth_{$auth}title", 'auth');
$choices[$auth] = auth_get_plugin_title ($auth);
}
return new user_filter_simpleselect('auth', get_string('authentication'), $advanced, 'auth', $choices);