Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changes to improve layout and formatting on old Netscape (eg version 4)

  • Loading branch information...
commit 19a55d6776e17248b40d80cdfee054787d333933 1 parent b0cb5e2
martin authored
View
22 course/lib.php
@@ -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);
@@ -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) {
@@ -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;
@@ -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>";
@@ -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);
}
View
2  course/weeks.php
@@ -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";
?>
View
16 index.php
@@ -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);
@@ -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)) {
@@ -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()) {
@@ -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 {
@@ -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);
}
?>
@@ -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>
View
8 lib/moodlelib.php
@@ -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;
View
4 mod/forum/lib.php
@@ -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>";
Please sign in to comment.
Something went wrong with that request. Please try again.