]> git.mjollnir.org Git - moodle.git/commitdiff
minor fixes, including bugs 997, 998
authorgustav_delius <gustav_delius>
Sun, 25 Jan 2004 19:37:04 +0000 (19:37 +0000)
committergustav_delius <gustav_delius>
Sun, 25 Jan 2004 19:37:04 +0000 (19:37 +0000)
course/edit.html
lib/datalib.php
theme/standard/styles.php
user/edit.html

index 82b709a544e7b335f693e772433e8fb94b97be60..00058ef194affdfed42831756f745f70314877ee 100644 (file)
@@ -1,67 +1,76 @@
+<?PHP
+    // Make sure all variables are defined
+    if (!isset($form->showreports)) {
+        $form->showreports = 0;
+    }
+    if (!isset($form->maxbytes)) {
+        $form->maxbytes = 0;
+    }
+?>
 <FORM METHOD="post" action="edit.php" NAME="form">
 <table cellpadding=9 cellspacing=0 >
 <tr valign=top>
-       <td align="right"><P><?php  print_string("category") ?>:</td>
-       <td><?php  
+    <td align="right"><P><?php  print_string("category") ?>:</td>
+    <td><?php  
            $displaylist = array();
            $parentlist = array();
            make_categories_list($displaylist, $parentlist);
            choose_from_menu($displaylist, "category", "$form->category", "");
            helpbutton("coursecategory", get_string("category"));
         ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("fullname") ?>:</td>
-       <td><input type="text" name="fullname" maxlength="254" size=50 value="<?php  p($form->fullname) ?>">
+    <td align="right"><P><?php  print_string("fullname") ?>:</td>
+    <td><input type="text" name="fullname" maxlength="254" size=50 value="<?php  p($form->fullname) ?>">
     <?php  helpbutton("coursefullname", get_string("fullname")) ?>
     <?php  if (isset($err["fullname"])) formerr($err["fullname"]); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("shortname") ?>:</td>
-       <td><input type="text" name="shortname" maxlength="15"  size="10" value="<?php  p($form->shortname) ?>">
+    <td align="right"><P><?php  print_string("shortname") ?>:</td>
+    <td><input type="text" name="shortname" maxlength="15"  size="10" value="<?php  p($form->shortname) ?>">
     <?php  helpbutton("courseshortname", get_string("shortname")) ?>
     <?php  if (isset($err["shortname"])) formerr($err["shortname"]); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("summary") ?>:</td>
-       <td><?php 
+    <td align="right"><P><?php  print_string("summary") ?>:</td>
+    <td><?php 
         print_textarea($usehtmleditor, 10, 50, 660, 200, "summary", $form->summary);
         helpbutton("text", get_string("helptext"));
         if (isset($err["summary"])) formerr($err["summary"]); 
     ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("format") ?>:</td>
-       <td><?php  
+    <td align="right"><P><?php  print_string("format") ?>:</td>
+    <td><?php  
            choose_from_menu ($form->courseformats, "format", "$form->format", "");
            helpbutton("courseformats", get_string("courseformats"));
         ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("startdate") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("startdate") ?>:</td>
+    <td><?php
            print_date_selector("startday", "startmonth", "startyear", $form->startdate);
            helpbutton("coursestartdate", get_string("startdate"));
-       ?></td>
+    ?></td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("numberweeks") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("numberweeks") ?>:</td>
+    <td><?php
            for ($i=1; $i<=52; $i++) {
               $sectionmenu[$i] = "$i";
            }
            choose_from_menu ($sectionmenu, "numsections", "$form->numsections", "");
            helpbutton("coursenumsections", get_string("numberweeks"));
