<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>lang:</TD>
<TD>
- <? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", "");
- formerr($err["lang"]);
- ?>
+ <? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
</TD>
<TD>
<? print_string("configlang") ?>
<TD ALIGN=RIGHT><P>locale:</TD>
<TD>
<INPUT NAME=locale TYPE=text SIZE=10 VALUE="<?=$config->locale?>">
- <? formerr($err["locale"]); ?>
</TD>
<TD>
<? print_string("configlocale") ?>
<TD ALIGN=RIGHT><P>smtphosts:</TD>
<TD>
<INPUT NAME=smtphosts TYPE=text SIZE=30 VALUE="<?=$config->smtphosts?>">
- <? formerr($err["smtphosts"]); ?>
</TD>
<TD>
<? print_string("configsmtphosts") ?>
<TD ALIGN=RIGHT><P>smtpuser:</TD>
<TD>
<INPUT NAME=smtpuser TYPE=text SIZE=10 VALUE="<?=$config->smtpuser?>">
- <? formerr($err["smtpuser"]); ?>
</TD>
<TD ROWSPAN=2>
<? print_string("configsmtpuser") ?>
<TD ALIGN=RIGHT><P>smtppass:</TD>
<TD>
<INPUT NAME=smtppass TYPE=text SIZE=10 VALUE="<?=$config->smtppass?>">
- <? formerr($err["smtppass"]); ?>
</TD>
</TR>
<TR VALIGN=TOP>
$options[0] = get_string("allownot");
$options[1] = get_string("allow");
choose_from_menu ($options, "htmleditor", $config->htmleditor, "", "", "");
- formerr($err["htmleditor"]);
?>
</TD>
<TD>
<TD ALIGN=RIGHT><P>zip:</TD>
<TD>
<INPUT name=zip TYPE=text SIZE=30 VALUE="<?=$config->zip?>">
- <? formerr($err["zip"]); ?>
</TD>
<TD>
<? print_string("configzip") ?>
<TD ALIGN=RIGHT><P>unzip:</TD>
<TD>
<INPUT name=unzip TYPE=text SIZE=30 VALUE="<?=$config->unzip?>">
- <? formerr($err["unzip"]); ?>
</TD>
<TD>
<? print_string("configunzip") ?>
<TD ALIGN=RIGHT><P>proxyhost:</TD>
<TD>
<INPUT name=proxyhost TYPE=text SIZE=30 VALUE="<?=$config->proxyhost?>">
- <? formerr($err["proxyhost"]); ?>
</TD>
<TD ROWSPAN=2>
<? print_string("configproxyhost") ?>
<TD ALIGN=RIGHT><P>proxyport:</TD>
<TD>
<INPUT name=proxyport TYPE=text SIZE=5 VALUE="<?=$config->proxyport?>">
- <? formerr($err["proxyport"]); ?>
+ </TD>
+</TR>
+<TR VALIGN=TOP>
+ <TD ALIGN=RIGHT><P>debug:</TD>
+ <TD>
+ <? $options[7] = get_string("no");
+ $options[15] = get_string("yes");
+
+ choose_from_menu ($options, "debug", $config->debug, "", "", "");
+ unset($options);
+ ?>
+ </TD>
+ <TD>
+ <? print_string("configdebug") ?>
</TD>
</TR>
<FORM METHOD="post" action="site.php" NAME="form">
<TABLE cellpadding=9 cellspacing=0 >
<tr valign=top>
- <td align=right><P><? print_string("fullsitename") ?>:</td>
- <td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
- <? formerr($err["fullname"]) ?>
- </td>
+ <td align=right><P><? print_string("fullsitename") ?>:</td>
+ <td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
+ <? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td align=right><P><? print_string("shortsitename") ?>:</td>
- <td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
- <? formerr($err["shortname"]) ?>
- </td>
+ <td align=right><P><? print_string("shortsitename") ?>:</td>
+ <td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
+ <? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
+ </td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("frontpagedescription") ?>:</P><BR>
<? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
</td>
<td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
- <? formerr($err["summary"]) ?>
+ <? if (isset($err["summary"])) formerr($err["summary"]); ?>
</td>
</tr>
<tr valign=top>
"9" => "9 $newsitems",
"10" => "10 $newsitems");
choose_from_menu ($options, "newsitems", "$form->newsitems", "");
- formerr($err["newsitems"]);
?>
</td>
</tr>
<tr>
<td></td>
- <td><input type="submit" value="<? print_string("savechanges") ?>"></td>
+ <td><input type="submit" value="<? print_string("savechanges") ?>"></td>
</tr>
</TABLE>
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
<?PHP // $Id$
- require("../config.php");
+ require("../config.php");
if ($site = get_site()) {
if (!isadmin()) {
/// If data submitted, then process and store.
- if (match_referer() && isset($HTTP_POST_VARS)) {
+ if (match_referer() && isset($HTTP_POST_VARS)) {
$form = (object)$HTTP_POST_VARS;
if ($form->id) {
if (update_record("course", $form)) {
- redirect("index.php", get_string("changessaved"));
+ redirect("index.php", get_string("changessaved"));
} else {
error("Serious Error! Could not update the site record! (id = $form->id)");
}
if ($newid = insert_record("course", $form)) {
$cat->name = get_string("miscellaneous");
if (insert_record("course_categories", $cat)) {
- redirect("index.php", get_string("changessaved"), "1");
+ redirect("index.php", get_string("changessaved"), "1");
} else {
error("Serious Error! Could not set up a default course category!");
}
error("Serious Error! Could not set up the site!");
}
}
- die;
+ die;
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
- }
+ }
/// Otherwise fill and print the form.
- if ($site && !$form) {
+ if ($site and empty($form)) {
$form = $site;
} else {
$form->category = 0;
$form->newsitems = 0;
}
+ if (empty($focus)) {
+ $focus = "form.fullname";
+ }
+
$stradmin = get_string("administration");
$strsitesettings = get_string("sitesettings");
print_heading($strsitesettings);
print_simple_box_start("center", "", "$THEME->cellheading");
- include("site.html");
+ include("site.html");
print_simple_box_end();
print_footer();
// It is assumed that $date is the GMT time of midnight for that day,
// and so the next 86400 seconds worth of logs are printed.
+ global $CFG;
+
if ($course->category) {
$selector = "WHERE l.course='$course->id' AND l.userid = u.id";
echo "<TD NOWRAP ALIGN=right><FONT SIZE=2>".userdate($log->time, "%A")."</TD>";
echo "<TD NOWRAP><FONT SIZE=2>".userdate($log->time, "%d %B %Y, %I:%M %p")."</TD>";
echo "<TD NOWRAP><FONT SIZE=2>";
- link_to_popup_window("$CFG->wwwroot/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
+ link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
echo "</TD>";
echo "<TD NOWRAP><FONT SIZE=2><A HREF=\"../user/view.php?id=$log->userid&course=$log->course\"><B>$log->firstname $log->lastname</B></TD>";
echo "<TD NOWRAP><FONT SIZE=2>";
break;
case "update mod":
$strupdated = get_string("updated", "moodle", get_string("modulename", $info[0]));
- if (! $changelist["$log->info"]) {
+ if (empty($changelist["$log->info"])) {
$changelist["$log->info"] = array ("operation" => "update", "text" => "$strupdated:<BR><A HREF=\"$CFG->wwwroot/course/$log->url\">$modname</A>");
}
break;
$editmenu = popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=0&add=",
$modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"), true);
$editmenu = "<DIV ALIGN=right>$editmenu</DIV>";
+ } else {
+ $editmenu = "";
}
print_side_block($heading, "", $moddata, $modicon, $editmenu, $width);
$string['closewindow'] = "Close this window";
$string['comparelanguage'] = "Compare and edit current language";
$string['configcountry'] = "If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.";
+$string['configdebug'] = "If you turn this on, then PHP's error_reporting will be increased so that more warnings are printed. This is only useful for developers.";
$string['configgdversion'] = "Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don't change this unless you really know what you're doing.";
$string['configerrorlevel'] = "Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.";
$string['confightmleditor'] = "Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it.";
//print "xStep: $xStep <BR>";\r
// if numeric x axis then calculate x coords for each data point. this is seperate from x ticks.\r
$gridX = $gridLeft;\r
+ if (empty($this->calculated['x_axis']['factor'])) {\r
+ $this->calculated['x_axis']['factor'] = 0;\r
+ }\r
+ if (empty($this->calculated['x_axis']['min'])) {\r
+ $this->calculated['x_axis']['min'] = 0;\r
+ }\r
$factor = $this->calculated['x_axis']['factor'];\r
$min = $this->calculated['x_axis']['min'];\r
\r
for ($i=2000; $i<=2010; $i++) {
$years[$i] = $i;
}
- choose_from_menu($days, $day, $currentdate[mday], "");
- choose_from_menu($months, $month, $currentdate[mon], "");
- choose_from_menu($years, $year, $currentdate[year], "");
+ choose_from_menu($days, $day, $currentdate['mday'], "");
+ choose_from_menu($months, $month, $currentdate['mon'], "");
+ choose_from_menu($years, $year, $currentdate['year'], "");
}
function print_time_selector($hour, $minute, $currenttime=0) {
for ($i=0; $i<=59; $i++) {
$minutes[$i] = sprintf("%02d",$i);
}
- choose_from_menu($hours, $hour, $currentdate[hours], "");
- choose_from_menu($minutes, $minute, $currentdate[minutes], "");
+ choose_from_menu($hours, $hour, $currentdate['hours'], "");
+ choose_from_menu($minutes, $minute, $currentdate['minutes'], "");
}
function error ($message, $link="") {
if (($discussion->forumtype == "teacher") and !isteacher($courseid)) {
continue;
}
- if ($replies[$discussion->discussion]) {
+ if (!empty($replies[$discussion->discussion])) {
$discussion->replies = $replies[$discussion->discussion]->replies;
} else {
$discussion->replies = 0;
$count1[$i] = 0;
$count2[$i] = 0;
$indexof[$val] = $i;
+ $stdev1[$i] = 0;
+ $stdev2[$i] = 0;
}
$aaa = get_records_select("survey_answers", "((survey = $cm->instance) AND (question in ($question->multi)))");
$studbuckets2[$i] = 0.0;
$studcount1[$i] = 0;
$studcount2[$i] = 0;
+ $stdev1[$i] = 0.0;
+ $stdev2[$i] = 0.0;
$subquestions = $question[$i]->multi; // otherwise next line doesn't work
$aaa = get_records_select("survey_answers","((survey = $cm->instance) AND (question in ($subquestions)))");
$studbuckets2[$i] = 0.0;
$studcount1[$i] = 0;
$studcount2[$i] = 0;
+ $stdev1[$i] = 0.0;
+ $stdev2[$i] = 0.0;
}
$aaa = get_records_select("survey_answers", "((survey = $cm->instance) AND (question in ($question->multi)))");
$graph->y_tick_labels = $options;
if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
- $graph->y_order = array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
+ $graph->y_order = array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
} else if ($maxbuckets1 > 0.0) {
$graph->y_order = array('stdev1', 'answers1', 'studanswers1');
} else {
$strseemoredetail = get_string("seemoredetail", "survey");
$strnotes = get_string("notes", "survey");
- if (!$action) {
+ if (empty($action)) {
$display = "summary";
}
- if ($display) { // Display the frame containing something.
+ if (!empty($display)) { // Display the frame containing something.
add_to_log($course->id, "survey", "view report", "report.php?id=$cm->id", "$survey->id");
echo "<HEAD><TITLE>$course->shortname: $strreport: $survey->name</TITLE>\n";
echo "<FRAMESET ROWS=70,* BORDER=1> ";
<?
if (isadmin()) {
echo "<tr valign=top>";
- echo "<td><P>".get_string("username").":</td>";
- echo "<td><input type=text name=username size=20 value=\"";
+ echo "<td><P>".get_string("username").":</td>";
+ echo "<td><input type=text name=username size=20 value=\"";
p($user->username);
echo "\">";
- if (isset($err["username"])) formerr($err["username"]);
- echo "</td>";
+ if (isset($err["username"])) formerr($err["username"]);
+ echo "</td>";
echo "</tr>";
echo "<tr valign=top>";
- echo "<td><P>".get_string("newpassword").":</td>";
- echo "<td><input type=text name=newpassword size=20 value=\"";
+ echo "<td><P>".get_string("newpassword").":</td>";
+ echo "<td><input type=text name=newpassword size=20 value=\"";
if (isset($user->newpassword)) p($user->newpassword);
echo "\">";
- if (isset($err["newpassword"])) {
+ if (isset($err["newpassword"])) {
formerr($err["newpassword"]);
} else if (empty($user->newpassword)) {
- echo " (".get_string("leavetokeep").")";
+ echo " (".get_string("leavetokeep").")";
}
- echo "</td>";
+ echo "</td>";
echo "</tr>";
echo "<tr><td colspan=2><HR></td></tr>";
}
?>
<tr valign=top>
- <td><P><? print_string("firstname") ?>:</td>
- <td><input type="text" name="firstname" size=30 value="<? p($user->firstname) ?>">
- <? if (isset($err["firstname"])) formerr($err["firstname"]); ?>
- </td>
+ <td><P><? print_string("firstname") ?>:</td>
+ <td><input type="text" name="firstname" size=30 value="<? p($user->firstname) ?>">
+ <? if (isset($err["firstname"])) formerr($err["firstname"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("lastname") ?>:</td>
- <td><input type="text" name="lastname" size=30 value="<? p($user->lastname) ?>">
- <? if (isset($err["lastname"])) formerr($err["lastname"]); ?>
- </td>
+ <td><P><? print_string("lastname") ?>:</td>
+ <td><input type="text" name="lastname" size=30 value="<? p($user->lastname) ?>">
+ <? if (isset($err["lastname"])) formerr($err["lastname"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("email") ?>:</td>
- <td><input type="text" name="email" size=30 value="<? p($user->email) ?>">
- <? if (isset($err["email"])) formerr($err["email"]); ?>
- </td>
+ <td><P><? print_string("email") ?>:</td>
+ <td><input type="text" name="email" size=30 value="<? p($user->email) ?>">
+ <? if (isset($err["email"])) formerr($err["email"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("emaildisplay") ?>:</td>
- <td><?
+ <td><P><? print_string("emaildisplay") ?>:</td>
+ <td><?
$choices["0"] = get_string("emaildisplayno");
$choices["1"] = get_string("emaildisplayyes");
$choices["2"] = get_string("emaildisplaycourse");
choose_from_menu ($choices, "maildisplay", $user->maildisplay, "") ?>
- </td>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("emailformat") ?>:</td>
- <td><?
+ <td><P><? print_string("emailformat") ?>:</td>
+ <td><?
unset($choices);
$choices["0"] = get_string("textformat");
$choices["1"] = get_string("htmlformat");
choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
- </td>
+ </td>
</tr>
<? if ($CFG->htmleditor) { ?>
<tr valign=top>
- <td><P><? print_string("textediting") ?>:</td>
- <td><?
+ <td><P><? print_string("textediting") ?>:</td>
+ <td><?
unset($choices);
$choices["0"] = get_string("texteditor");
$choices["1"] = get_string("htmleditor");
choose_from_menu ($choices, "htmleditor", $user->htmleditor, "") ?>
- </td>
+ </td>
</tr>
<? } ?>
<tr valign=top>
- <td><P><? print_string("city") ?>:</td>
- <td><input type="text" name="city" size=25 value="<? p($user->city) ?>">
- <? if (isset($err["city"])) formerr($err["city"]); ?>
- </td>
+ <td><P><? print_string("city") ?>:</td>
+ <td><input type="text" name="city" size=25 value="<? p($user->city) ?>">
+ <? if (isset($err["city"])) formerr($err["city"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("country") ?>:</td>
- <td><?
+ <td><P><? print_string("country") ?>:</td>
+ <td><?
if (!$user->country and $CFG->country) {
$user->country = $CFG->country;
}
choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?>
- <? if (isset($err["country"])) formerr($err["country"]); ?>
- </td>
+ <? if (isset($err["country"])) formerr($err["country"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("preferredlanguage") ?>:</td>
- <td><? if ($languages = get_list_of_languages()) {
+ <td><P><? print_string("preferredlanguage") ?>:</td>
+ <td><? if ($languages = get_list_of_languages()) {
if (!$user->lang) {
$user->lang = $CFG->lang;
}
choose_from_menu ($languages, "lang", $user->lang, "", "", "");
}
- if (isset($err["lang"])) formerr($err["lang"]);
+ if (isset($err["lang"])) formerr($err["lang"]);
?>
- </td>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("timezone") ?>:</td>
- <td><?
+ <td><P><? print_string("timezone") ?>:</td>
+ <td><?
if (abs($user->timezone) > 13) {
$user->timezone = 99;
}
choose_from_menu ($timezones, "timezone", $user->timezone, get_string("serverlocaltime"), "", "99");
echo "(".get_string("currentlocaltime").")";
- ?>
+ ?>
</td>
</tr>
<tr valign=top>
- <td><P><? print_string("userdescription") ?>:</td>
- <td><? if (isset($err["description"])) {
+ <td><P><? print_string("userdescription") ?>:</td>
+ <td><? if (isset($err["description"])) {
formerr($err["description"]);
echo "<BR>";
} ?>
<TEXTAREA NAME=description COLS=50 ROWS=10 WRAP=virtual><? p($user->description) ?></TEXTAREA>
<? helpbutton("text", get_string("helptext")) ?>
- </td>
+ </td>
</tr>
<tr>
<td colspan=2><BR><B><? print_string("followingoptional") ?>:</B></td>
</tr>
<tr valign=top>
- <td><P><? print_string("newpicture") ?>:</td>
- <td>
+ <td><P><? print_string("newpicture") ?>:</td>
+ <td>
<INPUT type="hidden" name="MAX_FILE_SIZE" value="<? echo get_max_upload_file_size() ?>">
<input type="file" name="imagefile" size=40>
<? helpbutton("picture", get_string("helppicture"));
print_string("maxsize", "", display_size(get_max_upload_file_size()));
- if (isset($err["imagefile"])) formerr($err["imagefile"]);
+ if (isset($err["imagefile"])) formerr($err["imagefile"]);
?>
- </td>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("webpage") ?>:</td>
- <td><input type="text" name="url" size=50 value="<? p($user->url) ?>">
- <? if (isset($err["url"])) formerr($err["url"]); ?>
- </td>
+ <td><P><? print_string("webpage") ?>:</td>
+ <td><input type="text" name="url" size=50 value="<? p($user->url) ?>">
+ <? if (isset($err["url"])) formerr($err["url"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("icqnumber") ?>:</td>
- <td><input type="text" name="icq" size=25 value="<? p($user->icq) ?>">
- <? if (isset($err["icq"])) formerr($err["icq"]); ?>
- </td>
+ <td><P><? print_string("icqnumber") ?>:</td>
+ <td><input type="text" name="icq" size=25 value="<? p($user->icq) ?>">
+ <? if (isset($err["icq"])) formerr($err["icq"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("idnumber") ?>:</td>
- <td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> <? p($teacheronly) ?>
- <? if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
- </td>
+ <td><P><? print_string("idnumber") ?>:</td>
+ <td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> <? p($teacheronly) ?>
+ <? if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("phone") ?> 1:</td>
- <td><input type="text" name="phone1" size=25 value="<? p($user->phone1) ?>"> <? p($teacheronly) ?>
- <? if (isset($err["phone1"])) formerr($err["phone1"]); ?>
- </td>
+ <td><P><? print_string("phone") ?> 1:</td>
+ <td><input type="text" name="phone1" size=25 value="<? p($user->phone1) ?>"> <? p($teacheronly) ?>
+ <? if (isset($err["phone1"])) formerr($err["phone1"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("phone") ?> 2:</td>
- <td><input type="text" name="phone2" size=25 value="<? p($user->phone2) ?>"> <? p($teacheronly) ?>
- <? if (isset($err["phone2"])) formerr($err["phone2"]); ?>
- </td>
+ <td><P><? print_string("phone") ?> 2:</td>
+ <td><input type="text" name="phone2" size=25 value="<? p($user->phone2) ?>"> <? p($teacheronly) ?>
+ <? if (isset($err["phone2"])) formerr($err["phone2"]); ?>
+ </td>
</tr>
<tr valign=top>
- <td><P><? print_string("address") ?>:</td>
- <td><input type="text" name="address" size=25 value="<? p($user->address) ?>"> <? p($teacheronly) ?>
- <? if (isset($err["address"])) formerr($err["address"]); ?>
- </td>
+ <td><P><? print_string("address") ?>:</td>
+ <td><input type="text" name="address" size=25 value="<? p($user->address) ?>"> <? p($teacheronly) ?>
+ <? if (isset($err["address"])) formerr($err["address"]); ?>
+ </td>
</tr>
<tr>
- <td></td>
- <td align=right><input type="submit" value="<? print_string("updatemyprofile") ?>"></td>
+ <td></td>
+ <td align=right><input type="submit" value="<? print_string("updatemyprofile") ?>"></td>
</TABLE>
<INPUT type="hidden" name="course" value="<? p($course->id) ?>">
<INPUT type="hidden" name="id" value="<? p($user->id) ?>">