mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
More files related to recent course display changes
This commit is contained in:
parent
c2cb45451f
commit
c9704833fa
@ -25,10 +25,20 @@
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><P><?php print_string("frontpageformat") ?>:</td>
|
||||
<td><?php
|
||||
$options = array("0" => get_string("frontpagenews"),
|
||||
"1" => get_string("frontpagecourselist"),
|
||||
"2" => get_string("frontpagecategorynames"));
|
||||
choose_from_menu ($options, "frontpage", "$form->frontpage", "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p><?php print_string("newsitemsnumber") ?>:</td>
|
||||
<td><?php
|
||||
$newsitem = get_string("newsitem");
|
||||
$newsitems = get_string("newsitems");
|
||||
$options = array("0" => get_string("showlistofcourses"),
|
||||
$options = array("0" => "0 $newsitems",
|
||||
"1" => "1 $newsitem",
|
||||
"2" => "2 $newsitems",
|
||||
"3" => "3 $newsitems",
|
||||
|
@ -17,11 +17,13 @@
|
||||
|
||||
if (count($err) == 0) {
|
||||
|
||||
set_config("frontpage", $form->frontpage);
|
||||
|
||||
$form->timemodified = time();
|
||||
|
||||
if ($form->id) {
|
||||
if (update_record("course", $form)) {
|
||||
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
|
||||
redirect("$CFG->wwwroot/", get_string("changessaved"));
|
||||
} else {
|
||||
error("Serious Error! Could not update the site record! (id = $form->id)");
|
||||
}
|
||||
@ -29,7 +31,7 @@
|
||||
if ($newid = insert_record("course", $form)) {
|
||||
$cat->name = get_string("miscellaneous");
|
||||
if (insert_record("course_categories", $cat)) {
|
||||
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
|
||||
redirect("$CFG->wwwroot/", get_string("changessaved"));
|
||||
} else {
|
||||
error("Serious Error! Could not set up a default course category!");
|
||||
}
|
||||
@ -55,7 +57,7 @@
|
||||
$form->fullname = "";
|
||||
$form->shortname = "";
|
||||
$form->summary = "";
|
||||
$form->newsitems = 0;
|
||||
$form->newsitems = 3;
|
||||
$form->id = "";
|
||||
$form->category = 0;
|
||||
$form->format = "social";
|
||||
@ -63,6 +65,18 @@
|
||||
$firsttime = true;
|
||||
}
|
||||
|
||||
if (isset($CFG->frontpage)) {
|
||||
$form->frontpage = $CFG->frontpage;
|
||||
|
||||
} else {
|
||||
if ($form->newsitems > 0) {
|
||||
$form->frontpage = 0;
|
||||
} else {
|
||||
$form->frontpage = 1;
|
||||
}
|
||||
set_config("frontpage", $form->frontpage);
|
||||
}
|
||||
|
||||
if (empty($focus)) {
|
||||
$focus = "form.fullname";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user