From 310c4767f9d9f6951083ebe49124742a4f82c9dd Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 10 May 2010 18:30:14 +0200 Subject: [PATCH] Cleaning code --- main/calendar/myagenda.php | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/main/calendar/myagenda.php b/main/calendar/myagenda.php index 4e5ee9b8a2..1b842e3fdd 100755 --- a/main/calendar/myagenda.php +++ b/main/calendar/myagenda.php @@ -158,8 +158,7 @@ if (!empty($_GET['action']) && $_GET['action'] == "delete" AND $_GET['id']) $process = "delete_personal_agenda_item"; } // OUTPUT -if (isset ($_user['user_id'])) -{ +if (isset ($_user['user_id'])) { // getting all the courses that this user is subscribed to $courses_dbs = get_all_courses_of_user(); if (!is_array($courses_dbs)) // this is for the special case if the user has no courses (otherwise you get an error) @@ -192,16 +191,16 @@ if (isset ($_user['user_id'])) $monthName = $MonthsLong[$month -1]; // Starting the output - echo "\n
\n"; - echo "\t".Display::return_icon('calendar_month.gif', get_lang('MonthView'))." ".get_lang('MonthView')." \n"; - echo "\t".Display::return_icon('calendar_week.gif', get_lang('WeekView'))." ".get_lang('WeekView')." \n"; - echo "\t".Display::return_icon('calendar_day.gif', get_lang('DayView'))." ".get_lang('DayView')." \n"; + echo "\n\n"; + echo "
"; echo ""; echo ""; @@ -223,7 +222,7 @@ if (isset ($_user['user_id'])) echo "
"; switch ($process) { - case "month_view" : + case 'month_view' : $agendaitems = get_myagendaitems($courses_dbs, $month, $year); $agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "month_view"); if (api_get_setting("allow_personal_agenda") == "true") @@ -232,16 +231,15 @@ if (isset ($_user['user_id'])) } display_mymonthcalendar($agendaitems, $month, $year, array(), $monthName); break; - case "week_view" : + case 'week_view' : $agendaitems = get_week_agendaitems($courses_dbs, $month, $year, $week); $agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "week_view"); - if (api_get_setting("allow_personal_agenda") == "true") - { + if (api_get_setting("allow_personal_agenda") == "true") { $agendaitems = get_personal_agenda_items($agendaitems, $day, $month, $year, $week, "week_view"); } display_weekcalendar($agendaitems, $month, $year, array(), $monthName); break; - case "day_view" : + case 'day_view' : $agendaitems = get_day_agendaitems($courses_dbs, $month, $year, $day); $agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "day_view"); if (api_get_setting("allow_personal_agenda") == "true") @@ -250,30 +248,27 @@ if (isset ($_user['user_id'])) } display_daycalendar($agendaitems, $day, $month, $year, array(), $monthName); break; - case "personal_view" : + case 'personal_view' : show_personal_agenda(); break; - case "add_personal_agenda_item" : + case 'add_personal_agenda_item' : show_new_personal_item_form(); break; - case "store_personal_agenda_item" : + case 'store_personal_agenda_item' : store_personal_item($_POST['frm_day'], $_POST['frm_month'], $_POST['frm_year'], $_POST['frm_hour'], $_POST['frm_minute'], $_POST['frm_title'], $_POST['frm_content'], (int)$_GET['id']); - if ($_GET['id']) - { + if ($_GET['id']) { echo '
'; Display :: display_normal_message(get_lang("PeronalAgendaItemEdited")); - } - else - { + } else { echo '
'; Display :: display_normal_message(get_lang("PeronalAgendaItemAdded")); } show_personal_agenda(); break; - case "edit_personal_agenda_item" : + case 'edit_personal_agenda_item' : show_new_personal_item_form((int)$_GET['id']); break; - case "delete_personal_agenda_item" : + case 'delete_personal_agenda_item' : delete_personal_agenda((int)$_GET['id']); echo '
'; Display :: display_normal_message(get_lang('PeronalAgendaItemDeleted')); @@ -281,6 +276,6 @@ if (isset ($_user['user_id'])) break; } } -echo "
"; +echo ''; Display :: display_footer(); ?> \ No newline at end of file