Skip to content

Commit

Permalink
major whitespace cleanup - fixed trailng whitespace in new files and …
Browse files Browse the repository at this point in the history
…admin area
  • Loading branch information
skodak committed Sep 20, 2006
1 parent 6124048 commit eef868d
Show file tree
Hide file tree
Showing 154 changed files with 2,052 additions and 2,052 deletions.
18 changes: 9 additions & 9 deletions admin/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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");
}
Expand Down Expand Up @@ -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", "");
Expand All @@ -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>';
Expand Down Expand Up @@ -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">';
Expand All @@ -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;';
Expand All @@ -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"} = '';
}
Expand Down
8 changes: 4 additions & 4 deletions admin/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -43,7 +43,7 @@
if (isset($a_config[$tocheck])) {
$temp .= "1";
} else {
$temp .= "0";
$temp .= "0";
}
unset($a_config[$tocheck]);
$i++;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions admin/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion admin/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ function delete_subdirectories($rootdir) {
}
closedir($dir);
}

?>
4 changes: 2 additions & 2 deletions admin/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

$enrol = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR);
$CFG->pagepath = 'enrol';

$adminroot = admin_get_root();
admin_externalpage_setup('enrolment', $adminroot);

Expand All @@ -20,7 +20,7 @@
if ($frm = data_submitted()) {
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
}
if (empty($frm->enable)) {
$frm->enable = array();
}
Expand Down
10 changes: 5 additions & 5 deletions admin/enrol_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

require_once("../config.php");
require_once($CFG->libdir.'/adminlib.php');

$adminroot = admin_get_root();
admin_externalpage_setup('enrolment', $adminroot);

Expand All @@ -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);
}
Expand Down Expand Up @@ -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]);

Expand All @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions admin/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -69,7 +69,7 @@
//==============================
// Display logic
//==============================

$filtername = ucfirst($filtername);
admin_externalpage_print_header($adminroot);
print_heading( $filtername );
Expand Down
14 changes: 7 additions & 7 deletions admin/health.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ function title() {
}
function exists() {
if (!$this->is_enabled()) {
return true;
return true;
}
if ($this->status() < 1) {
return true;
Expand All @@ -429,17 +429,17 @@ function exists() {
function severity() {
if ($this->is_enabled() and $this->status() == 0) {
return SEVERITY_SIGNIFICANT;
} else {
} else {
return SEVERITY_ANNOYANCE;
}
}
function description() {
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>';
Expand Down Expand Up @@ -470,9 +470,9 @@ function solution() {
$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;
}
Expand Down
42 changes: 21 additions & 21 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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').
Expand All @@ -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').
Expand All @@ -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').
Expand All @@ -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);

}

//////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -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');
Expand Down
Loading

0 comments on commit eef868d

Please sign in to comment.