From 3ecc49d495de83d27c00e035d8ec95ca17b15335 Mon Sep 17 00:00:00 2001 From: vyshane Date: Tue, 10 Oct 2006 02:38:33 +0000 Subject: [PATCH] Turn off display of week dates if we are in editing mode and if ajax is turned on. We do this for now because the ajax code does not yet update the week dates when sections are moved around. Will have to fix later. --- course/format/weeks/format.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index c54cefb725..86b5eea003 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -48,16 +48,15 @@ $strmoveup = get_string('moveup'); $strmovedown = get_string('movedown'); - if (!empty($USER->ajax) && debugging('', DEBUG_DEVELOPER)) { /// XXX TODO Debugging only temporary until fixed + if (!empty($USER->ajax)) { // If user doesnt want AJAX, then they wont get it, // from here everything detects $COURSE->javascriptportal - $COURSE->javascriptportal = new jsportal(); print_require_js(array('yui_yahoo','yui_dom','yui_event','yui_dragdrop', 'yui_connection', 'ajaxcourse_blocks','ajaxcourse_sections','ajaxcourse')); - + //javascript logging facilities if (debugging()) { print_require_js(Array('yui_logger')); @@ -189,12 +188,22 @@ echo ''; echo ' '; + if (!empty($USER->ajax) && $editing) { + // Temporarily hide the dates for the weeks. We do it this way + // for now. Eventually, we'll have to modify the javascript code + // to handle re-calculation of dates when sections are moved + // around. For now, just hide all the dates to avoid confusion. + $weekperiod = ''; + } else { + $weekperiod = $weekday.' '.$endweekday; + } + echo ''; if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { // Hidden for students - echo '
'.$weekday.' - '.$endweekday.' ('.get_string('notavailable').')
'; + echo '
'.$weekperiod.' ('.get_string('notavailable').')
'; } else { - echo '
'.$weekday.' - '.$endweekday.'
'; + echo '
'.$weekperiod.'
'; echo '
'; $summaryformatoptions->noclean = true; -- 2.39.5