$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
/// 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();
/// Get the auth descriptions (from core or own auth lang files)
- $authdescription = get_string("auth_{$auth}description", "auth");
- if ($authdescription == "[[auth_{$auth}description]]") {
- $authdescription = get_string("auth_{$auth}description", "auth_{$auth}");
- }
+ $authdescription = $authplugin->get_description();
// output configuration form
admin_externalpage_print_header();
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;
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;
}
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()) {
}
$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()) {
//override if needed
}
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Get the auth description (from core or own auth lang files)
+ */
+ function get_description() {
+ $authdescription = get_string("auth_{$this->authtype}description", "auth");
+ if ($authdescription == "[[auth_{$this->authtype}description]]") {
+ $authdescription = get_string("auth_{$this->authtype}description", "auth_{$this->authtype}");
+ }
+ return $authdescription;
+ }
}
?>