diff --git a/calendar/preferences.php b/calendar/preferences.php index c49838c7089..380c4ad1dbd 100644 --- a/calendar/preferences.php +++ b/calendar/preferences.php @@ -134,49 +134,10 @@ // Layout the whole page as three big columns. echo '
| '; + // START: The main column + echo ' | |||||
| "; - $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 ""; - forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false); - echo ""; - print_side_block_end(); - } - } - print_spacer(1,$side); - } - - if (iscreator()) { - if (!$firstcolumn) { - echo " | "; - $firstcolumn=true; - } - print_admin_links($site->id, $side); - } - - if ($firstcolumn) { - echo ' | '; - } - // END: The left column - - // START: Middle column - echo ''; + echo ' | ';
$text = ' '.get_string('calendarheading', 'calendar', strip_tags($site->shortname)).' ';
$text.= calendar_get_preferences_menu();
@@ -294,7 +255,7 @@
// END: Middle column
// START: Last column (3-month display)
- echo ' ';
+ echo ' | ';
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);
@@ -313,7 +274,7 @@
print_side_block_end();
print_spacer(1, $side);
echo ' | ';
- // START: Last column (3-month display)
+ // END: Last column (3-month display)
echo ' |
| '; + // START: Main column - $sections = get_all_sections($site->id); + echo ' | '; - // Latest site news - if ($site->newsitems > 0 || $sections[0]->sequence || isediting($site->id) || isadmin()) { - echo " | "; - $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 ""; - forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false); - echo ""; - print_side_block_end(); - } - } - print_spacer(1,$side); - } - - if (iscreator()) { - if (!$firstcolumn) { - echo " | "; - $firstcolumn=true; - } - print_admin_links($site->id, $side); - } - - if ($firstcolumn) { - echo ' | '; - } - - // END: The left column - - // START: Middle column - if ($lastcolumn) { - echo ''; - } - else { - echo ' | ';
- }
-
- if($prefmenu) {
+ if ($prefmenu) {
$text = ' '.get_string('calendarheading', 'calendar', strip_tags($site->shortname)).' ';
$text.= calendar_get_preferences_menu();
$text.= ' ';
- }
- else {
+
+ } else {
$text = get_string('calendarheading', 'calendar', strip_tags($site->shortname));
}
@@ -219,31 +171,30 @@
echo ' | ';
- // END: Middle column
+ // END: Main column
// START: Last column (3-month display)
- if ($lastcolumn) {
- echo '';
- 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 ' '; - echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr)); - echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr); - echo ' '; - echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr)); - echo calendar_get_mini($courses, $groups, $users, $mon, $yr); - echo ' '; - echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr)); - echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr); - echo ' '; - print_side_block_end(); - print_spacer(1, $side); - echo ' | ';
- }
+ echo '';
+ 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 ' '; + echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr)); + echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr); + echo ' '; + echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr)); + echo calendar_get_mini($courses, $groups, $users, $mon, $yr); + echo ' '; + echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr)); + echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr); + echo ' '; + print_side_block_end(); + print_spacer(1, $side); + echo ' | ';
echo '