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
+22
View File
@@ -320,6 +320,28 @@ class auth_plugin_base {
//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;
}
}
?>