$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;
Beispiel #2
0
 if ($week == NULL) {
     $week = date("W");
 }
 // The name of the current Month
 $monthName = $MonthsLong[$month - 1];
 // Starting the output
 echo "<div class=\"actions\">";
 echo "<a href=\"" . api_get_self() . "?action=view&amp;view=month\">" . Display::return_icon('month.png', get_lang('MonthView'), '', ICON_SIZE_MEDIUM) . "</a>";
 echo "<a href=\"" . api_get_self() . "?action=view&amp;view=week\">" . Display::return_icon('7days.png', get_lang('WeekView'), '', ICON_SIZE_MEDIUM) . "</a> ";
 echo "<a href=\"" . api_get_self() . "?action=view&amp;view=day\">" . Display::return_icon('1day.png', get_lang('DayView'), '', ICON_SIZE_MEDIUM) . "</a> ";
 if (api_get_setting('allow_personal_agenda') == 'true') {
     echo "<a href=\"" . api_get_self() . "?action=add_personal_agenda_item\">" . Display::return_icon('new_user_event.png', get_lang('AddPersonalItem'), '', ICON_SIZE_MEDIUM) . "</a> ";
     echo "<a href=\"" . api_get_self() . "?action=view&amp;view=personal\">" . Display::return_icon('personal_calendar.png', get_lang('ViewPersonalItem'), '', ICON_SIZE_MEDIUM) . "</a> ";
 }
 echo "</div>";
 $agendaitems = get_myagendaitems(api_get_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(api_get_user_id(), $agendaitems, $day, $month, $year, $week, "month_view");
 }
 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