Skip to content

Commit

Permalink
Some changes to the layout to remove blocks etc
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Apr 27, 2004
1 parent 36c34ab commit ff2ec3b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 119 deletions.
49 changes: 5 additions & 44 deletions calendar/preferences.php
Expand Up @@ -134,49 +134,10 @@
// 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();
Expand Down Expand Up @@ -294,7 +255,7 @@
// 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);
Expand All @@ -313,7 +274,7 @@
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();
Expand Down
101 changes: 26 additions & 75 deletions calendar/view.php
Expand Up @@ -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
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -115,63 +112,18 @@

// 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));
}

Expand Down Expand Up @@ -219,31 +171,30 @@

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) {
Expand Down

0 comments on commit ff2ec3b

Please sign in to comment.