Merged from MOODLE_19_STABLE: MDL-12440: take out auth title and description into base class, plugins can override. updated places that use get_string to call these methods. Credit: Luke Hudson <[email protected]>

This commit is contained in:
mjollnir_
2008-01-31 22:02:44 +00:00
parent 9d042298ff
commit 2a5f4a885b
3 changed files with 29 additions and 24 deletions
+5 -16
View File
@@ -3480,10 +3480,7 @@ class admin_setting_special_registerauth extends admin_setting_configselect {
continue;
}
// Get the auth title (from core or own auth lang files)
$authtitle = get_string("auth_{$auth}title", "auth");
if ($authtitle == "[[auth_{$auth}title]]") {
$authtitle = get_string("auth_{$auth}title", "auth_{$auth}");
}
$authtitle = $authplugin->get_title();
$this->choices[$auth] = $authtitle;
}
return true;
@@ -3603,10 +3600,8 @@ class admin_setting_manageauths extends admin_setting {
if (strpos($auth, $query) !== false) {
return true;
}
$authtitle = get_string("auth_{$auth}title", "auth");
if ($authtitle == "[[auth_{$auth}title]]") {
$authtitle = get_string("auth_{$auth}title", "auth_{$auth}");
}
$authplugin = get_auth_plugin($auth);
$authtitle = $authplugin->get_title();
if (strpos($textlib->strtolower($authtitle), $query) !== false) {
return true;
}
@@ -3639,10 +3634,7 @@ class admin_setting_manageauths extends admin_setting {
foreach ($authsenabled as $auth) {
$authplugin = get_auth_plugin($auth);
/// Get the auth title (from core or own auth lang files)
$authtitle = get_string("auth_{$auth}title", "auth");
if ($authtitle == "[[auth_{$auth}title]]") {
$authtitle = get_string("auth_{$auth}title", "auth_{$auth}");
}
$authtitle = $authplugin->get_title();
/// Apply titles
$displayauths[$auth] = $authtitle;
if ($authplugin->can_signup()) {
@@ -3656,10 +3648,7 @@ class admin_setting_manageauths extends admin_setting {
}
$authplugin = get_auth_plugin($auth);
/// Get the auth title (from core or own auth lang files)
$authtitle = get_string("auth_{$auth}title", "auth");
if ($authtitle == "[[auth_{$auth}title]]") {
$authtitle = get_string("auth_{$auth}title", "auth_{$auth}");
}
$authtitle = $authplugin->get_title();
/// Apply titles
$displayauths[$auth] = $authtitle;
if ($authplugin->can_signup()) {