This is Philippe Mingo
[squirrelmail.git] / plugins / calendar / day.php
index 44d60447772660dbcedb09b9dba429a7c69d075f..36ae7171bb6acbf8e26cb4c7d645c11d02e84590 100644 (file)
@@ -7,7 +7,7 @@
  *
  *  Displays the day page (day view).
  *
- *  18 Jan 2002 Adapted to official SM rules philippe@squirrelmail.org.
+ * $Id$
  */
 
 require_once('calendar_data.php');
@@ -27,9 +27,9 @@ function day_header() {
 
     echo "    <TR BGCOLOR=\"$color[0]\"><TD>" .
          "         <TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=1 BGCOLOR=\"$color[0]\">\n" .
-         "         <TR><TH ALIGN=LEFT><A HREF=\"day.php?year=$prev_year&month=$prev_month&day=$prev_day\">&lt;&nbsp;".
+         "         <TR><TH WIDTH=\"5%\" ALIGN=LEFT><A HREF=\"day.php?year=$prev_year&month=$prev_month&day=$prev_day\">&lt;&nbsp;".
          date_intl('D',$prev_date)."</A></TH>\n" .
-         "         <TH>" .
+         "         <TH WIDTH=\"75%\">" .
          date_intl( 'l, F d Y', mktime(0, 0, 0, $month, $day, $year)) . "</TH>\n" .
          "         <TH ALIGN=RIGHT><A HREF=\"day.php?year=$next_year&month=$next_month&day=$next_day\">".
          date_intl('D',$next_date)."&nbsp;&gt;</A></TH></TR>\n";
@@ -52,7 +52,7 @@ function initialize_events() {
 
     if (isset($calendardata[$cdate])){
         while ( $calfoo = each($calendardata[$cdate])){
-            $daily_events["$calfoo[key]"] = $calendardata[$cdate][$calfoo[key]];
+            $daily_events["$calfoo[key]"] = $calendardata[$cdate][$calfoo['key']];
         }
     }
 }
@@ -70,32 +70,31 @@ function display_events() {
             $eo=0;
         }
 
-        $ehour = substr($calfoo[key],0,2);
-        $eminute = substr($calfoo[key],2,2);
-        if (!is_array($calfoo[value])){
+        $ehour = substr($calfoo['key'],0,2);
+        $eminute = substr($calfoo['key'],2,2);
+        if (!is_array($calfoo['value'])){
             echo "         <TR BGCOLOR=\"$color[$eo]\"><TD>$ehour:$eminute</TD>\n" .
-                 "              <TD WIDTH=\"100%\">&nbsp;</TD>\n" .
-                 "              <TD ALIGN=CENTER><FONT SIZE=-1><A HREF=\"event_create.php?year=$year&month=$month&day=$day&hour=".substr($calfoo[key],0,2)."\">".
+                 "              <TD>&nbsp;</TD>\n" .
+                 "              <TD ALIGN=CENTER><FONT SIZE=-1><A HREF=\"event_create.php?year=$year&month=$month&day=$day&hour=".substr($calfoo['key'],0,2)."\">".
                  _("ADD") . "</A></FONT></TD></TR>\n";
         } else {
-            $calbar=$calfoo[value];
-            if ($calbar[length]!=0){
-                $elength = '-'.date('H:i',mktime($ehour,$eminute+$calbar[length],0,1,1,0));
+            $calbar=$calfoo['value'];
+            if ($calbar['length']!=0){
+                $elength = '-'.date('H:i',mktime($ehour,$eminute+$calbar['length'],0,1,1,0));
             } else {
                 $elength='';
             }
             echo "         <TR BGCOLOR=\"$color[$eo]\"><TD>$ehour:$eminute$elength</TD>\n" .
-                 "              <TD WIDTH=\"100%\">[";
-            echo ($calbar[priority]==1) ? "<FONT COLOR=\"$color[1]\">$calbar[title]</FONT>" : "$calbar[title]";
+                 "              <TD>[";
+            echo ($calbar['priority']==1) ? "<FONT COLOR=\"$color[1]\">$calbar[title]</FONT>" : "$calbar[title]";
             echo"] $calbar[message]&nbsp;</TD>\n" .
                  "              <TD ALIGN=CENTER><FONT SIZE=-1><nobr>\n" .
-                 "<A HREF=\"event_edit.php?year=$year&month=$month&day=$day&hour=".substr($calfoo[key],0,2)."&minute=".substr($calfoo[key],2,2)."\">".
+                 "<A HREF=\"event_edit.php?year=$year&month=$month&day=$day&hour=".substr($calfoo['key'],0,2)."&minute=".substr($calfoo['key'],2,2)."\">".
                  _("EDIT") . "</A>&nbsp;|&nbsp;\n" .
-                 "<A HREF=\"event_delete.php?dyear=$year&dmonth=$month&dday=$day&dhour=".substr($calfoo[key],0,2)."&dminute=".substr($calfoo[key],2,2)."&year=$year&month=$month&day=$day\">" .
+                 "<A HREF=\"event_delete.php?dyear=$year&dmonth=$month&dday=$day&dhour=".substr($calfoo['key'],0,2)."&dminute=".substr($calfoo['key'],2,2)."&year=$year&month=$month&day=$day\">" .
                  _("DEL") . '</A>' .
                  "              </nobr></FONT></TD></TR>\n";
     }
-    $i++;
 }
 
 
@@ -130,8 +129,6 @@ readcalendardata();
 day_header();
 initialize_events();
 display_events();
-
-
 ?>
 </table></td></tr></table>
 </body></html>