$content .= '<td style="width: 8px;"></td><td><a href="'.CALENDAR_URL.'set.php?var=showcourses'.$getvars.'" title="'.get_string('tt_showcourse', 'calendar').'">'.get_string('courseevents', 'calendar').'</a></td>'."\n";
}
- if(!empty($USER) && !isguest()) {
+ if(!empty($USER->id) && !isguest()) {
$content .= "</tr>\n<tr>";
if($groupevents) {
function calendar_session_vars() {
global $SESSION, $USER;
- if(isset($USER) && isset($USER->realuser) && !isset($SESSION->cal_loggedinas)) {
+ if(!empty($USER->id) && isset($USER->realuser) && !isset($SESSION->cal_loggedinas)) {
// We just logged in as someone else, update the filtering
unset($SESSION->cal_users_shown);
unset($SESSION->cal_courses_shown);
$SESSION->cal_loggedinas = true;
}
- else if(isset($USER) && !isset($USER->realuser) && isset($SESSION->cal_loggedinas)) {
+ else if(!empty($USER->id) && !isset($USER->realuser) && isset($SESSION->cal_loggedinas)) {
// We just logged back to our real self, update again
unset($SESSION->cal_users_shown);
unset($SESSION->cal_courses_shown);
function calendar_edit_event_allowed($event) {
global $USER;
- if(empty($USER) || isguest($USER->id)) {
+ if(empty($USER->id) || isguest($USER->id)) {
return false;
}
return array($SESSION->cal_course_referer => 1);
}
- if(empty($USER)) {
+ if(empty($USER->id)) {
return array();
}
}
}
- if (empty($USER) or isguest()) {
+ if (empty($USER->id) or isguest()) {
$defaultcourses = calendar_get_default_courses();
calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);
$events = calendar_get_upcoming($courses, $groups, $users, 1, 100, $starttime);
// New event button
- if (empty($USER) || isguest()) {
+ if (empty($USER->id) || isguest()) {
$text = get_string('dayview', 'calendar').': '.calendar_course_filter_selector($getvars);
} else {
$text = '<div style="float: left;">'.get_string('dayview', 'calendar').': '.
calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday);
// New event button
- if(empty($USER) || isguest()) {
+ if(empty($USER->id) || isguest()) {
$text = get_string('detailedmonthview', 'calendar').': '.calendar_course_filter_selector($getvars);
}
else {
echo "</tr>\n";
- if(!empty($USER) && !isguest()) {
+ if(!empty($USER->id) && !isguest()) {
echo '<tr>';
// Group events
if($SESSION->cal_show_groups) {
$events = calendar_get_upcoming($courses, $groups, $users, $futuredays, $maxevents);
// New event button
- if(empty($USER) || isguest()) {
+ if(empty($USER->id) || isguest()) {
$text = get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming');
} else {
function calendar_course_filter_selector($getvars = '') {
global $USER, $SESSION;
- if (empty($USER) or isguest()) {
+ if (empty($USER->id) or isguest()) {
return '';
}