Ejemplo n.º 1
0
            $my_course_list = CourseManager::get_courses_list_by_user_id($user_id, true);
            if (!is_array($my_course_list)) {
                // this is for the special case if the user has no courses (otherwise you get an error)
                $my_course_list = array();
            }
            $today = getdate();
            $year = !empty($_GET['year']) ? (int) $_GET['year'] : NULL;
            if ($year == NULL) {
                $year = $today['year'];
            }
            $month = !empty($_GET['month']) ? (int) $_GET['month'] : NULL;
            if ($month == NULL) {
                $month = $today['mon'];
            }
            $day = !empty($_GET['day']) ? (int) $_GET['day'] : NULL;
            if ($day == NULL) {
                $day = $today['mday'];
            }
            $monthName = $MonthsLong[$month - 1];
            $agendaitems = get_myagendaitems($user_id, $my_course_list, $month, $year);
            $agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
            if (api_get_setting('allow_personal_agenda') == 'true') {
                $agendaitems = get_personal_agenda_items($user_id, $agendaitems, $day, $month, $year, $week, "month_view");
            }
            display_mymonthcalendar($user_id, $agendaitems, $month, $year, array(), $monthName, false);
        }
        break;
    default:
        echo '';
}
exit;
Ejemplo n.º 2
0
 if ($process != 'month_view') {
     echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
     echo "<tr>";
     // output: the small calendar item on the left and the view / add links
     echo "<td width=\"220\" valign=\"top\">";
     display_myminimonthcalendar($agendaitems, $month, $year, $monthName);
     echo "</td>";
     // the divider
     // OlivierB : the image has a white background, which causes trouble if the portal has another background color. Image should be transparent. ----> echo "<td width=\"20\" background=\"../img/verticalruler.gif\">&nbsp;</td>";
     echo "<td width=\"8\">&nbsp;</td>";
     // the main area: day, week, month view
     echo "<td valign=\"top\">";
 }
 switch ($process) {
     case 'month_view':
         display_mymonthcalendar(api_get_user_id(), $agendaitems, $month, $year, array(), $monthName);
         break;
     case 'week_view':
         $agendaitems = get_week_agendaitems($my_course_list, $month, $year, $week);
         $agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "week_view");
         if (api_get_setting("allow_personal_agenda") == "true") {
             $agendaitems = get_personal_agenda_items(api_get_user_id(), $agendaitems, $day, $month, $year, $week, "week_view");
         }
         display_weekcalendar($agendaitems, $month, $year, array(), $monthName);
         break;
     case 'day_view':
         $agendaitems = get_day_agendaitems($my_course_list, $month, $year, $day);
         $agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "day_view");
         if (api_get_setting('allow_personal_agenda') == 'true') {
             $agendaitems = get_personal_agenda_items(api_get_user_id(), $agendaitems, $day, $month, $year, $week, "day_view");
         }