Various little fixes to remove warnings (usually about empty variables)

when error_reporting is turned up to 15 or so ... more of these to come ...
This commit is contained in:
moodler 2002-12-29 17:32:32 +00:00
parent a900458749
commit 9c9f7d7790
28 changed files with 1600 additions and 65 deletions

1466
CHANGES

File diff suppressed because it is too large Load diff

View file

@ -75,13 +75,16 @@
if (!isset($config)) { if (!isset($config)) {
$config = $CFG; $config = $CFG;
} }
if (!isset($focus)) {
$focus = "";
}
$stradmin = get_string("administration"); $stradmin = get_string("administration");
$strconfigvariables = get_string("configvariables"); $strconfigvariables = get_string("configvariables");
if ($site) { if ($site) {
print_header("$site->shortname: $strconfigvariables", "$site->fullname", print_header("$site->shortname: $strconfigvariables", $site->fullname,
"<A HREF=\"index.php\">$stradmin</A> -> $strconfigvariables", "$focus"); "<A HREF=\"index.php\">$stradmin</A> -> $strconfigvariables", $focus);
print_heading($strconfigvariables); print_heading($strconfigvariables);
} else { } else {
print_header(); print_header();

View file

@ -132,7 +132,7 @@
} }
print_continue("index.php"); print_continue("index.php");
print_simple_box_start("CENTER"); print_simple_box_start("CENTER");
include("$CFG->dirroot/doc/release.html"); include("$CFG->dirroot/lang/en/docs/release.html");
print_simple_box_end(); print_simple_box_end();
print_continue("index.php"); print_continue("index.php");
exit; exit;
@ -192,7 +192,7 @@
} }
} else { // module not installed yet, so install it } else { // module not installed yet, so install it
if (!$updated_modules) { if (!empty($updated_modules)) {
$strmodulesetup = get_string("modulesetup"); $strmodulesetup = get_string("modulesetup");
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup); print_header($strmodulesetup, $strmodulesetup, $strmodulesetup);
} }
@ -214,7 +214,7 @@
} }
} }
if ($updated_modules) { if (!empty($updated_modules)) {
print_continue("index.php"); print_continue("index.php");
die; die;
} }
@ -235,7 +235,7 @@
/// If any new configurations were found then send to the config page to check /// If any new configurations were found then send to the config page to check
if ($configchange) { if (!empty($configchange)) {
redirect("config.php"); redirect("config.php");
} }

View file

@ -261,7 +261,7 @@ function lang_save_file($path, $file, $strings) {
$value = str_replace("\\","",$value); // Delete all slashes $value = str_replace("\\","",$value); // Delete all slashes
$value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a $value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a
$value = str_replace("\"", "\\\"", $value); // Add slashes for " $value = str_replace("\"", "\\\"", $value); // Add slashes for "
if ($id == "string"){ if ($id == "string" and $value != ""){
fwrite($f,"\$string['$stringname'] = \"$value\";\n"); fwrite($f,"\$string['$stringname'] = \"$value\";\n");
} }
} }

View file

@ -43,7 +43,7 @@
/// Collect modules data /// Collect modules data
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
/// Search through all the modules, pulling out grade data /// Search through all the modules, pulling out grade data

View file

