From: vyshane Date: Wed, 3 Jan 2007 08:12:21 +0000 (+0000) Subject: Layout and colour tweaks for calendar. Related to MDL-7433. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3c49918a750d55ad6c521749fb4be66d94572aba;p=moodle.git Layout and colour tweaks for calendar. Related to MDL-7433. --- diff --git a/calendar/lib.php b/calendar/lib.php index 9a82581f44..498b30cabd 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -434,19 +434,19 @@ function calendar_add_event_metadata($event) { } else if($event->courseid == SITEID) { // Site event $event->icon = ''; - + $event->cssclass = 'event_global'; } else if($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { // Course event calendar_get_course_cached($coursecache, $event->courseid); $event->icon = ''; $event->courselink = ''.$coursecache[$event->courseid]->fullname.''; - + $event->cssclass = 'event_course'; } else if ($event->groupid) { // Group event $event->icon = ''; - + $event->cssclass = 'event_group'; } else if($event->userid) { // User event $event->icon = ''; + $event->cssclass = 'event_user'; } - return $event; } @@ -482,7 +482,7 @@ function calendar_print_event($event) { echo ''; echo ' '; - echo ''; + echo ''; echo format_text($event->description, FORMAT_HTML); if (calendar_edit_event_allowed($event)) { echo '
'; @@ -1184,8 +1184,8 @@ function calendar_edit_event_allowed($event) { return (has_capability('moodle/calendar:manageownentries', $sitecontext)); } } else if ($event->groupid) { - $group = get_record('groups', 'id', $event->groupid); - if($group === false) { + //TODO:check. + if (! groups_group_exists($event->groupid)) { return false; } @@ -1193,7 +1193,7 @@ function calendar_edit_event_allowed($event) { // to edit group calendar too // there is no need to check membership, because if you have this capability // you will have a role in this group context - return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_GROUP, $group->id)); + return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_GROUP, $event->groupid)); } else if ($event->courseid) { return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $event->courseid)); } diff --git a/calendar/view.php b/calendar/view.php index 677c92c942..0ead12a792 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -132,12 +132,13 @@ echo calendar_overlib_html(); // Layout the whole page as three big columns. - echo ''; + echo '
'; echo ''; // START: Main column echo ''; // END: Main column
'; + echo '
'; switch($view) { case 'day': @@ -150,16 +151,24 @@ calendar_show_upcoming_events($courses, $groups, $users, get_user_preferences('calendar_lookahead', CALENDAR_UPCOMING_DAYS), get_user_preferences('calendar_maxevents', CALENDAR_UPCOMING_MAXEVENTS)); break; } - + //Link to calendar export page - echo '

' . get_string('exportcalendar', 'calendar') . '

'; - + echo '
'; + print_single_button('export.php', false, get_string('exportcalendar', 'calendar')); + if (!empty($USER->id)) { $authtoken = sha1($USER->username . $USER->password); $usernameencoded = urlencode($USER->username); - echo "

" . get_string('quickdownloadcalendar', 'calendar') . '

'; + + echo "" + .'' + .''; } + echo '
'; + echo '
'; echo '