From 20207b827a8d69f0d3ccfb2e0d6040a908bd2d01 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 1 Nov 2009 10:57:00 +0000 Subject: [PATCH] MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup --- admin/auth.php | 2 +- admin/auth_config.php | 2 +- admin/block.php | 4 +-- admin/blocks.php | 4 +-- admin/bloglevelupgrade.php | 2 +- admin/cron.php | 60 +++++++++++++++++------------------ admin/dbtransfer/index.php | 2 +- admin/delete.php | 6 ++-- admin/enrol.php | 2 +- admin/enrol_config.php | 4 +-- admin/environment.php | 4 +-- admin/filters.php | 2 +- admin/generator.php | 2 +- admin/handlevirus.php | 2 +- admin/health.php | 2 +- admin/innodb.php | 2 +- admin/lang.php | 6 ++-- admin/langimport.php | 4 +-- admin/mailout-debugger.php | 2 +- admin/mnet/mnet_services.html | 28 ++++++++-------- admin/mnet/mnet_themes.html | 6 ++-- admin/mnet/trustedhosts.html | 4 +-- admin/modules.php | 4 +-- admin/multilangupgrade.php | 4 +-- admin/oacleanup.php | 2 +- admin/phpinfo.php | 4 +-- admin/portfolio.php | 2 +- admin/process_email.php | 14 ++++---- admin/qtypes.php | 4 +-- admin/register.php | 2 +- admin/replace.php | 4 +-- admin/search.php | 4 +-- admin/settings.php | 2 +- admin/timezone.php | 4 +-- admin/timezoneimport.php | 4 +-- admin/upgradesettings.php | 4 +-- admin/uploadpicture.php | 16 +++++----- admin/uploadpicture_form.php | 10 +++--- admin/uploaduser.php | 2 +- admin/uploaduser_form.php | 4 +-- admin/user.php | 6 ++-- 41 files changed, 124 insertions(+), 124 deletions(-) diff --git a/admin/auth.php b/admin/auth.php index fe3d610827..bed2282177 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -100,4 +100,4 @@ switch ($action) { redirect ($returnurl); -?> + diff --git a/admin/auth_config.php b/admin/auth_config.php index 369365bd25..fe37991255 100644 --- a/admin/auth_config.php +++ b/admin/auth_config.php @@ -136,7 +136,7 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $fieldname = get_string('webpage'); } else { $fieldname = get_string($fieldname); - } + } if ($retrieveopts) { $varname = 'field_map_' . $field; diff --git a/admin/block.php b/admin/block.php index 6c5252dfd5..b5243bde33 100644 --- a/admin/block.php +++ b/admin/block.php @@ -1,4 +1,4 @@ -'; echo $OUTPUT->footer(); -?> + diff --git a/admin/blocks.php b/admin/blocks.php index f6acc1a44b..d75e698a2f 100644 --- a/admin/blocks.php +++ b/admin/blocks.php @@ -1,4 +1,4 @@ -footer(); -?> + diff --git a/admin/bloglevelupgrade.php b/admin/bloglevelupgrade.php index ba3b52cb6c..7d2c9e4864 100644 --- a/admin/bloglevelupgrade.php +++ b/admin/bloglevelupgrade.php @@ -1,4 +1,4 @@ -cronclionly)) { + if (!empty($CFG->cronclionly)) { // This script can only be run via the cli. print_error('cronerrorclionly', 'admin'); exit; @@ -51,7 +51,7 @@ $pass = optional_param('password', '', PARAM_RAW); if($pass != $CFG->cronremotepassword) { // wrong password. - print_error('cronerrorpassword', 'admin'); + print_error('cronerrorpassword', 'admin'); exit; } } @@ -132,7 +132,7 @@ if (file_exists($blockfile)) { require_once($blockfile); $classname = 'block_'.$block->name; - $blockobj = new $classname; + $blockobj = new $classname; if (method_exists($blockobj,'cron')) { mtrace("Processing cron function for ".$block->name.'....',''); if ($blockobj->cron()) { @@ -177,7 +177,7 @@ } } mtrace("Finished quiz reports"); - + mtrace('Starting admin reports'); // Admin reports do not have a database table that lists them. Instead a // report includes cron.php with function report_reportname_cron() if it wishes @@ -254,7 +254,7 @@ } /// Run all core cron jobs, but not every time since they aren't too important. -/// These don't have a timer to reduce load, so we'll use a random number +/// These don't have a timer to reduce load, so we'll use a random number /// to randomly choose the percentage of times we should run these jobs. srand ((double) microtime() * 10000000); @@ -367,21 +367,21 @@ mtrace('Synchronised metacourses'); // - // generate new password emails for users + // generate new password emails for users // mtrace('checking for create_password'); if ($DB->count_records('user_preferences', array('name'=>'create_password', 'value'=>'1'))) { mtrace('creating passwords for new users'); - $newusers = $DB->get_records_sql("SELECT u.id as id, u.email, u.firstname, + $newusers = $DB->get_records_sql("SELECT u.id as id, u.email, u.firstname, u.lastname, u.username, - p.id as prefid - FROM {user} u + p.id as prefid + FROM {user} u JOIN {user_preferences} p ON u.id=p.userid WHERE p.name='create_password' AND p.value='1' AND u.email !='' "); foreach ($newusers as $newuserid => $newuser) { $newuser->emailstop = 0; // send email regardless - // email user + // email user if (setnew_password_and_mail($newuser)) { // remove user pref $DB->delete_records('user_preferences', array('id'=>$newuser->prefid)); @@ -390,20 +390,20 @@ } } } - + if (!empty($CFG->usetags)) { require_once($CFG->dirroot.'/tag/lib.php'); tag_cron(); mtrace ('Executed tag cron'); } - + // Accesslib stuff cleanup_contexts(); mtrace ('Cleaned up contexts'); gc_cache_flags(); mtrace ('Cleaned cache flags'); // If you suspect that the context paths are somehow corrupt - // replace the line below with: build_context_path(true); + // replace the line below with: build_context_path(true); build_context_path(); mtrace ('Built context paths'); @@ -418,8 +418,8 @@ @set_time_limit(0); @raise_memory_limit("192M"); if (function_exists('apache_child_terminate')) { - // if we are running from Apache, give httpd a hint that - // it can recycle the process after it's done. Apache's + // if we are running from Apache, give httpd a hint that + // it can recycle the process after it's done. Apache's // memory management is truly awful but we can help it. @apache_child_terminate(); } @@ -431,7 +431,7 @@ include_once("$CFG->dirroot/backup/backuplib.php"); include_once("$CFG->dirroot/backup/lib.php"); mtrace("Running backups if required..."); - + if (! schedule_backup_cron()) { mtrace("ERROR: Something went wrong while performing backup tasks!!!"); } else { @@ -507,51 +507,51 @@ // run gradebook import/export/report cron if ($gradeimports = get_plugin_list('gradeimport')) { - foreach ($gradeimports as $gradeimport => $plugindir) { + foreach ($gradeimports as $gradeimport => $plugindir) { if (file_exists($plugindir.'/lib.php')) { require_once($plugindir.'/lib.php'); - $cron_function = 'grade_import_'.$gradeimport.'_cron'; + $cron_function = 'grade_import_'.$gradeimport.'_cron'; if (function_exists($cron_function)) { mtrace("Processing gradebook import function $cron_function ...", ''); - $cron_function; + $cron_function; } } - } + } } if ($gradeexports = get_plugin_list('gradeexport')) { - foreach ($gradeexports as $gradeexport => $plugindir) { + foreach ($gradeexports as $gradeexport => $plugindir) { if (file_exists($plugindir.'/lib.php')) { require_once($plugindir.'/lib.php'); - $cron_function = 'grade_export_'.$gradeexport.'_cron'; + $cron_function = 'grade_export_'.$gradeexport.'_cron'; if (function_exists($cron_function)) { mtrace("Processing gradebook export function $cron_function ...", ''); - $cron_function; + $cron_function; } } } } if ($gradereports = get_plugin_list('gradereport')) { - foreach ($gradereports as $gradereport => $plugindir) { + foreach ($gradereports as $gradereport => $plugindir) { if (file_exists($plugindir.'/lib.php')) { require_once($plugindir.'/lib.php'); - $cron_function = 'grade_report_'.$gradereport.'_cron'; + $cron_function = 'grade_report_'.$gradereport.'_cron'; if (function_exists($cron_function)) { mtrace("Processing gradebook report function $cron_function ...", ''); - $cron_function; + $cron_function; } } } } - + // Run external blog cron if needed if ($CFG->useexternalblogs) { require_once($CFG->dirroot . '/blog/lib.php'); mtrace("Fetching external blog entries...", ''); $sql = "timefetched < ? - ? OR timefetched = 0"; $externalblogs = $DB->get_records_select('blog_external', $sql, array(mktime(), $CFG->externalblogcrontime)); - + foreach ($external_blogs as $eb) { blog_sync_external_entries($eb); } @@ -584,7 +584,7 @@ mtrace("Cron script completed correctly"); $difftime = microtime_diff($starttime, microtime()); - mtrace("Execution took ".$difftime." seconds"); + mtrace("Execution took ".$difftime." seconds"); /// finish the IE hack if (check_browser_version('MSIE')) { diff --git a/admin/dbtransfer/index.php b/admin/dbtransfer/index.php index 59920a0b9e..a3d61545e3 100644 --- a/admin/dbtransfer/index.php +++ b/admin/dbtransfer/index.php @@ -19,7 +19,7 @@ if ($data = $form->get_data()) { throw new dbtransfer_exception('notargetconectexception', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/"); } if ($targetdb->get_tables()) { - throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/"); + throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/"); } // Start output. diff --git a/admin/delete.php b/admin/delete.php index 36a7afa68b..d025c8b841 100644 --- a/admin/delete.php +++ b/admin/delete.php @@ -22,7 +22,7 @@ if (empty($sure)) { $optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey()); - + $formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes')); $formcancel = html_form::make_button('index.php', null, get_string('no'), 'get'); echo $OUTPUT->confirm('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', $formcontinue, $formcancel); @@ -34,8 +34,8 @@ $optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes'); $formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes')); $formcancel = html_form::make_button('index.php', null, get_string('no'), 'get'); - echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. - $deletedir .' (this includes all user images, and any other course files that have been created) ?', + echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. + $deletedir .' (this includes all user images, and any other course files that have been created) ?', $formcontinue, $formcancel); echo $OUTPUT->footer(); exit; diff --git a/admin/enrol.php b/admin/enrol.php index 889ef777a5..00562e190d 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -120,7 +120,7 @@ echo ''; echo '
'; echo '
'; - + echo '
'; diff --git a/admin/enrol_config.php b/admin/enrol_config.php index b3a9e4ee9b..c13b8ea55d 100644 --- a/admin/enrol_config.php +++ b/admin/enrol_config.php @@ -1,4 +1,4 @@ -footer(); exit; -?> + diff --git a/admin/environment.php b/admin/environment.php index d057df449c..6e0873fd99 100644 --- a/admin/environment.php +++ b/admin/environment.php @@ -62,8 +62,8 @@ /// Handle the 'updatecomponent' action if ($action == 'updatecomponent' && confirm_sesskey()) { /// Create component installer and execute it - if ($cd = new component_installer('http://download.moodle.org', - 'environment', + if ($cd = new component_installer('http://download.moodle.org', + 'environment', 'environment.zip')) { $status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED) switch ($status) { diff --git a/admin/filters.php b/admin/filters.php index 6489ee0b21..763adffe37 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -120,7 +120,7 @@ $title = get_string('deletefilterareyousure', 'admin', $filtername); admin_externalpage_print_header(); echo $OUTPUT->heading($title); - + $linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1)); $formcancel = html_form::make_button($returnurl, null, get_string('no'), 'get'); echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel); diff --git a/admin/generator.php b/admin/generator.php index 333848b699..d743cd295e 100755 --- a/admin/generator.php +++ b/admin/generator.php @@ -75,7 +75,7 @@ class generator { global $CFG; $this->starttime = time()+microtime(); - + $arguments = array( array('short'=>'u', 'long'=>'username', 'help' => 'Your moodle username', 'type'=>'STRING', 'default' => ''), diff --git a/admin/handlevirus.php b/admin/handlevirus.php index 5dff5e517b..c84428077e 100644 --- a/admin/handlevirus.php +++ b/admin/handlevirus.php @@ -86,7 +86,7 @@ function notify_admins($user,$subject,$a) { $eventdata->fullmessage = $body; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; + $eventdata->smallmessage = ''; events_trigger('message_send', $eventdata); } } diff --git a/admin/health.php b/admin/health.php index 8a3b8b32b4..77d1471ce6 100644 --- a/admin/health.php +++ b/admin/health.php @@ -533,7 +533,7 @@ class problem_000013 extends problem_base { } function exists() { global $DB; - $positionexpr = $DB->sql_position($DB->sql_concat("','", "q.id", "','"), + $positionexpr = $DB->sql_position($DB->sql_concat("','", "q.id", "','"), $DB->sql_concat("','", "qma.sequence", "','")); return $DB->record_exists_sql(" SELECT * FROM {question} q diff --git a/admin/innodb.php b/admin/innodb.php index a504f83c9f..c1dda3c672 100644 --- a/admin/innodb.php +++ b/admin/innodb.php @@ -42,4 +42,4 @@ echo $OUTPUT->footer(); } -?> + diff --git a/admin/lang.php b/admin/lang.php index 0d642d3ae4..25f6312c61 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -841,7 +841,7 @@ if ($preview_url) { $link = html_link::make($preview_url, get_string('preview')); $link->add_action(new popup_action('click', $link->url)); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } echo '
'; } @@ -861,7 +861,7 @@ if ($preview_url) { $link = html_link::make($preview_url, get_string('preview')); $link->add_action(new popup_action('click', $link->url)); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } echo ''; } @@ -885,7 +885,7 @@ if ($preview_url) { $link = html_link::make($preview_url, get_string('preview')); $link->add_action(new popup_action('click', $link->url)); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } echo ''; } diff --git a/admin/langimport.php b/admin/langimport.php index 34aaad421f..732f179010 100755 --- a/admin/langimport.php +++ b/admin/langimport.php @@ -1,4 +1,4 @@ -dataroot/lang @@ -449,4 +449,4 @@ return false; } } -?> + diff --git a/admin/mailout-debugger.php b/admin/mailout-debugger.php index ce7c1918bb..97a2f91d58 100644 --- a/admin/mailout-debugger.php +++ b/admin/mailout-debugger.php @@ -22,7 +22,7 @@ * - Run your admin/cron.php * * - Read /tmp/moodle-mailout.log - * + * * * This script will create logfiles in /tmp/ or in $TMPDIR if set. * On windows, use php -r 'print sys_get_temp_dir()' to see where the file is saved. diff --git a/admin/mnet/mnet_services.html b/admin/mnet/mnet_services.html index dd7063f8bc..3f23bafb2f 100644 --- a/admin/mnet/mnet_services.html +++ b/admin/mnet/mnet_services.html @@ -24,7 +24,7 @@ echo $OUTPUT->box_start(); - $versions) { $version = current($versions); ?> @@ -40,7 +40,7 @@ echo $OUTPUT->box_start(); } else { $versionstring = ''; } - + echo $breakstring; ?> @@ -48,29 +48,29 @@ echo $OUTPUT->box_start(); /> -name).'">√ '; + echo $versionstring; + if (!empty($version['hostsubscribes'])) { + echo ' '; } - if (!empty($version['allhosts_publish'])) { + if (!empty($version['allhosts_publish'])) { print_string("enabled_for_all",'mnet',!empty($version['I_publish'])); - } + } echo '
'; } ?> /> -name).'">√ '; - } + } if (!empty($version['allhosts_subscribe'])) { print_string("enabled_for_all",'mnet',!empty($version['I_subscribe'])); } - - echo '
'; + + echo '
'; $breakstring = '. . . . . . . . . . . . . . . . . . . . . . . .
'; } // end foreach ?> diff --git a/admin/mnet/mnet_themes.html b/admin/mnet/mnet_themes.html index 01859dd6b6..291dbc3085 100644 --- a/admin/mnet/mnet_themes.html +++ b/admin/mnet/mnet_themes.html @@ -13,7 +13,7 @@ $tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&hostid= $tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&hostid='.$mnet_peer->id, $strmnetthemes, $strmnetthemes, false); if ($mnet_peer->id != $CFG->mnet_all_hosts_id) { $tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false); -} +} print_tabs(array($tabs), 'mnetthemes'); @@ -69,12 +69,12 @@ print_tabs(array($tabs), 'mnetthemes'); $readme = '
  • '. $link = html_link::make($CFG->themewww .'/'. $theme .'/README.html', $strinfo); $link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500))); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) { $readme = '
  • '. $link = html_link::make($CFG->themewww .'/'. $theme .'/README.txt', $strinfo); $link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500))); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } if (file_exists("$theme/screenshot.png")) { $screenshotpath = "$theme/screenshot.png"; diff --git a/admin/mnet/trustedhosts.html b/admin/mnet/trustedhosts.html index 021e819a1a..3cf6032b8f 100644 --- a/admin/mnet/trustedhosts.html +++ b/admin/mnet/trustedhosts.html @@ -25,7 +25,7 @@ admin_externalpage_print_header();
  • - @@ -48,7 +48,7 @@ admin_externalpage_print_header();
    diff --git a/admin/modules.php b/admin/modules.php index c915e1d76c..20e8d6ce3a 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -1,4 +1,4 @@ -footer(); -?> + diff --git a/admin/multilangupgrade.php b/admin/multilangupgrade.php index 801c8b0585..bb1e958a4f 100644 --- a/admin/multilangupgrade.php +++ b/admin/multilangupgrade.php @@ -1,4 +1,4 @@ - + diff --git a/admin/oacleanup.php b/admin/oacleanup.php index 30b5aa1c89..d05b18f13f 100644 --- a/admin/oacleanup.php +++ b/admin/oacleanup.php @@ -77,7 +77,7 @@ function online_assignment_cleanup($output=false) { FROM {course_modules} cm, {assignment} a WHERE cm.id = ? AND cm.module = ? AND cm.instance = a.id AND a.assignmenttype = 'online'"; - $params = array($instance, $aid); + $params = array($instance, $aid); /// if record exists then we need to move instance to it's correct section if ($DB->record_exists_sql($sql, $params)) { diff --git a/admin/phpinfo.php b/admin/phpinfo.php index 257433783c..447fe529e2 100644 --- a/admin/phpinfo.php +++ b/admin/phpinfo.php @@ -1,4 +1,4 @@ -footer(); -?> + diff --git a/admin/portfolio.php b/admin/portfolio.php index 3dcdc2ef1d..23cc2a7d19 100644 --- a/admin/portfolio.php +++ b/admin/portfolio.php @@ -111,4 +111,4 @@ if (!empty($return)) { redirect($baseurl); } echo $OUTPUT->footer(); -?> + diff --git a/admin/process_email.php b/admin/process_email.php index c8b63ac9c1..53f8483d1c 100755 --- a/admin/process_email.php +++ b/admin/process_email.php @@ -15,11 +15,11 @@ if ($_ENV['RECIPIENT'] == $CFG->noreplyaddress) { if (!validate_email($user->email)) { die(); } - + $site = get_site(); $subject = get_string('noreplybouncesubject','moodle',format_string($site->fullname)); $body = get_string('noreplybouncemessage','moodle',format_string($site->fullname))."\n\n"; - + $fd = fopen('php://stdin','r'); if ($fd) { while(!feof($fd)) { @@ -27,14 +27,14 @@ if ($_ENV['RECIPIENT'] == $CFG->noreplyaddress) { } fclose($fd); } - + $user->id = 0; // to prevent anything annoying happening - + $from->firstname = null; $from->lastname = null; $from->email = '<>'; $from->maildisplay = true; - + email_to_user($user,$from,$subject,$body); die (); } @@ -60,7 +60,7 @@ else { $function = $modname.'_process_email'; if (!function_exists($function)) { - die(); + die(); } $fd = fopen('php://stdin','r'); if (!$fd) { @@ -71,7 +71,7 @@ while(!feof($fd)) { $body .= fgets($fd); } -$function($modargs,$body); +$function($modargs,$body); fclose($fd); diff --git a/admin/qtypes.php b/admin/qtypes.php index 4e2ff79848..f09612a026 100644 --- a/admin/qtypes.php +++ b/admin/qtypes.php @@ -1,4 +1,4 @@ -'; return $html; } -?> + diff --git a/admin/register.php b/admin/register.php index d328045400..9f1b293557 100644 --- a/admin/register.php +++ b/admin/register.php @@ -1,4 +1,4 @@ -continue_button('index.php'); echo $OUTPUT->footer(); -?> + diff --git a/admin/search.php b/admin/search.php index 11d0a76b0b..57bd730f38 100644 --- a/admin/search.php +++ b/admin/search.php @@ -1,4 +1,4 @@ -'; echo $OUTPUT->footer(); -?> + diff --git a/admin/settings.php b/admin/settings.php index d9b289a9a0..10b9f6b727 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -61,7 +61,7 @@ $PAGE->set_focuscontrol($focus); if (empty($SITE->fullname)) { $PAGE->set_title($settingspage->visiblename); $PAGE->set_heading($settingspage->visiblename); - + echo $OUTPUT->header(); echo $OUTPUT->box(get_string('configintrosite', 'admin')); diff --git a/admin/timezone.php b/admin/timezone.php index 3c7bf1c6ab..7068d57d3d 100644 --- a/admin/timezone.php +++ b/admin/timezone.php @@ -7,7 +7,7 @@ if (!is_numeric($zone)) { //not a path, but it looks like it anyway $zone = clean_param($zone, PARAM_PATH); - } + } require_login(); @@ -23,7 +23,7 @@ $PAGE->set_heading($strtimezone); $PAGE->navbar->add($strtimezone); echo $OUTPUT->header(); - + echo $OUTPUT->heading(""); if (data_submitted() and !empty($zone) and confirm_sesskey()) { diff --git a/admin/timezoneimport.php b/admin/timezoneimport.php index 264b6de334..b61c68140c 100644 --- a/admin/timezoneimport.php +++ b/admin/timezoneimport.php @@ -1,12 +1,12 @@ libdir.'/adminlib.php'); require_once($CFG->libdir.'/filelib.php'); require_once($CFG->libdir.'/olson.php'); - + admin_externalpage_setup('timezoneimport'); $ok = optional_param('ok', 0, PARAM_BOOL); diff --git a/admin/upgradesettings.php b/admin/upgradesettings.php index e1a829f317..4a800a4851 100644 --- a/admin/upgradesettings.php +++ b/admin/upgradesettings.php @@ -1,4 +1,4 @@ -'; echo $OUTPUT->footer(); -?> + diff --git a/admin/uploadpicture.php b/admin/uploadpicture.php index 5dada3f550..85fe9e095d 100644 --- a/admin/uploadpicture.php +++ b/admin/uploadpicture.php @@ -28,8 +28,8 @@ require_once('uploadpicture_form.php'); define ('PIX_FILE_UPDATED', 0); define ('PIX_FILE_ERROR', 1); -define ('PIX_FILE_SKIPPED', 2); - +define ('PIX_FILE_SKIPPED', 2); + admin_externalpage_setup('uploadpictures'); require_login(); @@ -76,12 +76,12 @@ if ($formdata = $mform->get_data()) { if (function_exists('apache_child_terminate')) { @apache_child_terminate(); } - + // Create a unique temporary directory, to process the zip file // contents. $zipodir = my_mktempdir($CFG->dataroot.'/temp/', 'usrpic'); $dstfile = $zipodir.'/images.zip'; - + if (!$mform->save_file('userfile', $dstfile, true)) { echo $OUTPUT->notification(get_string('uploadpicture_cannotmovezip','admin')); @remove_dir($zipdir); @@ -93,12 +93,12 @@ if ($formdata = $mform->get_data()) { // We don't need the zip file any longer, so delete it to make // it easier to process the rest of the files inside the directory. @unlink($dstfile); - + $results = array ('errors' => 0,'updated' => 0); process_directory($zipdir, $userfields[$userfield], $overwritepicture, $results); - + // Finally remove the temporary directory with all the user images and print some stats. remove_dir($zipdir); echo $OUTPUT->notification(get_string('usersupdated', 'admin') . ": " . $results['updated']); @@ -195,7 +195,7 @@ function process_directory ($dir, $userfield, $overwrite, &$results) { */ function process_file ($file, $userfield, $overwrite) { global $DB, $OUTPUT; - + // Add additional checks on the filenames, as they are user // controlled and we don't want to open any security holes. $path_parts = pathinfo(cleardoubleslashes($file)); @@ -247,7 +247,7 @@ function process_file ($file, $userfield, $overwrite) { * picture file to. * @param string $originalfile the full path of the picture file. * - * @return bool + * @return bool */ function my_save_profile_image($id, $originalfile) { $destination = create_profile_image_destination($id, 'user'); diff --git a/admin/uploadpicture_form.php b/admin/uploadpicture_form.php index cfba7b4b75..a5d10cebae 100644 --- a/admin/uploadpicture_form.php +++ b/admin/uploadpicture_form.php @@ -4,13 +4,13 @@ class admin_uploadpicture_form extends moodleform { function definition (){ global $CFG, $USER; - + $mform =& $this->_form; - + $this->set_upload_manager(new upload_manager('userpicturesfile', false, false, null, false, 0, true, true, false)); - + $mform->addElement('header', 'settingsheader', get_string('upload')); - + $mform->addElement('file', 'userpicturesfile', get_string('file'), 'size="40"'); $mform->addRule('userpicturesfile', null, 'required'); @@ -21,7 +21,7 @@ $choices = array( 0 => get_string('no'), 1 => get_string('yes') ); $mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices); $mform->setType('overwritepicture', PARAM_INT); - + $this->add_action_buttons(false, get_string('uploadpictures', 'admin')); } } diff --git a/admin/uploaduser.php b/admin/uploaduser.php index 2477d63128..944e1fdb84 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -1020,4 +1020,4 @@ function uu_allowed_roles($shortname=false) { return $choices; } -?> + diff --git a/admin/uploaduser_form.php b/admin/uploaduser_form.php index 370bb55db0..ecb2d974a4 100644 --- a/admin/uploaduser_form.php +++ b/admin/uploaduser_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'; class admin_uploaduser_form1 extends moodleform { @@ -335,4 +335,4 @@ class admin_uploaduser_form2 extends moodleform { return $errors; } } -?> + diff --git a/admin/user.php b/admin/user.php index eee2cf28d1..4b78f94669 100644 --- a/admin/user.php +++ b/admin/user.php @@ -119,7 +119,7 @@ // create the user filter form $ufiltering = new user_filtering(); admin_externalpage_print_header(); - + // Carry on with the user listing $columns = array("firstname", "lastname", "email", "city", "country", "lastaccess"); @@ -164,7 +164,7 @@ $alphabet = explode(',', get_string('alphabet')); $strall = get_string('all'); - + $baseurl = new moodle_url('user.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage)); echo $OUTPUT->paging_bar(moodle_paging_bar::make($usercount, $page, $perpage, $baseurl)); @@ -210,7 +210,7 @@ ($CFG->fullnamedisplay == 'firstname') or ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) { $fullnamedisplay = "$firstname / $lastname"; - } else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname') + } else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname') $fullnamedisplay = "$lastname / $firstname"; } -- 2.39.5