]> git.mjollnir.org Git - moodle.git/commitdiff
site front page can now have a topic section, see http://moodle.org/mod/forum/discuss...
authorgustav_delius <gustav_delius>
Fri, 2 Jul 2004 09:32:17 +0000 (09:32 +0000)
committergustav_delius <gustav_delius>
Fri, 2 Jul 2004 09:32:17 +0000 (09:32 +0000)
admin/site.html
course/lib.php
index.php
lang/en/moodle.php

index 163ee0e2083e88122d9cad3fac00f05aec777421..b7a75ab2a192107a2289ef1a970a2d19bcce1803 100644 (file)
         </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>
index 90e2178594b871f7f512ae76d317e9f5c08b666d..9da98c7fe4a8f2577ca60b2302e5c3bc2b9a3a5e 100644 (file)
@@ -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";
                 }
index 42688880355aeef3547e1956b897cbe4a490ff24..e8f0a926422361dac75321fa267c61a3b759d5a8 100644 (file)
--- a/index.php
+++ b/index.php
     }
 
     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")) {
index ab1b6aefc6d4477080a412c537760ec69e692a26..1da2a73a84e061590f81944d461f1839a8c43716 100644 (file)
@@ -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';