* After the javascripts in the head area of the include/header.tmpl.php include this javascript to ensure jQuery scripting does not conflict with other existing scripts.
<script language="javascript" type="text/javascript"> //<!-- jQuery.noConflict(); //--> </script>
- Add in slow collapsible menus to header.tmpl.php
To add slow collapsing menus, replace the toggleToc() function with the new one:
//Old function looks like this function toggleToc(objId) { var toc = document.getElementById(objId); if (toc == null) { return; } var showlink=document.getElementById(objId + 'showlink'); var hidelink=document.getElementById(objId + 'hidelink'); if (hidelink.style.display == 'none') { document.getElementById('contentcolumn').id="contentcolumn_shiftright"; toc.style.display = ''; hidelink.style.display=''; showlink.style.display='none'; } else { document.getElementById('contentcolumn_shiftright').id="contentcolumn"; toc.style.display = 'none'; hidelink.style.display='none'; showlink.style.display=''; } setcookie(objId, toc.style.display, 1); }
Change it to:
// Replace with this new function function toggleToc(objId) { var toc = document.getElementById(objId); if (toc == null) { return; } var showlink=document.getElementById(objId + 'showlink'); var hidelink=document.getElementById(objId + 'hidelink'); if (hidelink.style.display == 'none') { document.getElementById('contentcolumn').id="contentcolumn_shiftright"; jQuery("[id="+objId+"]").slideDown("slow"); hidelink.style.display=''; showlink.style.display='none'; } else { document.getElementById('contentcolumn_shiftright').id="contentcolumn"; jQuery("[id="+objId+"]").slideUp("slow"); hidelink.style.display='none'; showlink.style.display=''; } setcookie(objId, hidelink.style.display, 1); }
- add more javascript functions to the script area in the header.tmpl.php file to control folder toggle open/close icons
// toggle content folder in side menu "content navigation" function toggleFolder(cid) { if (jQuery("#tree_icon"+cid).attr("src") == tree_collapse_icon) { jQuery("#tree_icon"+cid).attr("src", tree_expand_icon); jQuery("#tree_icon"+cid).attr("alt", "<?php echo _AT('expand'); ?>"); setcookie("c<?php echo $this->course_id;?>_"+cid, null, 1); } else { jQuery("#tree_icon"+cid).attr("src", tree_collapse_icon); jQuery("#tree_icon"+cid).attr("alt", "<?php echo _AT('collapse'); ?>"); setcookie("c<?php echo $this->course_id;?>_"+cid, "1", 1); } jQuery("#folder"+cid).slideToggle(); } // toggle elements in side menu function elementToggle(elem, title) { element_collapse_icon = "<?php echo $this->base_path; ?>images/mswitch_minus.gif"; element_expand_icon = "<?php echo $this->base_path; ?>images/mswitch_plus.gif"; if (jQuery(elem).attr("src") == element_collapse_icon) { jQuery(elem).attr("src", element_expand_icon); jQuery(elem).attr("alt", "<?php echo _AT('show'). ' '; ?>"+ title); jQuery(elem).attr("title", "<?php echo _AT('show'). ' '; ?>"+ title); setcookie("m_"+title, 0, 1); } else { jQuery(elem).attr("src", element_collapse_icon); jQuery(elem).attr("alt", "<?php echo _AT('collapse'); ?>"); jQuery(elem).attr("alt", "<?php echo _AT('hide'). ' '; ?>"+ title); jQuery(elem).attr("title", "<?php echo _AT('hide'). ' '; ?>"+ title); setcookie("m_"+title, null, 1);; } jQuery(elem).parent().next().slideToggle(); } function printSubmenuHeader(title) { if (getcookie("m_"+title) == "0") { image = "<?php echo $this->base_path?>images/mswitch_plus.gif"; alt_text = "<?php echo _AT('show'); ?> " + title; } else { image = "<?php echo $this->base_path?>images/mswitch_minus.gif"; alt_text = "<?php echo _AT('hide'); ?> " + title; } document.writeln('<h4 class="box">'+ ' <input src="'+image+'"' + ' onclick="elementToggle(this, \''+title+'\'); return false;"' + ' alt="'+ alt_text + '" ' + ' title="'+ alt_text + '"' + ' style="float:right" type="image" /> '+ title + '</h4>'); }
- In header.tmpl.php & side_menu.inc.php, replace all occurances of $_SESSION['course_id'] with $this->course_id
ATutor 2.0
* change the path in the default/test_questions/matchingdd.tmpl.php from
tools/tests/dd.php to mods/_standard/tests/dd.php?qid
* add course categories array to themes API
$this->cats
* change "sequence-links" in the default/include/header.tmpl.php from
<div id="sequence-links"> to <div class="sequence-links">
* change "sequence-links" definition in the default/styles.css & default/print.css from
div#sequence-links to div.sequence-links