From 4454447d56247deb58bddb65223a36de86208a5b Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 16 Dec 2009 22:14:17 +0000 Subject: [PATCH] MDL-20700 whitespace terror returns --- auth/cas/auth.php | 96 ++++++------- auth/ldap/auth.php | 4 +- blocks/section_links/config_instance.html | 52 +++---- blocks/section_links/settings.php | 4 +- calendar/calendar.js | 2 +- calendar/view.php | 98 ++++++------- course/completion.js | 4 +- course/format/topics/format.php | 2 +- course/format/weeks/format.php | 2 +- enrol/authorize/enrol_form.php | 2 +- enrol/authorize/uploadcsv.php | 2 +- enrol/flatfile/enrol.php | 2 +- enrol/imsenterprise/enrol.php | 2 +- enrol/manual/enrol.php | 4 +- enrol/paypal/ipn.php | 2 +- group/autogroup.php | 8 +- group/autogroup_form.php | 4 +- group/lib.php | 4 +- lang/en_utf8/help/grade/index.html | 136 +++++++++--------- lib/form/datetimeselector.php | 14 +- lib/simpletest/testcompletionlib.php | 4 +- lib/simpletest/testrss.php | 4 +- lib/simpletest/testsimpletestlib.php | 2 +- lib/simpletestlib.php | 24 ++-- mod/assignment/lib.php | 2 +- .../type/upload/assignment.class.php | 6 +- mod/forum/mod_form.php | 2 +- mod/hotpot/mod_form.js | 6 +- mod/quiz/accessrules.php | 2 +- mod/scorm/aicc.php | 11 +- mod/scorm/datamodels/scorm_13.js.php | 4 +- mod/scorm/locallib.php | 2 +- portfolio/googledocs/lib.php | 2 +- portfolio/picasa/lib.php | 2 +- question/editlib.php | 2 +- question/format/blackboard/format.php | 10 +- .../calculated/datasetdefinitions_form.php | 8 +- .../type/calculated/datasetitems_form.php | 8 +- question/type/calculated/questiontype.php | 44 +++--- .../type/calculatedsimple/questiontype.php | 1 - question/type/essay/edit_essay_form.php | 2 +- question/type/numerical/display.html | 38 ++--- repository/alfresco/repository.class.php | 8 +- repository/flickr_public/image.php | 84 +++++------ repository/merlot/repository.class.php | 2 +- repository/repository.src.js | 4 +- repository/youtube/repository.class.php | 4 +- tag/index.php | 2 +- theme/anomaly/README.html | 22 +-- theme/anomaly/header.html | 60 ++++---- theme/colors/colors.css | 2 +- theme/formal_white/fw_layout.css | 8 +- theme/lines/header.html | 4 +- theme/lines/lines.css | 2 +- theme/oceanblue/styles_color.css | 2 +- 55 files changed, 416 insertions(+), 418 deletions(-) diff --git a/auth/cas/auth.php b/auth/cas/auth.php index 703cebd68f..b30b32fa63 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -63,7 +63,7 @@ class auth_plugin_cas extends auth_plugin_base { * @return bool Authentication success or failure. */ function user_login ($username, $password) { - $this->connectCAS(); + $this->connectCAS(); return phpCAS::isAuthenticated() && (trim(moodle_strtolower(phpCAS::getUser())) == $username); } /** @@ -91,43 +91,43 @@ class auth_plugin_cas extends auth_plugin_base { function loginpage_hook() { global $frm; global $CFG; - global $SESSION, $OUTPUT; + global $SESSION, $OUTPUT; $site = get_site(); $CASform = get_string("CASform","auth_cas"); $username = optional_param("username", '', PARAM_RAW); if (!empty($username)) { - if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS')) - unset($SESSION->wantsurl); - return; + if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS')) + unset($SESSION->wantsurl); + return; } - - // Test si cas activ� et param�tres non remplis - if (empty($this->config->hostname)) { - return; - } + + // Test si cas activ� et param�tres non remplis + if (empty($this->config->hostname)) { + return; + } // Connection to CAS server - $this->connectCAS(); - - // Gestion de la connection CAS si acc�s direct d'un ent ou autre - if (phpCAS::checkAuthentication()) { - $frm->username=phpCAS::getUser(); -// if (phpCAS::getUser()=='esup9992') -// $frm->username='erhar0062'; - $frm->password="passwdCas"; - return; - } - - if ($_GET["loginguest"]== true) { - $frm->username="guest"; - $frm->password="guest"; - return; - } - + $this->connectCAS(); + + // Gestion de la connection CAS si acc�s direct d'un ent ou autre + if (phpCAS::checkAuthentication()) { + $frm->username=phpCAS::getUser(); +// if (phpCAS::getUser()=='esup9992') +// $frm->username='erhar0062'; + $frm->password="passwdCas"; + return; + } + + if ($_GET["loginguest"]== true) { + $frm->username="guest"; + $frm->password="guest"; + return; + } + if ($this->config->multiauth) { $authCAS = optional_param("authCAS", '', PARAM_RAW); if ($authCAS=="NOCAS") @@ -144,7 +144,7 @@ class auth_plugin_cas extends auth_plugin_base { include($CFG->dirroot."/auth/cas/cas_form.html"); echo $OUTPUT->footer(); exit(); - } + } } // CAS authentication if (!phpCAS::isAuthenticated()) @@ -158,11 +158,11 @@ class auth_plugin_cas extends auth_plugin_base { */ function prelogout_hook() { global $CFG; - if ($this->config->logoutcas ) { - $backurl = $CFG->wwwroot; - $this->connectCAS(); - phpCAS::logout($backurl); - } + if ($this->config->logoutcas ) { + $backurl = $CFG->wwwroot; + $this->connectCAS(); + phpCAS::logout($backurl); + } } /** * Connect to the cas (clientcas connection or proxycas connection @@ -171,20 +171,20 @@ class auth_plugin_cas extends auth_plugin_base { * */ function connectCAS() { - - global $PHPCAS_CLIENT; + + global $PHPCAS_CLIENT; // mode proxy CAS if ( !is_object($PHPCAS_CLIENT) ) { - if ($this->config->proxycas) { - phpCAS::proxy($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri); - } + if ($this->config->proxycas) { + phpCAS::proxy($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri); + } // mode client CAS - else { - phpCAS::client($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri); - } + else { + phpCAS::client($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri); + } + } + } - - } /** * Prints a form for configuring this authentication plugin. * @@ -974,16 +974,16 @@ if (!empty($this->config->attrcreators)) { $filter = "(& (".$this->config->user_attribute."=$username)(|"; foreach ($attrs as $attr){ if(strpos($attr, "=")) - $filter .= "($attr)"; + $filter .= "($attr)"; else - $filter .= "(".$this->config->memberattribute."=$attr)"; + $filter .= "(".$this->config->memberattribute."=$attr)"; } $filter .= "))"; //search $result = $this->ldap_get_userlist($filter); if (count($result)!=0) - return true; - } + return true; + } return false; } @@ -1089,7 +1089,7 @@ if (!empty($this->config->attrcreators)) { do { $attributes = @ldap_get_attributes($conn, $entry); for ($j=0; $j<$attributes['count']; $j++) { - $values = ldap_get_values_len($conn, $entry,$attributes[$j]); + $values = ldap_get_values_len($conn, $entry,$attributes[$j]); if (is_array($values)) { $fresult[$i][strtolower($attributes[$j])] = $values; diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 9162ab6421..2de694cb1e 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -1567,8 +1567,8 @@ class auth_plugin_ldap extends auth_plugin_base { } if ($bindresult) { - // Set the connection counter so we can call PHP's ldap_close() - // when we call $this->ldap_close() for the last 'open' connection. + // Set the connection counter so we can call PHP's ldap_close() + // when we call $this->ldap_close() for the last 'open' connection. $this->ldapconns = 1; $this->ldapconnection = $connresult; return $connresult; diff --git a/blocks/section_links/config_instance.html b/blocks/section_links/config_instance.html index 069e22ee90..38c447388b 100755 --- a/blocks/section_links/config_instance.html +++ b/blocks/section_links/config_instance.html @@ -1,19 +1,19 @@ config)){ - $config = $this->config; + $config = $this->config; } else{ - $config = get_config('blocks/section_links'); + $config = get_config('blocks/section_links'); } $selected = array(); @@ -40,28 +40,28 @@ if (!empty($config->numsections2)) { - - - : - - - - - - - - - - - : - - - - - - - - + + + : + + + + + + + + + + + : + + + + + + + + diff --git a/blocks/section_links/settings.php b/blocks/section_links/settings.php index 9b0d1dad26..bad7638de9 100755 --- a/blocks/section_links/settings.php +++ b/blocks/section_links/settings.php @@ -4,12 +4,12 @@ $configs = array(); $numberofsections = array(); for ($i = 1; $i < 53; $i++){ - $numberofsections[$i] = $i; + $numberofsections[$i] = $i; } $increments = array(); for ($i = 1; $i < 11; $i++){ - $increments[$i] = $i; + $increments[$i] = $i; } $selected = array(1 => array(22,2), diff --git a/calendar/calendar.js b/calendar/calendar.js index da53a827b8..bcc7979616 100644 --- a/calendar/calendar.js +++ b/calendar/calendar.js @@ -15,7 +15,7 @@ YAHOO.moodle.container.calendarpanels = []; * has been resolved. */ YAHOO.util.Event.onDOMReady(function () { - //TODO: remove this hack MDL-20204 + //TODO: remove this hack MDL-20204 var animationlib = document.createElement('script'); animationlib.setAttribute('type','text/javascript'); animationlib.setAttribute('src',moodle_cfg.wwwroot+'/lib/yui/2.8.0r4/animation/animation-min.js'); diff --git a/calendar/view.php b/calendar/view.php index 2cfbb9d101..b348425f7f 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -539,55 +539,55 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course echo "\n"; // Tabular display of days ends - // OK, now for the filtering display - echo '
'; - - // Global events - if($SESSION->cal_show_global) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - - // Course events - if(!empty($SESSION->cal_show_course)) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - - echo "\n"; - - if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) { - echo ''; - // Group events - if($SESSION->cal_show_groups) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - // User events - if($SESSION->cal_show_user) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - echo "\n"; - } - - echo '
'.get_string('globalevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('globalevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('courseevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('courseevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'.get_string('groupevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('groupevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('userevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('userevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'; + // OK, now for the filtering display + echo '
'; + + // Global events + if($SESSION->cal_show_global) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + + // Course events + if(!empty($SESSION->cal_show_course)) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + + echo "\n"; + + if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) { + echo ''; + // Group events + if($SESSION->cal_show_groups) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + // User events + if($SESSION->cal_show_user) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + echo "\n"; + } + + echo '
'.get_string('globalevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('globalevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('courseevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('courseevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'.get_string('groupevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('groupevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('userevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('userevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'; } function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $maxevents, $courseid) { diff --git a/course/completion.js b/course/completion.js index 3c7dd0383d..5e9f186b5c 100644 --- a/course/completion.js +++ b/course/completion.js @@ -95,12 +95,12 @@ function completion_toggle(e) { function completion_set_progressicon_visibility(spanid,displaystatus) { // Check if the progress icon exists if (document.getElementById(spanid)!= null) { - if (displaystatus=='show') { + if (displaystatus=='show') { document.getElementById(spanid).style.display="block"; } else if (displaystatus=='hide') { document.getElementById(spanid).style.display="none"; - + } else { alert ("An error occurred when calling completion_set_progressicon_visibility() function."); diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 90e1ec7c83..bbf6425ff6 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -182,7 +182,7 @@ while ($section <= $course->numsections) { // Note, 'right side' is BEFORE content. echo '
'; - if ($displaysection == $section) { // Show the zoom boxes + if ($displaysection == $section) { // Show the zoom boxes echo ''. ''.$strshowalltopics.'
'; } else { diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 069fe9a2bb..9d2e84aff2 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -173,7 +173,7 @@ echo '
  • '; - echo '
     '.$currenttext.'
    '; + echo '
     '.$currenttext.'
    '; // Note, 'right side' is BEFORE content. echo '
    '; diff --git a/enrol/authorize/enrol_form.php b/enrol/authorize/enrol_form.php index 60567f42f6..92b7f3d4d4 100755 --- a/enrol/authorize/enrol_form.php +++ b/enrol/authorize/enrol_form.php @@ -60,7 +60,7 @@ class enrol_authorize_form extends moodleform $endyear = $startyear + 20; $yearsmenu = array('' => get_string('choose')); for ($i = $startyear; $i < $endyear; $i++) { - $yearsmenu[$i] = $i; + $yearsmenu[$i] = $i; } $ccexpiregrp = array(); $ccexpiregrp[] = &$mform->createElement('select', 'ccexpiremm', '', $monthsmenu); diff --git a/enrol/authorize/uploadcsv.php b/enrol/authorize/uploadcsv.php index b2a50942e1..417f463d78 100644 --- a/enrol/authorize/uploadcsv.php +++ b/enrol/authorize/uploadcsv.php @@ -240,7 +240,7 @@ function authorize_process_csv($filename) $eventdata->fullmessage = $ignoredlines; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; message_send($eventdata); } diff --git a/enrol/flatfile/enrol.php b/enrol/flatfile/enrol.php index e074621c51..b91774220a 100644 --- a/enrol/flatfile/enrol.php +++ b/enrol/flatfile/enrol.php @@ -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 = ''; message_send($eventdata); } } diff --git a/enrol/imsenterprise/enrol.php b/enrol/imsenterprise/enrol.php index db1e9134ac..96cfbf13a4 100644 --- a/enrol/imsenterprise/enrol.php +++ b/enrol/imsenterprise/enrol.php @@ -388,7 +388,7 @@ function cron() { $eventdata->fullmessage = $msg; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; message_send($eventdata); $this->log_line('Notification email sent to administrator.'); diff --git a/enrol/manual/enrol.php b/enrol/manual/enrol.php index 449bde5c77..a9caedcbdc 100644 --- a/enrol/manual/enrol.php +++ b/enrol/manual/enrol.php @@ -329,7 +329,7 @@ function cron() { $eventdata->fullmessage = $strexpirynotifystudentsemail; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; message_send($eventdata); } } @@ -354,7 +354,7 @@ function cron() { $eventdata->fullmessage = $strexpirynotifyemail; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; message_send($eventdata); } } diff --git a/enrol/paypal/ipn.php b/enrol/paypal/ipn.php index b0c22dd227..33a5153b0f 100644 --- a/enrol/paypal/ipn.php +++ b/enrol/paypal/ipn.php @@ -219,7 +219,7 @@ $eventdata->fullmessage = get_string('enrolmentnewuser', '', $a); $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; message_send($eventdata); } diff --git a/group/autogroup.php b/group/autogroup.php index af2af7d754..668ca3d84a 100644 --- a/group/autogroup.php +++ b/group/autogroup.php @@ -92,11 +92,11 @@ if ($editform->is_cancelled()) { // Plan the allocation if ($data->groupby == 'groups') { - $numgrps = $data->number; + $numgrps = $data->number; $userpergrp = floor($usercnt/$numgrps); } else { // members - $numgrps = ceil($usercnt/$data->number); + $numgrps = ceil($usercnt/$data->number); $userpergrp = $data->number; if (!empty($data->nosmallgroups) and $usercnt % $data->number != 0) { @@ -194,7 +194,7 @@ if ($editform->is_cancelled()) { } // Save the groups data - foreach ($groups as $key=>$group) { + foreach ($groups as $key=>$group) { if (groups_get_group_by_name($courseid, $group['name'])) { $error = get_string('groupnameexists', 'group', $group['name']); $failed = true; @@ -244,7 +244,7 @@ if ($error != '') { $editform->display(); if($preview !== '') { - echo $OUTPUT->heading(get_string('groupspreview', 'group')); + echo $OUTPUT->heading(get_string('groupspreview', 'group')); echo $preview; } diff --git a/group/autogroup_form.php b/group/autogroup_form.php index 016713d3d9..71b02fcefe 100644 --- a/group/autogroup_form.php +++ b/group/autogroup_form.php @@ -89,7 +89,7 @@ class autogroup_form extends moodleform { function validation($data, $files) { - global $CFG, $COURSE; + global $CFG, $COURSE; $errors = parent::validation($data, $files); if ($data['allocateby'] != 'no') { @@ -102,7 +102,7 @@ class autogroup_form extends moodleform { $usercnt = count($users); if ($data['number'] > $usercnt || $data['number'] < 1) { - $errors['number'] = get_string('toomanygroups', 'group', $usercnt); + $errors['number'] = get_string('toomanygroups', 'group', $usercnt); } } } diff --git a/group/lib.php b/group/lib.php index ed82029046..26e0f2ac8b 100644 --- a/group/lib.php +++ b/group/lib.php @@ -530,7 +530,7 @@ function groups_get_possible_roles($context) { * @return array An array of the users */ function groups_get_potential_members($courseid, $roleid = null, $orderby = 'lastname,firstname') { - global $DB; + global $DB; $context = get_context_instance(CONTEXT_COURSE, $courseid); $sitecontext = get_context_instance(CONTEXT_SYSTEM); @@ -606,7 +606,7 @@ function groups_parse_name($format, $groupnumber) { } $str = str_replace('@', $letter, $format); } else { - $str = str_replace('#', $groupnumber+1, $format); + $str = str_replace('#', $groupnumber+1, $format); } return($str); } diff --git a/lang/en_utf8/help/grade/index.html b/lang/en_utf8/help/grade/index.html index 07d8dca992..27d0d128f1 100644 --- a/lang/en_utf8/help/grade/index.html +++ b/lang/en_utf8/help/grade/index.html @@ -1,71 +1,71 @@

    Grade

    diff --git a/lib/form/datetimeselector.php b/lib/form/datetimeselector.php index 25c2098ff6..b7d80a56db 100644 --- a/lib/form/datetimeselector.php +++ b/lib/form/datetimeselector.php @@ -109,13 +109,13 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group{ $this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true); $this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); $this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); - if (right_to_left()) { // Switch order of elements for Right-to-Left - $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); - } else { - $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); - } + if (right_to_left()) { // Switch order of elements for Right-to-Left + $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); + } else { + $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); + $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + } // If optional we add a checkbox which the user can use to turn if on if($this->_options['optional']) { $this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true); diff --git a/lib/simpletest/testcompletionlib.php b/lib/simpletest/testcompletionlib.php index 3cd0aa4c19..6d89337c3b 100644 --- a/lib/simpletest/testcompletionlib.php +++ b/lib/simpletest/testcompletionlib.php @@ -477,14 +477,14 @@ WHERE // Try with no activities $DB->expectAt(0,'get_records_select',array('course_modules', - 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE)); + 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE)); $DB->setReturnValueAt(0,'get_records_select',array()); $result=$c->get_activities(); $this->assertEqual(array(),$result); // Try with an activity (need to fake up modinfo for it as well) $DB->expectAt(1,'get_records_select',array('course_modules', - 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE)); + 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE)); $DB->setReturnValueAt(1,'get_records_select',array( 13=>(object)array('id'=>13) )); diff --git a/lib/simpletest/testrss.php b/lib/simpletest/testrss.php index 7f3a500519..7dd0611056 100644 --- a/lib/simpletest/testrss.php +++ b/lib/simpletest/testrss.php @@ -38,7 +38,7 @@ class moodlesimplepie_test extends UnitTestCase { $this->assertFalse($feed->error(), "Failed to load the sample RSS file. Please check your proxy settings in Moodle. %s"); if ($feed->error()) { - return; + return; } $this->assertEqual($feed->get_title(), 'Moodle News'); @@ -58,7 +58,7 @@ class moodlesimplepie_test extends UnitTestCase { $this->assertTrue($itemone = $feed->get_item(0)); if (!$itemone) { - return; + return; } $this->assertEqual($itemone->get_title(), 'Google HOP contest encourages pre-University students to work on Moodle'); diff --git a/lib/simpletest/testsimpletestlib.php b/lib/simpletest/testsimpletestlib.php index bd97a7c245..b6b278440f 100644 --- a/lib/simpletest/testsimpletestlib.php +++ b/lib/simpletest/testsimpletestlib.php @@ -92,7 +92,7 @@ class ContainsTagWithAttribute_test extends UnitTestCase { } function test_real_regression1() { - $expectation = new ContainsTagWithAttribute('label', 'for', 'html_select4ac387224bf9d'); + $expectation = new ContainsTagWithAttribute('label', 'for', 'html_select4ac387224bf9d'); $html = ''; $this->assert($expectation, $html); } diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php index 0be971c7b9..b9e4a02e45 100644 --- a/lib/simpletestlib.php +++ b/lib/simpletestlib.php @@ -188,20 +188,20 @@ class CheckSpecifiedFieldsExpectation extends SimpleExpectation { } abstract class XMLStructureExpectation extends SimpleExpectation { - /** - * Parse a string as XML and return a DOMDocument; - * @param $html - * @return unknown_type - */ + /** + * Parse a string as XML and return a DOMDocument; + * @param $html + * @return unknown_type + */ protected function load_xml($html) { - $prevsetting = libxml_use_internal_errors(true); - $parser = new DOMDocument(); - if (!$parser->loadXML('' . $html . '')) { - $parser = new DOMDocument(); - } + $prevsetting = libxml_use_internal_errors(true); + $parser = new DOMDocument(); + if (!$parser->loadXML('' . $html . '')) { + $parser = new DOMDocument(); + } libxml_clear_errors(); - libxml_use_internal_errors($prevsetting); - return $parser; + libxml_use_internal_errors($prevsetting); + return $parser; } } /** diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 0f6688ab82..011961182d 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1390,7 +1390,7 @@ class assignment_base { } } - $userlink = '' . fullname($auser) . ''; + $userlink = '' . fullname($auser) . ''; $row = array($picture, $userlink, $grade, $comment, $studentmodified, $teachermodified, $status, $finalgrade); if ($uses_outcomes) { $row[] = $outcomes; diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index 6fd015f43e..1a4b63f650 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -961,9 +961,9 @@ class assignment_upload extends assignment_base { return false; } - if ($this->is_finalized($submission)) { - return false; - } + if ($this->is_finalized($submission)) { + return false; + } if (has_capability('mod/assignment:grade', $this->context)) { return true; diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index aa9b2ea6f1..f6d8a322e9 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -219,7 +219,7 @@ class mod_forum_mod_form extends moodleform_mod { } } - function add_completion_rules() { + function add_completion_rules() { $mform =& $this->_form; $group=array(); diff --git a/mod/hotpot/mod_form.js b/mod/hotpot/mod_form.js index e33b9483f2..c6c185496e 100644 --- a/mod/hotpot/mod_form.js +++ b/mod/hotpot/mod_form.js @@ -33,9 +33,9 @@ function AddWhiteSpace(BeforeOrAfter, id) { obj = obj.parentNode; } if (obj) { - switch (BeforeOrAfter) { - case 'before': obj.style.marginTop = '1.8em'; break; - case 'after': obj.style.marginBottom = '0.8em'; break; + switch (BeforeOrAfter) { + case 'before': obj.style.marginTop = '1.8em'; break; + case 'after': obj.style.marginBottom = '0.8em'; break; } } } diff --git a/mod/quiz/accessrules.php b/mod/quiz/accessrules.php index c734ba10ff..d8621cd910 100644 --- a/mod/quiz/accessrules.php +++ b/mod/quiz/accessrules.php @@ -783,7 +783,7 @@ class securewindow_access_rule extends quiz_access_rule_base { class safebrowser_access_rule extends quiz_access_rule_base { public function prevent_access() { if (!$this->_quizobj->is_preview_user() && !quiz_check_safe_browser()) { - return get_string('safebrowsererror', 'quiz'); + return get_string('safebrowsererror', 'quiz'); } else { return false; } diff --git a/mod/scorm/aicc.php b/mod/scorm/aicc.php index e042868c8e..096fac55b6 100755 --- a/mod/scorm/aicc.php +++ b/mod/scorm/aicc.php @@ -8,12 +8,11 @@ include_once('lib.php'); require_once('locallib.php'); require_once('datamodels/aicclib.php'); - - foreach ($_POST as $key => $value) - { - $tempkey = strtolower($key); - $_POST[$tempkey] = $value; - } + + foreach ($_POST as $key => $value) { + $tempkey = strtolower($key); + $_POST[$tempkey] = $value; + } $command = required_param('command', PARAM_ALPHA); $sessionid = required_param('session_id', PARAM_ALPHANUM); diff --git a/mod/scorm/datamodels/scorm_13.js.php b/mod/scorm/datamodels/scorm_13.js.php index 3dda7c7886..f7d8cf7c89 100644 --- a/mod/scorm/datamodels/scorm_13.js.php +++ b/mod/scorm/datamodels/scorm_13.js.php @@ -695,8 +695,8 @@ function SCORMapi1_3() { } break; case 'cmi.interactions.n.correct_responses.n.pattern': - subel= subelement.split('.'); - subel1= 'cmi.interactions.'+subel[2]; + subel= subelement.split('.'); + subel1= 'cmi.interactions.'+subel[2]; if (typeof eval(subel1+'.type') == "undefined") { errorCode="408"; diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index c81d97fb1e..8fc5536f8a 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -460,7 +460,7 @@ function scorm_get_tracks($scoid,$userid,$attempt='') { * */ function scorm_get_sco_runtime($scormid, $scoid, $userid, $attempt=1) { - global $DB; + global $DB; $timedata = new object(); $sql = !empty($scoid) ? "userid=$userid AND scormid=$scormid AND scoid=$scoid AND attempt=$attempt" : "userid=$userid AND scormid=$scormid AND attempt=$attempt"; diff --git a/portfolio/googledocs/lib.php b/portfolio/googledocs/lib.php index 2a23e6ce53..9127c01a19 100644 --- a/portfolio/googledocs/lib.php +++ b/portfolio/googledocs/lib.php @@ -30,7 +30,7 @@ class portfolio_plugin_googledocs extends portfolio_plugin_push_base { // we send the files as they are, no prep required return true; } - + public function get_interactive_continue_url(){ return 'http://docs.google.com/'; } diff --git a/portfolio/picasa/lib.php b/portfolio/picasa/lib.php index f0fab4af87..a5082d6159 100644 --- a/portfolio/picasa/lib.php +++ b/portfolio/picasa/lib.php @@ -23,7 +23,7 @@ class portfolio_plugin_picasa extends portfolio_plugin_push_base { // we send the files as they are, no prep required return true; } - + public function get_interactive_continue_url(){ return 'http://picasaweb.google.com/'; } diff --git a/question/editlib.php b/question/editlib.php index c621bb4ba2..07d66f09dc 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -1451,7 +1451,7 @@ class question_bank_view { if ($questionlist = explode(',', $deleteselected)) { // for each question either hide it if it is in use or delete it foreach ($questionlist as $questionid) { - $questionid = (int)$questionid; + $questionid = (int)$questionid; question_require_capability_on($questionid, 'edit'); if ($DB->record_exists('quiz_question_instances', array('question' => $questionid))) { if (!$DB->set_field('question', 'hidden', 1, array('id' => $questionid))) { diff --git a/question/format/blackboard/format.php b/question/format/blackboard/format.php index 23fd4cd381..5c7d8895dc 100644 --- a/question/format/blackboard/format.php +++ b/question/format/blackboard/format.php @@ -49,17 +49,17 @@ class qformat_blackboard extends qformat_default { function process_essay($xml, &$questions ) { if (isset($xml["POOL"]["#"]["QUESTION_ESSAY"])) { - $essayquestions = $xml["POOL"]["#"]["QUESTION_ESSAY"]; + $essayquestions = $xml["POOL"]["#"]["QUESTION_ESSAY"]; } else { - return; - } + return; + } foreach ($essayquestions as $essayquestion) { $question = $this->defaultquestion(); - $question->qtype = ESSAY; + $question->qtype = ESSAY; // determine if the question is already escaped html $ishtml = $essayquestion["#"]["BODY"][0]["#"]["FLAGS"][0]["#"]["ISHTML"][0]["@"]["value"]; @@ -76,7 +76,7 @@ function process_essay($xml, &$questions ) { $question->fraction = 0; $questions[] = $question; - } + } } //---------------------------------------- diff --git a/question/type/calculated/datasetdefinitions_form.php b/question/type/calculated/datasetdefinitions_form.php index 8aceae4017..232ca23a7c 100644 --- a/question/type/calculated/datasetdefinitions_form.php +++ b/question/type/calculated/datasetdefinitions_form.php @@ -28,10 +28,10 @@ class question_dataset_dependent_definitions_form extends moodleform { global $QTYPES, $DB; $this->question = $question; $this->qtypeobj =& $QTYPES[$this->question->qtype]; - // Validate the question category. - if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) { - print_error('categorydoesnotexist', 'question', $returnurl); - } + // Validate the question category. + if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) { + print_error('categorydoesnotexist', 'question', $returnurl); + } $this->category = $category; $this->categorycontext = get_context_instance_by_id($category->contextid); parent::moodleform($submiturl); diff --git a/question/type/calculated/datasetitems_form.php b/question/type/calculated/datasetitems_form.php index 93ccd3b796..46bd508200 100644 --- a/question/type/calculated/datasetitems_form.php +++ b/question/type/calculated/datasetitems_form.php @@ -36,10 +36,10 @@ class question_dataset_dependent_items_form extends moodleform { $this->regenerate = $regenerate; $this->question = $question; $this->qtypeobj =& $QTYPES[$this->question->qtype]; - // Validate the question category. - if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) { - print_error('categorydoesnotexist', 'question', $returnurl); - } + // Validate the question category. + if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) { + print_error('categorydoesnotexist', 'question', $returnurl); + } $this->category = $category; $this->categorycontext = get_context_instance_by_id($category->contextid); //get the dataset defintions for this question diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index 6dc9eb5af0..c8841fe99a 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -1041,29 +1041,29 @@ class question_calculated_qtype extends default_questiontype { } } - /** - * This function get the dataset items using id as unique parameter and return an - * array with itemnumber as index sorted ascendant - * If the multiple records with the same itemnumber exist, only the newest one - * i.e with the greatest id is used, the others are ignored but not deleted. - * MDL-19210 - */ + /** + * This function get the dataset items using id as unique parameter and return an + * array with itemnumber as index sorted ascendant + * If the multiple records with the same itemnumber exist, only the newest one + * i.e with the greatest id is used, the others are ignored but not deleted. + * MDL-19210 + */ function get_database_dataset_items($definition){ - global $CFG, $DB; - $databasedataitems = $DB->get_records_sql( // Use number as key!! - " SELECT id , itemnumber, definition, value - FROM {question_dataset_items} - WHERE definition = $definition order by id DESC ", array($definition)); - $dataitems = Array(); - foreach($databasedataitems as $id => $dataitem ){ - if (!isset($dataitems[$dataitem->itemnumber])){ - $dataitems[$dataitem->itemnumber] = $dataitem ; - }else { - // deleting the unused records could be added here - } - } - ksort($dataitems); - return $dataitems ; + global $CFG, $DB; + $databasedataitems = $DB->get_records_sql( // Use number as key!! + " SELECT id , itemnumber, definition, value + FROM {question_dataset_items} + WHERE definition = $definition order by id DESC ", array($definition)); + $dataitems = Array(); + foreach($databasedataitems as $id => $dataitem ){ + if (!isset($dataitems[$dataitem->itemnumber])){ + $dataitems[$dataitem->itemnumber] = $dataitem ; + }else { + // deleting the unused records could be added here + } + } + ksort($dataitems); + return $dataitems ; } function save_dataset_items($question, $fromform){ diff --git a/question/type/calculatedsimple/questiontype.php b/question/type/calculatedsimple/questiontype.php index da7e92fe4d..f7cfb62834 100644 --- a/question/type/calculatedsimple/questiontype.php +++ b/question/type/calculatedsimple/questiontype.php @@ -217,7 +217,6 @@ class question_calculatedsimple_qtype extends question_calculated_qtype { * @param PARAM_ALPHA $wizardnow should be added as we are coming from question2.php */ function save_question($question, $form, $course) { - $question = default_questiontype::save_question($question, $form, $course); return $question; } diff --git a/question/type/essay/edit_essay_form.php b/question/type/essay/edit_essay_form.php index 991c76de29..5b90371d72 100644 --- a/question/type/essay/edit_essay_form.php +++ b/question/type/essay/edit_essay_form.php @@ -33,7 +33,7 @@ class question_edit_essay_form extends question_edit_form { } function set_data($question) { - if (!empty($question->options) && !empty($question->options->answers)) { + if (!empty($question->options) && !empty($question->options->answers)) { $answer = reset($question->options->answers); $question->feedback = $answer->feedback; } diff --git a/question/type/numerical/display.html b/question/type/numerical/display.html index ab34b86f34..139b0de85e 100644 --- a/question/type/numerical/display.html +++ b/question/type/numerical/display.html @@ -47,9 +47,9 @@
    - - - + + + size="" /> @@ -79,9 +79,9 @@ ?>
    - - - + + + size=""/> @@ -94,11 +94,11 @@ ?>
    - - options->units[0]->unit ; - ?> - + + options->units[0]->unit ; + ?> +
    - - - + + + size=""/> @@ -208,14 +208,14 @@