// Note, 'right side' is BEFORE content.
echo '<li id="section-0" class="section main" >';
echo '<div class="left side"> </div>';
- echo '<div class="right side" > </div>';
+ echo '<div class="right side" > </div>';
echo '<div class="content">';
echo '<div class="summary">';
} else {
echo '<a href="view.php?id='.$course->id.'&marker='.$section.'&sesskey='.sesskey().'#section-'.$section.'" title="'.$strmarkthistopic.'">'.'<img src="'.$OUTPUT->old_icon_url('i/marker') . '" alt="'.$strmarkthistopic.'" /></a><br />';
}
-
+
if ($thissection->visible) { // Show the hide/show eye
echo '<a href="view.php?id='.$course->id.'&hide='.$section.'&sesskey='.sesskey().'#section-'.$section.'" title="'.$strtopichide.'">'.
- '<img src="'.$OUTPUT->old_icon_url('i/hide') . '" class="icon hide" alt="'.$strtopichide.'" /></a><br />';
+ '<img src="'.$OUTPUT->old_icon_url('i/hide') . '" class="icon hide" alt="'.$strtopichide.'" /></a><br />';
} else {
echo '<a href="view.php?id='.$course->id.'&show='.$section.'&sesskey='.sesskey().'#section-'.$section.'" title="'.$strtopicshow.'">'.
'<img src="'.$OUTPUT->old_icon_url('i/show') . '" class="icon hide" alt="'.$strtopicshow.'" /></a><br />';
- }
+ }
if ($section > 1) { // Add a arrow to move section up
echo '<a href="view.php?id='.$course->id.'&random='.rand(1,10000).'&section='.$section.'&move=-1&sesskey='.sesskey().'#section-'.($section-1).'" title="'.$strmoveup.'">'.
'<img src="'.$OUTPUT->old_icon_url('t/up') . '" class="icon up" alt="'.$strmoveup.'" /></a><br />';
echo '</div>';
print_section($course, $thissection, $mods, $modnamesused);
-
+ echo '<br />';
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, $section, $modnames);
}
// Course-based switches
if (ajaxenabled($CFG->ajaxtestedbrowsers)) { // Browser, user and site-based switches
- $PAGE->requires->yui_lib('dragdrop');
- $PAGE->requires->yui_lib('connection');
- $PAGE->requires->yui_lib('selector');
- $PAGE->requires->js('lib/ajax/block_classes.js');
- $PAGE->requires->js('lib/ajax/section_classes.js');
+ $PAGE->requires->yui_lib('dragdrop')->asap();
+ $PAGE->requires->yui_lib('connection')->asap();
+ $PAGE->requires->yui_lib('selector')->asap();
+ $PAGE->requires->js('lib/ajax/block_classes.js')->asap();
+ $PAGE->requires->js('lib/ajax/section_classes.js')->asap();
// Okay, global variable alert. VERY UGLY. We need to create
// this object here before the <blockname>_print_block()
$completion = new completion_info($course);
if ($completion->is_enabled() && ajaxenabled()) {
- $PAGE->requires->yui_lib('connection');
- $PAGE->requires->js('course/completion.js');
+ $PAGE->requires->yui_lib('connection')->asap();
+ $PAGE->requires->js('course/completion.js')->asap();
$PAGE->requires->js_function_call('completion_init')->on_dom_ready();
$PAGE->requires->data_for_js('completion_strsaved', get_string('saved', 'completion'));
$PAGE->requires->data_for_js('completion_strtitley', get_string('completion-title-manual-y', 'completion'));
$PAGE->requires->data_for_js('completion_strtitlen', get_string('completion-title-manual-n', 'completion'));
$PAGE->requires->data_for_js('completion_stralty', get_string('completion-alt-manual-y', 'completion'));
- $PAGE->requires->data_for_js('completion_straltn', get_string('completion-alt-manual-n', 'completion'));
+ $PAGE->requires->data_for_js('completion_straltn', get_string('completion-alt-manual-n', 'completion'));
}
// The "Editing On" button will be appearing only in the "main" course screen
// Content wrapper end.
echo "</div>\n\n";
- // Use AJAX?
+ // Use AJAX?
if ($useajax && has_capability('moodle/course:manageactivities', $context)) {
// At the bottom because we want to process sections and activities
// after the relevant html has been generated. We're forced to do this
- // because of the way in which lib/ajax/ajaxcourse.js is written.
- $PAGE->requires->js('lib/ajax/ajaxcourse.js');
-
+ // because of the way in which lib/ajax/ajaxcourse.js is written.
+
+ echo '<script type="text/javascript" ';
+ echo "src=\"{$CFG->wwwroot}/lib/ajax/ajaxcourse.js\"></script>\n";
$COURSE->javascriptportal->print_javascript($course->id);
}
this.leftcolumn = null;
this.rightcolumn = null;
this.adminBlock = null;
+ this.tempBlock = null;
this.icons = [];
+ this.courseformat = null;
this.marker = null;
//things to process onload
}
this.adminBlock = YAHOO.util.Dom.getElementsByClassName('block_adminblock')[0];
- YAHOO.log("admin - "+this.adminBlock.className);
+ this.tempBlock = YAHOO.util.Dom.getElementsByClassName('tempblockhandler')[0];
}
//strings
this.strings = [];
+ //icons
+ this.icons = [];
+
YAHOO.log("Instantiated php_portal_class", "info");
}
* Prints the JavaScript code needed to set up AJAX for the course.
*/
function print_javascript($courseid, $return=false) {
- global $CFG, $USER, $OUTPUT;
+ global $CFG, $USER, $OUTPUT, $COURSE;
$blocksoutput = $output = '';
for ($i=0; $i<count($this->blocks); $i++) {
$output .= "<script type=\"text/javascript\">\n";
$output .= " main.portal.id = ".$courseid.";\n";
$output .= " main.portal.blocks = new Array(".$blocksoutput.");\n";
+ $output .= " main.portal.strings['courseformat']='".$COURSE->format."';\n";
$output .= " main.portal.strings['wwwroot']='".$CFG->wwwroot."';\n";
$output .= " main.portal.strings['marker']='".get_string('markthistopic', '', '_var_')."';\n";
$output .= " main.portal.strings['marked']='".get_string('markedthistopic', '', '_var_')."';\n";
commandContainer.removeChild(commandContainer.childNodes[i])
}
- if (!this.isWeekFormat) {
+ if (main.getString('courseformat', this.sectionId) != "weeks" && this.sectionId > 0) {
var highlightbutton = main.mk_button('div', main.portal.icons['marker'], main.getString('marker', this.sectionId));
YAHOO.util.Event.addListener(highlightbutton, 'click', this.mk_marker, this, true);
commandContainer.appendChild(highlightbutton);
this.highlightButton = highlightbutton;
+ }
+ if (this.sectionId > 0 ) {
+ var viewbutton = main.mk_button('div', main.portal.icons['hide'], main.getString('hidesection', this.sectionId),
+ [['title', main.portal.strings['hide'] ]]);
+ YAHOO.util.Event.addListener(viewbutton, 'click', this.toggle_hide, this,true);
+ commandContainer.appendChild(viewbutton);
+ this.viewButton = viewbutton;
}
- var viewbutton = main.mk_button('div', main.portal.icons['hide'], main.getString('hidesection', this.sectionId),
- [['title', main.portal.strings['hide'] ]]);
- YAHOO.util.Event.addListener(viewbutton, 'click', this.toggle_hide, this,true);
- commandContainer.appendChild(viewbutton);
- this.viewButton = viewbutton;
}
}
-section_class.prototype.onDragDrop = function(e, id) {
+section_class.prototype.onDragDrop = function(e, id) {
// get the drag and drop object that was targeted
var target = YAHOO.util.DDM.getDDById(id);
//move on front end
for (var i=loopStart; eval(loopCondition); eval(loopInc)) {
- if ((main.sections[i] == this) && !found) {
+ if ((main.sections[i] == this) && !found) {
//encounter with original node
if (this.debug) {
YAHOO.log("Found Original "+main.sections[i].getEl().id);
YAHOO.log("Found target "+main.sections[i].getEl().id);
}
main.sections[i].swap_with_section(main.sections[eval(loopmodifier)]);
- main.sections[i].swap_dates(main.sections[eval(loopmodifier)]);
+ main.sections[i].swap_dates(main.sections[eval(loopmodifier)]);
found = false;
break;
} else if (found) {
}
/* Prevent border-collapse:collapse from bleeding through in IE6, IE7 */
#date_selector_calendar_panel.yui-overlay-hidden table {
- *display:none;
+ display:none;
}
#date_selector_calendar_panel th.calhead {
padding-right: 2em;
margin-bottom: 0.5em;
border-style:solid;
border-width:1px;
+ clear: both;
}
.weeks .content,
.topics .content {
- padding: 5px;
+ padding: 5px 5px 15px 5px;
margin: 0 1.7em 0 1.7em;
}
.weeks .right,