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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user