]> git.mjollnir.org Git - moodle.git/commitdiff
Some changes to the layout to remove blocks etc
authormoodler <moodler>
Tue, 27 Apr 2004 08:49:22 +0000 (08:49 +0000)
committermoodler <moodler>
Tue, 27 Apr 2004 08:49:22 +0000 (08:49 +0000)
calendar/preferences.php
calendar/view.php

index c49838c7089b6d3837c26962f418ab789c2beeef..380c4ad1dbd612eab8b292cdc6c472c7436e2da9 100644 (file)
     // Layout the whole page as three big columns.
     echo '<table border="0" cellpadding="3" cellspacing="0" width="100%">';
 
-    // START: The left column
-    echo '<tr valign="top"><td valign="top" width="180">';
+    // START: The main column
+    echo '<tr valign="top">';
 
-    $sections = get_all_sections($site->id);
-
-    if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id) or isadmin()) {
-        echo "<td width=\"$side\" valign=top nowrap>";
-        $firstcolumn=true;
-
-        if ($sections[0]->sequence or isediting($site->id)) {
-            get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
-            print_section_block(get_string("mainmenu"), $site, $sections[0],
-                                 $mods, $modnames, $modnamesused, true, $side);
-        }
-
-        print_courses_sideblock(0, $side);
-        if ($site->newsitems) {
-            if ($news = forum_get_course_forum($site->id, "news")) {
-                print_side_block_start(get_string("latestnews"), $side, "sideblocklatestnews");
-                echo "<font size=\"-2\">";
-                forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false);
-                echo "</font>";
-                print_side_block_end();
-            }
-        }
-        print_spacer(1,$side);
-    }
-
-    if (iscreator()) {
-        if (!$firstcolumn) {
-            echo "<td width=\"$side\" valign=top nowrap>";
-            $firstcolumn=true;
-        }
-        print_admin_links($site->id, $side);
-    }
-
-    if ($firstcolumn) {
-        echo '</td>';
-    }
-    // END: The left column
-
-    // START: Middle column
-    echo '<td width="70%" valign="top\">';
+    echo '<td width="100%" valign="top\">';
 
     $text = '<div style="float: left;">'.get_string('calendarheading', 'calendar', strip_tags($site->shortname)).'</div><div style="float: right;">';
     $text.= calendar_get_preferences_menu();
     // END: Middle column
 
     // START: Last column (3-month display)
-    echo '<td valign="top">';
+    echo '<td valign="top" width="'.$side.'">';
     print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain');
     list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
     list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
     print_side_block_end();
     print_spacer(1, $side);
     echo '</td>';
-    // START: Last column (3-month display)
+    // END: Last column (3-month display)
 
     echo '</tr></table>';
     print_footer();
index 007a97d0544c98ab71acc8d107077c835c79253c..f33050dd89e6e0d103ff8ca351469f197b0728a5 100644 (file)
@@ -56,8 +56,6 @@
 
     //add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
 
-    $firstcolumn = false;  // for now
-    $lastcolumn = true;   // for now
     $side = 175;
 
     $prefmenu = true; // By default, display it
@@ -85,7 +83,6 @@
         case 'month':
             $nav .= ' -> '.calendar_month_name($mon).' '.$yr;
             $pagetitle = get_string('detailedmonthview', 'calendar');
-            $lastcolumn = false;
         break;
         case 'upcoming':
             $pagetitle = get_string('upcomingevents', 'calendar');
 
     // Layout the whole page as three big columns.
     echo '<table border="0" cellpadding="3" cellspacing="0" width="100%">';
+    echo '<tr valign="top">';
 
-    // START: The left column ...
-    echo '<tr valign="top"><td valign="top" width="180">';
+    // START: Main column
 
-    $sections = get_all_sections($site->id);
+    echo '<td width="100%" valign="top">';
 
-    // Latest site news
-    if ($site->newsitems > 0 || $sections[0]->sequence || isediting($site->id) || isadmin()) {
-        echo "<td width=\"$side\" valign=top nowrap>";
-        $firstcolumn=true;
-
-        if ($sections[0]->sequence or isediting($site->id)) {
-            get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
-            print_section_block(get_string("mainmenu"), $site, $sections[0],
-                                $mods, $modnames, $modnamesused, true, $side);
-        }
-        print_courses_sideblock(0, $side);
-        if ($site->newsitems) {
-            if ($news = forum_get_course_forum($site->id, "news")) {
-                print_side_block_start(get_string("latestnews"), $side, "sideblocklatestnews");
-                echo "<font size=\"-2\">";
-                forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false);
-                echo "</font>";
-                print_side_block_end();
-            }
-        }
-        print_spacer(1,$side);
-    }
-
-    if (iscreator()) {
-        if (!$firstcolumn) {
-            echo "<td width=\"$side\" valign=top nowrap>";
-            $firstcolumn=true;
-        }
-        print_admin_links($site->id, $side);
-    }
-
-    if ($firstcolumn) {
-        echo '</td>';
-    }
-
-    // END: The left column
-
-    // START: Middle column
-    if ($lastcolumn) {
-        echo '<td width="70%" valign="top\">';
-    }
-    else {
-        echo '<td width="100%" valign="top">';
-    }
-
-    if($prefmenu) {
+    if ($prefmenu) {
         $text = '<div style="float: left;">'.get_string('calendarheading', 'calendar', strip_tags($site->shortname)).'</div><div style="float: right;">';
         $text.= calendar_get_preferences_menu();
         $text.= '</div>';
-    }
-    else {
+
+    else {
         $text = get_string('calendarheading', 'calendar', strip_tags($site->shortname));
     }
 
 
     echo '</td>';
 
-    // END: Middle column
+    // END: Main column
 
     // START: Last column (3-month display)
-    if ($lastcolumn) {
-        echo '<td valign="top">';
-        print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain');
-        list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
-        list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
-        echo calendar_filter_controls($_GET['view']);
-        echo '<p>';
-        echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr));
-        echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
-        echo '</p><p>';
-        echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr));
-        echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
-        echo '</p><p>';
-        echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr));
-        echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
-        echo '</p>';
-        print_side_block_end();
-        print_spacer(1, $side);
-        echo '</td>';
-    }
+    echo '<td valign="top" width="'.$side.'">';
+    print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain');
+    list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
+    list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
+    echo calendar_filter_controls($_GET['view']);
+    echo '<p>';
+    echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr));
+    echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
+    echo '</p><p>';
+    echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr));
+    echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
+    echo '</p><p>';
+    echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr));
+    echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
+    echo '</p>';
+    print_side_block_end();
+    print_spacer(1, $side);
+    echo '</td>';
 
     echo '</tr></table>';
+
     print_footer();
 
 function calendar_show_event($event) {