At the same time I have converted the calendar block to use YUI instead of overlib, this introduces one regression in that the panel is shown immediatly but should really have a minimal delay for usability.
This will be fixed once the theme changes for 2.0 have been commited
$courseset = true;
$SESSION->cal_courses_shown[$this->page->course->id] = $this->page->course;
}
-
+
// Be VERY careful with the format for default courses arguments!
// Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
calendar_set_filters($courses, $group, $user, $filtercourse, $groupeventsfrom, false);
+ $this->page->requires->js('calendar/calendar.js');
if ($courseshown == SITEID) {
// For the front page
- $this->content->text .= calendar_overlib_html();
$this->content->text .= calendar_top_controls('frontpage', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
$this->content->text .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y);
// No filters for now
} else {
// For any other course
- $this->content->text .= calendar_overlib_html();
$this->content->text .= calendar_top_controls('course', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
$this->content->text .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y);
$this->content->text .= '<h3 class="eventskey">'.get_string('eventskey', 'calendar').'</h3>';
--- /dev/null
+function attach_calendar_panel(properties) {
+ YAHOO.namespace("moodle.container");
+ YAHOO.moodle.container[properties.id] = new YAHOO.widget.Panel(properties.id+'_panel', {
+ width:"320px",
+ visible:false,
+ draggable:false,
+ close:false,
+ constraintoviewport:true
+ } );
+ YAHOO.moodle.container[properties.id].setHeader(properties.title);
+ YAHOO.moodle.container[properties.id].setBody(properties.content);
+ YAHOO.moodle.container[properties.id].render(properties.id);
+ YAHOO.util.Event.addListener(properties.id, 'mouseover', YAHOO.moodle.container[properties.id].show, YAHOO.moodle.container[properties.id], true);
+ YAHOO.util.Event.addListener(properties.id, 'mouseout', YAHOO.moodle.container[properties.id].hide, YAHOO.moodle.container[properties.id], true);
+}
\ No newline at end of file
echo $OUTPUT->header();
- echo calendar_overlib_html();
-
echo '<table id="calendar">';
echo '<tr><td class="maincalendar">';
echo $OUTPUT->header();
-echo calendar_overlib_html();
-
// Layout the whole page as three big columns.
echo '<table id="calendar">';
echo '<tr>';
* @return $popup string, contains onmousover and onmouseout events.
*/
function calendar_get_popup($is_today, $event_timestart, $popupcontent='') {
+ global $PAGE;
+ static $popupcount;
+ if ($popupcount === null) {
+ $popupcount = 1;
+ }
$popupcaption = '';
if($is_today) {
$popupcaption = get_string('today', 'calendar').' ';
} else {
$popupcaption .= get_string('eventsfor', 'calendar', userdate($event_timestart, get_string('strftimedayshort')));
}
- $popupcontent = addslashes_js(s($popupcontent));
- $popupcaption = addslashes_js(s($popupcaption));
- $popup = 'onmouseover="return overlib(\''.$popupcontent.'\', CAPTION, \''.$popupcaption.'\');" onmouseout="return nd();"';
- return $popup;
+ $id = 'calendar_tooltip_'.$popupcount;
+ $PAGE->requires->yui_lib('container');
+ $PAGE->requires->js_function_call('attach_calendar_panel', Array(Array('id'=>$id,'title'=>$popupcaption, 'content'=>$popupcontent)));
+ $popupcount++;
+ return 'id="'.$id.'"';
}
function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxevents, $fromtime=0) {
}
}
-function calendar_overlib_html() {
- global $PAGE;
- $output = '';
- $output .= $PAGE->requires->js('calendar/overlib.cfg.php')->asap();
- $output .= '<div id="overDiv" style="position: absolute; visibility: hidden; z-index:1000;"></div>';
- return $output;
-}
-
function calendar_set_referring_course($courseid) {
global $SESSION;
$SESSION->cal_course_referer = intval($courseid);
+++ /dev/null
-ol_delay = 350;
-ol_fgclass = 'cal_popup_fg';
-ol_bgclass = 'cal_popup_bg';
-ol_cgclass = 'cal_popup_cg';
-ol_captionfontclass = 'cal_popup_caption';
-ol_noclose = true;
-ol_sticky = true;
-ol_close = 'X';
-ol_offsety = -1;
-ol_mouseoff = 1;
$strcalendar = get_string('calendar', 'calendar');
$prefsbutton = calendar_preferences_button();
+ $PAGE->requires->js('calendar/calendar.js');
+
// Print title and header
$PAGE->set_title("$site->shortname: $strcalendar: $pagetitle");
$PAGE->set_heading($strcalendar);
echo $OUTPUT->header();
- echo calendar_overlib_html();
-
// Layout the whole page as three big columns.
echo '<table id="calendar" style="height:100%;">';
echo '<tr>';
$PAGE->requires->yui_lib('container');
$PAGE->requires->js('grade/report/grader/functions.js');
$PAGE->requires->js('grade/report/grader/grader.js');
+$PAGE->requires->js('lib/overlib/overlib.js')->in_head();
+$PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
if ($report->get_pref('enableajax')) {
$report = new grade_report_grader_ajax($courseid, $gpr, $context, $page, $sortitemid);
$rs->close();
}
+$PAGE->requires->js('lib/overlib/overlib.js')->in_head();
+$PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+
$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
$PAGE->navbar->add($strgroups);
$this->page->requires->js('lib/javascript-static.js')->in_head();
$this->page->requires->js('lib/javascript-deprecated.js')->in_head();
$this->page->requires->js('lib/javascript-mod.php')->in_head();
- $this->page->requires->js('lib/overlib/overlib.js')->in_head();
- $this->page->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
$this->page->requires->js_function_call('setTimeout', array('fix_column_widths()', 20));
$focus = $this->page->focuscontrol;
$strmodulenameplural = get_string("modulenameplural", "hotpot");
$strmodulename = get_string("modulename", "hotpot");
// print header
-
+
+ $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
+ $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
$PAGE->set_title(format_string($course->shortname) . ": $hotpot->name");
$PAGE->set_heading($course->fullname);
$PAGE->set_button(update_module_button($cm->id, $course->id, $strmodulename));
$attemptobj->load_question_states($questionids);
/// Print the quiz page ////////////////////////////////////////////////////////
+ $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
+ $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
// Arrange for the navigation to be displayed.
$navbc = $attemptobj->get_navigation_panel('quiz_attempt_nav_panel', $page);
* Displays the report.
*/
function display($quiz, $cm, $course) {
- global $CFG, $QTYPES, $DB, $OUTPUT;
+ global $CFG, $QTYPES, $DB, $OUTPUT, $PAGE;
$viewoptions = array('mode'=>'grading', 'q'=>$quiz->id);
$this->cm = $cm;
+ echo $PAGE->requires->js('lib/overlib/overlib.js')->asap();
+ echo $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->asap();
+
$this->print_header_and_tabs($cm, $course, $quiz, $reportmode="grading");
// Check permissions
$firstregion = reset($PAGE->blocks->get_regions());
$PAGE->blocks->add_pretend_block($navbc, $firstregion);
+ $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
+ $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+
/// Print the page header
$headtags = $attemptobj->get_html_head_contributions($page);
if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
($stateid ? '&state=' . $stateid : ''),
$attemptobj->get_quizid(), $attemptobj->get_cmid());
+ $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
+ $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+
/// Print the page header
$attemptobj->get_question_html_head_contributions($questionid);
}
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
- global $QTYPES, $CFG, $USER, $OUTPUT;
+ global $QTYPES, $CFG, $USER, $OUTPUT, $PAGE;
$readonly = empty($options->readonly) ? '' : 'readonly="readonly"';
$disabled = empty($options->readonly) ? '' : 'disabled="disabled"';
// The regex will recognize text snippets of type {#X}
// where the X can be any text not containg } or white-space characters.
+ echo $PAGE->requires->js('lib/overlib/overlib.js')->asap();
+ echo $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->asap();
+
while (preg_match('~\{#([^[:space:]}]*)}~', $qtextremaining, $regs)) {
$qtextsplits = explode($regs[0], $qtextremaining, 2);
echo $qtextsplits[0];
$feedback .= '</div>';
}
}
+
if ($options->feedback) {
$chosenanswer = null;
switch ($wrapped->qtype) {