@ -342,7 +342,7 @@ function print_recent_activity($course) {
} }
} }
if ($changelist) { if (!empty($changelist)) {
foreach ($changelist as $changeinfo => $change) { foreach ($changelist as $changeinfo => $change) {
if ($change) { if ($change) {
$changes[$changeinfo] = $change; $changes[$changeinfo] = $change;
@ -473,7 +473,7 @@ function print_section_block($heading, $course, $section, $mods, $modnames, $mod
$moddata[] = "<a title=\"$mod->modfullname\" href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a><BR>$editbuttons"; $moddata[] = "<a title=\"$mod->modfullname\" href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a><BR>$editbuttons";
} }
} }
if (isediting($site->id)) { if (isediting($course->id)) {
$editmenu = popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=0&add=", $editmenu = popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=0&add=",
$modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"), true); $modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"), true);
$editmenu = "<DIV ALIGN=right>$editmenu</DIV>"; $editmenu = "<DIV ALIGN=right>$editmenu</DIV>";

View file

@ -61,7 +61,7 @@
} }
echo "</TR></TABLE>"; echo "</TR></TABLE>";
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
switch ($mode) { switch ($mode) {
case "todaylogs" : case "todaylogs" :

View file

@ -26,19 +26,25 @@
add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id"); add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
if ( isteacher($course->id) ) { if (isset($edit)) {
if (isteacher($course->id)) {
if ($edit == "on") { if ($edit == "on") {
$USER->editing = true; $USER->editing = true;
} else if ($edit == "off") { } else if ($edit == "off") {
$USER->editing = false; $USER->editing = false;
} }
save_session("USER");
} }
}
if (isset($help)) {
if ($help == "on") { if ($help == "on") {
$USER->help = true; $USER->help = true;
} else if ($help == "off") { } else if ($help == "off") {
$USER->help = false; $USER->help = false;
} }
save_session("USER"); save_session("USER");
}
$SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id"; $SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
save_session("SESSION"); save_session("SESSION");
@ -53,7 +59,7 @@
print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true, print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true,
update_course_icon($course->id)); update_course_icon($course->id));
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
if (! $sections = get_all_sections($course->id)) { if (! $sections = get_all_sections($course->id)) {
$section->course = $course->id; // Create a default section. $section->course = $course->id; // Create a default section.

View file

@ -168,7 +168,7 @@
if (isediting($course->id)) { if (isediting($course->id)) {
echo "<DIV ALIGN=right>"; echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=", popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=",
$modnames, "section$week", "", "$stradd...", "mods", $stractivities); $modnames, "section$week", "", "$stradd...");
echo "</DIV>"; echo "</DIV>";
} }

View file

@ -26,6 +26,7 @@
"<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">", "<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
true, "", $headerbutton); true, "", $headerbutton);
$firstcolumn = false; // for now
$side = 175; $side = 175;
?> ?>
@ -38,7 +39,8 @@
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) { if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) {
echo "<TD WIDTH=\"$side\" VALIGN=TOP NOWRAP>"; $firstcolumn=true; echo "<TD WIDTH=\"$side\" VALIGN=TOP NOWRAP>";
$firstcolumn=true;
if ($sections[0]->sequence or isediting($site->id)) { if ($sections[0]->sequence or isediting($site->id)) {
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused); get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);

View file

@ -13,6 +13,7 @@ I would suggest that you:
MOST IMPORTANT MOST IMPORTANT
|------------------- |-------------------
| |
| - files.php
| - install.html | - install.html
| - upgrade.html | - upgrade.html
| |

View file

@ -26,7 +26,9 @@
Arabic (from Ahmed Nabil), Turkish (from M. Cüneyt Birkök) and Swedish (from Set Lonnert). Many thanks Arabic (from Ahmed Nabil), Turkish (from M. Cüneyt Birkök) and Swedish (from Set Lonnert). Many thanks
to these guys! All other languages have also had updates and fixes since 1.0.7. to these guys! All other languages have also had updates and fixes since 1.0.7.
The language editor has been improved slightly, making it easier to see The language editor has been improved slightly, making it easier to see
new strings and empty strings that need translating.</DD> new strings and empty strings that need translating. All documentation is
now able to be localised and will appear in the current language if
translated versions exist.</DD>
<DT> Themes </DT> <DT> Themes </DT>
<DD> Theme support of CSS has been extended to give theme makers more control <DD> Theme support of CSS has been extended to give theme makers more control

View file

@ -21,6 +21,7 @@
"proxyhost" => "", "proxyhost" => "",
"proxyport" => "", "proxyport" => "",
"maxeditingtime" => 1800, "maxeditingtime" => 1800,
"changepassword" => true,
"country" => "", "country" => "",
"guestloginbutton" => 1 "guestloginbutton" => 1
); );

View file

