// 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();
//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
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) {