From: nfreear Date: Thu, 13 Apr 2006 14:28:36 +0000 (+0000) Subject: Major fix for Bug 5027, "Three-col layout breaks when window is narrow" (also, Bug... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1528decaae59ce68921bfb73fcaf4bda72ea2770;p=moodle.git Major fix for Bug 5027, "Three-col layout breaks when window is narrow" (also, Bug 5161). 'weekscss' course format. --- diff --git a/course/format/weekscss/format.php b/course/format/weekscss/format.php index 838d9cbe2c..f3aa27f462 100644 --- a/course/format/weekscss/format.php +++ b/course/format/weekscss/format.php @@ -28,7 +28,7 @@ require_once("$CFG->dirroot/mod/forum/lib.php"); $week = optional_param('week', -1, PARAM_INT); - +/* // Bounds for block widths; in PIXELS. define('BLOCK_L_MIN_WIDTH', 100); define('BLOCK_L_MAX_WIDTH', 210); @@ -48,7 +48,7 @@ $width_center = '60%; '; $min_max_block= 'min-width:100px; max-width:210px; '; $min_max_main = 'min-width:25em; max-width:37em; '; //33em - +*/ if ($week != -1) { $displaysection = course_set_display($course->id, $week); } else { @@ -81,20 +81,40 @@ } +/* Internet Explorer min-width fix. (See theme/standard/styles_layout.css: min-width for Firefox.) + Window width: 800px, Firefox 763px, IE 752px. (Window width: 640px, Firefox 602px, IE 588px.) +*/ +?> + + +'; /// The left column ... if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { - echo '
'; + //echo '
'; + echo '
'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo '
'; } + +/// The right column, BEFORE the middle-column. + if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { + //echo '
'; + echo '
'; + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); + echo '
'; + } /// Start main column - echo '
'; - + //echo '
'; + echo '
'; print_heading_block(get_string('weeklyoutline'), 'outline'); @@ -118,7 +138,9 @@ if ($thissection->summary or $thissection->sequence or isediting($course->id)) { // Note, no need for a 'left side' cell or DIV. + // Note, 'right side' is BEFORE content. echo '
  • '; + echo '
     
    '; echo '
    '; echo '
    '; @@ -138,7 +160,7 @@ print_section_add_menus($course, $section, $modnames); } - echo '
     
    '; + echo '
    '; //'
     
    '; echo "
  • \n"; } @@ -201,6 +223,38 @@ echo '
  • '; //'
     
    '; + // Note, 'right side' is BEFORE content. + echo '
    '; + + if ($displaysection == $section) { + echo ''. + ''.$strshowallweeks.'
    '; + } else { + $strshowonlyweek = get_string("showonlyweek", "", $section); + echo ''. + ''.$strshowonlyweek.'
    '; + } + + if (isediting($course->id)) { + if ($thissection->visible) { // Show the hide/show eye + echo ''. + ''.$strweekhide.'
    '; + } else { + echo ''. + ''.$strweekhide.'
    '; + } + if ($section > 1) { // Add a arrow to move section up + echo ''. + ''.$strmoveup.'
    '; + } + + if ($section < $course->numsections) { // Add a arrow to move section down + echo ''. + ''.$strmovedown.'
    '; + } + } + echo '
    '; + echo '
    '; if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students echo '
    '.$weekday.' - '.$endweekday.' ('.get_string('notavailable').')
    '; @@ -225,7 +279,7 @@ } } - echo '
    '; + echo '
    '; /*'
    '; if ($displaysection == $section) { echo ''. @@ -255,7 +309,8 @@ } } - echo '
    '; + ///echo '
  • '; + */ echo "\n"; } @@ -273,7 +328,7 @@ echo '
    '; - // The right column +/* // The right column if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo '
    '; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); @@ -281,6 +336,17 @@ } echo '
    '; +*/ echo '
    '; + echo '
    '; +if ($CFG->debug > 7) { ?> +

    Debug, document.body.clientWidth: + +

    + \ No newline at end of file diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index d19407bf2f..17c46f1c6d 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -868,10 +868,6 @@ span.current { border-right:0px; } -* html #course-view .section .content .commands { - clear: both; -} - #course-view .section td.side { padding:5px; border-style:solid; @@ -922,19 +918,27 @@ span.current { text-indent: 0; list-style: none; } +/* Window-width: 800 pixels. + IE doesn't support, see inline IE conditional comment. */ .weekscss-format { - min-width:763px; /* Doesn't work for IE. */ + min-width: 763px; } .weekscss-format .block_adminblock select { width:100%; } .weekscss-format #middle-column { - padding-left:12px; - padding-right:12px; + margin: 0 12.5em 0 12.5em; +} +.weekscss-format #left-column { + float: left; + width: 11.5em; +} +.weekscss-format #right-column { + float: right; + width: 11.5em; } .weekscss li.section { margin-bottom: 0.5em; - width: 100%; border-style:solid; border-width:1px; } @@ -943,16 +947,12 @@ span.current { padding: 5px; } .weekscss .content { - margin-left: 4%; /* Why? Firefox 8%; IE 4% */ - width: 80%; - float: left; -} -.weekscss .side { - width: 8%; - float: left; + margin: 0 1.7em 0 1.7em; } -.weekscss .clearer { - height: 0; +.weekscss .right { + width: 1.6em; + float: right; + text-align:center; } .section .activity img.activityicon {