public static function calendar_view($day = null, $month = null, $year = null, $calendar_type = null) { global $uid; if (!is_null($calendar_type) && ($calendar_type == 'day' || $calendar_type == 'week' || $calendar_type == 'month')) { Calendar_Events::set_calendar_view_preference($calendar_type); $view_func = $calendar_type . "_calendar"; } else { $view_func = Calendar_Events::$calsettings->view_type . "_calendar"; } if (is_null($month) || is_null($year) || $month < 0 || $month > 12 || $year < 1990 || $year > 2099) { $today = getdate(); $day = $today['mday']; $month = $today['mon']; $year = $today['year']; } if ($calendar_type == 'small') { return Calendar_Events::small_month_calendar($day, $month, $year); } else { return Calendar_Events::$view_func($day, $month, $year); } }
$_user['persoLastLogin'] = last_login($uid); $_user['lastLogin'] = str_replace('-', ' ', $_user['persoLastLogin']); $user_announcements = ''; // Get user's course info $user_lesson_info = getUserLessonInfo($uid); //if user is registered to at least one lesson if (count($lesson_ids) > 0) { // get user announcements $user_announcements = getUserAnnouncements($lesson_ids); } // get user latest personal messages $user_messages = getUserMessages(); // create array with content $today = getdate(); $day = $today['mday']; $month = $today['mon']; $year = $today['year']; Calendar_Events::get_calendar_settings(); $user_personal_calendar = Calendar_Events::small_month_calendar($day, $month, $year); // create array with personalised content $perso_tool_content = array( 'lessons_content' => $user_lesson_info, 'personal_calendar_content' => $user_personal_calendar );