From 30a2286946e455effbc2e08aa46e3298942272db Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 28 Jul 2011 17:03:57 +0200 Subject: [PATCH] Cleaning code --- main/calendar/agenda.inc.php | 17 ++++++++++------- main/calendar/myagenda.inc.php | 2 +- main/forum/reply.php | 2 +- main/link/link.php | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php index 3fa0793a39..f6f60738e7 100755 --- a/main/calendar/agenda.inc.php +++ b/main/calendar/agenda.inc.php @@ -2963,8 +2963,9 @@ function display_daycalendar($agendaitems, $day, $month, $year, $weekdaynames, $ // we are loading all the calendar items of all the courses for today echo ""; // the forward and backwards url - $backwardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".Security::remove_XSS($_GET['courseCode'])."&action=view&view=day&day=".date("j", $previousday)."&month=".date("n", $previousday)."&year=".date("Y", $previousday); - $forewardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".Security::remove_XSS($_GET['courseCode'])."&action=view&view=day&day=".date("j", $nextday)."&month=".date("n", $nextday)."&year=".date("Y", $nextday); + $course_code = isset($_GET['courseCode']) ? Security::remove_XSS($_GET['courseCode']) : null; + $backwardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".$course_code."&action=view&view=day&day=".date("j", $previousday)."&month=".date("n", $previousday)."&year=".date("Y", $previousday); + $forewardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".$course_code."&action=view&view=day&day=".date("j", $nextday)."&month=".date("n", $nextday)."&year=".date("Y", $nextday); // The title row containing the day echo "", "", ""); } echo ""; echo ""; diff --git a/main/calendar/myagenda.inc.php b/main/calendar/myagenda.inc.php index 6458cac36f..db798b7252 100755 --- a/main/calendar/myagenda.inc.php +++ b/main/calendar/myagenda.inc.php @@ -675,7 +675,7 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = " $halfhour = $halfhour +1; } //Display events by list - $agendaitems[$halfhour] .= "
$hour:$minute $course_link ".$item['title']."
"; + $agendaitems[$halfhour] .= "
$hour:$minute $course_link ".$item['title']."
"; } } diff --git a/main/forum/reply.php b/main/forum/reply.php index 6c6e8de4a6..808577eb81 100755 --- a/main/forum/reply.php +++ b/main/forum/reply.php @@ -33,7 +33,7 @@ api_protect_course_script(true); // Including additional library scripts. require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php'; -$nameTools = get_lang('ToolForum'); +$nameTools = get_lang('ForumCategories'); $origin = ''; if (isset($_GET['origin'])) { diff --git a/main/link/link.php b/main/link/link.php index dbf61a5de0..4a3997038a 100755 --- a/main/link/link.php +++ b/main/link/link.php @@ -457,7 +457,7 @@ if (empty($_GET['action']) || ($_GET['action'] != 'editlink' && $_GET['action'] // - instead of a +, the category is no longer clickable and all the links of this category are displayed $myrow['description'] = text_filter($myrow['description']); - if ($urlview[$i] == '1') { + if (isset($urlview[$i]) && $urlview[$i] == '1') { $newurlview = $urlview; $newurlview[$i] = '0';
".Display::return_icon('action_prev.png',get_lang('Previous')).""; echo $DaysLong[$day_of_the_week]." ".date("j", $today)." ".$MonthsLong[date("n", $today) - 1]." ".date("Y", $today); @@ -2987,12 +2988,14 @@ function display_daycalendar($agendaitems, $day, $month, $year, $weekdaynames, $ echo ("". ((($i) / 2) - (1 / 2))." ".get_lang("HourShort")." 30"; - if (is_array($agendaitems[$i])) { - foreach ($agendaitems[$i] as $key => $value) { - echo $value; + if (isset($agendaitems[$i])) { + if (is_array($agendaitems[$i])) { + foreach ($agendaitems[$i] as $key => $value) { + echo $value; + } + } else { + echo $agendaitems[$i]; } - } else { - echo $agendaitems[$i]; } echo "