From 46a811142e64ed660badae5c77ced7d25a9227d2 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Thu, 9 Mar 2006 05:06:18 +0000 Subject: [PATCH] [multienrol]Don't die if there's an empty directory in enrol and better strings for admin ui The admin UI still needs a bit of wordsmithing to make it easy to understand what the model we have is. --- admin/enrol.php | 6 ++++++ enrol/enrol.class.php | 11 ++++++++--- lang/en_utf8/admin.php | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/admin/enrol.php b/admin/enrol.php index 1330da93dd..9bc69d5516 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -70,6 +70,12 @@ $modules = get_list_of_plugins("enrol"); foreach ($modules as $module) { + + // skip if directory is empty + if (!file_exists("$CFG->dirroot/enrol/$module/enrol.php")) { + continue; + } + $name = get_string("enrolname", "enrol_$module"); $plugin = enrolment_factory::factory($module); $enable = 'enrol; } - require_once("$CFG->dirroot/enrol/$enrol/enrol.php"); - $class = "enrolment_plugin_$enrol"; - return new $class; + if (file_exists("$CFG->dirroot/enrol/$enrol/enrol.php")) { + require_once("$CFG->dirroot/enrol/$enrol/enrol.php"); + $class = "enrolment_plugin_$enrol"; + return new $class; + } else { + trigger_error("$CFG->dirroot/enrol/$enrol/enrol.php does not exist"); + error("$CFG->dirroot/enrol/$enrol/enrol.php does not exist"); + } } } diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index ea01768f13..169232fef7 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -44,7 +44,7 @@ $string['configenablecourserequests'] = 'This will allow any user to request a c $string['configenablerssfeeds'] = 'This switch will enable RSS feeds from across the site. To actually see any change you will need to enable RSS feeds in the individual modules too - go to the Modules settings under Admin Configuration.'; $string['configenablerssfeedsdisabled'] = ' It is not available because RSS feeds are disabled in all the Site. To enable them, go to the Variables settings under Admin Configuration.'; $string['configenablestats'] = 'If you choose \'yes\' here, Moodle\'s cronjob will process the logs and gather some statistics. Depending on the amount of traffic on your site, this can take awhile. If you enable this, you will be able to see some interesting graphs and statistics about each of your courses, or on a sitewide basis.'; -$string['configenrolmentplugins'] = 'Please choose the enrolment plugins you wish to use. Don\'t forget to configure the settings properly.

Default plugins are avaliable for interactive plugins only (etc internal, paypal). Should interactive enrolment be disabled, please set \"enrollable\" to \"No\" in required courses.'; +$string['configenrolmentplugins'] = 'Please choose the enrolment plugins you wish to use. Don\'t forget to configure the settings properly.

You have to indicate which plugins are enabled, and one plugin can be set as the default plugin for interactive enrolment. To disable interactive enrolment, set \"enrollable\" to \"No\" in required courses.'; $string['configerrorlevel'] = 'Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.'; $string['configextendedusernamechars'] = 'Enable this setting to allow students to use any characters in their usernames (note this does not affect their actual names). The default is \"false\" which restricts usernames to be alphanumeric characters only'; $string['configfilterall'] = 'Filter all strings, including headings, titles, navigation bar and so on. This is mostly useful when using the multilang filter, otherwise it will just create extra load on your site for little gain.'; -- 2.39.5