Cleaning code

skala
Julio Montoya 15 years ago
parent 1a6a80ff9b
commit 3994cc4814
  1. 13
      main/calendar/agenda.php
  2. 13
      main/calendar/myagenda.inc.php

@ -198,16 +198,13 @@ echo '<a name="top"></a>';
//setting the default year and month
$select_year = '';
$select_month = '';
if(!empty($_GET['year']))
{
if(!empty($_GET['year'])) {
$select_year = (int)$_GET['year'];
}
if(!empty($_GET['month']))
{
if(!empty($_GET['month'])) {
$select_month = (int)$_GET['month'];
}
if (empty($select_year) && empty($select_month))
{
if (empty($select_year) && empty($select_month)) {
$today = getdate();
$select_year = $today['year'];
$select_month = $today['mon'];
@ -384,7 +381,7 @@ if (!$_GET['action'] || $_GET['action']=="showall" || $_GET['action']=="showcur
if ($_GET['origin'] != 'learnpath') {
if (!$_SESSION['view'] || $_SESSION['view'] <> 'month') {
if(!empty($_GET['agenda_id'])) {
display_one_agenda_item((int)$_GET['agenda_id']);
display_one_agenda_item($_GET['agenda_id']);
} else {
display_agenda_items();
}
@ -405,4 +402,4 @@ if ($_GET['origin'] != 'learnpath')
{
Display::display_footer();
}
?>
?>

@ -163,14 +163,17 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra
$backwardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;action=view&amp;view=month&amp;month=". ($month == 1 ? 12 : $month -1)."&amp;year=". ($month == 1 ? $year -1 : $year);
$forewardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;action=view&amp;view=month&amp;month=". ($month == 12 ? 1 : $month +1)."&amp;year=". ($month == 12 ? $year +1 : $year);
echo "<table class=\"data_table\">", "<tr>", "<th width=\"10%\"><a href=\"", $backwardsURL, "\">".Display::return_icon('action_prev.png',get_lang('Previous'))."</a></th>";
echo "<th width=\"80%\" colspan=\"5\">", $monthName, " ", $year, "</th>", "<th width=\"10%\"><a href=\"", $forewardsURL, "\">".Display::return_icon('action_next.png',get_lang('Next'))."</a></th>", "</tr>";
echo '<table id="agenda_list">'.'<tr>';
echo '<th width="10%"><a href="'.$backwardsURL.'">'.Display::return_icon('action_prev.png',get_lang('Previous')).'</a></th>';
echo '<th width="80%" colspan="5">'.$monthName." ".$year.'</th>';
echo '<th width="10%"><a href="'.$forewardsURL.'">'.Display::return_icon('action_next.png',get_lang('Next')).'</a></th>';
echo '</tr>';
echo "<tr>";
echo '<tr>';
for ($ii = 1; $ii < 8; $ii ++) {
echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
echo '<td class="weekdays">'.$DaysShort[$ii % 7].'</td>';
}
echo "</tr>";
echo '</tr>';
$curday = -1;
$today = getdate();
while ($curday <= $numberofdays[$month]) {

Loading…
Cancel
Save