Skip to content

Commit

Permalink
Changes to improve layout and formatting on old Netscape (eg version 4)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Aug 23, 2002
1 parent b0cb5e2 commit 19a55d6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
22 changes: 11 additions & 11 deletions course/lib.php
Expand Up @@ -455,11 +455,11 @@ function get_all_sections($courseid) {
ORDER BY section");
}

function print_section($courseid, $section, $mods, $modnamesused, $absolute=false) {
function print_section($courseid, $section, $mods, $modnamesused, $absolute=false, $width="100%") {
global $CFG;


echo "<TABLE WIDTH=100%><TR><TD>\n";
echo "<TABLE WIDTH=\"$width\"><TR><TD>\n";
if ($section->sequence) {

$sectionmods = explode(",", $section->sequence);
Expand All @@ -479,9 +479,9 @@ function print_section($courseid, $section, $mods, $modnamesused, $absolute=fals
echo "</TD></TR></TABLE><BR>\n\n";
}

function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) {
function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL, $width=190) {

echo "<TABLE WIDTH=100%>\n";
echo "<TABLE WIDTH=\"$width\">\n";
echo "<TR><TD COLSPAN=2><P><B><FONT SIZE=2>$heading</TD></TR>\n";
if ($list) {
foreach($list as $key => $string) {
Expand All @@ -502,10 +502,10 @@ function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) {
echo "</TABLE><BR>\n\n";
}

function print_admin_links ($siteid) {
function print_admin_links ($siteid, $width=190) {
global $THEME, $CFG;

print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box(get_string("administration"), $align="CENTER", $width, $color="$THEME->cellheading");
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[]="<A HREF=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."</A>";
$modicon[]=$icon;
Expand All @@ -524,11 +524,11 @@ function print_admin_links ($siteid) {
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php\">".get_string("edituser")."</A>";
$modicon[]=$icon;
$fulladmin = "<P><A HREF=\"$CFG->wwwroot/admin/\">".get_string("admin")."</A>...";
print_side_block("", $moddata, "$fulladmin", $modicon);
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=200 HEIGHT=0><BR>";
print_side_block("", $moddata, "$fulladmin", $modicon, $width);
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=\"$width\" HEIGHT=1><BR>";
}

function print_course_admin_links($courseid) {
function print_course_admin_links($courseid, $width=190) {
global $THEME, $CFG;

echo "<BR>";
Expand All @@ -553,8 +553,8 @@ function print_course_admin_links($courseid) {
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
}

print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $admindata, "", $adminicon);
print_simple_box(get_string("administration"), $align="CENTER", $width, $color="$THEME->cellheading");
print_side_block("", $admindata, "", $adminicon, $width);
}


Expand Down
2 changes: 2 additions & 0 deletions course/weeks.php
Expand Up @@ -182,6 +182,8 @@
print_recent_activity($course);
print_simple_box_end();

echo "<BR><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";

echo "</TD></TR></TABLE>\n";

?>
16 changes: 10 additions & 6 deletions index.php
Expand Up @@ -27,12 +27,15 @@
true, $headerbutton);


$side = 190;


?>


<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<TR>
<TD VALIGN="TOP" NOWRAP>
<TD WIDTH=<?=$side?> VALIGN="TOP" NOWRAP>
<?

$sections = get_all_sections($site->id);
Expand All @@ -41,11 +44,11 @@

if ($sections[0]->sequence or isediting($site->id)) {
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_simple_box(get_string("mainmenu"), "CENTER", "100%", "$THEME->cellheading");
print_simple_box(get_string("mainmenu"), "CENTER", $side, "$THEME->cellheading");
}

if ($sections[0]->sequence) {
print_section($site->id, $sections[0], $mods, $modnamesused, true);
print_section($site->id, $sections[0], $mods, $modnamesused, true, $side);
}

if (isediting($site->id)) {
Expand All @@ -59,7 +62,7 @@
print_simple_box(get_string("courses"), "CENTER", "100%", "$THEME->cellheading");
print_all_courses($cat=1, "minimal", 10);
}
echo "<IMG SRC=\"pix/spacer.gif\" WIDTH=200 HEIGHT=0><BR>";
print_spacer(1,$side);
}

if (isadmin()) {
Expand All @@ -72,7 +75,7 @@
<TD WIDTH="70%" VALIGN="TOP">
<? if ($site->newsitems == 0 ) {
print_simple_box(get_string("availablecourses"), "CENTER", "100%", "$THEME->cellheading");
echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
print_spacer(8,1);
print_all_courses();

} else {
Expand All @@ -97,7 +100,7 @@
$headertext = get_string("sitenews");
}
print_simple_box($headertext, "CENTER", "100%", $THEME->cellheading);
echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
print_spacer(8,1);
forum_print_latest_discussions($newsforum->id, $site->newsitems);
}
?>
Expand All @@ -109,6 +112,7 @@
$site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
}
print_simple_box($site->summary, "", "100%", $THEME->cellheading);
print_spacer(1,$side);
?>
</TD>
</TR>
Expand Down
8 changes: 8 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -141,6 +141,14 @@ function print_single_button($link, $options, $label="OK") {
echo "<INPUT TYPE=submit VALUE=\"$label\"></FORM>";
}

function print_spacer($height=1, $width=1, $br=true) {
global $CFG;
echo "<IMG HEIGHT=\"$height\" WIDTH=\"$width\" SRC=\"$CFG->wwwroot/pix/spacer.gif\" ALT=\"\">";
if ($br) {
echo "<BR>\n";
}
}

function print_user_picture($userid, $courseid, $picture, $large=false, $returnstring=false) {
global $CFG;

Expand Down
4 changes: 2 additions & 2 deletions mod/forum/lib.php
Expand Up @@ -162,9 +162,9 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link
echo "</TD>";

if ($post->parent) {
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\">";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" WIDTH=\"100%\">";
} else {
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading2\">";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading2\" WIDTH=\"100%*\">";
}
echo "<P>";
echo "<FONT SIZE=3><B>$post->subject</B></FONT><BR>";
Expand Down

0 comments on commit 19a55d6

Please sign in to comment.