From ab9ad21d0b33b8c4bbc53e4aee2f46e22d5beec4 Mon Sep 17 00:00:00 2001 From: nfreear Date: Tue, 13 Nov 2007 17:16:54 +0000 Subject: [PATCH] Follow up fix for MDL-7878 "Link identification and skipping" (and MDL-9306 "Replaced weeks..") - duplicate skip_main_destination(). --- course/format/weeks/format.php | 209 ++++++++++++++++----------------- 1 file changed, 104 insertions(+), 105 deletions(-) diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 48b64a6424656..fcf074ab021f8 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -1,32 +1,38 @@ and with DIVs; inline styles. + * 3. Reorder columns so that in linear view content is first then blocks; + * styles to maintain original graphical (side by side) view. + * + * Target: 3-column graphical view using relative widths for pixel screen sizes + * 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards. + * + * http://www.maxdesign.com.au/presentation/em/ Ideal length for content. + * http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE. + * + * @copyright © 2006 The Open University + * @author N.D.Freear@open.ac.uk, and others. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License + * @package + */ +//TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formatweekscss'] require_once($CFG->libdir.'/ajax/ajaxlib.php'); - + if (!empty($THEME->customcorners)) { - require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); + require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); } $week = optional_param('week', -1, PARAM_INT); - // Bounds for block widths - // more flexible for theme designers taken from theme config.php - $lmin = (empty($THEME->block_l_min_width)) ? 100 : $THEME->block_l_min_width; - $lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width; - $rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width; - $rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width; - - define('BLOCK_L_MIN_WIDTH', $lmin); - define('BLOCK_L_MAX_WIDTH', $lmax); - define('BLOCK_R_MIN_WIDTH', $rmin); - define('BLOCK_R_MAX_WIDTH', $rmax); - - $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), - BLOCK_L_MAX_WIDTH); - $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), - BLOCK_R_MAX_WIDTH); - if ($week != -1) { $displaysection = course_set_display($course->id, $week); } else { @@ -55,46 +61,54 @@ } $context = get_context_instance(CONTEXT_COURSE, $course->id); -/// Layout the whole page as three big columns. - echo ''; - $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable; - foreach ($lt as $column) { - switch ($column) { - case 'left': - +/* 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 ''; } - break; - case 'middle': + +/// The right column, BEFORE the middle-column. + if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { + echo '
'; + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); + echo '
'; + } + /// Start main column - echo ''; - - break; - case 'right': - // The right column - if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { - echo ''; - } - - break; - } - } - echo '
'; - - if (!empty($THEME->customcorners)) print_custom_corners_start(); + echo '
'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); - if (!empty($THEME->customcorners)) print_custom_corners_end(); - - echo '
'; + echo '
'; if (!empty($THEME->customcorners)) print_custom_corners_start(); - - echo skip_main_destination(); + echo skip_main_destination(); + print_heading_block(get_string('weeklyoutline'), 'outline'); - echo ''; + // Note, an ordered list would confuse - "1" could be the clipboard or summary. + echo "
    \n"; /// If currently moving a file then show the current clipboard if (ismoving($course->id)) { $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname))); $strcancel= get_string('cancel'); - echo '
'; - echo ''; - echo ''; + echo "\n"; } /// Print Section 0 with general activities @@ -103,18 +117,21 @@ $thissection = $sections[$section]; if ($thissection->summary or $thissection->sequence or isediting($course->id)) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - + echo ''; + echo "\n"; } @@ -190,38 +204,13 @@ $sectionstyle = ''; } - echo ''; - echo ''; - - $weekperiod = $weekday.' - '.$endweekday; - - echo ''; - - echo ''; - echo ''; + echo ''; + echo "\n"; } $section++; $weekdate = $nextweekdate; } - echo '
'; + echo '
  • '; echo $stractivityclipboard.'  ('.$strcancel.')'; - echo '
  •  '; + + // Note, 'right side' is BEFORE content. + echo '
  • '; + echo '
     
    '; + echo '
     
    '; + echo '
    '; echo '
    '; $summaryformatoptions->noclean = true; echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) { - echo ''.$streditsummary.'

    '; + ' class="icon edit" alt="'.$streditsummary.'" />

    '; } echo '
    '; @@ -124,11 +141,8 @@ print_section_add_menus($course, $section, $modnames); } - echo '
  •  
     '.$currenttext.''; - if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { // Hidden for students - echo '
    '.$weekperiod.' ('.get_string('notavailable').')
    '; - - } else { - echo '
    '.$weekperiod.'
    '; - - echo '
    '; - $summaryformatoptions->noclean = true; - echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); - - if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) { - echo ' '. - ''.$streditsummary.'

    '; - } - echo '
    '; - - print_section($course, $thissection, $mods, $modnamesused); + echo '
  • '; - if (isediting($course->id)) { - print_section_add_menus($course, $section, $modnames); - } - } - echo '
  • '; + echo '
     '.$currenttext.'
    '; + // Note, 'right side' is BEFORE content. + echo '
    '; + if ($displaysection == $section) { echo ''. ''.$strshowallweeks.'
    '; @@ -241,23 +230,48 @@ } if ($section > 1) { // Add a arrow to move section up echo ''. - ''.$strmoveup.'
    '; + ''.$strmoveup.'
    '; } if ($section < $course->numsections) { // Add a arrow to move section down echo ''. - ''.$strmovedown.'
    '; + ''.$strmovedown.'
    '; + } + } + echo '
    '; + + echo '
    '; + if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { // Hidden for students + echo '
    '.$currenttext.$weekday.' - '.$endweekday.' ('.get_string('notavailable').')
    '; + + } else { + echo '
    '.$currenttext.$weekday.' - '.$endweekday.'
    '; + + echo '
    '; + $summaryformatoptions->noclean = true; + echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); + + if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) { + echo ' '. + ''.$streditsummary.'

    '; + } + echo '
    '; + + print_section($course, $thissection, $mods, $modnamesused); + + if (isediting($course->id)) { + print_section_add_menus($course, $section, $modnames); } } - echo '
    '; + echo "\n"; if (!empty($sectionmenu)) { echo '
    '; @@ -268,24 +282,9 @@ if (!empty($THEME->customcorners)) print_custom_corners_end(); - echo '
    '; - - if (!empty($THEME->customcorners)) print_custom_corners_start(); - blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); - if (!empty($THEME->customcorners)) print_custom_corners_end(); + echo ''; - echo '
    '; + echo ''; + echo '
    '; ?>