diff --git a/course/format/topicscss/ajax.php b/course/format/topicscss/ajax.php new file mode 100644 index 00000000000..2280eddd815 --- /dev/null +++ b/course/format/topicscss/ajax.php @@ -0,0 +1,10 @@ +ajaxcapable = true; +$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); + +?> diff --git a/course/format/topicscss/config.php b/course/format/topicscss/config.php new file mode 100644 index 00000000000..2d3eaca7073 --- /dev/null +++ b/course/format/topicscss/config.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/course/format/topicscss/format.php b/course/format/topicscss/format.php new file mode 100644 index 00000000000..8894d6fdd7e --- /dev/null +++ b/course/format/topicscss/format.php @@ -0,0 +1,301 @@ + 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['formattopicscss'] + + require_once($CFG->libdir.'/ajax/ajaxlib.php'); + + if (!empty($THEME->customcorners)) { + require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); + } + + $topic = optional_param('topic', -1, PARAM_INT); + + if ($topic != -1) { + $displaysection = course_set_display($course->id, $topic); + } else { + if (isset($USER->display[$course->id])) { + $displaysection = $USER->display[$course->id]; + } else { + $displaysection = course_set_display($course->id, 0); + } + } + + $context = get_context_instance(CONTEXT_COURSE, $course->id); + + if (($marker >=0) && has_capability('moodle/course:setcurrentsection', $context) && confirm_sesskey()) { + $course->marker = $marker; + if (! set_field("course", "marker", $marker, "id", $course->id)) { + error("Could not mark that topic for this course"); + } + } + + $streditsummary = get_string('editsummary'); + $stradd = get_string('add'); + $stractivities = get_string('activities'); + $strshowalltopics = get_string('showalltopics'); + $strtopic = get_string('topic'); + $strgroups = get_string('groups'); + $strgroupmy = get_string('groupmy'); + $editing = $PAGE->user_is_editing(); + + if ($editing) { + $strstudents = moodle_strtolower($course->students); + $strtopichide = get_string('topichide', '', $strstudents); + $strtopicshow = get_string('topicshow', '', $strstudents); + $strmarkthistopic = get_string('markthistopic'); + $strmarkedthistopic = get_string('markedthistopic'); + $strmoveup = get_string('moveup'); + $strmovedown = get_string('movedown'); + } + +/* 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 '
'; + 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 '
'; + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); + echo '
'; + } + +/// Start main column + echo '
'; + + if (!empty($THEME->customcorners)) print_custom_corners_start(); + + echo ''; + + print_heading_block(get_string('topicoutline'), 'outline'); + + // Note, an ordered list would confuse - "1" could be the clipboard or summary. + echo "
'; + echo "\n"; + } + + $section++; + } + echo "\n"; + + if (!empty($sectionmenu)) { + echo '
'; + echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&', $sectionmenu, + 'sectionmenu', '', get_string('jumpto'), '', '', true); + echo '
'; + } + + if (!empty($THEME->customcorners)) print_custom_corners_end(); + + echo ''; + + echo ''; + echo '
'; + +?> diff --git a/course/format/weekscss/ajax.php b/course/format/weekscss/ajax.php new file mode 100644 index 00000000000..2280eddd815 --- /dev/null +++ b/course/format/weekscss/ajax.php @@ -0,0 +1,10 @@ +ajaxcapable = true; +$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); + +?> diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index dc66d531d5d..e928e3e754b 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -643,6 +643,7 @@ $string['formatsocial'] = 'Social format'; $string['formattext'] = 'Moodle auto-format'; $string['formattexttype'] = 'Formatting'; $string['formattopics'] = 'Topics format'; +$string['formattopicscss'] = 'Topics format - CSS/No tables'; $string['formattopicsajax'] = 'Topics format - AJAX'; $string['formatweeks'] = 'Weekly format'; $string['formatweekscss'] = 'Weekly format - CSS/No tables'; diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index 9c0add90776..1adcc789309 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -54,7 +54,7 @@ section_class.prototype.init_section = function(id, group, config, isDraggable) this.numberDisplay = null; // Used to display the section number on the top left // of the section. Not used in all course formats. this.summary = null; - this.content_td = null; + this.content_div = null; this.hidden = false; this.highlighted = false; this.showOnly = false; @@ -79,7 +79,7 @@ section_class.prototype.init_section = function(id, group, config, isDraggable) section_class.prototype.init_buttons = function() { - var commandContainer = this.getEl().childNodes[2]; + var commandContainer = YAHOO.util.Dom.getElementsByClassName('right',null,this.getEl())[0]; //clear all but show only button var commandContainerCount = commandContainer.childNodes.length; @@ -115,7 +115,7 @@ section_class.prototype.add_handle = function() { section_class.prototype.process_section = function() { - this.content_td = this.getEl().childNodes[1]; + this.content_div = YAHOO.util.Dom.getElementsByClassName('content',null,this.getEl())[0]; if (YAHOO.util.Dom.hasClass(this.getEl(),'current')) { this.highlighted = true; @@ -137,11 +137,11 @@ section_class.prototype.process_section = function() { } // Find/edit resources - this.resources_ul = this.content_td.getElementsByTagName('ul')[0]; + this.resources_ul = this.content_div.getElementsByTagName('ul')[0]; if (!this.resources_ul) { this.resources_ul = document.createElement('ul'); this.resources_ul.className='section'; - this.content_td.insertBefore(this.resources_ul, this.content_td.lastChild); + this.content_div.insertBefore(this.resources_ul, this.content_div.lastChild); } var resource_count = this.resources_ul.getElementsByTagName('li').length; @@ -195,7 +195,7 @@ section_class.prototype.endDrag = function() { section_class.prototype.move_to_section = function(target) { - var tempTd = document.createElement('td'); + var tempDiv = document.createElement('div'); var tempStore = null; var sectionCount = main.sections.length; var found = null; diff --git a/theme/custom_corners/user_styles.css b/theme/custom_corners/user_styles.css index 604af5bc8bf..b14859aa9b6 100644 --- a/theme/custom_corners/user_styles.css +++ b/theme/custom_corners/user_styles.css @@ -609,7 +609,7 @@ td#left-column div.hidden div.header { td#right-column div.hidden div.header { border-bottom-style: none; } -td#middle-column div.bt div { +td#middle-column div.bt div, div#middle-column div.bt div { background-image: url(pix/box.png); background-repeat: no-repeat; background-position: 0 0; @@ -619,7 +619,7 @@ td#middle-column div.bt div { position: relative; width: 13px; } -td#middle-column div.bt { +td#middle-column div.bt, div#middle-column div.bt { background-image: url(pix/box.png); background-repeat: no-repeat; background-position: 100% 0; @@ -627,14 +627,14 @@ td#middle-column div.bt { height: 12px; background-color: transparent; } -td#middle-column div.i1 { +td#middle-column div.i1, div#middle-column div.i1 { background-image: url(pix/borders.png); background-repeat: repeat-y; background-position: 0 0; background-color: transparent; padding: 0 0 0 12px; } -td#middle-column div.i2 { +td#middle-column div.i2, div#middle-column div.i2 { background-image: url(pix/borders.png); background-repeat: repeat-y; background-attachment: scroll; @@ -642,14 +642,14 @@ td#middle-column div.i2 { background-color: transparent; padding: 0 12px 0 0; } -td#middle-column div.i3 { +td#middle-column div.i3, div#middle-column div.i3 { background-color: #FFFFFF; padding: 0 10px; border-width: 1px 0; border-style: solid; border-color: #FFFFFF; } -td#middle-column div.bb div { +td#middle-column div.bb div, div#middle-column div.bb div { background-image: url(pix/box.png); background-repeat: no-repeat; background-position: 0 100%; @@ -659,7 +659,7 @@ td#middle-column div.bb div { position: relative; width: 13px; } -td#middle-column div.bb { +td#middle-column div.bb, div#middle-column div.bb { background-image: url(pix/box.png); background-repeat: no-repeat; background-position: 100% 100%; @@ -667,7 +667,7 @@ td#middle-column div.bb { height: 12px; background-color: transparent; } -td#middle-column div.bt div { +td#middle-column div.bt div, div#middle-column div.bt div { z-index: 10; } div#footer div.bt div { @@ -913,7 +913,7 @@ body.nocoursepage div#content div.bb { height: 12px; background-color: transparent; } -td#middle-column tr.section { +td#middle-column tr.section, div#middle-column li.section { background-image: url(pix/bottom_shadow_to_top.png); background-repeat: repeat-x; background-position: center bottom; @@ -1083,4 +1083,4 @@ body.grade-report-grader table#user-grades td.cat { } body.grade-report-grader table#user-grades td.course { font-weight: bold; -} \ No newline at end of file +} diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 5f1d398fcac..94c203ec5cf 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -1793,6 +1793,9 @@ border-width:0px; display:inline; } +.weekscss-format, .topicscss-format { + margin-top: 8px; +} /*#course-view ul.section li.activity ul li, #site-index ul.section li.activity ul li { @@ -1800,53 +1803,71 @@ border-width:0px; }*/ /*Accessibility: No-tables course format. */ -#course-view ul.weekscss { +#course-view ul.weekscss , #course-view ul.topicscss{ margin: 0; padding: 0; list-style: none; } /* Window-width: 800 pixels. IE doesn't support, see inline IE conditional comment. */ -.weekscss-format { +.weekscss-format, .topicscss-format { min-width: 763px; } -.weekscss-format .block_adminblock select, -.weekscss-format .block_calendar_month .minicalendar { +.topicscss-format .block_adminblock select, +.weekscss-format .block_calendar_month .minicalendar, +.topicscss-format .block_calendar_month .minicalendar { width: 100%; padding: 0; } .weekscss-format .block_calendar_month .minicalendar th, -.weekscss-format .block_calendar_month .minicalendar td { +.topicscss-format .block_calendar_month .minicalendar th, +.weekscss-format .block_calendar_month .minicalendar td, +.topicscss-format .block_calendar_month .minicalendar td, { padding: 0.1em 0 0.1em 1px; } -.weekscss-format #middle-column { +.weekscss-format #middle-column , +.topicscss-format #middle-column { margin: 0 12.5em 0 12.5em; } .weekscss-format #left-column, -.weekscss-format #right-column { +.weekscss-format #right-column, +.topicscss-format #left-column, +.topicscss-format #right-column { width: 11.5em; } -.weekscss-format #left-column { +.weekscss-format #left-column, +.topicscss-format #left-column { float: left; } -.weekscss-format #right-column { +.weekscss-format #right-column, +.topicscss-format #right-column { float: right; } -.weekscss li.section { +.weekscss li.section , +.topicscss li.section { margin-bottom: 0.5em; border-style:solid; border-width:1px; } .weekscss .content, -.weekscss .side { +.topicscss .content { padding: 5px; -} -.weekscss .content { margin: 0 1.7em 0 1.7em; } -.weekscss .right { +.weekscss .right, +.weekscss .left, +.topicscss .right, +.topicscss .left { width: 1.6em; - float: right; + padding: 5px 0; +} +.weekscss .left, +.topicscss .left { + float: left; +} +.weekscss .right, +.topicscss .right { + float: right; text-align:center; } @@ -4139,4 +4160,4 @@ wikiadminactions { background: #eee; border: 1px dashed #ddd; padding: 3px; -} \ No newline at end of file +}