From: defacer Date: Tue, 18 May 2004 07:51:46 +0000 (+0000) Subject: Fix for bug 1416: X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4e17c6f39e31df56ab3a81e94f0b86167f1741bb;p=moodle.git Fix for bug 1416: Now the module icon is shown before the event name in the mini-month tooltips. Maybe this would be better with the module name instead, but I don't know. Comment in the bugtracker if this isn't what we want. --- diff --git a/calendar/lib.php b/calendar/lib.php index 162a07e89c..b3a2ac3723 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -59,7 +59,7 @@ calendar_session_vars(); function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_year = false) { global $CFG, $USER; - $display = &New object; + $display = &New stdClass; $display->minwday = get_user_preferences('calendar_startwday', CALENDAR_STARTING_WEEKDAY); $display->maxwday = $display->minwday + 6; @@ -166,7 +166,12 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y // OverLib popup $popupcontent = ''; foreach($eventsbyday[$day] as $eventid) { - $popupcontent .= '
id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'
'; + if(!empty($events[$eventid]->modulename)) { + $popupcontent .= '
modpixpath.'/'.$events[$eventid]->modulename.'/icon.gif\\\' style=\\\'vertical-align: middle; margin-right: 4px;\\\' alt=\\\''.$events[$eventid]->modulename.'\\\' />id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'
'; + } + else { + $popupcontent .= '
id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'
'; + } } $popupcaption = get_string('eventsfor', 'calendar', userdate($events[$eventid]->timestart, get_string('strftimedayshort')));