]> git.mjollnir.org Git - moodle.git/commitdiff
Support some strings from within the auth plugin lang files added. MDL-10694
authorstronk7 <stronk7>
Sat, 4 Aug 2007 17:18:14 +0000 (17:18 +0000)
committerstronk7 <stronk7>
Sat, 4 Aug 2007 17:18:14 +0000 (17:18 +0000)
Merged from MOODLE_18_STABLE

admin/auth.php
admin/auth_config.php

index 8b0c25cf76203fe727fa36b3a5fc9d9c1a9921c3..fabfa5e69dcae5758ddc8cdb03f8fc666b54c341 100644 (file)
@@ -139,9 +139,15 @@ $registrationauths = array();
 $registrationauths[''] = $txt->disable;
 foreach ($authsenabled as $auth) {
     $authplugin = get_auth_plugin($auth);
-    $displayauths[$auth] = get_string("auth_{$auth}title", '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}");
+    }
+/// Apply titles
+    $displayauths[$auth] = $authtitle;
     if ($authplugin->can_signup()) {
-        $registrationauths[$auth] = get_string("auth_{$auth}title", 'auth');
+        $registrationauths[$auth] = $authtitle;
     }
 }
 
@@ -150,9 +156,15 @@ foreach ($authsavailable as $auth) {
         continue; //already in the list
     }
     $authplugin = get_auth_plugin($auth);
-    $displayauths[$auth] = get_string("auth_{$auth}title", '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}");
+    }
+/// Apply titles
+    $displayauths[$auth] = $authtitle;
     if ($authplugin->can_signup()) {
-        $registrationauths[$auth] = get_string("auth_{$auth}title", 'auth');
+        $registrationauths[$auth] = $authtitle;
     }
 }
 
index a75f4ed20f6f824565532aa73b7f23bdb86cf77d..a9cb8fd18ab3e2c7991ad0006c3b01bdd0dc3291 100644 (file)
@@ -51,11 +51,16 @@ if ($frm = data_submitted()) {
 
 $user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
 
-$modules = get_list_of_plugins('auth');
-foreach ($modules as $module) {
-    $options[$module] = get_string("auth_{$module}title", 'auth');
-}
-asort($options);
+/// 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}");
+    }
+/// 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}");
+    }
 
 // output configuration form
 admin_externalpage_print_header();
@@ -68,9 +73,9 @@ echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
 
 // auth plugin description
 print_simple_box_start('center', '80%');
-print_heading($options[$auth]);
-print_simple_box_start('center', '60%', '', 5, 'informationbox');
-print_string("auth_{$auth}description", 'auth');
+print_heading($authtitle);
+print_simple_box_start('center', '80%', '', 5, 'informationbox');
+echo $authdescription;
 print_simple_box_end();
 echo "<hr />\n";
 $authplugin->config_form($frm, $err, $user_fields);