Skip to content
Browse files

minor fixes, including bugs 997, 998

  • Loading branch information...
1 parent a4de843 commit 2e39d2f810401468e8a999b865e81b23e2b2ca21 gustav_delius committed Jan 25, 2004
Showing with 79 additions and 67 deletions.
  1. +72 −63 course/edit.html
  2. +3 −3 lib/datalib.php
  3. +1 −1 theme/standard/styles.php
  4. +3 −0 user/edit.html
View
135 course/edit.html
@@ -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");
@@ -77,35 +86,35 @@
$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>
@@ -130,74 +139,74 @@
</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>
View
6 lib/datalib.php
@@ -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";
}
View
2 theme/standard/styles.php
@@ -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,
View
3 user/edit.html
@@ -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;
}

0 comments on commit 2e39d2f

Please sign in to comment.
Something went wrong with that request. Please try again.