Commit eef868d1 authored by skodak's avatar skodak
Browse files

major whitespace cleanup - fixed trailng whitespace in new files and admin area

parent 61240489
......@@ -26,7 +26,7 @@
// extract and sanitize the auth key explicitly
$modules = get_list_of_plugins("auth");
if (in_array($config['auth'], $modules)) {
$auth = $config['auth'];
$auth = $config['auth'];
} else {
notify("Error defining the authentication method");
}
......@@ -44,10 +44,10 @@
if (preg_match('/^pluginconfig_(.+?)$/', $name, $matches)) {
$plugin = "auth/$auth";
$name = $matches[1];
if (! set_config($name, $value, $plugin)) {
if (! set_config($name, $value, $plugin)) {
notify("Problem saving config $name as $value for plugin $plugin");
}
} else { // normal handling for
} else { // normal handling for
if (! set_config($name, $value)) {
notify("Problem saving config $name as $value");
}
......@@ -128,7 +128,7 @@
echo "<form target=\"{$CFG->framename}\" name=\"authmenu\" method=\"post\" action=\"auth.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";
print_string("chooseauthmethod","auth");
echo '&nbsp;&nbsp;';
choose_from_menu ($options, "auth", $auth, "","document.location='auth.php?sesskey=$USER->sesskey&auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
......@@ -150,7 +150,7 @@
require_once("$CFG->dirroot/auth/$auth/config.html");
$CFG->pagepath = 'auth/' . $auth;
echo '<tr><td colspan="3">';
print_heading(get_string('auth_common_settings', 'auth'));
echo '<td/></tr>';
......@@ -241,7 +241,7 @@
// Good enough for most auth plugins
// but some may want a custom one if they are offering
// other options
// Note: pluginconfig_ fields have special handling.
// Note: pluginconfig_ fields have special handling.
function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $updateopts) {
echo '<tr><td colspan="3">';
......@@ -259,9 +259,9 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
'onlogin' => get_string('update_onlogin', 'auth'));
$updateextoptions = array('0' => get_string('update_never', 'auth'),
'1' => get_string('update_onupdate', 'auth'));
$pluginconfig = get_config("auth/$auth");
// helptext is on a field with rowspan
if (empty($helptext)) {
$helptext = '&nbsp;';
......@@ -275,7 +275,7 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
}
if(empty($pluginconfig->{"field_updatelocal_$field"})) {
$pluginconfig->{"field_updatelocal_$field"} = '';
}
}
if (empty($pluginconfig->{"field_updateremote_$field"})) {
$pluginconfig->{"field_updateremote_$field"} = '';
}
......
......@@ -23,7 +23,7 @@
//First of all we check that everything is correct
//Check for trailing slash and backslash in backup_sche_destination
if (!empty($backup_sche_destination) and
if (!empty($backup_sche_destination) and
(substr($backup_sche_destination,-1) == "/" or substr($backup_sche_destination,-1) == "\\")) {
$error = true;
$sche_destination_error = get_string("pathslasherror");
......@@ -43,7 +43,7 @@
if (isset($a_config[$tocheck])) {
$temp .= "1";
} else {
$temp .= "0";
$temp .= "0";
}
unset($a_config[$tocheck]);
$i++;
......@@ -76,7 +76,7 @@
foreach ($courses as $course) {
//We check if the course exists in backup_course
$backup_course = get_record("backup_courses","courseid",$course->id);
//If it doesn't exist, create
//If it doesn't exist, create
if (!$backup_course) {
$temp_backup_course->courseid = $course->id;
$newid = insert_record("backup_courses",$temp_backup_course);
......@@ -120,7 +120,7 @@
//Check for required functions...
if (!function_exists('utf8_encode')) {
notify("You need to add XML support to your PHP installation");
}
}
include ("$CFG->dirroot/backup/config.html");
print_simple_box_end();
......
......@@ -9,7 +9,7 @@
require_once($CFG->libdir.'/blocklib.php');
$blockid = required_param('block', PARAM_INT);
if(($blockrecord = blocks_get_record($blockid)) === false) {
error('This block does not exist');
}
......@@ -51,11 +51,11 @@
$strconfiguration = get_string('configuration');
$strmanageblocks = get_string('manageblocks');
$strblockname = $block->get_title();
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'block/' . $block->name() . '/config';
admin_externalpage_print_header($adminroot);
......
......@@ -216,15 +216,15 @@
print_heading(get_string('incompatibleblocks', 'admin'));
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'incompatible');
$table->set_attribute('class', 'generaltable generalbox');
$table->setup();
foreach ($incompatible as $block) {
......
......@@ -64,5 +64,5 @@ function delete_subdirectories($rootdir) {
}
closedir($dir);
}
?>
......@@ -7,7 +7,7 @@
$enrol = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR);
$CFG->pagepath = 'enrol';
$adminroot = admin_get_root();
admin_externalpage_setup('enrolment', $adminroot);
......@@ -20,7 +20,7 @@
if ($frm = data_submitted()) {
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
}
if (empty($frm->enable)) {
$frm->enable = array();
}
......
......@@ -4,7 +4,7 @@
require_once("../config.php");
require_once($CFG->libdir.'/adminlib.php');
$adminroot = admin_get_root();
admin_externalpage_setup('enrolment', $adminroot);
......@@ -21,7 +21,7 @@
if ($frm = data_submitted()) {
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
}
if ($enrolment->process_config($frm)) {
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
}
......@@ -55,8 +55,8 @@
"document.location='enrol_config.php?enrol='+document.enrolmenu.enrol.options[document.enrolmenu.enrol.selectedIndex].value", "");
echo "</b></p></div>";
/// Print current enrolment type description
/// Print current enrolment type description
print_simple_box_start("center", "80%");
print_heading($options[$enrol]);
......@@ -65,7 +65,7 @@
print_simple_box_end();
echo "<hr />";
$enrolment->config_form($frm);
echo "<center><p><input type=\"submit\" value=\"".get_string("savechanges")."\"></p></center>\n";
......
......@@ -21,7 +21,7 @@
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'filter/' . $filtername . '/config';
// get translated strings for use on page
$txt = new Object;
$txt->managefilters = get_string( 'managefilters' );
......@@ -69,7 +69,7 @@
//==============================
// Display logic
//==============================
$filtername = ucfirst($filtername);
admin_externalpage_print_header($adminroot);
print_heading( $filtername );
......
......@@ -419,7 +419,7 @@ class problem_000010 extends problem_base {
}
function exists() {
if (!$this->is_enabled()) {
return true;
return true;
}
if ($this->status() < 1) {
return true;
......@@ -429,7 +429,7 @@ class problem_000010 extends problem_base {
function severity() {
if ($this->is_enabled() and $this->status() == 0) {
return SEVERITY_SIGNIFICANT;
} else {
} else {
return SEVERITY_ANNOYANCE;
}
}
......@@ -437,9 +437,9 @@ class problem_000010 extends problem_base {
global $CFG;
$desc = 'Slasharguments are needed for relative linking in uploaded resources:<ul>';
if (!$this->is_enabled()) {
$desc .= '<li>slasharguments are <strong>disabled</strong> in Moodle configuration</li>';
$desc .= '<li>slasharguments are <strong>disabled</strong> in Moodle configuration</li>';
} else {
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
}
if ($this->status() == -1) {
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a> manually</li>';
......@@ -470,9 +470,9 @@ class problem_000010 extends problem_base {
$solution .= 'Congratulations - everything seems OK now :-D';
}
if ($status < 1) {
$solution .= '<p>IIS:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li><li>do NOT enable AllowPathInfoForScriptMappings !!!</li><li>slasharguments may not work when using ISAPI and PHP 4.3.10 and older</li></ul></p>';
$solution .= '<p>Apache 1:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>Apache 2:<ul><li>you must add <code>AcceptPathInfo on</code> to php.ini or .htaccess</li><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>IIS:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li><li>do NOT enable AllowPathInfoForScriptMappings !!!</li><li>slasharguments may not work when using ISAPI and PHP 4.3.10 and older</li></ul></p>';
$solution .= '<p>Apache 1:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>Apache 2:<ul><li>you must add <code>AcceptPathInfo on</code> to php.ini or .htaccess</li><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
}
return $solution;
}
......
......@@ -386,7 +386,7 @@
blocks_execute_action($page, blocks_get_by_page($page), 'add', (int)$admintree->id, false, false);
if ($admintreeinstance = get_record('block_instance', 'pagetype', $page->type, 'pageid', SITEID, 'blockid', $admintree->id)) {
blocks_execute_action($page, blocks_get_by_page($page), 'moveleft', $admintreeinstance, false, false);
}
}
}
set_config('adminblocks_initialised', 1);
......@@ -457,7 +457,7 @@
}
/// Check for any special upgrades that might need to be run
if (!empty($CFG->upgrade)) {
if (!empty($CFG->upgrade)) {
print_simple_box(get_string("upgrade$CFG->upgrade", "admin",
"$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"), "center", '60%');
print_spacer(10,10);
......@@ -490,7 +490,7 @@
}
/// Print slightly annoying registration button every six months ;-)
/// You can set the "registered" variable to something far in the future
/// You can set the "registered" variable to something far in the future
/// if you really want to prevent this. eg 9999999999
if (!isset($CFG->registered) || $CFG->registered < (time() - 3600*24*30*6)) {
$options = array();
......@@ -512,7 +512,7 @@
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '40%';
$configdata = '<div class="adminlink"><a href="config.php">'.get_string('configvariables', 'admin').
'</a> - <span class="explanation">'.get_string('adminhelpconfigvariables').'</span></div>';
$configdata .= '<div class="adminlink"><a href="site.php">'.get_string('sitesettings').
......@@ -537,9 +537,9 @@
'</a> - <span class="explanation">'.get_string('helpcalendarsettings', 'admin').'</span></div>';
$configdata .= '<div class="adminlink"><a href="maintenance.php">'.get_string('sitemaintenancemode', 'admin').
'</a> - <span class="explanation">'.get_string('helpsitemaintenance', 'admin').'</span></div>';
$table->data[] = array('<strong>'.get_string('configuration').'</strong>', $configdata);
$userdata = '<div class="adminlink"><a href="auth.php?sesskey='.$USER->sesskey.'">'.get_string("authentication").
'</a> - <span class="explanation">'.get_string('adminhelpauthentication').'</span></div>';
$userdata .= '<div class="adminlink"><a href="user.php">'.get_string('edituser').
......@@ -554,17 +554,17 @@
$userdata .= '<div class="adminlink"><a href="roles/assign.php?contextid='.$context->id.'">'.
get_string('assignsiteroles').'</a> - <span class="explanation">'.get_string('adminhelpassignsiteroles').
'</span></div>';
$table->data[] = array('<strong>'.get_string('users').'</strong>', $userdata);
$coursedata = '<div class="adminlink"><a href="../course/index.php?edit=on&amp;sesskey='.$USER->sesskey.'">'.get_string('managecourses').
'</a> - <span class="explanation">'.get_string('adminhelpcourses').'</span></div>';
$coursedata .= '<div class="adminlink"><a href="enrol.php?sesskey='.$USER->sesskey.'">'.get_string('enrolmentplugins').
'</a> - <span class="explanation">'.get_string('adminhelpenrolments').'</span></div>';
$table->data[] = array('<strong>'.get_string('courses').'</strong>', $coursedata);
$miscdata = '<div class="adminlink"><a href="../files/index.php?id='.$site->id.'">'.get_string('sitefiles').
'</a> - <span class="explanation">'.get_string('adminhelpsitefiles').'</span></div>';
$miscdata .= '<div class="adminlink"><a href="stickyblocks.php">'.get_string('stickyblocks','admin').
......@@ -586,28 +586,28 @@
$miscdata .= '<div class="adminlink"><a href="xmldb/index.php">'.get_string('xmldbeditor').
'</a> - <span class="explanation">'.get_string('adminhelpxmldbeditor').'</span></div>';
}
$table->data[] = array('<strong>'.get_string('miscellaneous').'</strong>', $miscdata);
/*
/// Hooks for Matt Oquists contrib code for repositories and portfolio.
/*
/// Hooks for Matt Oquists contrib code for repositories and portfolio.
/// The eventual official versions may not look like this
if (isset($CFG->portfolio) && file_exists("$CFG->dirroot/$CFG->portfolio")) {
$table->data[] = array("<strong><a href=\"../portfolio/\">".get_string('portfolio','portfolio').'</a></
strong>',
'<div class="explanation">'.get_string('adminhelpportfolio','portfolio').'</div>');
}
if (isset($CFG->repo) && file_exists("$CFG->dirroot/$CFG->repo")) {
$table->data[] = array("<strong><a href=\"../repository/?repoid=1&action=list\">".get_string('repository','
repository').'</a></strong>',
'<div class="explanation">'.get_string('adminhelprepository','repository').'</div>');
}
*/
*/
print_table($table);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -629,7 +629,7 @@
echo '</div>';
}
if (optional_param('dbmigrate')) { // ??? Is this actually used?
print_simple_box_start('center','60%');
require_once($CFG->dirroot.'/admin/utfdbmigrate.php');
......
......@@ -49,11 +49,11 @@
$strconfiguration = get_string("configuration");
$strmanagemodules = get_string("managemodules");
$strmodulename = get_string("modulename", $module);
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'mod/' . $module . '/config';
admin_externalpage_print_header($adminroot);
print_heading($strmodulename);
......
......@@ -29,9 +29,9 @@
admin_externalpage_print_header($adminroot);
print_heading($stractivities);
$coursesaffected = false;
/// If data submitted, then process and store.
......@@ -56,12 +56,12 @@
}
if (!empty($delete) and confirm_sesskey()) {
$strmodulename = get_string("modulename", "$delete");
if (!$confirm) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
"modules.php");
admin_externalpage_print_footer($adminroot);
exit;
......@@ -90,7 +90,7 @@
notify("Error occurred while deleting all $strmodulename records in course_modules table");
}
// Then delete all the logs
// Then delete all the logs
if (!delete_records("log", "module", $module->name)) {
notify("Error occurred while deleting all $strmodulename records in log table");
}
......@@ -116,10 +116,10 @@
}
}
}
}
}
// Delete the capabilities that were defined by this module
capabilities_cleanup('mod/'.$module->name);
// rebuild_course_cache(); // Because things have changed
$coursesaffected = true;
......@@ -128,11 +128,11 @@
notice(get_string("moduledeletefiles", "", $a), "modules.php");
}
}
if ($coursesaffected) {
rebuild_course_cache(); // Because things have changed
}
/// Get and sort the existing modules
......
<?PHP // $Id$
// Allows the admin to manage questiontypes
// This page is adapted from modules.php
// This page is not yet in service, the whole plug-in architecture
// for question types is still under construction.
......@@ -35,12 +35,12 @@
$strquestions = get_string("questions");
$strquestiontype = get_string("questiontype", 'quiz');
print_header("$site->shortname: $strquestions", "$site->fullname",
print_header("$site->shortname: $strquestions", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strquestions");
print_heading($strquestions);
/// If data submitted, then process and store.
......@@ -59,12 +59,12 @@
}
if (!empty($delete) and confirm_sesskey()) {
$strqtypename = get_string("qtypename", "qtype_$delete");
if (!$confirm) {
notice_yesno(get_string("qtypedeleteconfirm", "admin", $strqtypename),
"questiontypes.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
notice_yesno(get_string("qtypedeleteconfirm", "admin", $strqtypename),
"questiontypes.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
"questiontypes.php");
print_footer();
exit;
......@@ -104,7 +104,7 @@
}
}
}
}
}
$a->qtype = $strqtypename;
$a->directory = "$CFG->dirroot/qtype/$delete";
......@@ -145,7 +145,7 @@
$count = count_records('quiz_questions', 'qtype', $qtype->id);
$delete = $count ? '' : "<a href=\"questiontypes.php?delete=$qtype->name&amp;sesskey=$USER->sesskey\">$strdelete</a>";
if ($qtype->visible) {
$visible = "<a href=\"questiontypes.php?hide=$qtype->name&amp;sesskey=$USER->sesskey\" title=\"$strhide\">".
"<img src=\"$CFG->pixpath/i/hide.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
......
......@@ -28,7 +28,7 @@
$strcourseoverview = get_string('courseoverview');
$strnav = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.get_string('administration').'</a> -> <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/report.php">'.$strreports.'</a> -> '.$strcourseoverview;
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
$tableprefix = $CFG->prefix.'stats_';
......@@ -36,7 +36,7 @@
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend LIMIT 1');
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend LIMIT 1');
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend LIMIT 1');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();
if (empty($earliestmonth)) $earliestmonth = time();
......@@ -66,14 +66,14 @@
if (!empty($report) && !empty($time)) {
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= ".$param->timeafter
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby
." LIMIT ".$numcourses;
$courses = get_records_sql($sql);
if (empty($courses)) {
......@@ -81,17 +81,17 @@
}
echo '<center><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></center>';
$table = new object();
$table->align = array('left','center','center','center');
$table->head = array(get_string('course'),$param->line1);
if (!empty($param->line2)) {
$table->head[] = $param->line2;
$table->head[] = $param->line2;
}
if (!empty($param->line3)) {
$table->head[] = $param->line3;
}
foreach ($courses as $c) {
$a = array();
$a[] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$c->courseid.'">'.get_field('course','shortname','id',$c->courseid).'</a>';
......@@ -107,7 +107,7 @@
}
print_table($table);
}
admin_externalpage_print_footer($adminroot);
?>
......@@ -11,7 +11,7 @@
require_login();
require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM, SITEID));
stats_check_uptodate($course->id);
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
......@@ -22,13 +22,13 @@
.$param->extras
." ORDER BY ".$param->orderby
." LIMIT ".$numcourses;
$courses = get_records_sql($sql);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
}
$graph = new graph(750,400);
......@@ -48,5 +48,5 @@
$graph->y_format['bar1'] = array('colour' => 'blue','bar' => 'fill','legend' => $param->{$param->graphline});
$graph->draw_stack();
?>
......@@ -16,7 +16,7 @@
print_heading(get_string('chooselogs') .':');
print_log_selector_form($course);
print_log_selector_form($course);
echo '<br />';
print_heading(get_string('chooselivelogs') .':');
......
......@@ -25,24 +25,24 @@ class ExHtmlReporter extends HtmlReporter {
// Options set when the class is created.
var $showpasses;