diff --git a/enrol/README.txt b/enrol/README.txt
index 83609d322de..cf4ddef2828 100644
--- a/enrol/README.txt
+++ b/enrol/README.txt
@@ -9,7 +9,7 @@ of a complete class, take a look at the 'manual' class.
Each plugin is in a subfolder here.
-Except for the configuration methods, most methods
+Except for the configuration methods, most methods
defined in the API are optional -- callers will use
method_exists() to determine whether your plugin offers
the functionality they are after.
@@ -30,40 +30,40 @@ Login-time methods
get_student_courses()
get_teacher_courses()
-
+
You probably will want to offer at least get_student_courses().
-
+
These methods are triggered when a user logs in successfully,
- and they are expected to populate $USER->student and
+ and they are expected to populate $USER->student and
$USER->teacher arrays and maintain (add/delete) entries from
user_students and user_teachers.
-
+
These methods are relevant for most plugins, and are the main
interest for plugins that work with a read-only backend such
as LDAP or a database.
-
- Note that with the multi-enrol infrastructure two things have
- changed. We now have an 'enrol' field in those tables, and
- each plugin must maintain only its own enrolment records.
+
+ Note that with the multi-enrol infrastructure two things have
+ changed. We now have an 'enrol' field in those tables, and
+ each plugin must maintain only its own enrolment records.
Conversely, the $USER->student and ->teacher arrays have the
enrolment type as value, like
-
+
$USER->student = array ( $courseid => $plugintype );
-
+
Moodle 1.7 and later
--------------------
setup_enrolments()
- With the advent of roles, there could well not be students and
+ With the advent of roles, there could well not be students and
teachers any more, so enrolment plugins have to be more flexible
about how they map outside data to the internal roles.
-
- This one method should do everything, calling functions from
+
+ This one method should do everything, calling functions from
lib/accesslib.php as necessary to set up relationships.
-
-
+
+
Interactive enrolment methods
=============================
@@ -73,9 +73,9 @@ Interactive enrolment methods
get_access_icons()
These methods are for enrolment plugins that allow for user
-driven enrolment. These methods are relevant for plugins
+driven enrolment. These methods are relevant for plugins
that implement payment gateways (credit card, paypal),
-as well as "magic password" schemes.
+as well as "magic password" schemes.
Only one interactive enrolment method can be active for
a given course. The site default can be set from
@@ -93,7 +93,7 @@ execute, perhaps offering a config option.
For really heavy cron processing, an alternative is to have
a separate script to be called separately. Currently the LDAP
-and DB plugins have external scripts.
+and DB plugins have external scripts.
Guilty Parties
diff --git a/enrol/authorize/authorizenet.class.php b/enrol/authorize/authorizenet.class.php
index 18a7ae80ff2..1f17a35f76d 100644
--- a/enrol/authorize/authorizenet.class.php
+++ b/enrol/authorize/authorizenet.class.php
@@ -1,4 +1,4 @@
-
+
diff --git a/enrol/authorize/config_form.php b/enrol/authorize/config_form.php
index b0da0f807b1..26d6bc7e2db 100755
--- a/enrol/authorize/config_form.php
+++ b/enrol/authorize/config_form.php
@@ -1,4 +1,4 @@
-enrol_cost)) $frm->enrol_cost = '5';
if (!isset($frm->enrol_currency)) $frm->enrol_currency = 'USD';
@@ -64,7 +64,7 @@ if (!isset($frm->acceptechecktypes)) {
diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php
index 78271630dad..0665ab713b4 100644
--- a/enrol/database/enrol.php
+++ b/enrol/database/enrol.php
@@ -1,4 +1,4 @@
-dirroot.'/enrol/enrol.class.php');
@@ -276,7 +276,7 @@ function sync_enrolments($role = null) {
continue;
}
- // slurp results into an array
+ // slurp results into an array
while ($crs_obj = (object)$crs->FetchRow()) {
$crs_obj = (object)array_change_key_case((array)$crs_obj , CASE_LOWER);
array_push($extenrolments, $crs_obj->{strtolower($CFG->enrol_remoteuserfield)});
@@ -675,4 +675,4 @@ function role_fields($enroldb, $role) {
} // end of class
-?>
+
diff --git a/enrol/database/enrol_database_sync.php b/enrol/database/enrol_database_sync.php
index df599c8fa9d..8e2fa82ac9f 100644
--- a/enrol/database/enrol_database_sync.php
+++ b/enrol/database/enrol_database_sync.php
@@ -1,11 +1,11 @@
-dirroot . '/course/lib.php');
@@ -28,14 +28,14 @@
$roles = !empty($CFG->enrol_db_remoterolefield) && !empty($CFG->enrol_db_localrolefield)
? get_all_roles()
: array(null);
-
+
foreach ($roles as $role) {
$enrol->sync_enrolments($role);
}
-
+
// sync metacourses
if (function_exists('sync_metacourses')) {
sync_metacourses();
}
-
-?>
+
+
diff --git a/enrol/flatfile/enrol.php b/enrol/flatfile/enrol.php
index e68230d50d8..a34d219b9e4 100644
--- a/enrol/flatfile/enrol.php
+++ b/enrol/flatfile/enrol.php
@@ -10,7 +10,7 @@ require_once($CFG->libdir.'/eventslib.php');
class enrolment_plugin_flatfile {
- var $log;
+ var $log;
/// Override the base config_form() function
function config_form($frm) {
@@ -20,7 +20,7 @@ function config_form($frm) {
foreach ($vars as $var) {
if (!isset($frm->$var)) {
$frm->$var = '';
- }
+ }
}
$roles = $DB->get_records('role', null, '', 'id, name, shortname');
@@ -34,8 +34,8 @@ function config_form($frm) {
isset($ffconfig->{"map_{$record->shortname}"}) ? $ffconfig->{"map_{$record->shortname}"} : $record->shortname
);
}
-
- include ("$CFG->dirroot/enrol/flatfile/config.html");
+
+ include ("$CFG->dirroot/enrol/flatfile/config.html");
}
@@ -102,17 +102,17 @@ function get_access_icons($course) {
}
if ( file_exists($filename) ) {
-
+
$this->log = userdate(time()) . "\n";
$this->log .= "Flatfile enrol cron found file: $filename\n\n";
if (($fh = fopen($filename, "r")) != false) {
list($roles, $rolemap) = $this->get_roles();
-
+
$line = 0;
while (!feof($fh)) {
-
+
$line++;
$fields = explode( ",", str_replace( "\r", "", fgets($fh) ) );
@@ -124,15 +124,15 @@ function get_access_icons($course) {
}
continue;
}
-
+
$fields[0] = trim(strtolower($fields[0]));
$fields[1] = trim(strtolower($fields[1]));
$fields[2] = trim($fields[2]);
$fields[3] = trim($fields[3]);
-
+
$this->log .= "$line: $fields[0] $fields[1] $fields[2] $fields[3] ";
-
+
if (!empty($fields[5])) {
$fields[4] = (int)trim($fields[4]);
$fields[5] = (int)trim($fields[5]);
@@ -140,7 +140,7 @@ function get_access_icons($course) {
} else {
$fields[4] = 0;
$fields[5] = 0;
- }
+ }
$this->log .= ":";
@@ -185,16 +185,16 @@ function get_access_icons($course) {
// Create/resurrect a context object
$context = get_context_instance(CONTEXT_COURSE, $course->id);
-
+
if ($fields[0] == 'add') {
role_assign($roleid, $user->id, null, $context->id, $fields[4], $fields[5], 0, 'flatfile');
} else {
role_unassign($roleid, $user->id, null, $context->id);
}
-
+
if ( empty($elog) and ($fields[0] == "add") ) {
-
+
if ($fields[1] == "student") {
if ($teachers = get_users_by_capability($context, 'moodle/course:update', 'u.*,ra.hidden', 'ra.sortorder ASC')) {
@@ -213,11 +213,11 @@ function get_access_icons($course) {
$teacher = get_admin();
}
-
+
if (!empty($CFG->enrol_mailstudents)) {
$a->coursename = "$course->fullname";
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";
-
+
$eventdata = new object();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $teacher;
@@ -233,11 +233,11 @@ function get_access_icons($course) {
if (!empty($CFG->enrol_mailteachers) && $teachers) {
foreach($teachers as $teacher) {
-
+
if (!$u->hidden || has_capability('moodle/role:viewhiddenassigns', $context)) {
$a->course = "$course->fullname";
$a->user = fullname($user);
-
+
$eventdata = new object();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $user;
@@ -246,7 +246,7 @@ function get_access_icons($course) {
$eventdata->fullmessage = get_string('enrolmentnewuser', '', $a);
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);
}
}
@@ -323,4 +323,4 @@ function get_access_icons($course) {
} // end of class
-?>
+
diff --git a/enrol/imsenterprise/README.txt b/enrol/imsenterprise/README.txt
index 2f88dc144d9..ff5ae8c1fcd 100644
--- a/enrol/imsenterprise/README.txt
+++ b/enrol/imsenterprise/README.txt
@@ -12,16 +12,16 @@ Please see INSTALL.txt.
DESCRIPTION
-This enrolment script will repeatedly read an XML file from a
+This enrolment script will repeatedly read an XML file from a
specified location. The XML file should conform to the IMS Enterprise
-1.1 specification, containing , , and
-elements to specify which students/teachers should be added/removed
-from the course. User accounts and/or Moodle courses can be created
-by the script if they aren't yet registered (this is an option which
+1.1 specification, containing , , and
+elements to specify which students/teachers should be added/removed
+from the course. User accounts and/or Moodle courses can be created
+by the script if they aren't yet registered (this is an option which
can be turned on/off).
(The IMS 1.0 specification is significantly different from the 1.1
-spec. This code has been made flexible so it should in theory be
+spec. This code has been made flexible so it should in theory be
able to handle IMS 1.0 as well, but I haven't directly tested it
with v1.0 Enterprise data.
The one restriction that may be important is that the plugin assumes
@@ -31,27 +31,27 @@ demands this, but the 1.0 spec does not make this restriction.)
HOW USERS/COURSES ARE MATCHED AGAINST MOODLE'S DATABASE
-IMS Enterprise data typically contains a "sourcedid" for each person
-or group (course) record, which represents the canonical identifier
-used by the source system. This is separate from the "userid" for a
-person, which is also present in the data and should represent the
-login userid which a person is intended to use in Moodle. (In some
+IMS Enterprise data typically contains a "sourcedid" for each person
+or group (course) record, which represents the canonical identifier
+used by the source system. This is separate from the "userid" for a
+person, which is also present in the data and should represent the
+login userid which a person is intended to use in Moodle. (In some
systems these may have the same value.)
-This script uses the "sourcedid" as the lookup to determine if the
-user/course exists in the database, in both cases looking at the
-"idnumber" field. This "idnumber" is not typically displayed in
-Moodle. When creating a user, the "userid" field must not be blank,
+This script uses the "sourcedid" as the lookup to determine if the
+user/course exists in the database, in both cases looking at the
+"idnumber" field. This "idnumber" is not typically displayed in
+Moodle. When creating a user, the "userid" field must not be blank,
because it is stored as the user's Moodle login ID.
TECHNICAL NOTE
-The script uses an optimised pattern-matching (regex) method for
+The script uses an optimised pattern-matching (regex) method for
processing the XML, rather than any built-in XML handling. This is for
-two reasons: firstly, because some systems produce very sloppy
-(even invalid) XML and we'd like to be able to process it anyway; and
-secondly, because PHP 4 and PHP 5 handle XML differently, and we'd
+two reasons: firstly, because some systems produce very sloppy
+(even invalid) XML and we'd like to be able to process it anyway; and
+secondly, because PHP 4 and PHP 5 handle XML differently, and we'd
like to be independent of that changeover.
diff --git a/enrol/imsenterprise/TODO.txt b/enrol/imsenterprise/TODO.txt
index d4b56d8def5..f7f890e3328 100644
--- a/enrol/imsenterprise/TODO.txt
+++ b/enrol/imsenterprise/TODO.txt
@@ -8,12 +8,12 @@ TO DO:
- Support for enrolling using multiple files? At present only one filename
is supported. Some systems may wish/need to do multiple. This may be tricky
- since multiple filepaths may be too long for a single moodle config
+ since multiple filepaths may be too long for a single moodle config
variable (255 chars max)
- Process group's "relationship"?
-- Activate handling, dependent upon acceptance of
+- Activate handling, dependent upon acceptance of
modification to Moodle's gdlib.php
@@ -22,7 +22,7 @@ DONE:
v0.6:
-- Reduce processing from two passes to one pass (dependent on tags
+- Reduce processing from two passes to one pass (dependent on tags
coming after any person/group tags to which they refer)
- The log data should NOT contain any personal information! NO STUDENT NAMES
diff --git a/enrol/imsenterprise/config.html b/enrol/imsenterprise/config.html
index f53c7162208..c0fc8461081 100644
--- a/enrol/imsenterprise/config.html
+++ b/enrol/imsenterprise/config.html
@@ -24,7 +24,7 @@
enrol_mailadmins) echo "checked=\"checked\"" ?> />
- help_icon(moodle_help_icon::make('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ help_icon(moodle_help_icon::make('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise')); ?>