From: moodler Date: Sun, 29 Dec 2002 04:17:32 +0000 (+0000) Subject: More little fixes X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9d378732e4869b1edb3143ba3a85dca63957ea0f;p=moodle.git More little fixes --- diff --git a/lib/datalib.php b/lib/datalib.php index 4d583312f3..e0fe57dad5 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -211,8 +211,6 @@ function get_records_select($table, $select="", $sort="", $fields="*") { if ($select) { $select = "WHERE $select"; - } else { - $select = ""; } if ($sort) { diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 96b4cdeafc..25352e470a 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -225,7 +225,7 @@ function main_upgrade($oldversion=0) { execute_sql("ALTER TABLE `user_students` CHANGE `end` `timeend` INT(10) UNSIGNED DEFAULT '0' NOT NULL "); } - if ($oldversion < 2002122301) { + if ($oldversion < 2002122700) { if (! record_exists("log_display", "module", "user", "action", "view")) { execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)') "); } diff --git a/lib/setup.php b/lib/setup.php index 5bf03ba1f0..9504edb44a 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -11,7 +11,7 @@ ////////////////////////////////////////////////////////////// /// If there are any errors in the standard libraries we want to know! - error_reporting(15); // use 0=none 7=normal 15=all + error_reporting(E_ALL); // use 0=none 7=normal 15=all /// Connect to the database using adodb @@ -32,7 +32,7 @@ /// Set error reporting back to normal - error_reporting(7); + error_reporting(15); /// Load up any configuration from the config table @@ -113,10 +113,12 @@ if (! isset($_SESSION["USER"])) { $_SESSION["USER"] = new object; } extract($_SESSION); // Makes $SESSION and $USER available for read-only access - if (!$FULLME) { + if (isset($FULLME)) { + $ME = $FULLME; + } else { $FULLME = qualified_me(); + $ME = strip_querystring($FULLME); } - $ME = strip_querystring($FULLME); /// Set language/locale of printed times. If user has chosen a language that diff --git a/lib/weblib.php b/lib/weblib.php index 11c10bf3d1..91fa92d034 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -542,6 +542,8 @@ function print_header ($title="", $heading="", $navigation="", $focus="", $meta= if ($navigation == "home") { $home = true; $navigation = ""; + } else { + $home = false; } if ($button == "") { @@ -602,10 +604,12 @@ function print_footer ($course=NULL) { } /// User links - if ($USER->realuser) { + if (isset($USER->realuser)) { if ($realuser = get_record("user", "id", $USER->realuser)) { $realuserinfo = " [wwwroot/course/loginas.php?id=$course->id&return=$realuser->id\">$realuser->firstname $realuser->lastname] "; } + } else { + $realuserinfo = ""; } if ($USER->id) { @@ -665,12 +669,12 @@ function print_simple_box_start($align="", $width="", $color="#FFFFFF", $padding global $THEME; if ($align) { - $tablealign = "ALIGN=\"$align\""; + $align = "ALIGN=\"$align\""; } if ($width) { - $tablewidth = "WIDTH=\"$width\""; + $width = "WIDTH=\"$width\""; } - echo "
"; + echo ""; foreach ($table->head as $key => $heading) { + if (!isset($size[$key])) { + $size[$key] = ""; + } + if (!isset($align[$key])) { + $align[$key] = ""; + } echo ""; } echo "\n"; @@ -820,6 +830,12 @@ function print_table($table) { foreach ($table->data as $row) { echo ""; foreach ($row as $key => $item) { + if (!isset($size[$key])) { + $size[$key] = ""; + } + if (!isset($align[$key])) { + $align[$key] = ""; + } echo ""; } echo "\n";
"; } function print_simple_box_end() { @@ -793,15 +797,15 @@ function print_table($table) { } } - if (!$table->width) { + if (empty($table->width)) { $table->width = "80%"; } - if (!$table->cellpadding) { + if (empty($table->cellpadding)) { $table->cellpadding = "5"; } - if (!$table->cellspacing) { + if (empty($table->cellspacing)) { $table->cellspacing = "1"; } @@ -812,6 +816,12 @@ function print_table($table) { if ($table->head) { echo "
$heading
$item