Commit 5fc2f2fd authored by gustav_delius's avatar gustav_delius
Browse files

site front page can now have a topic section, see...

site front page can now have a topic section, see http://moodle.org/mod/forum/discuss.php?d=9444#45748
parent 217a6e1f
......@@ -66,32 +66,42 @@
</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("sitesection") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "numsections", $form->numsections, "");
?>
</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") ?>)
<?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>
......
......@@ -805,7 +805,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
continue;
}
echo "<a title=\"$strmovefull\"".
" href=\"mod.php?moveto=$mod->id\">".
" href=\"$CFG->wwwroot/course/mod.php?moveto=$mod->id\">".
"<img height=\"16\" width=\"80\" src=\"$CFG->pixpath/movehere.gif\" ".
" alt=\"$strmovehere\" border=\"0\"></a><br />\n";
}
......
......@@ -153,6 +153,65 @@
}
echo '<td style="vertical-align: top;">';
/// Print Section
if ($site->numsections > 0) {
echo "<table class=\"topicsoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
/// If currently moving a file then show the current clipboard
if (ismoving($site->id)) {
$stractivityclipboard = strip_tags(get_string("activityclipboard", "", addslashes($USER->activitycopyname)));
$strcancel= get_string("cancel");
echo "<tr>";
echo "<td colspan=3 valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicoutlineclip\" width=\"100%\">";
echo "<p><font size=2>";
echo "$stractivityclipboard&nbsp;&nbsp;(<a href=\"course/mod.php?cancelcopy=true\">$strcancel</a>)";
echo "</font></p>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"pix/spacer.gif\" width=1 height=1></td></tr>";
}
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$stractivities = get_string("activities");
$sections = get_all_sections($site->id);
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
$section = 0;
$thissection = $sections[$section];
echo '<tr id="section_0">';
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">";
echo format_text($thissection->summary, FORMAT_HTML);
if ($editing) {
echo "<a title=\"$streditsummary\" ".
" href=\"course/editsection.php?id=$thissection->id\"><img src=\"$CFG->pixpath/t/edit.gif\" ".
" height=11 width=11 border=0 alt=\"$streditsummary\"></a><br />";
}
echo '<br clear="all">';
print_section($site, $thissection, $mods, $modnamesused, true);
if ($editing) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$site->id&amp;section=$section&add=",
$modnames, "section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</td>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>";
echo "&nbsp;</td></tr>";
echo "<tr><td colspan=3><img src=\"pix/spacer.gif\" width=1 height=1></td></tr>";
echo '</table>';
}
switch ($CFG->frontpage) { /// Display the main part of the front page.
case FRONTPAGENEWS:
if (! $newsforum = forum_get_course_forum($site->id, "news")) {
......
......@@ -835,6 +835,7 @@ $string['sitefiles'] = 'Site files';
$string['sitelogs'] = 'Site logs';
$string['sitenews'] = 'Site news';
$string['sites'] = 'Sites';
$string['sitesection'] = 'Include a topic section';
$string['sitesettings'] = 'Site settings';
$string['size'] = 'Size';
$string['sizeb'] = 'bytes';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment