Skip to content

Commit

Permalink
site front page can now have a topic section, see http://moodle.org/m…
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav_delius committed Jul 2, 2004
1 parent 217a6e1 commit 5fc2f2f
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 17 deletions.
42 changes: 26 additions & 16 deletions admin/site.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
59 changes: 59 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
1 change: 1 addition & 0 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@
$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';
Expand Down

0 comments on commit 5fc2f2f

Please sign in to comment.