]> git.mjollnir.org Git - moodle.git/commitdiff
More little fixes
authormoodler <moodler>
Sun, 29 Dec 2002 04:17:32 +0000 (04:17 +0000)
committermoodler <moodler>
Sun, 29 Dec 2002 04:17:32 +0000 (04:17 +0000)
lib/datalib.php
lib/db/mysql.php
lib/setup.php
lib/weblib.php

index 4d583312f3eb000cd6a8458a18c7593988ae6acb..e0fe57dad5b74e0684b74516999641d55eba1c6b 100644 (file)
@@ -211,8 +211,6 @@ function get_records_select($table, $select="", $sort="", $fields="*") {
 
     if ($select) {
         $select = "WHERE $select";
-    } else {
-        $select = "";
     }
 
     if ($sort) {
index 96b4cdeafc42ff429a37a97d4ee4512f2c4d0abe..25352e470abb574f10a62e9f98c897a32ce6e8e8 100644 (file)
@@ -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)') ");
         }
index 5bf03ba1f09da0231ac4c717e423a4a12c3b7976..9504edb44a8e79213481ba9fd85c0cc86ce95f0a 100644 (file)
@@ -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
     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 
index 11c10bf3d19d2a0784e038d310ff2d4e976dfd0b..91fa92d034a0077bb972321b110c2636bd6540f5 100644 (file)
@@ -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";