-       ?></td>
+    ?></td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("groupmode") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("groupmode") ?>:</td>
+    <td><?php
     unset($choices);
     $choices[NOGROUPS] = get_string("groupsnone");
     $choices[SEPARATEGROUPS] = get_string("groupsseparate");
     $choices["1"] = get_string("yes");
     choose_from_menu ($choices, "groupmodeforce", $form->groupmodeforce, "");
     helpbutton("groupmodeforce", get_string("groupmodeforce")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("availability") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("availability") ?>:</td>
+    <td><?php
     unset($choices);
     $choices["0"] = get_string("courseavailablenot");
     $choices["1"] = get_string("courseavailable");
     choose_from_menu ($choices, "visible", $form->visible, "");
     helpbutton("courseavailability", get_string("availability")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("enrolmentkey") ?>:</td>
-       <td><input type="text" name="password" size=25 value="<?php  p($form->password) ?>">
+    <td align="right"><P><?php  print_string("enrolmentkey") ?>:</td>
+    <td><input type="text" name="password" size=25 value="<?php  p($form->password) ?>">
     <?php  helpbutton("enrolmentkey", get_string("enrolmentkey")) ?>
     <?php  if (isset($err["password"])) formerr($err["password"]); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("opentoguests") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("opentoguests") ?>:</td>
+    <td><?php
     unset($choices);
     $choices["0"] = get_string("guestsno");
     $choices["1"] = get_string("guestsyes");
     $choices["2"] = get_string("guestskey");
     choose_from_menu ($choices, "guest", $form->guest, "");
     helpbutton("guestaccess", get_string("opentoguests")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
     <td align="right"><P><?php  print_string("newsitemsnumber") ?>:</td>
     </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("showrecent") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("showrecent") ?>:</td>
+    <td><?php
     unset($choices);
     $choices["0"] = get_string("no");
     $choices["1"] = get_string("yes");
     choose_from_menu ($choices, "showrecent", $form->showrecent, "");
     helpbutton("courserecent", get_string("recentactivity")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("showgrades") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("showgrades") ?>:</td>
+    <td><?php
     unset($choices);
     $choices["0"] = get_string("no");
     $choices["1"] = get_string("yes");
     choose_from_menu ($choices, "showgrades", $form->showgrades, "");
     helpbutton("coursegrades", get_string("grades")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("showreports") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("showreports") ?>:</td>
+    <td><?php
     unset($choices);
     $choices["0"] = get_string("no");
     $choices["1"] = get_string("yes");
     choose_from_menu ($choices, "showreports", $form->showreports, "");
     helpbutton("coursereports", get_string("activityreport")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("maximumupload") ?>:</td>
-       <td><?php
+    <td align="right"><P><?php  print_string("maximumupload") ?>:</td>
+    <td><?php
     $choices = get_max_upload_sizes($CFG->maxbytes);
     choose_from_menu ($choices, "maxbytes", $form->maxbytes, "");
     helpbutton("courseuploadsize", get_string("maximumupload")); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("wordforteacher") ?>:</td>
-       <td><input type="text" name="teacher" maxlength="100" size=25 value="<?php  p($form->teacher) ?>">
-       (<?php  print_string("wordforteachereg") ?>) 
+    <td align="right"><P><?php  print_string("wordforteacher") ?>:</td>
+    <td><input type="text" name="teacher" maxlength="100" size=25 value="<?php  p($form->teacher) ?>">
+    (<?php  print_string("wordforteachereg") ?>) 
     <?php  if (isset($err["teacher"])) formerr($err["teacher"]); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("wordforteachers") ?>:</td>
-       <td><input type="text" name="teachers" maxlength="100" size=25 value="<?php  p($form->teachers) ?>">
-       (<?php  print_string("wordforteacherseg") ?>)
+    <td align="right"><P><?php  print_string("wordforteachers") ?>:</td>
+    <td><input type="text" name="teachers" maxlength="100" size=25 value="<?php  p($form->teachers) ?>">
+    (<?php  print_string("wordforteacherseg") ?>)
     <?php  if (isset($err["teachers"])) formerr($err["teachers"]); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("wordforstudent") ?>:</td>
-       <td><input type="text" name="student" maxlength="100" size=25 value="<?php  p($form->student) ?>">
-       (<?php  print_string("wordforstudenteg") ?>) 
+    <td align="right"><P><?php  print_string("wordforstudent") ?>:</td>
+    <td><input type="text" name="student" maxlength="100" size=25 value="<?php  p($form->student) ?>">
+    (<?php  print_string("wordforstudenteg") ?>) 
     <?php  if (isset($err["student"])) formerr($err["student"]); ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td align="right"><P><?php  print_string("wordforstudents") ?>:</td>
-       <td><input type="text" name="students" maxlength="100" size=25 value="<?php  p($form->students) ?>">
-       (<?php  print_string("wordforstudentseg") ?>) 
+    <td align="right"><P><?php  print_string("wordforstudents") ?>:</td>
+    <td><input type="text" name="students" maxlength="100" size=25 value="<?php  p($form->students) ?>">
+    (<?php  print_string("wordforstudentseg") ?>) 
     <?php  if (isset($err["students"])) formerr($err["students"]); ?>
-       </td>
+    </td>
 </tr>
 <tr>
-       <td></td>
-       <td><input type="submit" value="<?php  print_string("savechanges") ?>"></td>
+    <td></td>
+    <td><input type="submit" value="<?php  print_string("savechanges") ?>"></td>
 </TABLE>
 <INPUT type="hidden" name="id" value="<?php echo $form->id ?>">
 </FORM>
index 0c88b64796a1a92b28780bf77dd37867c742d92f..3e59fc40dee14dc37687184d78861beffde8dd11 100644 (file)
@@ -1149,7 +1149,7 @@ function get_course_students($courseid, $sort="s.timeaccess", $dir="", $page=0,
     }
 
     return get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.maildisplay, u.mailformat,
-                            u.email, u.city, u.country, u.lastlogin, u.picture, s.timeaccess as lastaccess
+                            u.email, u.city, u.country, u.lastlogin, u.picture, u.lang, u.timezone, s.timeaccess as lastaccess
                             FROM {$CFG->prefix}user u, 
                                  {$CFG->prefix}user_students s
                             WHERE $select
@@ -1200,7 +1200,7 @@ function get_course_teachers($courseid, $sort="t.authority ASC") {
     global $CFG;
 
     return get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.maildisplay, u.mailformat,
-                                   u.email, u.city, u.country, u.lastlogin, u.picture, 
+                                   u.email, u.city, u.country, u.lastlogin, u.picture, u.lang, u.timezone, 
                                    t.authority,t.role,t.editall,t.timeaccess as lastaccess
                             FROM {$CFG->prefix}user u, 
                                  {$CFG->prefix}user_teachers t
@@ -1259,7 +1259,7 @@ function get_site_users($sort="u.lastaccess DESC", $select="") {
         $selectinfo = $select;
     } else {
         $selectinfo = "u.id, u.username, u.firstname, u.lastname, u.maildisplay, u.mailformat,".
-                      "u.email, u.city, u.country, u.lastaccess, u.lastlogin, u.picture";
+                      "u.email, u.city, u.country, u.lastaccess, u.lastlogin, u.picture, u.lang, u.timezone";
     }
                   
 
index 11a51fcd119fee8f50987fe7437f263e7c802e67..5e9afd81627f8f1eba3b0e8b7d4f35f896bdd52d 100644 (file)
@@ -4,7 +4,7 @@
 
     $nomoodlecookie = true;
     require_once("../../config.php"); 
-    $themeurl = style_sheet_setup(filemtime("styles.php"), 300, $themename);
+    $themeurl = style_sheet_setup(filemtime("styles.php"), 300, 'standard');
 
 /// From here on it's nearly a normal stylesheet. 
 /// First are some CSS definitions for normal tags, 
index 6703bcddf1660a8dfe0f10635ba9908bef5a9f7f..1ec77137b08968b8ac825273176afc41bf8d952b 100644 (file)
@@ -2,6 +2,9 @@
    if (!isset($user->htmleditor)) {
        $user->htmleditor = 1;
    }
+   if (!isset($user->picture)) {
+       $user->picture = NULL;
+   }
    if (empty($user->lang)) {
        $user->lang = $CFG->lang;
    }