From 4317f92f3f68b09ffc55599022076c6c60740552 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 1 Nov 2009 12:51:40 +0000 Subject: [PATCH] MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup --- enrol/README.txt | 38 ++-- enrol/authorize/authorizenet.class.php | 4 +- enrol/authorize/config_form.php | 4 +- enrol/authorize/const.php | 4 +- enrol/authorize/db/access.php | 4 +- enrol/authorize/db/upgrade.php | 4 +- enrol/authorize/enrol.php | 4 +- enrol/authorize/enrol_form.php | 10 +- enrol/authorize/index.php | 2 +- enrol/authorize/localfuncs.php | 4 +- enrol/authorize/locallib.php | 6 +- enrol/authorize/uploadcsv.php | 6 +- enrol/authorize/version.php | 4 +- enrol/database/config.html | 16 +- enrol/database/enrol.php | 6 +- enrol/database/enrol_database_sync.php | 12 +- enrol/flatfile/enrol.php | 40 ++--- enrol/imsenterprise/README.txt | 38 ++-- enrol/imsenterprise/TODO.txt | 6 +- enrol/imsenterprise/config.html | 14 +- enrol/imsenterprise/enrol.php | 6 +- .../entv1p1_conformance_summary.html | 4 +- .../examples/example-grouped.xml | 6 +- enrol/imsenterprise/examples/example.xml | 4 +- enrol/index.html | 2 +- enrol/ldap/config.html | 22 +-- enrol/ldap/enrol.php | 164 +++++++++--------- enrol/ldap/enrol_ldap_sync.php | 8 +- enrol/manual/config.html | 4 +- enrol/manual/enrol.php | 8 +- enrol/mnet/allowed_courses.php | 2 +- enrol/mnet/enrol.php | 26 +-- enrol/paypal/config.html | 2 +- enrol/paypal/db/upgrade.php | 10 +- enrol/paypal/enrol.php | 4 +- enrol/paypal/ipn.php | 18 +- enrol/paypal/return.php | 6 +- enrol/paypal/version.php | 4 +- filter/activitynames/filter.php | 8 +- filter/algebra/algebradebug.php | 4 +- filter/algebra/filter.php | 2 +- filter/algebra/pix.php | 2 +- filter/censor/README.txt | 4 +- filter/censor/filter.php | 12 +- filter/censor/filtersettings.php | 4 +- filter/emailprotect/filter.php | 8 +- filter/local_settings_form.php | 3 +- filter/manage.php | 4 +- filter/mediaplugin/eolas_fix.js | 2 +- filter/mediaplugin/filter.php | 8 +- filter/mediaplugin/filtersettings.php | 4 +- filter/mediaplugin/flvplayer.README.txt | 2 +- filter/multilang/README.txt | 6 +- filter/multilang/filter.php | 6 +- filter/multilang/filtersettings.php | 4 +- filter/tex/displaytex.php | 2 +- filter/tex/filter.php | 10 +- filter/tex/filtersettings.php | 4 +- filter/tex/latex.php | 24 +-- filter/tex/lib.php | 4 +- filter/tex/texdebug.php | 16 +- filter/tex/texed.php | 2 +- filter/tidy/filter.php | 16 +- portfolio/add.php | 2 +- portfolio/already.php | 2 +- portfolio/file.php | 2 +- .../simpletest/testportfoliopluginboxnet.php | 4 +- portfolio/type/boxnet/version.php | 2 +- portfolio/type/download/file.php | 2 +- .../testportfolioplugindownload.php | 4 +- portfolio/type/download/version.php | 2 +- portfolio/type/flickr/version.php | 2 +- portfolio/type/googledocs/db/events.php | 6 +- portfolio/type/googledocs/lib.php | 9 +- portfolio/type/googledocs/version.php | 4 +- portfolio/type/mahara/db/upgrade.php | 2 +- portfolio/type/mahara/lib.php | 2 +- portfolio/type/mahara/preconfig.php | 2 +- portfolio/type/mahara/version.php | 2 +- portfolio/type/picasa/db/events.php | 6 +- portfolio/type/picasa/lib.php | 9 +- portfolio/type/picasa/version.php | 4 +- repository/alfresco/repository.class.php | 5 +- repository/boxnet/repository.class.php | 9 +- repository/draft/repository.class.php | 3 +- repository/filesystem/repository.class.php | 2 +- repository/flickr/repository.class.php | 3 +- repository/flickr_public/image.php | 6 +- repository/flickr_public/repository.class.php | 5 +- repository/googledocs/repository.class.php | 13 +- repository/local/repository.class.php | 3 +- repository/mahara/repository.class.php | 8 +- repository/manage_instances.php | 2 +- repository/picasa/repository.class.php | 13 +- repository/remotemoodle/repository.class.php | 3 +- repository/repository.css | 10 +- repository/repository.src.js | 24 +-- repository/s3/S3.php | 2 - repository/s3/repository.class.php | 4 +- repository/upload/repository.class.php | 3 +- repository/url/lib.php | 6 +- repository/url/repository.class.php | 3 +- repository/webdav/repository.class.php | 1 - repository/wikimedia/repository.class.php | 6 +- repository/ws.php | 2 +- repository/youtube/repository.class.php | 3 +- 106 files changed, 437 insertions(+), 457 deletions(-) diff --git a/enrol/README.txt b/enrol/README.txt index 83609d322d..cf4ddef282 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 18a7ae80ff..1f17a35f76 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 b0da0f807b..26d6bc7e2d 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)) { enrol_currency: - enrol_currency, false); $select->nothingvalue = ''; echo $OUTPUT->select($select); diff --git a/enrol/authorize/const.php b/enrol/authorize/const.php index 650dbbeb8c..16030df37d 100644 --- a/enrol/authorize/const.php +++ b/enrol/authorize/const.php @@ -1,4 +1,4 @@ - + diff --git a/enrol/authorize/db/access.php b/enrol/authorize/db/access.php index 084cbcbc1a..954bf74f06 100644 --- a/enrol/authorize/db/access.php +++ b/enrol/authorize/db/access.php @@ -1,4 +1,4 @@ - + diff --git a/enrol/authorize/db/upgrade.php b/enrol/authorize/db/upgrade.php index 592ec1b3f7..424a71bc6b 100644 --- a/enrol/authorize/db/upgrade.php +++ b/enrol/authorize/db/upgrade.php @@ -1,4 +1,4 @@ - + diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index c74f05ea98..c2afaea55f 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -1,4 +1,4 @@ -dirroot.'/enrol/enrol.class.php'); require_once($CFG->dirroot.'/enrol/authorize/const.php'); @@ -902,4 +902,4 @@ class enrolment_plugin_authorize $rs->close(); } } -?> + diff --git a/enrol/authorize/enrol_form.php b/enrol/authorize/enrol_form.php index e60d5bc424..60567f42f6 100755 --- a/enrol/authorize/enrol_form.php +++ b/enrol/authorize/enrol_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'); @@ -74,13 +74,13 @@ class enrol_authorize_form extends moodleform $mform->setType('ccexpireyyyy', PARAM_INT); $mform->setDefault('ccexpiremm', ''); $mform->setDefault('ccexpireyyyy', ''); - + $creditcardsmenu = array('' => get_string('choose')) + get_list_of_creditcards(); $mform->addElement('select', 'cctype', get_string('cctype', 'enrol_authorize'), $creditcardsmenu); $mform->setType('cctype', PARAM_ALPHA); $mform->addRule('cctype', get_string('missingcctype', 'enrol_authorize'), 'required', null, 'client'); $mform->setDefault('cctype', ''); - + $mform->addElement('text', 'cvv', get_string('ccvv', 'enrol_authorize'), 'size="4"'); $mform->setHelpButton('cvv', array('authorize/cvv',get_string('ccvv', 'enrol_authorize'),'enrol'), true); $mform->setType('cvv', PARAM_ALPHANUM); @@ -95,7 +95,7 @@ class enrol_authorize_form extends moodleform $ccauthgrp[] = &$mform->createElement('text', 'ccauthcode', '', 'size="8"'); $mform->addGroup($ccauthgrp, 'ccauthgrp', get_string('authcode', 'enrol_authorize'), ' ', false); $mform->setHelpButton('ccauthgrp', array('authorize/authcode',get_string('authcode', 'enrol_authorize'),'enrol'), true); - + $ccauthgrprules = array(); $ccauthgrprules['ccauthcode'][] = array(get_string('missingccauthcode', 'enrol_authorize'), 'numeric', null, 'client'); $mform->addGroupRule('ccauthgrp', $ccauthgrprules); @@ -345,4 +345,4 @@ class enrol_authorize_form extends moodleform } } -?> + diff --git a/enrol/authorize/index.php b/enrol/authorize/index.php index 8f2bf5bbe6..986579f31b 100644 --- a/enrol/authorize/index.php +++ b/enrol/authorize/index.php @@ -50,4 +50,4 @@ else { authorize_print_order($orderid); } -?> + diff --git a/enrol/authorize/localfuncs.php b/enrol/authorize/localfuncs.php index be4b7a17ef..29870c508c 100644 --- a/enrol/authorize/localfuncs.php +++ b/enrol/authorize/localfuncs.php @@ -1,4 +1,4 @@ -libdir.'/eventslib.php'); @@ -261,4 +261,4 @@ function authorize_verify_account() return $ret; } -?> + diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 2da6dd27f5..1e11fb555f 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -1,4 +1,4 @@ - $authstrs->reviewfailed, AN_STATUS_TEST => $authstrs->tested ); - + $popupmenu .= $OUTPUT->select(html_select::make_popup_form($baseurl.'&course='.$courseid, 'status', $statusmenu, 'statusmenu', $status)); if ($canmanagepayments) { $popupmenu .= '
'; @@ -682,4 +682,4 @@ function authorize_print_action_button($orderid, $do, $suborderid=0, $confirm=fa } return $ret; } -?> + diff --git a/enrol/authorize/uploadcsv.php b/enrol/authorize/uploadcsv.php index de3219ee76..dfa0617613 100644 --- a/enrol/authorize/uploadcsv.php +++ b/enrol/authorize/uploadcsv.php @@ -231,7 +231,7 @@ function authorize_process_csv($filename) /// Send email to admin if (!empty($ignoredlines)) { $admin = get_admin(); - + $eventdata = new object(); $eventdata->modulename = 'moodle'; $eventdata->userfrom = $admin; @@ -240,7 +240,7 @@ function authorize_process_csv($filename) $eventdata->fullmessage = $ignoredlines; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; events_trigger('message_send', $eventdata); } @@ -253,4 +253,4 @@ function authorize_process_csv($filename) notice("Done...
Imported: $imported
Updated: $updated
Ignored: $ignored"); } -?> + diff --git a/enrol/authorize/version.php b/enrol/authorize/version.php index d5270fd7d1..933bb1663f 100755 --- a/enrol/authorize/version.php +++ b/enrol/authorize/version.php @@ -1,6 +1,6 @@ -version = 2009042700; $plugin->requires = 2007101507; -?> + diff --git a/enrol/database/config.html b/enrol/database/config.html index 3391f0bc40..aa838ddeb8 100644 --- a/enrol/database/config.html +++ b/enrol/database/config.html @@ -11,7 +11,7 @@ enrol_dbtype: - nothingvalue = ''; echo $OUTPUT->select($select); ?> - + @@ -33,10 +33,10 @@ enrol_dbhost: - enrol_dbhost)) { $frm->enrol_dbhost = ''; - } + } ?> @@ -161,9 +161,9 @@ $sitecontext = get_context_instance(CONTEXT_SYSTEM); $assignableroles = get_assignable_roles($sitecontext); $assignableroles = array('' => get_string('default')) + $assignableroles; - + echo $OUTPUT->select(html_select::make($assignableroles, 'enrol_db_defaultcourseroleid', $frm->enrol_db_defaultcourseroleid, false)); - if (isset($err['enrol_db_defaultcourseroleid'])) echo $OUTPUT->error_text($err['enrol_db_defaultcourseroleid']); + if (isset($err['enrol_db_defaultcourseroleid'])) echo $OUTPUT->error_text($err['enrol_db_defaultcourseroleid']); ?> @@ -181,7 +181,7 @@ select(html_select::make($yesno, "enrol_db_autocreate", $frm->enrol_db_autocreate, false)); - if (isset($err["enrol_db_autocreate"])) echo $OUTPUT->error_text($err["enrol_db_autocreate"]); + if (isset($err["enrol_db_autocreate"])) echo $OUTPUT->error_text($err["enrol_db_autocreate"]); ?> @@ -197,7 +197,7 @@ $parentlist = array(); make_categories_list($displaylist, $parentlist); echo $OUTPUT->select(html_select::make($displaylist, "enrol_db_category", $frm->enrol_db_category, false)); - + ?> error_text($err["enrol_db_category"]); ?> diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index 78271630da..0665ab713b 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 df599c8fa9..8e2fa82ac9 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 e68230d50d..a34d219b9e 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 2f88dc144d..ff5ae8c1fc 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 d4b56d8def..f7f890e332 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 f53c716220..c0fc846108 100644 --- a/enrol/imsenterprise/config.html +++ b/enrol/imsenterprise/config.html @@ -24,7 +24,7 @@ enrol_mailadmins) echo "checked=\"checked\"" ?> /> - + @@ -58,7 +58,7 @@ enrol_fixcaseusernames) echo "checked=\"checked\"" ?> /> - + @@ -68,7 +68,7 @@ enrol_fixcasepersonalnames) echo "checked=\"checked\"" ?> /> - + @@ -78,7 +78,7 @@ enrol_imssourcedidfallback) 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')); ?> sits:vision 28/Oct/2005 @@ -26,7 +26,7 @@ sits:vision 90078058 - + IMGBY26 Chloe Eva Piotrowska @@ -126,7 +126,7 @@ 90078058 - + IMGBY26 1 green team diff --git a/enrol/imsenterprise/examples/example.xml b/enrol/imsenterprise/examples/example.xml index a66cf07eba..7397b0c067 100644 --- a/enrol/imsenterprise/examples/example.xml +++ b/enrol/imsenterprise/examples/example.xml @@ -1,5 +1,5 @@ - - + + sits:vision 28/Oct/2005 diff --git a/enrol/index.html b/enrol/index.html index 8d1c8b69c3..8b13789179 100644 --- a/enrol/index.html +++ b/enrol/index.html @@ -1 +1 @@ - + diff --git a/enrol/ldap/config.html b/enrol/ldap/config.html index f0ec3bbb21..0dc63920b7 100755 --- a/enrol/ldap/config.html +++ b/enrol/ldap/config.html @@ -75,13 +75,13 @@ foreach($roles as $role) { // autocreate if (!isset($frm->enrol_ldap_autocreate)) { - $frm->enrol_ldap_autocreate = false; + $frm->enrol_ldap_autocreate = false; } if (!isset($frm->enrol_ldap_category)) { - $frm->enrol_ldap_category = 1; + $frm->enrol_ldap_category = 1; } if (!isset($frm->enrol_ldap_template)) { - $frm->enrol_ldap_template = ''; + $frm->enrol_ldap_template = ''; } ?> @@ -109,7 +109,7 @@ if (!isset($frm->enrol_ldap_template)) { $versions[2] = "2"; $versions[3] = "3"; echo $OUTPUT->select(html_select::make($versions, "enrol_ldap_version", $frm->enrol_ldap_version, false)); - if (isset($err["enrol_ldap_version"])) echo $OUTPUT->error_text($err["enrol_ldap_version"]); + if (isset($err["enrol_ldap_version"])) echo $OUTPUT->error_text($err["enrol_ldap_version"]); ?> @@ -219,9 +219,9 @@ if (!isset($frm->enrol_ldap_template)) { - name, ENT_COMPAT, 'UTF-8'); ?> - - + name, ENT_COMPAT, 'UTF-8'); ?> + + @@ -262,7 +262,7 @@ if (!isset($frm->enrol_ldap_template)) { - + @@ -320,7 +320,7 @@ if (!isset($frm->enrol_ldap_template)) { enrol_ldap_course_summary: - + error_text($err["enrol_ldap_course_summary"]); ?>
@@ -352,7 +352,7 @@ if (!isset($frm->enrol_ldap_template)) { select(html_select::make(array('0'=>'no','1'=>'yes'), "enrol_ldap_autocreate", $frm->enrol_ldap_autocreate, false)); - if (isset($err["enrol_ldap_autocreate"])) echo $OUTPUT->error_text($err["enrol_ldap_autocreate"]); + if (isset($err["enrol_ldap_autocreate"])) echo $OUTPUT->error_text($err["enrol_ldap_autocreate"]); ?> @@ -367,7 +367,7 @@ if (!isset($frm->enrol_ldap_template)) { $parentlist = array(); make_categories_list($displaylist, $parentlist); echo $OUTPUT->select(html_select::make($displaylist, "enrol_ldap_category", $frm->enrol_ldap_category, false)); - + ?> error_text($err["enrol_ldap_category"]); ?> diff --git a/enrol/ldap/enrol.php b/enrol/ldap/enrol.php index 7a1d6e815b..1b3fde09f2 100755 --- a/enrol/ldap/enrol.php +++ b/enrol/ldap/enrol.php @@ -4,8 +4,8 @@ require_once("$CFG->dirroot/enrol/enrol.class.php"); class enrolment_plugin_ldap { - var $log; - + var $log; + var $enrol_localcoursefield = 'idnumber'; /** @@ -23,7 +23,7 @@ function setup_enrolments(&$user) { echo $OUTPUT->notification("[ENROL_LDAP] LDAP-module cannot connect to server: {$CFG->enrol_ldap_host_url}"); return false; } - + // we are connected OK, continue... // Get all the possible roles @@ -37,7 +37,7 @@ function setup_enrolments(&$user) { if (!$roleassignments) { $roleassignments = array(); } - + // Get the ones that came from LDAP $ldap_assignments = array_filter($roleassignments, create_function('$x', 'return $x->enrol == \'ldap\';')); @@ -46,20 +46,20 @@ function setup_enrolments(&$user) { // Get enrolments for each type of role from LDAP. foreach($roles as $role) { $enrolments = $this->find_ext_enrolments( - $ldap_connection, - $user->idnumber , + $ldap_connection, + $user->idnumber , $role); //error_log('[ENROL_LDAP] LDAP reports ' . count($enrolments) . ' enrolments of type ' . $role->shortname . '.'); foreach ($enrolments as $enrol){ - + $course_ext_id = $enrol[$CFG->enrol_ldap_course_idnumber][0]; if(empty($course_ext_id)){ error_log("[ENROL_LDAP] The course external id is invalid!\n"); continue; // next; skip this one! } - + // create the course ir required $course_obj = $DB->get_record('course', array($this->enrol_localcoursefield, $course_ext_id)); @@ -72,18 +72,18 @@ function setup_enrolments(&$user) { error_log("[ENROL_LDAP] User $user->username enrolled to a nonexistant course $course_ext_id \n"); } } - + // deal with enrolment in the moodle db - if (!empty($course_obj)) { // does course exist now? - + if (!empty($course_obj)) { // does course exist now? + $context = get_context_instance(CONTEXT_COURSE, $course_obj->id); //$courseroles = get_user_roles($context, $user->id); - + if (!$DB->get_record('role_assignments', array('roleid'=>$role->id, 'userid'=>$user->id, 'contextid'=>$context->id))) { //error_log("[ENROL_LDAP] Assigning role '{$role->name}' to {$user->id} ({$user->username}) in course {$course_obj->id} ({$course_obj->shortname})"); if (!role_assign($role->id, $user->id, 0, $context->id, 0, 0, 0, 'ldap')){ error_log("[ENROL_LDAP] Failed to assign role '{$role->name}' to $user->id ($user->username) into course $course_obj->id ($course_obj->shortname)"); - } + } } else { //error_log("[ENROL_LDAP] Role '{$role->name}' already assigned to {$user->id} ({$user->username}) in course {$course_obj->id} ({$course_obj->shortname})"); } @@ -113,7 +113,7 @@ function setup_enrolments(&$user) { @ldap_close($ldap_connection); //error_log('[ENROL_LDAP] finished with setup_enrolments'); - + return true; } @@ -135,7 +135,7 @@ function sync_enrolments($type, $enrol = false) { echo $OUTPUT->notification("LDAP-module cannot connect to server: $CFG->ldap_host_url"); return false; } - + // we are connected OK, continue... $this->enrol_ldap_bind($ldap_connection); @@ -143,7 +143,7 @@ function sync_enrolments($type, $enrol = false) { $ldap_contexts = explode(";",$CFG->{'enrol_ldap_contexts_role'.$role->id}); // get all the fields we will want for the potential course creation - // as they are light. don't get membership -- potentially a lot of data. + // as they are light. don't get membership -- potentially a lot of data. $ldap_fields_wanted = array( 'dn', $CFG->enrol_ldap_course_idnumber); if (!empty($CFG->enrol_ldap_course_fullname)){ array_push($ldap_fields_wanted, $CFG->enrol_ldap_course_fullname); @@ -159,11 +159,11 @@ function sync_enrolments($type, $enrol = false) { } // define the search pattern - if (!empty($CFG->enrol_ldap_objectclass)){ + if (!empty($CFG->enrol_ldap_objectclass)){ $ldap_search_pattern='(objectclass='.$CFG->enrol_ldap_objectclass.')'; } else { $ldap_search_pattern="(objectclass=*)"; - + } // first, pack the sortorder... @@ -174,19 +174,19 @@ function sync_enrolments($type, $enrol = false) { $context = trim($context); if ($CFG->enrol_ldap_search_sub){ //use ldap_search to find first user from subtree - $ldap_result = @ldap_search($ldap_connection, - $context, + $ldap_result = @ldap_search($ldap_connection, + $context, $ldap_search_pattern, $ldap_fields_wanted); } else { //search only in this context - $ldap_result = @ldap_list($ldap_connection, - $context, + $ldap_result = @ldap_list($ldap_connection, + $context, $ldap_search_pattern, $ldap_fields_wanted,0,0); } - + // check and push results $records = $ldap_result ? ldap_get_entries($ldap_connection,$ldap_result) @@ -195,9 +195,9 @@ function sync_enrolments($type, $enrol = false) { // ldap libraries return an odd array, really. fix it: $flat_records=array(); for ($c=0;$c<$records['count'];$c++) { - array_push($flat_records, $records["$c"]); + array_push($flat_records, $records["$c"]); } - // free mem -- is there a leak? + // free mem -- is there a leak? $records=0; $ldap_result=0; if (count($flat_records)) { @@ -206,7 +206,7 @@ function sync_enrolments($type, $enrol = false) { foreach($flat_records as $course){ $idnumber = $course{$CFG->enrol_ldap_course_idnumber}[0]; print "== Synching $idnumber\n"; - // does the course exist in moodle already? + // does the course exist in moodle already? $course_obj = false; $course_obj = $DB->get_record('course', array($this->enrol_localcoursefield=>$idnumber)); if (!is_object($course_obj)) { @@ -228,17 +228,17 @@ function sync_enrolments($type, $enrol = false) { $context = get_context_instance(CONTEXT_COURSE, $course_obj->id); // pull the ldap membership into a nice array - // this is an odd array -- mix of hash and array -- + // this is an odd array -- mix of hash and array -- $ldapmembers=array(); if(array_key_exists('enrol_ldap_memberattribute_role'.$role->id, $CFG) && !empty($CFG->{'enrol_ldap_memberattribute_role'.$role->id}) && !empty($course[strtolower($CFG->{'enrol_ldap_memberattribute_role'.$role->id} ) ])){ // may have no membership! - $ldapmembers = $course[strtolower($CFG->{'enrol_ldap_memberattribute_role'.$role->id} )]; + $ldapmembers = $course[strtolower($CFG->{'enrol_ldap_memberattribute_role'.$role->id} )]; unset($ldapmembers['count']); // remove oddity ;) } - + // prune old ldap enrolments // hopefully they'll fit in the max buffer size for the RDBMS $sql = ' @@ -267,20 +267,20 @@ function sync_enrolments($type, $enrol = false) { } } } - - // insert current enrolments + + // insert current enrolments // bad we can't do INSERT IGNORE with postgres... foreach ($ldapmembers as $ldapmember) { $sql = 'SELECT id,1 FROM {user} ' ." WHERE idnumber=?"; - $member = $DB->get_record_sql($sql, array($ldapmember)); -// print "sql: $sql \nidnumber = ".$ldapmember." \n".var_dump($member); + $member = $DB->get_record_sql($sql, array($ldapmember)); +// print "sql: $sql \nidnumber = ".$ldapmember." \n".var_dump($member); if(empty($member) || empty($member->id)){ print "Could not find user $ldapmember, skipping\n"; continue; } $member = $member->id; - if (!$DB->get_record('role_assignments', array('roleid'=>$role->id, + if (!$DB->get_record('role_assignments', array('roleid'=>$role->id, 'contextid'=>$context->id, 'userid'=>$member, 'enrol'=>'ldap'))){ if (role_assign($role->id, $member, 0, $context->id, 0, 0, 0, 'ldap')){ print "Assigned role $type to $member ($ldapmember) for course $course_obj->id ($course_obj->shortname)\n"; @@ -293,10 +293,10 @@ function sync_enrolments($type, $enrol = false) { } } } - + // we are done now, a bit of housekeeping fix_course_sortorder(); - + @ldap_close($ldap_connection); return true; } @@ -312,7 +312,7 @@ function config_form($frm) { global $CFG; $this->check_legacy_config(); - + include("$CFG->dirroot/enrol/ldap/config.html"); } @@ -331,7 +331,7 @@ function process_config($config) { $config->enrol_ldap_version = ''; } set_config('enrol_ldap_version', $config->enrol_ldap_version); - + if (!isset ($config->enrol_ldap_bind_dn)) { $config->enrol_ldap_bind_dn = ''; } @@ -340,58 +340,58 @@ function process_config($config) { if (!isset ($config->enrol_ldap_bind_pw)) { $config->enrol_ldap_bind_pw = ''; } - set_config('enrol_ldap_bind_pw', $config->enrol_ldap_bind_pw); - + set_config('enrol_ldap_bind_pw', $config->enrol_ldap_bind_pw); + if (!isset ($config->enrol_ldap_objectclass)) { $config->enrol_ldap_objectclass = ''; } - set_config('enrol_ldap_objectclass', $config->enrol_ldap_objectclass); - + set_config('enrol_ldap_objectclass', $config->enrol_ldap_objectclass); + if (!isset ($config->enrol_ldap_category)) { $config->enrol_ldap_category = ''; } - set_config('enrol_ldap_category', $config->enrol_ldap_category); - + set_config('enrol_ldap_category', $config->enrol_ldap_category); + if (!isset ($config->enrol_ldap_template)) { $config->enrol_ldap_template = ''; } - set_config('enrol_ldap_template', $config->enrol_ldap_template); - + set_config('enrol_ldap_template', $config->enrol_ldap_template); + if (!isset ($config->enrol_ldap_course_fullname)) { $config->enrol_ldap_course_fullname = ''; } - set_config('enrol_ldap_course_fullname', $config->enrol_ldap_course_fullname); + set_config('enrol_ldap_course_fullname', $config->enrol_ldap_course_fullname); if (!isset ($config->enrol_ldap_course_shortname)) { $config->enrol_ldap_course_shortname = ''; } - set_config('enrol_ldap_course_shortname', $config->enrol_ldap_course_shortname); - + set_config('enrol_ldap_course_shortname', $config->enrol_ldap_course_shortname); + if (!isset ($config->enrol_ldap_course_summary)) { $config->enrol_ldap_course_summary = ''; } - set_config('enrol_ldap_course_summary', $config->enrol_ldap_course_summary); - + set_config('enrol_ldap_course_summary', $config->enrol_ldap_course_summary); + if (!isset ($config->enrol_ldap_course_idnumber)) { $config->enrol_ldap_course_idnumber = ''; } - set_config('enrol_ldap_course_idnumber', $config->enrol_ldap_course_idnumber); - + set_config('enrol_ldap_course_idnumber', $config->enrol_ldap_course_idnumber); + if (!isset ($config->enrol_localcoursefield)) { $config->enrol_localcoursefield = ''; } set_config('enrol_localcoursefield', $config->enrol_localcoursefield); - + if (!isset ($config->enrol_ldap_user_memberfield)) { $config->enrol_ldap_user_memberfield = ''; } - set_config('enrol_ldap_user_memberfield', $config->enrol_ldap_user_memberfield); - + set_config('enrol_ldap_user_memberfield', $config->enrol_ldap_user_memberfield); + if (!isset ($config->enrol_ldap_search_sub)) { $config->enrol_ldap_search_sub = '0'; } - set_config('enrol_ldap_search_sub', $config->enrol_ldap_search_sub); - + set_config('enrol_ldap_search_sub', $config->enrol_ldap_search_sub); + if (!isset ($config->enrol_ldap_autocreate)) { $config->enrol_ldap_autocreate = '0'; } @@ -402,11 +402,11 @@ function process_config($config) { if (!isset($config->{'enrol_ldap_contexts_role'.$role->id})) { $config->{'enrol_ldap_contexts_role'.$role->id} = ''; } - + if (!isset($config->{'enrol_ldap_memberattribute_role'.$role->id})) { $config->{'enrol_ldap_memberattribute_role'.$role->id} = ''; } - + set_config('enrol_ldap_contexts_role'.$role->id, $config->{'enrol_ldap_contexts_role'.$role->id}); set_config('enrol_ldap_memberattribute_role'.$role->id, $config->{'enrol_ldap_memberattribute_role'.$role->id}); } @@ -427,7 +427,7 @@ function enrol_ldap_connect(){ if (!empty($CFG->enrol_ldap_bind_dn)) { $bind = ldap_bind( $result, - $CFG->enrol_ldap_bind_dn, + $CFG->enrol_ldap_bind_dn, $CFG->enrol_ldap_bind_pw ); if (!$bind) { echo $OUTPUT->notification("Error in binding to LDAP server"); @@ -456,11 +456,11 @@ function enrol_ldap_bind($ldap_connection){ } } else { - //bind anonymously + //bind anonymously if ( !ldap_bind($ldap_connection)){ echo $OUTPUT->notification("Error: could not bind ldap anonymously"); return false; - } + } } return true; @@ -469,13 +469,13 @@ function enrol_ldap_bind($ldap_connection){ function find_ext_enrolments ($ldap_connection, $memberuid, $role){ /// role is a record from the mdl_role table /// return multidimentional array array with of courses (at least dn and idnumber) -/// +/// global $CFG; if(empty($memberuid)) { // No "idnumber" stored for this user, so no LDAP enrolments return array(); - } + } //default return value $courses = array(); @@ -485,7 +485,7 @@ function find_ext_enrolments ($ldap_connection, $memberuid, $role){ $ldap_contexts = explode(";",$CFG->{'enrol_ldap_contexts_role'.$role->id}); // get all the fields we will want for the potential course creation - // as they are light. don't get membership -- potentially a lot of data. + // as they are light. don't get membership -- potentially a lot of data. $ldap_fields_wanted = array( 'dn', $CFG->enrol_ldap_course_idnumber); if (!empty($CFG->enrol_ldap_course_fullname)){ array_push($ldap_fields_wanted, $CFG->enrol_ldap_course_fullname); @@ -499,7 +499,7 @@ function find_ext_enrolments ($ldap_connection, $memberuid, $role){ // define the search pattern $ldap_search_pattern = "(".$CFG->{'enrol_ldap_memberattribute_role'.$role->id}."=".$memberuid.")"; - if (!empty($CFG->enrol_ldap_objectclass)){ + if (!empty($CFG->enrol_ldap_objectclass)){ $ldap_search_pattern='(&(objectclass='.$CFG->enrol_ldap_objectclass.')'.$ldap_search_pattern.')'; } @@ -508,31 +508,31 @@ function find_ext_enrolments ($ldap_connection, $memberuid, $role){ if (empty($context)) { continue; // next; } - + if ($CFG->enrol_ldap_search_sub){ //use ldap_search to find first user from subtree - $ldap_result = ldap_search($ldap_connection, - $context, + $ldap_result = ldap_search($ldap_connection, + $context, $ldap_search_pattern, $ldap_fields_wanted); } else { //search only in this context - $ldap_result = ldap_list($ldap_connection, - $context, + $ldap_result = ldap_list($ldap_connection, + $context, $ldap_search_pattern, $ldap_fields_wanted); } - + // check and push results - $records = ldap_get_entries($ldap_connection,$ldap_result); + $records = ldap_get_entries($ldap_connection,$ldap_result); // ldap libraries return an odd array, really. fix it: $flat_records=array(); for ($c=0;$c<$records['count'];$c++) { - array_push($flat_records, $records["$c"]); + array_push($flat_records, $records["$c"]); } - + if (count($flat_records)) { $courses = array_merge($courses, $flat_records); } @@ -543,7 +543,7 @@ function find_ext_enrolments ($ldap_connection, $memberuid, $role){ // will create the moodle course from the template // course_ext is an array as obtained from ldap -- flattened somewhat -// NOTE: if you pass true for $skip_fix_course_sortorder +// NOTE: if you pass true for $skip_fix_course_sortorder // you will want to call fix_course_sortorder() after your are done // with course creation function create_course ($course_ext,$skip_fix_course_sortorder=0){ @@ -566,7 +566,7 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){ $course->shortname = $course_ext[$CFG->enrol_ldap_course_shortname][0]; if ( empty($course->idnumber) || empty($course->fullname) - || empty($course->shortname) ) { + || empty($course->shortname) ) { // we are in trouble! error_log("Cannot create course: missing required data from the LDAP record!"); error_log(var_export($course, true)); @@ -596,8 +596,8 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){ $course = $DB->get_record('course', array('id' => $newcourseid)); blocks_add_default_course_blocks($course); - if (!$skip_fix_course_sortorder){ - fix_course_sortorder(); + if (!$skip_fix_course_sortorder){ + fix_course_sortorder(); } add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "enrol/ldap auto-creation"); } else { @@ -605,7 +605,7 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){ echo $OUTPUT->notification("Serious Error! Could not create the new course!"); return false; } - + return $newcourseid; } @@ -642,7 +642,7 @@ function check_legacy_config () { unset_config('enrol_ldap_teacher_contexts'); } - + if (isset($CFG->enrol_ldap_teacher_memberattribute)) { if (isset($teacher_role) or $teacher_role = $DB->get_record('role', array('shortname'=>'teacher'))) { diff --git a/enrol/ldap/enrol_ldap_sync.php b/enrol/ldap/enrol_ldap_sync.php index 4d516941c7..c49995f329 100755 --- a/enrol/ldap/enrol_ldap_sync.php +++ b/enrol/ldap/enrol_ldap_sync.php @@ -5,7 +5,7 @@ exit; } error_reporting(E_ALL); - + require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file. require_once($CFG->dirroot . '/course/lib.php'); @@ -26,10 +26,10 @@ foreach ($roles as $role) { $enrol->sync_enrolments($role->shortname, true); } - + // sync metacourses if (function_exists('sync_metacourses')) { sync_metacourses(); } - -?> + + diff --git a/enrol/manual/config.html b/enrol/manual/config.html index cd6d6e5569..d116442fd4 100644 --- a/enrol/manual/config.html +++ b/enrol/manual/config.html @@ -3,13 +3,13 @@ enrol_manual_keyholderrole: - $role) { $rolenames[$id]=$role->name; } - echo $OUTPUT->select(html_select::make($rolenames, 'enrol_manual_keyholderrole', $frm->enrol_manual_keyholderrole)); + echo $OUTPUT->select(html_select::make($rolenames, 'enrol_manual_keyholderrole', $frm->enrol_manual_keyholderrole)); ?> diff --git a/enrol/manual/enrol.php b/enrol/manual/enrol.php index 08fc51d57e..98300e277d 100644 --- a/enrol/manual/enrol.php +++ b/enrol/manual/enrol.php @@ -1,4 +1,4 @@ -fullmessage = $strexpirynotifystudentsemail; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; events_trigger('message_send', $eventdata); } } @@ -354,7 +354,7 @@ function cron() { $eventdata->fullmessage = $strexpirynotifyemail; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; events_trigger('message_send', $eventdata); } } @@ -455,4 +455,4 @@ function print_enrolmentkeyfrom($course) { } /// end of class -?> + diff --git a/enrol/mnet/allowed_courses.php b/enrol/mnet/allowed_courses.php index 5781c89eb8..244f891482 100644 --- a/enrol/mnet/allowed_courses.php +++ b/enrol/mnet/allowed_courses.php @@ -124,7 +124,7 @@ if ($courses = $DB->get_records('course', null, 'shortname', 'id, shortname')) { echo $OUTPUT->box_start(); ?> -
+
get_records_sql($sql); $returnarray = array(); foreach($enrolments as $user) { - $returnarray[$user->username] = array('enrol' => $user->enrol, - 'timemodified' => $user->timemodified, - 'shortname' => $user->shortname, + $returnarray[$user->username] = array('enrol' => $user->enrol, + 'timemodified' => $user->timemodified, + 'shortname' => $user->shortname, 'username' => $user->username, 'name' => $user->name); } @@ -385,10 +385,10 @@ class enrolment_plugin_mnet { global $CFG, $DB; $sql = " - SELECT DISTINCT - h.id, + SELECT DISTINCT + h.id, h.name - FROM + FROM {mnet_host} h, {mnet_host2service} h2s, {mnet_service} s @@ -443,7 +443,7 @@ class enrolment_plugin_mnet { $course = &$courses[$n]; // add/update cached data in mnet_enrol_courses - // sanitise data + // sanitise data $course = (object)$course; $course->remoteid = (int)$course->remoteid; $course->hostid = $mnethostid; @@ -592,4 +592,4 @@ class enrolment_plugin_mnet { } // end of class -?> + diff --git a/enrol/paypal/config.html b/enrol/paypal/config.html index 20ae584b7f..aca9a54c2a 100644 --- a/enrol/paypal/config.html +++ b/enrol/paypal/config.html @@ -13,7 +13,7 @@ enrol_currency: - enrol_currency, false); $select->nothingvalue = ''; diff --git a/enrol/paypal/db/upgrade.php b/enrol/paypal/db/upgrade.php index 8a0aa93eb3..fa6c3c491b 100644 --- a/enrol/paypal/db/upgrade.php +++ b/enrol/paypal/db/upgrade.php @@ -1,6 +1,6 @@ -get_manager(); $result = true; -/// And upgrade begins here. For each one, you'll need one -/// block of code similar to the next one. Please, delete +/// And upgrade begins here. For each one, you'll need one +/// block of code similar to the next one. Please, delete /// this comment lines once this file start handling proper /// upgrade code. @@ -38,4 +38,4 @@ function xmldb_enrol_paypal_upgrade($oldversion) { return $result; } -?> + diff --git a/enrol/paypal/enrol.php b/enrol/paypal/enrol.php index f08de8eeb9..12b6715659 100644 --- a/enrol/paypal/enrol.php +++ b/enrol/paypal/enrol.php @@ -1,4 +1,4 @@ -dirroot/enrol/enrol.class.php"); @@ -218,4 +218,4 @@ function print_enrolmentkeyfrom($course) { } // end of class definition -?> + diff --git a/enrol/paypal/ipn.php b/enrol/paypal/ipn.php index ce2bf3f599..5cc24f3fa6 100644 --- a/enrol/paypal/ipn.php +++ b/enrol/paypal/ipn.php @@ -1,4 +1,4 @@ -mc_currency != $course->currency) { email_paypal_error_to_admin("Currency does not match course settings, received: ".addslashes($data->mc_currency), $data); @@ -193,7 +193,7 @@ if (!empty($CFG->enrol_mailstudents)) { $a->coursename = $course->fullname; $a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id"; - + $eventdata = new object(); $eventdata->modulename = 'moodle'; $eventdata->userfrom = $teacher; @@ -204,13 +204,13 @@ $eventdata->fullmessagehtml = ''; $eventdata->smallmessage = ''; events_trigger('message_send', $eventdata); - + } if (!empty($CFG->enrol_mailteachers)) { $a->course = $course->fullname; $a->user = fullname($user); - + $eventdata = new object(); $eventdata->modulename = 'moodle'; $eventdata->userfrom = $user; @@ -219,15 +219,15 @@ $eventdata->fullmessage = get_string('enrolmentnewuser', '', $a); $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; - events_trigger('message_send', $eventdata); + $eventdata->smallmessage = ''; + events_trigger('message_send', $eventdata); } if (!empty($CFG->enrol_mailadmins)) { $a->course = $course->fullname; $a->user = fullname($user); $admins = get_admins(); - foreach ($admins as $admin) { + foreach ($admins as $admin) { $eventdata = new object(); $eventdata->modulename = 'moodle'; $eventdata->userfrom = $user; @@ -280,4 +280,4 @@ function message_paypal_error_to_admin($subject, $data) { events_trigger('message_send', $eventdata); } -?> + diff --git a/enrol/paypal/return.php b/enrol/paypal/return.php index c5157e5e25..e4dc86bd89 100644 --- a/enrol/paypal/return.php +++ b/enrol/paypal/return.php @@ -1,4 +1,4 @@ -dirroot/enrol/paypal/enrol.php"); @@ -24,7 +24,7 @@ } else { $destination = "$CFG->wwwroot/course/view.php?id=$course->id"; } - + if (has_capability('moodle/course:view', $context)) { redirect($destination, get_string('paymentthanks', '', $course->fullname)); @@ -34,4 +34,4 @@ notice(get_string('paymentsorry', '', get_string('defaultcourseteacher')), $destination); } -?> + diff --git a/enrol/paypal/version.php b/enrol/paypal/version.php index 6be8fd71a0..5efaf03b3d 100644 --- a/enrol/paypal/version.php +++ b/enrol/paypal/version.php @@ -1,4 +1,4 @@ -version = 2006092200; // This module's version $plugin->requires = 2007101000; // Requires this Moodle version -?> + diff --git a/filter/activitynames/filter.php b/filter/activitynames/filter.php index 67923a2f49..83583841e6 100644 --- a/filter/activitynames/filter.php +++ b/filter/activitynames/filter.php @@ -1,4 +1,4 @@ -cachedcourseid) || $this->cachedcourseid !== (int)$this->courseid) { $this->activitylist = null; - } + } $this->cachedcourseid = (int)$this->courseid; /// It may be cached @@ -47,7 +47,7 @@ class activitynames_filter extends moodle_text_filter { usort($modinfo, 'comparemodulenamesbylength'); foreach ($modinfo as $activity) { - //Exclude labels, hidden activities and activities for group members only + //Exclude labels, hidden activities and activities for group members only if ($activity->mod != "label" and $activity->visible and empty($activity->groupmembersonly)) { $title = s(trim(strip_tags(urldecode($activity->name)))); $currentname = trim(urldecode($activity->name)); @@ -82,4 +82,4 @@ function comparemodulenamesbylength($a, $b) { } return (strlen($a->name) < strlen($b->name)) ? 1 : -1; } -?> + diff --git a/filter/algebra/algebradebug.php b/filter/algebra/algebradebug.php index 7635f8c076..5f2c195c08 100644 --- a/filter/algebra/algebradebug.php +++ b/filter/algebra/algebradebug.php @@ -300,7 +300,7 @@ function slasharguments($texexp, $md5) {




@@ -340,7 +340,7 @@ C sources downloaded from http://www.forkosh.com/mimetex.zip, or looking for an appropriate binary at http://moodle.org/download/mimetex/. You may then also need to -edit your moodle/filter/algebra/pix.php file to add +edit your moodle/filter/algebra/pix.php file to add

to the list of operating systems in the switch (PHP_OS) statement. Windows users may have a problem properly unzipping mimetex.exe. Make sure that mimetex.exe is is PRECISELY diff --git a/filter/algebra/filter.php b/filter/algebra/filter.php index 555e8bfc51..bd7ff31e85 100644 --- a/filter/algebra/filter.php +++ b/filter/algebra/filter.php @@ -233,4 +233,4 @@ class algebra_filter extends moodle_text_filter { } } -?> + diff --git a/filter/algebra/pix.php b/filter/algebra/pix.php index 5debd28829..063da52e03 100644 --- a/filter/algebra/pix.php +++ b/filter/algebra/pix.php @@ -6,7 +6,7 @@ // disable moodle specific debug messages and any errors in output define('NO_DEBUG_DISPLAY', true); define('NO_MOODLE_COOKIES', true); // Because it interferes with caching - + require_once('../../config.php'); if (!filter_is_enabled('filter/algebra')) { diff --git a/filter/censor/README.txt b/filter/censor/README.txt index cc50a2c3a9..cc1ee810c6 100644 --- a/filter/censor/README.txt +++ b/filter/censor/README.txt @@ -4,8 +4,8 @@ // // ////////////////////////// -This is a very simple Text Filter that searches text -being output to the screen, replacing "bad" words +This is a very simple Text Filter that searches text +being output to the screen, replacing "bad" words with other words. To customise the word list, use the censor settings page diff --git a/filter/censor/filter.php b/filter/censor/filter.php index 58fac89411..2a0fe1bbd2 100644 --- a/filter/censor/filter.php +++ b/filter/censor/filter.php @@ -1,22 +1,22 @@ - + diff --git a/filter/censor/filtersettings.php b/filter/censor/filtersettings.php index 6effb9c30e..bd43273b3b 100644 --- a/filter/censor/filtersettings.php +++ b/filter/censor/filtersettings.php @@ -1,6 +1,6 @@ -add(new admin_setting_configtextarea('filter_censor_badwords', get_string('badwordslist','admin'), get_string('badwordsconfig', 'admin').'
'.get_string('badwordsdefault', 'admin'), '')); -?> + diff --git a/filter/emailprotect/filter.php b/filter/emailprotect/filter.php index 9427b5e861..bd0ceb021e 100644 --- a/filter/emailprotect/filter.php +++ b/filter/emailprotect/filter.php @@ -1,6 +1,6 @@ - + diff --git a/filter/local_settings_form.php b/filter/local_settings_form.php index 08a199b96c..81a182ac22 100644 --- a/filter/local_settings_form.php +++ b/filter/local_settings_form.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/filter/manage.php b/filter/manage.php index a8e0e5615c..3c48533dcc 100644 --- a/filter/manage.php +++ b/filter/manage.php @@ -1,4 +1,4 @@ -footer(); -?> + diff --git a/filter/mediaplugin/eolas_fix.js b/filter/mediaplugin/eolas_fix.js index e3a223171e..cbf57b783a 100644 --- a/filter/mediaplugin/eolas_fix.js +++ b/filter/mediaplugin/eolas_fix.js @@ -35,7 +35,7 @@ while (childNode = elm.childNodes[z++]) HTML += childNode[outerHTML]; - // create a 'dummy' element + // create a 'dummy' element dummy = doc.createElement('i'); // inject it next to `elm`, elm[parentNode].insertBefore(dummy, elm); diff --git a/filter/mediaplugin/filter.php b/filter/mediaplugin/filter.php index 3a1b0e2d81..aa36702cc6 100644 --- a/filter/mediaplugin/filter.php +++ b/filter/mediaplugin/filter.php @@ -1,4 +1,4 @@ -'. ''. ''. @@ -358,4 +358,4 @@ function mediaplugin_filter_qt_callback($link, $autostart=false) { '; } -?> + diff --git a/filter/mediaplugin/filtersettings.php b/filter/mediaplugin/filtersettings.php index 3068a79c44..0c05dafeec 100644 --- a/filter/mediaplugin/filtersettings.php +++ b/filter/mediaplugin/filtersettings.php @@ -1,4 +1,4 @@ -add(new admin_setting_configcheckbox('filter_mediaplugin_enable_mp3', get_string('mediapluginmp3','admin'), '', 1)); @@ -24,4 +24,4 @@ $settings->add(new admin_setting_configcheckbox('filter_mediaplugin_enable_youtu $settings->add(new admin_setting_configcheckbox('filter_mediaplugin_enable_img', get_string('mediapluginimg','admin'), '', 1)); -?> + diff --git a/filter/mediaplugin/flvplayer.README.txt b/filter/mediaplugin/flvplayer.README.txt index da6d533399..38de3eaca7 100644 --- a/filter/mediaplugin/flvplayer.README.txt +++ b/filter/mediaplugin/flvplayer.README.txt @@ -1,4 +1,4 @@ -The FLV player is by Jeroen Wijering - www.jeroenwijering.com +The FLV player is by Jeroen Wijering - www.jeroenwijering.com and included in Moodle by his permission under the GNU GPL version 2 or later. Thanks, Jeroen! diff --git a/filter/multilang/README.txt b/filter/multilang/README.txt index 39ae791fd2..12e00f731b 100644 --- a/filter/multilang/README.txt +++ b/filter/multilang/README.txt @@ -1,8 +1,6 @@ -$Id$ - To Install it: - Enable if from "Administration/Filters". - + To Use it: - Create your contents in multiple languages. - Enclose every language content between: @@ -36,7 +34,7 @@ One example in action: Hola! This text is common for every language because it's out from any lang block. Bye! - + Ciao, Eloy :-) stronk7@moodle.org diff --git a/filter/multilang/filter.php b/filter/multilang/filter.php index 3aa23c1d5d..8320bb6ddc 100644 --- a/filter/multilang/filter.php +++ b/filter/multilang/filter.php @@ -1,4 +1,4 @@ - (Doesn't work curently) - // [skodak] it supports it now, though it is slower - any better idea? + // [skodak] it supports it now, though it is slower - any better idea? if (empty($text) or is_numeric($text)) { return $text; @@ -105,4 +105,4 @@ function multilang_filter_impl($langblock) { } } -?> + diff --git a/filter/multilang/filtersettings.php b/filter/multilang/filtersettings.php index 895aa0ee91..022c6cc23b 100644 --- a/filter/multilang/filtersettings.php +++ b/filter/multilang/filtersettings.php @@ -1,6 +1,6 @@ -add(new admin_setting_configcheckbox('filter_multilang_force_old', 'filter_multilang_force_old', get_string('multilangforceold', 'admin'), 0)); -?> + diff --git a/filter/tex/displaytex.php b/filter/tex/displaytex.php index d352f853aa..be70dc7b5b 100644 --- a/filter/tex/displaytex.php +++ b/filter/tex/displaytex.php @@ -1,4 +1,4 @@ - + diff --git a/filter/tex/filtersettings.php b/filter/tex/filtersettings.php index 111e531322..34bfdd4b08 100644 --- a/filter/tex/filtersettings.php +++ b/filter/tex/filtersettings.php @@ -1,4 +1,4 @@ -dirroot.'/filter/tex/lib.php'); @@ -42,4 +42,4 @@ foreach ($items as $item) { $item->set_updatedcallback('filter_tex_updatedcallback'); $settings->add($item); } -?> + diff --git a/filter/tex/latex.php b/filter/tex/latex.php index 5386b2b986..36d4c2e112 100644 --- a/filter/tex/latex.php +++ b/filter/tex/latex.php @@ -1,8 +1,8 @@ -temp_dir = $CFG->dataroot . "/temp/latex"; if (!file_exists("$CFG->dataroot/temp")) { @@ -30,7 +30,7 @@ } /** - * Accessor function for support_platform field. + * Accessor function for support_platform field. * @return boolean value of supported_platform */ function supported() { @@ -49,7 +49,7 @@ $formula = tex_sanitize_formula($formula); // $fontsize don't affects to formula's size. $density can change size - $doc = "\\documentclass[{$fontsize}pt]{article}\n"; + $doc = "\\documentclass[{$fontsize}pt]{article}\n"; $doc .= $CFG->filter_tex_latexpreamble; $doc .= "\\pagestyle{empty}\n"; $doc .= "\\begin{document}\n"; @@ -63,7 +63,7 @@ return $doc; } - /** + /** * execute an external command, with optional logging * @param string $command command to execute * @param file $log valid open file handle - log info will be written to this file @@ -92,9 +92,9 @@ * @return bool true if successful */ function render( $formula, $filename, $fontsize=12, $density=240, $background='', $log=null ) { - + global $CFG; - + // quick check - will this work? if (empty($CFG->filter_tex_pathlatex)) { return false; @@ -118,7 +118,7 @@ chdir( $this->temp_dir ); if ($this->execute($command, $log)) { // It allways False on Windows // return false; - } + } // run dvips (.dvi to .ps) $command = "{$CFG->filter_tex_pathdvips} -E $dvi -o $ps"; @@ -158,4 +158,4 @@ } -?> + diff --git a/filter/tex/lib.php b/filter/tex/lib.php index d8c67513c1..8d8fc83238 100644 --- a/filter/tex/lib.php +++ b/filter/tex/lib.php @@ -1,4 +1,4 @@ -delete_records('cache_filters', array('filter'=>'algebra')); } -?> + diff --git a/filter/tex/texdebug.php b/filter/tex/texdebug.php index f5f542b06f..094f4980b2 100644 --- a/filter/tex/texdebug.php +++ b/filter/tex/texdebug.php @@ -1,4 +1,4 @@ -



@@ -316,7 +316,7 @@ tag. The filter/tex/pix.php script then searches the database to find an appropriate gif image file for that expression and to create one if it doesn't exist. It will then use either the LaTex/Ghostscript renderer (using external executables on your system) or the bundled Mimetex executable. The full Latex/Ghostscript -renderer produces better results and is tried first. +renderer produces better results and is tried first. Here are a few common things that can go wrong and some suggestions on how you might try to fix them.

    @@ -324,27 +324,27 @@ you might try to fix them.

    process this expression. Then the database entry for that expression contains a bad TeX expression in the rawtext field (usually blank). You can fix this by clicking on "Delete DB Entry" -
  1. The TeX to gif image conversion process does not work. +
  2. The TeX to gif image conversion process does not work. If paths are specified in the filter configuation screen for the three executables these will be tried first. Note that they still must be correctly -installed and have the correct permissions. In particular make sure that you +installed and have the correct permissions. In particular make sure that you have all the packages installed (e.g., on Debian/Ubuntu you need to install the 'tetex-extra' package). Running the 'show command execution' test should give a big clue. -If this fails or is not available, the Mimetex executable is tried. If this +If this fails or is not available, the Mimetex executable is tried. If this fails a likely cause is that the mimetex binary you are using is incompatible with your operating system. You can try compiling it from the C sources downloaded from http://www.forkosh.com/mimetex.zip, or looking for an appropriate binary at http://moodle.org/download/mimetex/. You may then also need to -edit your moodle/filter/tex/pix.php file to add +edit your moodle/filter/tex/pix.php file to add

    to the list of operating systems in the switch (PHP_OS) statement. Windows users may have a problem properly unzipping mimetex.exe. Make sure that mimetex.exe is is PRECISELY 433152 bytes in size. If not, download a fresh copy from -http://moodle.org/download/mimetex/windows/mimetex.exe. +http://moodle.org/download/mimetex/windows/mimetex.exe. Another possible problem which may affect both Unix and Windows servers is that the web server doesn't have execute permission on the mimetex binary. In that case change permissions accordingly
  3. diff --git a/filter/tex/texed.php b/filter/tex/texed.php index 128617a9c1..28259f228c 100644 --- a/filter/tex/texed.php +++ b/filter/tex/texed.php @@ -1,4 +1,4 @@ - * @param string text to be filtered */ function filter($text) { - + /// Configuration for tidy. Feel free to tune for your needs, e.g. to allow /// proprietary markup. - $tidyoptions = array( + $tidyoptions = array( 'output-xhtml' => true, 'show-body-only' => true, 'tidy-mark' => false, @@ -30,13 +30,13 @@ class tidy_filter extends moodle_text_filter { 'indent' => true, 'quiet' => true, ); - + /// Do a quick check using strpos to avoid unnecessary work if (strpos($text, '<') === false) { return $text; } - + /// If enabled: run tidy over the entire string if (function_exists('tidy_repair_string')){ $text = tidy_repair_string($text, $tidyoptions, 'utf8'); @@ -45,4 +45,4 @@ class tidy_filter extends moodle_text_filter { return $text; } } -?> + diff --git a/portfolio/add.php b/portfolio/add.php index 5fdd841fb4..75bfb81dad 100644 --- a/portfolio/add.php +++ b/portfolio/add.php @@ -233,4 +233,4 @@ if ($postcontrol) { // the magic request variable plugins must pass on returning // actually do the work now.. $exporter->process_stage($stage, $alreadystolen); -?> + diff --git a/portfolio/already.php b/portfolio/already.php index 0516612a75..e7a358860b 100644 --- a/portfolio/already.php +++ b/portfolio/already.php @@ -79,4 +79,4 @@ if (count($table->data) > 0) { echo $OUTPUT->footer(); -?> + diff --git a/portfolio/file.php b/portfolio/file.php index 6032e6de29..e184c91342 100644 --- a/portfolio/file.php +++ b/portfolio/file.php @@ -59,4 +59,4 @@ if (!$exporter->get('instance')->verify_file_request_params(array_merge($_GET, $ $exporter->get('instance')->send_file(); $exporter->process_stage_cleanup(true); exit; -?> + diff --git a/portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php b/portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php index ac03f95c88..30bb1bff74 100644 --- a/portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php +++ b/portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php @@ -1,4 +1,4 @@ -libdir/simpletest/testportfoliolib.php"); require_once("$CFG->dirroot/portfolio/type/boxnet/lib.php"); require_once("$CFG->dirroot/$CFG->admin/generator.php"); @@ -56,4 +56,4 @@ class testPortfolioPluginBoxnet extends portfoliolib_test { $this->assertTrue($this->plugin->send_package()); } } -?> + diff --git a/portfolio/type/boxnet/version.php b/portfolio/type/boxnet/version.php index 1a00826079..b0f0203add 100644 --- a/portfolio/type/boxnet/version.php +++ b/portfolio/type/boxnet/version.php @@ -4,4 +4,4 @@ $plugin->version = 2008072500; $plugin->requires = 2008072500; $plugin->cron = 0; -?> + diff --git a/portfolio/type/download/file.php b/portfolio/type/download/file.php index e131478cce..0ae8307d90 100644 --- a/portfolio/type/download/file.php +++ b/portfolio/type/download/file.php @@ -37,4 +37,4 @@ echo '
    echo $OUTPUT->footer(); -?> + diff --git a/portfolio/type/download/simpletest/testportfolioplugindownload.php b/portfolio/type/download/simpletest/testportfolioplugindownload.php index 094edc2489..8d3dfc8e52 100755 --- a/portfolio/type/download/simpletest/testportfolioplugindownload.php +++ b/portfolio/type/download/simpletest/testportfolioplugindownload.php @@ -1,4 +1,4 @@ -libdir.'/simpletest/testportfoliolib.php'); require_once($CFG->dirroot.'/portfolio/type/download/lib.php'); @@ -19,4 +19,4 @@ class testPortfolioPluginDownload extends portfoliolib_test { } } -?> + diff --git a/portfolio/type/download/version.php b/portfolio/type/download/version.php index 1a00826079..b0f0203add 100644 --- a/portfolio/type/download/version.php +++ b/portfolio/type/download/version.php @@ -4,4 +4,4 @@ $plugin->version = 2008072500; $plugin->requires = 2008072500; $plugin->cron = 0; -?> + diff --git a/portfolio/type/flickr/version.php b/portfolio/type/flickr/version.php index 1a00826079..b0f0203add 100755 --- a/portfolio/type/flickr/version.php +++ b/portfolio/type/flickr/version.php @@ -4,4 +4,4 @@ $plugin->version = 2008072500; $plugin->requires = 2008072500; $plugin->cron = 0; -?> + diff --git a/portfolio/type/googledocs/db/events.php b/portfolio/type/googledocs/db/events.php index 181dc1de3c..b6342a7de5 100644 --- a/portfolio/type/googledocs/db/events.php +++ b/portfolio/type/googledocs/db/events.php @@ -1,11 +1,11 @@ - array ( 'handlerfile' => '/portfolio/type/googledocs/lib.php', - 'handlerfunction' => 'portfolio_googledocs_user_deleted', + 'handlerfunction' => 'portfolio_googledocs_user_deleted', 'schedule' => 'cron' ), ); -?> + diff --git a/portfolio/type/googledocs/lib.php b/portfolio/type/googledocs/lib.php index 226c6bafa8..34e9ad12e3 100644 --- a/portfolio/type/googledocs/lib.php +++ b/portfolio/type/googledocs/lib.php @@ -1,9 +1,8 @@ - - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ require_once($CFG->libdir.'/googleapi.php'); @@ -21,7 +20,7 @@ class portfolio_plugin_googledocs extends portfolio_plugin_push_base { public function prepare_package() { // we send the files as they are, no prep required - return true; + return true; } public function get_continue_url(){ @@ -89,7 +88,7 @@ class portfolio_plugin_googledocs extends portfolio_plugin_push_base { } /** - * Registers to the user_deleted event to revoke any + * Registers to the user_deleted event to revoke any * subauth tokens we have from them * * @param $user user object @@ -110,5 +109,5 @@ function portfolio_googledocs_user_deleted($user){ } } - return true; + return true; } diff --git a/portfolio/type/googledocs/version.php b/portfolio/type/googledocs/version.php index cd8312d2d8..ca8f93f28e 100644 --- a/portfolio/type/googledocs/version.php +++ b/portfolio/type/googledocs/version.php @@ -1,6 +1,6 @@ -version = 2008072505; $plugin->requires = 2008072500; $plugin->cron = 0; -?> + diff --git a/portfolio/type/mahara/db/upgrade.php b/portfolio/type/mahara/db/upgrade.php index 36cfb6c096..ea11f8e520 100644 --- a/portfolio/type/mahara/db/upgrade.php +++ b/portfolio/type/mahara/db/upgrade.php @@ -1,4 +1,4 @@ - + diff --git a/portfolio/type/mahara/preconfig.php b/portfolio/type/mahara/preconfig.php index 8784fc8208..c74ed82b06 100644 --- a/portfolio/type/mahara/preconfig.php +++ b/portfolio/type/mahara/preconfig.php @@ -28,4 +28,4 @@ if (!$landed = optional_param('landed', false, PARAM_BOOL)) { $exporter->get('instance')->send_intent(); redirect($CFG->wwwroot . '/portfolio/add.php?postcontrol=1&id=' . $exporter->get('id')); } -?> + diff --git a/portfolio/type/mahara/version.php b/portfolio/type/mahara/version.php index 1a00826079..b0f0203add 100644 --- a/portfolio/type/mahara/version.php +++ b/portfolio/type/mahara/version.php @@ -4,4 +4,4 @@ $plugin->version = 2008072500; $plugin->requires = 2008072500; $plugin->cron = 0; -?> + diff --git a/portfolio/type/picasa/db/events.php b/portfolio/type/picasa/db/events.php index dd5e280761..62845c04b6 100644 --- a/portfolio/type/picasa/db/events.php +++ b/portfolio/type/picasa/db/events.php @@ -1,11 +1,11 @@ - array ( 'handlerfile' => '/portfolio/type/picasa/lib.php', - 'handlerfunction' => 'portfolio_picasa_user_deleted', + 'handlerfunction' => 'portfolio_picasa_user_deleted', 'schedule' => 'cron' ), ); -?> + diff --git a/portfolio/type/picasa/lib.php b/portfolio/type/picasa/lib.php index 75e3c1cad2..ac539d2a5d 100644 --- a/portfolio/type/picasa/lib.php +++ b/portfolio/type/picasa/lib.php @@ -1,9 +1,8 @@ - - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -22,7 +21,7 @@ class portfolio_plugin_picasa extends portfolio_plugin_push_base { public function prepare_package() { // we send the files as they are, no prep required - return true; + return true; } public function get_continue_url(){ @@ -90,7 +89,7 @@ class portfolio_plugin_picasa extends portfolio_plugin_push_base { } /** - * Registers to the user_deleted event to revoke any + * Registers to the user_deleted event to revoke any * subauth tokens we have from them * * @param $user user object @@ -111,5 +110,5 @@ function portfolio_picasa_user_deleted($user){ } } - return true; + return true; } diff --git a/portfolio/type/picasa/version.php b/portfolio/type/picasa/version.php index e210acd073..0560b4465c 100644 --- a/portfolio/type/picasa/version.php +++ b/portfolio/type/picasa/version.php @@ -1,7 +1,7 @@ -version = 2008072505; $plugin->requires = 2008072500; $plugin->cron = 0; -?> + diff --git a/repository/alfresco/repository.class.php b/repository/alfresco/repository.class.php index 2b1334205d..eb557c48d7 100755 --- a/repository/alfresco/repository.class.php +++ b/repository/alfresco/repository.class.php @@ -2,7 +2,6 @@ /** * repository_alfresco class * - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -51,7 +50,7 @@ class repository_alfresco extends repository { $user_field->id = 'alfresco_username'; $user_field->type = 'text'; $user_field->name = 'al_username'; - + $passwd_field->label = get_string('password', 'repository_alfresco').': '; $passwd_field->id = 'alfresco_password'; $passwd_field->type = 'password'; @@ -203,4 +202,4 @@ class repository_alfresco extends repository { } } } -?> + diff --git a/repository/boxnet/repository.class.php b/repository/boxnet/repository.class.php index ef206cd648..19071d8833 100755 --- a/repository/boxnet/repository.class.php +++ b/repository/boxnet/repository.class.php @@ -6,7 +6,6 @@ require_once($CFG->libdir.'/boxlib.php'); * This is a subclass of repository class * * @author Dongsheng Cai - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ class repository_boxnet extends repository { @@ -32,7 +31,7 @@ class repository_boxnet extends repository { if(!empty($options['username']) && !empty($options['password']) && !empty($options['ticket']) ) { $this->box = new boxclient($this->api_key); try { - $SESSION->$sess_name = $this->box->getAuthToken($options['ticket'], + $SESSION->$sess_name = $this->box->getAuthToken($options['ticket'], $options['username'], $options['password']); } catch (repository_exception $e) { throw $e; @@ -149,7 +148,7 @@ class repository_boxnet extends repository { $fileicon = $tree['thumbnail']; foreach ($filenames as $n=>$v){ if(strstr(strtolower($v), strtolower($search_text)) !== false) { - $list[] = array('title'=>$v, + $list[] = array('title'=>$v, 'size'=>$filesizes[$n], 'date'=>$filedates[$n], 'source'=>'http://box.net/api/1.0/download/' @@ -199,7 +198,7 @@ class repository_boxnet extends repository { $user_field->type = 'text'; $user_field->name = 'boxusername'; $user_field->value = $ret->username; - + $passwd_field->label = get_string('password', 'repository_boxnet').': '; $passwd_field->id = 'box_password'; $passwd_field->type = 'password'; @@ -244,4 +243,4 @@ class repository_boxnet extends repository { $mform->addElement('static', null, '', get_string('information','repository_boxnet')); } } -?> + diff --git a/repository/draft/repository.class.php b/repository/draft/repository.class.php index 4a608cae5f..806f569852 100755 --- a/repository/draft/repository.class.php +++ b/repository/draft/repository.class.php @@ -3,7 +3,6 @@ * repository_draft class * This is a subclass of repository class * - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ class repository_draft extends repository { @@ -102,4 +101,4 @@ class repository_draft extends repository { return get_string('repositoryname', 'repository_draft');; } } -?> + diff --git a/repository/filesystem/repository.class.php b/repository/filesystem/repository.class.php index c5f64a4fb0..d728a34af4 100644 --- a/repository/filesystem/repository.class.php +++ b/repository/filesystem/repository.class.php @@ -1,4 +1,4 @@ - - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -169,7 +168,7 @@ class repository_flickr extends repository { $format = '.'.$format; // append extensions to the files if (substr($p['title'], strlen($p['title'])-strlen($format)) != $format) { - $p['title'] .= $format; + $p['title'] .= $format; } $ret['list'][] = array('title'=>$p['title'],'source'=>$p['id'], 'id'=>$p['id'],'thumbnail'=>$this->flickr->buildPhotoURL($p, 'Square'), diff --git a/repository/flickr_public/image.php b/repository/flickr_public/image.php index bb4d558df3..373b4129ce 100755 --- a/repository/flickr_public/image.php +++ b/repository/flickr_public/image.php @@ -27,8 +27,8 @@ class moodle_image { case 'image/png': $this->image = imagecreatefrompng($this->imagepath); break; - case 'image/gif': - $this->image = imagecreatefromgif($this->imagepath); + case 'image/gif': + $this->image = imagecreatefromgif($this->imagepath); break; default: break; @@ -114,7 +114,7 @@ class moodle_image { case 'image/png': return imagepng($this->image, $imagepath); break; - case 'image/gif': + case 'image/gif': return imagegif($this->image, $imagepath); break; default: diff --git a/repository/flickr_public/repository.class.php b/repository/flickr_public/repository.class.php index 4ed6414eac..6fbfc0f386 100644 --- a/repository/flickr_public/repository.class.php +++ b/repository/flickr_public/repository.class.php @@ -6,7 +6,6 @@ * access photos in this public account * * @author Dongsheng Cai - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -266,7 +265,7 @@ class repository_flickr_public extends repository { if (!empty($SESSION->{$this->sess_tag}) // use tag to search or !empty($SESSION->{$this->sess_text}) // use keyword to search - or !empty($this->nsid)/*use pre-defined accound*/) { + or !empty($this->nsid)/*use pre-defined accound*/) { $photos = $this->flickr->photos_search(array( 'tags'=>$SESSION->{$this->sess_tag}, 'page'=>$page, @@ -336,7 +335,7 @@ class repository_flickr_public extends repository { // append author id // $p['title'] .= '-'.$p['owner']; // append file extension - $p['title'] .= $format; + $p['title'] .= $format; } $ret['list'][] = array('title'=>$p['title'], 'source'=>$p['id'], 'id'=>$p['id'],'thumbnail'=>$this->flickr->buildPhotoURL($p, 'Square'), diff --git a/repository/googledocs/repository.class.php b/repository/googledocs/repository.class.php index 45948d1bfa..f854e2645d 100644 --- a/repository/googledocs/repository.class.php +++ b/repository/googledocs/repository.class.php @@ -3,7 +3,6 @@ * Google Docs Plugin * * @author Dan Poltawski - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -44,16 +43,16 @@ class repository_googledocs extends repository { return false; } - public function print_login($ajax = true){ + public function print_login($ajax = true){ global $CFG; if($ajax){ - $ret = array(); - $popup_btn = new stdclass; - $popup_btn->type = 'popup'; + $ret = array(); + $popup_btn = new stdclass; + $popup_btn->type = 'popup'; $returnurl = $CFG->wwwroot.'/repository/ws.php?callback=yes&repo_id='.$this->id; $popup_btn->url = google_authsub::login_url($returnurl, google_docs::REALM); - $ret['login'] = array($popup_btn); - return $ret; + $ret['login'] = array($popup_btn); + return $ret; } } diff --git a/repository/local/repository.class.php b/repository/local/repository.class.php index 13ddb00c2f..b29ddf1368 100755 --- a/repository/local/repository.class.php +++ b/repository/local/repository.class.php @@ -3,7 +3,6 @@ * repository_local class * This is a subclass of repository class * - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -160,4 +159,4 @@ class repository_local extends repository { return get_string('repositoryname', 'repository_local');; } } -?> + diff --git a/repository/mahara/repository.class.php b/repository/mahara/repository.class.php index 75cc8a96e6..7f6f32e090 100644 --- a/repository/mahara/repository.class.php +++ b/repository/mahara/repository.class.php @@ -88,7 +88,7 @@ class repository_mahara extends repository { //set session $SESSION->loginmahara = true; - + $ret = array(); $popup_btn = new stdclass; $popup_btn->type = 'popup'; @@ -176,7 +176,7 @@ class repository_mahara extends repository { } else { $client->add_param($search); } - + ///call the method and manage host error if (!$client->send($mnet_peer)) { $message =" "; @@ -219,7 +219,7 @@ class repository_mahara extends repository { $list[] = array( 'title'=>$file['title'], 'date'=>$file['mtime'], 'source'=>$file['id'], 'thumbnail' => $thumbnail); } } - + $filepickerlisting = array( 'path' => $newpath, @@ -343,4 +343,4 @@ class repository_mahara extends repository { return array('peer'); } } -?> + diff --git a/repository/manage_instances.php b/repository/manage_instances.php index 315d2a200a..1b4e1142f2 100644 --- a/repository/manage_instances.php +++ b/repository/manage_instances.php @@ -1,4 +1,4 @@ -dirroot . '/repository/lib.php'); diff --git a/repository/picasa/repository.class.php b/repository/picasa/repository.class.php index 629b820f9c..f03a91d50d 100644 --- a/repository/picasa/repository.class.php +++ b/repository/picasa/repository.class.php @@ -3,7 +3,6 @@ * Picasa Repository Plugin * * @author Dan Poltawski - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -44,17 +43,17 @@ class repository_picasa extends repository { return false; } - public function print_login(){ + public function print_login(){ global $CFG; $returnurl = $CFG->wwwroot.'/repository/ws.php?callback=yes&repo_id='.$this->id; $authurl = google_authsub::login_url($returnurl, google_picasa::REALM); if($this->options['ajax']){ - $ret = array(); - $popup_btn = new stdclass; - $popup_btn->type = 'popup'; + $ret = array(); + $popup_btn = new stdclass; + $popup_btn->type = 'popup'; $popup_btn->url = $authurl; - $ret['login'] = array($popup_btn); - return $ret; + $ret['login'] = array($popup_btn); + return $ret; } else { echo 'Login'; } diff --git a/repository/remotemoodle/repository.class.php b/repository/remotemoodle/repository.class.php index 388e9e4d40..9898144d17 100644 --- a/repository/remotemoodle/repository.class.php +++ b/repository/remotemoodle/repository.class.php @@ -4,7 +4,6 @@ * This plugin allowed to connect a retrieve a file from another Moodle site * This is a subclass of repository class * @author Jerome Mouneyrac - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -322,4 +321,4 @@ class repository_remotemoodle extends repository { return array('peer'); } } -?> + diff --git a/repository/repository.css b/repository/repository.css index 941a353b71..cc4937fbd8 100644 --- a/repository/repository.css +++ b/repository/repository.css @@ -22,17 +22,17 @@ .ygtvlph { background: url(../pix/y/lph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } /* Loading icon */ .ygtvloading { background: url(../pix/y/loading.gif) 0 0 no-repeat; width:16px; height:22px; } -/* the style for the empty cells that are used for rendering the depth +/* the style for the empty cells that are used for rendering the depth * of the node */ .ygtvdepthcell { background: url(../pix/y/vline.gif) 0 0 no-repeat; width:17px; height:22px; } .ygtvblankdepthcell { width:17px; height:22px; } /* the style of the div around each node */ -.ygtvitem { } +.ygtvitem { } .ygtvitem table{ margin-bottom:0; } -.ygtvitem td { border:none;padding:0; } +.ygtvitem td { border:none;padding:0; } /* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:1%; } +.ygtvchildren { } +* html .ygtvchildren { height:1%; } /* the style of the text label in ygTextNode */ .ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { margin-left:2px; text-decoration: none; } diff --git a/repository/repository.src.js b/repository/repository.src.js index 3f6d7592c3..b56f1539e0 100644 --- a/repository/repository.src.js +++ b/repository/repository.src.js @@ -4,7 +4,7 @@ // // /////////////////////////////////////////////////////////////////////////// /** - * repository_client is a javascript class, it contains several static + * repository_client is a javascript class, it contains several static * methods you can call it directly without creating an instance. * If you are going to create a file picker, you need create an instance * repo = new repository_client(); @@ -173,7 +173,7 @@ var repository_client = (function(){ var container = new YAHOO.util.Element('repo-list-'+this.client_id); container.set('innerHTML', ''); container.on('contentReady', function() { - this.init_search(); + this.init_search(); for(var i in repository_listing[this.client_id]) { var repo = repository_listing[this.client_id][i]; var support = false; @@ -265,7 +265,7 @@ repository_client.req = function(client_id, id, path, page) { repository_client.req_cb = { success: function(o){ - var data = repository_client.parse_json(o.responseText, 'req_cb'); + var data = repository_client.parse_json(o.responseText, 'req_cb'); var repo = repository_client.fp[data.client_id]; repo.viewbar.set('disabled', false); var panel = new YAHOO.util.Element('panel-'+data.client_id); @@ -370,7 +370,7 @@ repository_client.print_login = function(id, data) { str += ''; for(var item in list) { str +=''+labels[item]+'
    '; + field_id+' value="'+list[item]+'" />'+labels[item]+'
    '; } str += ''; }else{ @@ -494,7 +494,7 @@ repository_client.view_as_list = function(client_id, data) { // from viewfiles list = repository_client.fp[client_id].fs.list; }else{ - // from callback + // from callback list = data; } var panel = new YAHOO.util.Element('panel-'+client_id); @@ -507,7 +507,7 @@ repository_client.view_as_list = function(client_id, data) { tree.dynload = function (node, fnLoadComplete) { var callback = { success: function(o) { - var json = repository_client.parse_json(o.responseText, 'dynload'); + var json = repository_client.parse_json(o.responseText, 'dynload'); for(k in json.list) { repository_client.buildtree(json.client_id, json.list[k], node); } @@ -590,7 +590,7 @@ repository_client.select_file = function(oldname, url, icon, client_id, repo_id) if (repository_client.files[client_id] == undefined) { repository_client.files[client_id] = 0; } - if (repository_client.files[client_id] >= repository_client.fp[client_id].maxfiles && + if (repository_client.files[client_id] >= repository_client.fp[client_id].maxfiles && repository_client.fp[client_id].maxfiles != -1) { alert('Only '+repository_client.fp[client_id].maxfiles+' files are allowed!'); @@ -800,7 +800,7 @@ repository_client.view_as_icons = function(client_id, data) { delbtn.innerHTML = "[X]"; delbtn.id = 'del-id-'+String(count); el.appendChild(delbtn); - delbtn.itemid=fp.itemid; + delbtn.itemid=fp.itemid; delbtn.client_id=client_id; delbtn.title=list[k].title; delbtn.repo_id=fp.fs.repo_id; @@ -852,7 +852,7 @@ repository_client.view_as_icons = function(client_id, data) { this.on('click', function(){ this.folder.fireEvent('click'); }); - }); + }); el_title.folder = folder; } else { var el_title = new YAHOO.util.Element(title.id); @@ -866,7 +866,7 @@ repository_client.view_as_icons = function(client_id, data) { el_title.repo_id = file.repo_id = list[k].repo_id; }else{ el_title.repo_id = file.repo_id = ''; - } + } file.on('contentReady', function() { this.on('click', function() { repository_client.select_file(this.filename, this.value, this.icon, client_id, this.repo_id); @@ -1015,7 +1015,7 @@ repository_client.download = function(client_id, repo_id) { } repository_client.download_cb = { success: function(o) { - var data = repository_client.parse_json(o.responseText, 'download_cb'); + var data = repository_client.parse_json(o.responseText, 'download_cb'); var panel = new YAHOO.util.Element('panel-'+data.client_id); if(data && data.e) { panel.get('element').innerHTML = data.e; @@ -1109,7 +1109,7 @@ repository_client.upload = function(client_id) { } repository_client.upload_cb = { upload: function(o) { - var ret = repository_client.parse_json(o.responseText, 'upload'); + var ret = repository_client.parse_json(o.responseText, 'upload'); client_id = ret.client_id; if(ret && ret.e) { var panel = new YAHOO.util.Element('panel-'+client_id); diff --git a/repository/s3/S3.php b/repository/s3/S3.php index e2e3b54277..603b39b301 100644 --- a/repository/s3/S3.php +++ b/repository/s3/S3.php @@ -1,7 +1,5 @@ s->getObject($bucket, $filename, $path); return $path; } - // login + // login public function check_login() { return true; } diff --git a/repository/upload/repository.class.php b/repository/upload/repository.class.php index d0f3821c8b..5813cd4016 100755 --- a/repository/upload/repository.class.php +++ b/repository/upload/repository.class.php @@ -3,7 +3,6 @@ * repository_upload class * A subclass of repository, which is used to upload file * - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -72,4 +71,4 @@ class repository_upload extends repository { return get_string('repositoryname', 'repository_upload'); } } -?> + diff --git a/repository/url/lib.php b/repository/url/lib.php index 9d41127ab5..ae5d9cefab 100644 --- a/repository/url/lib.php +++ b/repository/url/lib.php @@ -678,7 +678,7 @@ function extract_css_urls( $text ) // @import "..." foreach ( $matches[3] as $match ) if ( !empty($match) ) - $urls['import'][] = + $urls['import'][] = preg_replace( '/\\\\(.)/u', '\\1', $match ); // @import url(...) @@ -686,7 +686,7 @@ function extract_css_urls( $text ) // @import url("...") foreach ( $matches[7] as $match ) if ( !empty($match) ) - $urls['import'][] = + $urls['import'][] = preg_replace( '/\\\\(.)/u', '\\1', $match ); // url(...) @@ -694,7 +694,7 @@ function extract_css_urls( $text ) // url("...") foreach ( $matches[11] as $match ) if ( !empty($match) ) - $urls['property'][] = + $urls['property'][] = preg_replace( '/\\\\(.)/u', '\\1', $match ); return $urls; diff --git a/repository/url/repository.class.php b/repository/url/repository.class.php index b67a390619..e295dc2695 100755 --- a/repository/url/repository.class.php +++ b/repository/url/repository.class.php @@ -3,7 +3,6 @@ * repository_url class * A subclass of repository, which is used to download a file from a specific url * - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -139,4 +138,4 @@ EOD; return get_string('repositoryname', 'repository_url');; } } -?> + diff --git a/repository/webdav/repository.class.php b/repository/webdav/repository.class.php index d32771363c..f49aa2b59e 100644 --- a/repository/webdav/repository.class.php +++ b/repository/webdav/repository.class.php @@ -3,7 +3,6 @@ * repository_webdav class * * @author Dongsheng Cai - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ diff --git a/repository/wikimedia/repository.class.php b/repository/wikimedia/repository.class.php index 5d985a715b..c65044693c 100644 --- a/repository/wikimedia/repository.class.php +++ b/repository/wikimedia/repository.class.php @@ -8,7 +8,7 @@ class repository_wikimedia extends repository { } public function get_listing($path = '', $page = '') { global $OUTPUT; - $client = new wikimedia; + $client = new wikimedia; $result = $client->search_images($this->keyword); $list = array(); $list['list'] = array(); @@ -24,7 +24,7 @@ class repository_wikimedia extends repository { } return $list; } - // login + // login public function check_login() { return !empty($this->keyword); } @@ -52,7 +52,7 @@ class repository_wikimedia extends repository { $search_result['list'] = array(); return $search_result; } - // when logout button on file picker is clicked, this function will be + // when logout button on file picker is clicked, this function will be // called. public function logout() { return true; diff --git a/repository/ws.php b/repository/ws.php index 18989e2984..4d203adb82 100644 --- a/repository/ws.php +++ b/repository/ws.php @@ -1,4 +1,4 @@ - - * @version $Id$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ @@ -52,7 +51,7 @@ class repository_youtube extends repository { 'date'=>'', 'source'=>$source ); - } + } return $list; } -- 2.39.5