Permalink
Browse files

More little fixes

  • Loading branch information...
1 parent 5c63e0c commit 9d378732e4869b1edb3143ba3a85dca63957ea0f moodler committed Dec 29, 2002
Showing with 30 additions and 14 deletions.
  1. +0 −2 lib/datalib.php
  2. +1 −1 lib/db/mysql.php
  3. +6 −4 lib/setup.php
  4. +23 −7 lib/weblib.php
View
@@ -211,8 +211,6 @@ function get_records_select($table, $select="", $sort="", $fields="*") {
if ($select) {
$select = "WHERE $select";
- } else {
- $select = "";
}
if ($sort) {
View
@@ -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)') ");
}
View
@@ -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 @@ class object {};
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
View
@@ -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 = " [<A HREF=\"$CFG->wwwroot/course/loginas.php?id=$course->id&return=$realuser->id\">$realuser->firstname $realuser->lastname</A>] ";
}
+ } 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 "<table $tablealign $tablewidth class=\"$class\" border=\"0\" cellpadding=\"$padding\" cellspacing=\"0\"><tr><td bgcolor=\"$color\" class=\"$class"."content\">";
+ echo "<table $align $width class=\"$class\" border=\"0\" cellpadding=\"$padding\" cellspacing=\"0\"><tr><td bgcolor=\"$color\" class=\"$class"."content\">";
}
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 "<TR>";
foreach ($table->head as $key => $heading) {
+ if (!isset($size[$key])) {
+ $size[$key] = "";
+ }
+ if (!isset($align[$key])) {
+ $align[$key] = "";
+ }
echo "<TH VALIGN=top ".$align[$key].$size[$key]." NOWRAP class=\"generaltableheader\">$heading</TH>";
}
echo "</TR>\n";
@@ -820,6 +830,12 @@ function print_table($table) {
foreach ($table->data as $row) {
echo "<TR VALIGN=TOP>";
foreach ($row as $key => $item) {
+ if (!isset($size[$key])) {
+ $size[$key] = "";
+ }
+ if (!isset($align[$key])) {
+ $align[$key] = "";
+ }
echo "<TD ".$align[$key].$size[$key]." class=\"generaltablecell\">$item</TD>";
}
echo "</TR>\n";

0 comments on commit 9d37873

Please sign in to comment.