@ -102,6 +102,11 @@ function format_time($totalsecs, $str=NULL) {
$sh = ($hours == 1) ? $str->hour : $str->hours; $sh = ($hours == 1) ? $str->hour : $str->hours;
$sd = ($days == 1) ? $str->day : $str->days; $sd = ($days == 1) ? $str->day : $str->days;
$odays = "";
$ohours = "";
$omins = "";
$osecs = "";
if ($days) $odays = "$days $sd"; if ($days) $odays = "$days $sd";
if ($hours) $ohours = "$hours $sh"; if ($hours) $ohours = "$hours $sh";
if ($mins) $omins = "$mins $sm"; if ($mins) $omins = "$mins $sm";
@ -268,7 +273,7 @@ function require_login($courseid=0) {
// Next, check if the user can be in a particular course // Next, check if the user can be in a particular course
if ($courseid) { if ($courseid) {
if ($USER->student[$courseid] || $USER->teacher[$courseid] || $USER->admin) { if (!empty($USER->student[$courseid]) or !empty($USER->teacher[$courseid]) or !empty($USER->admin)) {
if (isset($USER->realuser)) { // Make sure the REAL person can also access this course if (isset($USER->realuser)) { // Make sure the REAL person can also access this course
if (!isteacher($courseid, $USER->realuser)) { if (!isteacher($courseid, $USER->realuser)) {
print_header(); print_header();
@ -416,6 +421,9 @@ function isediting($courseid, $user=NULL) {
if (!$user){ if (!$user){
$user = $USER; $user = $USER;
} }
if (empty($user->editing)) {
return false;
}
return ($user->editing and isteacher($courseid, $user->id)); return ($user->editing and isteacher($courseid, $user->id));
} }
@ -770,6 +778,9 @@ function make_mod_upload_directory($courseid) {
function valid_uploaded_file($newfile) { function valid_uploaded_file($newfile) {
/// Returns current name of file on disk if true /// Returns current name of file on disk if true
if (empty($newfile)) {
return "";
}
if (is_uploaded_file($newfile['tmp_name']) and $newfile['size'] > 0) { if (is_uploaded_file($newfile['tmp_name']) and $newfile['size'] > 0) {
return $newfile['tmp_name']; return $newfile['tmp_name'];
} else { } else {

View file

@ -127,9 +127,9 @@
/// then use the one from the default language. Otherwise (and this is the /// then use the one from the default language. Otherwise (and this is the
/// majority of cases), use the stored locale specified by admin. /// majority of cases), use the stored locale specified by admin.
if ($USER->lang and ($USER->lang != $CFG->lang) ) { if (!empty($USER->lang) and ($USER->lang != $CFG->lang) ) {
$CFG->locale = get_string("locale"); $CFG->locale = get_string("locale");
} else if (!$CFG->locale) { } else if (empty($CFG->locale)) {
$CFG->locale = get_string("locale"); $CFG->locale = get_string("locale");
set_config("locale", $CFG->locale); // cache it to save lookups in future set_config("locale", $CFG->locale); // cache it to save lookups in future
} }

View file

@ -272,7 +272,10 @@ function choose_from_menu ($options, $name, $selected="", $nothing="choose", $sc
if ($script) { if ($script) {
$javascript = "onChange=\"$script\""; $javascript = "onChange=\"$script\"";
} else {
$javascript = "";
} }
$output = "<SELECT NAME=$name $javascript>\n"; $output = "<SELECT NAME=$name $javascript>\n";
if ($nothing) { if ($nothing) {
$output .= " <OPTION VALUE=\"$nothingvalue\"\n"; $output .= " <OPTION VALUE=\"$nothingvalue\"\n";
@ -338,14 +341,14 @@ function popup_form ($common, $options, $formname, $selected="", $nothing="choos
} }
} }
$output .= "</SELECT>"; $output .= "</SELECT>";
if (!$return and $help) {
helpbutton($help, $helptext);
}
$output .= "</FORM>\n"; $output .= "</FORM>\n";
if ($return) { if ($return) {
return $output; return $output;
} else { } else {
if ($help) {
helpbutton($help, $helptext);
}
echo $output; echo $output;
} }
} }
@ -612,7 +615,7 @@ function print_footer ($course=NULL) {
$realuserinfo = ""; $realuserinfo = "";
} }
if ($USER->id) { if (isset($USER->id) and $USER->id) {
$username = "<A HREF=\"$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id\">$USER->firstname $USER->lastname</A>"; $username = "<A HREF=\"$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id\">$USER->firstname $USER->lastname</A>";
$loggedinas = $realuserinfo.get_string("loggedinas", "moodle", "$username"). $loggedinas = $realuserinfo.get_string("loggedinas", "moodle", "$username").
" (<A HREF=\"$CFG->wwwroot/login/logout.php\">".get_string("logout")."</A>)"; " (<A HREF=\"$CFG->wwwroot/login/logout.php\">".get_string("logout")."</A>)";
@ -889,7 +892,7 @@ function update_course_icon($courseid) {
global $CFG, $USER; global $CFG, $USER;
if (isteacher($courseid)) { if (isteacher($courseid)) {
if ($USER->editing) { if (!empty($USER->editing)) {
$string = get_string("turneditingoff"); $string = get_string("turneditingoff");
$edit = "off"; $edit = "off";
} else { } else {

View file

@ -71,15 +71,21 @@
} }
if (empty($errormsg)) {
$errormsg = "";
}
if (empty($SESSION->wantsurl)) { if (empty($SESSION->wantsurl)) {
$SESSION->wantsurl = $HTTP_REFERER; $SESSION->wantsurl = $HTTP_REFERER;
save_session("SESSION"); save_session("SESSION");
} }
if (!$frm->username) if (empty($frm->username)) {
$frm->username = get_moodle_cookie(); $frm->username = get_moodle_cookie();
$frm->password = "";
}
if ($frm->username) { if (!empty($frm->username)) {
$focus = "form.password"; $focus = "form.password";
} else { } else {
$focus = "form.username"; $focus = "form.username";

View file

@ -57,9 +57,14 @@
} }
$due = userdate($assignment->timedue); $due = userdate($assignment->timedue);
$link = "<A HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>"; $link = "<A HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>";
if ($assignment->section) {
$section = "$assignment->section";
} else {
$section = "";
}
if ($course->format == "weeks" or $course->format == "topics") { if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ($assignment->section, $link, $due, $submitted); $table->data[] = array ($section, $link, $due, $submitted);
} else { } else {
$table->data[] = array ($link, $due, $submitted); $table->data[] = array ($link, $due, $submitted);
} }

View file

@ -58,7 +58,7 @@
$navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">".get_string("forums", "forum")."</A> -> <A HREF=\"../forum/view.php?f=$forum->id\">$forum->name</A>"; $navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">".get_string("forums", "forum")."</A> -> <A HREF=\"../forum/view.php?f=$forum->id\">$forum->name</A>";
$searchform = forum_print_search_form($course, $search, true, "plain"); $searchform = forum_print_search_form($course, "", true, "plain");
if ($course->category) { if ($course->category) {
print_header("$course->shortname: $discussion->name", "$course->fullname", print_header("$course->shortname: $discussion->name", "$course->fullname",

View file

@ -1071,7 +1071,7 @@ function forum_set_return() {
function forum_go_back_to($default) { function forum_go_back_to($default) {
global $SESSION; global $SESSION;
if ($SESSION->fromdiscussion) { if (!empty($SESSION->fromdiscussion)) {
$returnto = $SESSION->fromdiscussion; $returnto = $SESSION->fromdiscussion;
unset($SESSION->fromdiscussion); unset($SESSION->fromdiscussion);
save_session("SESSION"); save_session("SESSION");
@ -1467,7 +1467,7 @@ function forum_print_latest_discussions($forum_id=0, $forum_numdiscussions=5, $f
echo get_string("olderdiscussions", "forum")."</A> ...</P>"; echo get_string("olderdiscussions", "forum")."</A> ...</P>";
break; break;
} }
if ($replies[$discussion->discussion]) { if (!empty($replies[$discussion->discussion])) {
$discussion->replies = $replies[$discussion->discussion]->replies; $discussion->replies = $replies[$discussion->discussion]->replies;
} else { } else {
$discussion->replies = 0; $discussion->replies = 0;
@ -1624,7 +1624,7 @@ function forum_set_display_mode($mode=0) {
if ($mode) { if ($mode) {
$USER->mode = $mode; $USER->mode = $mode;
save_session("USER"); save_session("USER");
} else if (!$USER->mode) { } else if (empty($USER->mode)) {
$USER->mode = $FORUM_DEFAULT_DISPLAY_MODE; $USER->mode = $FORUM_DEFAULT_DISPLAY_MODE;
save_session("USER"); save_session("USER");
} }

View file

@ -68,6 +68,7 @@
$onsubmit = "onsubmit=\"copyrichtext(theform.message);\""; $onsubmit = "onsubmit=\"copyrichtext(theform.message);\"";
} else { } else {
$defaultformat = FORMAT_MOODLE; $defaultformat = FORMAT_MOODLE;
$onsubmit = "";
} }
@ -271,6 +272,10 @@
$navtail = "$toppost->subject"; $navtail = "$toppost->subject";
} }
if (empty($post->edit)) {
$post->edit = "";
}
$strforums = get_string("modulenameplural", "forum"); $strforums = get_string("modulenameplural", "forum");
@ -278,13 +283,17 @@
$cm = get_coursemodule_from_instance("forum", $forum->id, $course->id); $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id);
if (empty($discussion->name)) {
$discussion->name = $forum->name;
}
if ($course->category) { if ($course->category) {
print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname", print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname",
"<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> -> "<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> ->
$navmiddle -> $navtail", "$forumstart", "", true, "", navmenu($course, $cm)); $navmiddle -> $navtail", "$formstart", "", true, "", navmenu($course, $cm));
} else { } else {
print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname", print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname",
"$navmiddle -> $navtail", ""); "$navmiddle -> $navtail", "$formstart", "", true, "", navmenu($course, $cm));
} }

View file

@ -49,7 +49,7 @@
foreach ($journals as $journal) { foreach ($journals as $journal) {
$entrytext = get_field("journal_entries", "text", "userid", $USER->id, "journal", $journal->id"); $entrytext = get_field("journal_entries", "text", "userid", $USER->id, "journal", $journal->id);
$journal->timestart = $course->startdate + (($journal->section - 1) * 608400); $journal->timestart = $course->startdate + (($journal->section - 1) * 608400);
if ($journal->daysopen) { if ($journal->daysopen) {
@ -66,8 +66,13 @@
} else { } else {
$text .= "$strview</A></P>"; $text .= "$strview</A></P>";
} }
if ($journal->section) {
$section = "$journal->section";
} else {
$section = "";
}
if ($course->format == "weeks" or $course->format == "topics") { if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ("$journal->section", $table->data[] = array ($section,
text_to_html($journal->intro), text_to_html($journal->intro),
$text); $text);
} else { } else {

View file

@ -62,8 +62,14 @@
$bestgrade = quiz_get_best_grade($quiz->id, $USER->id); $bestgrade = quiz_get_best_grade($quiz->id, $USER->id);
if ($quiz->section) {
$section = "$quiz->section";
} else {
$section = "";
}
if ($course->format == "weeks" or $course->format == "topics") { if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ($quiz->section, $link, "$bestgrade / $quiz->grade"); $table->data[] = array ($section, $link, "$bestgrade / $quiz->grade");
} else { } else {
$table->data[] = array ($link, "$bestgrade / $quiz->grade"); $table->data[] = array ($link, "$bestgrade / $quiz->grade");
} }

View file

@ -182,6 +182,8 @@ function quiz_print_recent_activity(&$logs, $isteacher=false) {
global $CFG, $COURSE_TEACHER_COLOR; global $CFG, $COURSE_TEACHER_COLOR;
$content = "";
return $content; // True if anything was printed, otherwise false return $content; // True if anything was printed, otherwise false
} }

View file

@ -49,8 +49,13 @@
} else { } else {
$ss = $strnotdone; $ss = $strnotdone;
} }
if ($survey->section) {
$section = "$survey->section";
} else {
$section = "";
}
if ($course->format == "weeks" or $course->format == "topics") { if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ("$survey->section", $table->data[] = array ($section,
"<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>", "<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
"<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>"); "<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
} else { } else {

View file

@ -7,14 +7,14 @@ if (isadmin()) {
echo "<td><input type=text name=username size=20 value=\""; echo "<td><input type=text name=username size=20 value=\"";
p($user->username); p($user->username);
echo "\">"; echo "\">";
echo formerr($err["username"]); if (isset($err["username"])) formerr($err["username"]);
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";
echo "<tr valign=top>"; echo "<tr valign=top>";
echo "<td><P>".get_string("newpassword").":</td>"; echo "<td><P>".get_string("newpassword").":</td>";
echo "<td><input type=text name=newpassword size=20 value=\""; echo "<td><input type=text name=newpassword size=20 value=\"";
p($user->newpassword); if (isset($user->newpassword)) p($user->newpassword);
echo "\">"; echo "\">";
if (isset($err["newpassword"])) { if (isset($err["newpassword"])) {
formerr($err["newpassword"]); formerr($err["newpassword"]);
@ -29,19 +29,19 @@ if (isadmin()) {
<tr valign=top> <tr valign=top>
<td><P><? print_string("firstname") ?>:</td> <td><P><? print_string("firstname") ?>:</td>
<td><input type="text" name="firstname" size=30 value="<? p($user->firstname) ?>"> <td><input type="text" name="firstname" size=30 value="<? p($user->firstname) ?>">
<? formerr($err["firstname"]) ?> <? if (isset($err["firstname"])) formerr($err["firstname"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("lastname") ?>:</td> <td><P><? print_string("lastname") ?>:</td>
<td><input type="text" name="lastname" size=30 value="<? p($user->lastname) ?>"> <td><input type="text" name="lastname" size=30 value="<? p($user->lastname) ?>">
<? formerr($err["lastname"]) ?> <? if (isset($err["lastname"])) formerr($err["lastname"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("email") ?>:</td> <td><P><? print_string("email") ?>:</td>
<td><input type="text" name="email" size=30 value="<? p($user->email) ?>"> <td><input type="text" name="email" size=30 value="<? p($user->email) ?>">
<? formerr($err["email"]) ?> <? if (isset($err["email"])) formerr($err["email"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
@ -76,7 +76,7 @@ if (isadmin()) {
<tr valign=top> <tr valign=top>
<td><P><? print_string("city") ?>:</td> <td><P><? print_string("city") ?>:</td>
<td><input type="text" name="city" size=25 value="<? p($user->city) ?>"> <td><input type="text" name="city" size=25 value="<? p($user->city) ?>">
<? formerr($err["city"]) ?> <? if (isset($err["city"])) formerr($err["city"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
@ -88,7 +88,7 @@ if (isadmin()) {
} }
choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?> choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?>
<? formerr($err["country"]) ?> <? if (isset($err["country"])) formerr($err["country"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
@ -99,7 +99,7 @@ if (isadmin()) {
} }
choose_from_menu ($languages, "lang", $user->lang, "", "", ""); choose_from_menu ($languages, "lang", $user->lang, "", "", "");
} }
formerr($err["lang"]); if (isset($err["lang"])) formerr($err["lang"]);
?> ?>
</td> </td>
</tr> </tr>
@ -125,13 +125,13 @@ if (isadmin()) {
choose_from_menu ($timezones, "timezone", $user->timezone, get_string("serverlocaltime"), "", "99"); choose_from_menu ($timezones, "timezone", $user->timezone, get_string("serverlocaltime"), "", "99");
echo "(".get_string(currentlocaltime).")"; echo "(".get_string("currentlocaltime").")";
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("userdescription") ?>:</td> <td><P><? print_string("userdescription") ?>:</td>
<td><? if ($err["description"]) { <td><? if (isset($err["description"])) {
formerr($err["description"]); formerr($err["description"]);
echo "<BR>"; echo "<BR>";
} ?> } ?>
@ -149,44 +149,44 @@ if (isadmin()) {
<input type="file" name="imagefile" size=40> <input type="file" name="imagefile" size=40>
<? helpbutton("picture", get_string("helppicture")); <? helpbutton("picture", get_string("helppicture"));
print_string("maxsize", "", display_size(get_max_upload_file_size())); print_string("maxsize", "", display_size(get_max_upload_file_size()));
formerr($err["imagefile"]); if (isset($err["imagefile"])) formerr($err["imagefile"]);
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("webpage") ?>:</td> <td><P><? print_string("webpage") ?>:</td>
<td><input type="text" name="url" size=50 value="<? p($user->url) ?>"> <td><input type="text" name="url" size=50 value="<? p($user->url) ?>">
<? formerr($err["url"]) ?> <? if (isset($err["url"])) formerr($err["url"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("icqnumber") ?>:</td> <td><P><? print_string("icqnumber") ?>:</td>
<td><input type="text" name="icq" size=25 value="<? p($user->icq) ?>"> <td><input type="text" name="icq" size=25 value="<? p($user->icq) ?>">
<? formerr($err["icq"]) ?> <? if (isset($err["icq"])) formerr($err["icq"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("idnumber") ?>:</td> <td><P><? print_string("idnumber") ?>:</td>
<td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> <? p($teacheronly) ?> <td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> <? p($teacheronly) ?>
<? formerr($err["idnumber"]) ?> <? if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("phone") ?> 1:</td> <td><P><? print_string("phone") ?> 1:</td>
<td><input type="text" name="phone1" size=25 value="<? p($user->phone1) ?>"> <? p($teacheronly) ?> <td><input type="text" name="phone1" size=25 value="<? p($user->phone1) ?>"> <? p($teacheronly) ?>
<? formerr($err["phone1"]) ?> <? if (isset($err["phone1"])) formerr($err["phone1"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("phone") ?> 2:</td> <td><P><? print_string("phone") ?> 2:</td>
<td><input type="text" name="phone2" size=25 value="<? p($user->phone2) ?>"> <? p($teacheronly) ?> <td><input type="text" name="phone2" size=25 value="<? p($user->phone2) ?>"> <? p($teacheronly) ?>
<? formerr($err["phone2"]) ?> <? if (isset($err["phone2"])) formerr($err["phone2"]); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("address") ?>:</td> <td><P><? print_string("address") ?>:</td>
<td><input type="text" name="address" size=25 value="<? p($user->address) ?>"> <? p($teacheronly) ?> <td><input type="text" name="address" size=25 value="<? p($user->address) ?>"> <? p($teacheronly) ?>
<? formerr($err["address"]) ?> <? if (isset($err["address"])) formerr($err["address"]); ?>
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -136,11 +136,13 @@
$teacher = strtolower($course->teacher); $teacher = strtolower($course->teacher);
if (!isadmin()) { if (!isadmin()) {
$teacheronly = "(".get_string("teacheronly", "", $teacher).")"; $teacheronly = "(".get_string("teacheronly", "", $teacher).")";
} else {
$teacheronly = "";
} }
print_heading( get_string("userprofilefor", "", "$userfullname") ); print_heading( get_string("userprofilefor", "", "$userfullname") );
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
if ($err) { if (!empty($err)) {
echo "<CENTER>"; echo "<CENTER>";
notify(get_string("someerrorswerefound")); notify(get_string("someerrorswerefound"));
echo "</CENTER>"; echo "</CENTER>";

View file

@ -5,7 +5,7 @@
// database to determine whether upgrades should // database to determine whether upgrades should
// be performed (see lib/db/*.php) // be performed (see lib/db/*.php)
$version = 2002122301; // The current version is a date (YYYYMMDDXX) $version = 2002122700; // The current version is a date (YYYYMMDDXX)
$release = "1.0.8 dev"; // User-friendly version number $release = "1.0.8 dev"; // User-friendly version number