Happy New Year
[squirrelmail.git] / plugins / calendar / day.php
index 10944fb22ce81310ba0d529337466fe036eb21db..983a33174075e812502c2b71be33a61664c75786 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Displays the day page (day view).
  *
- * @copyright 2002-2019 The SquirrelMail Project Team
+ * @copyright 2002-2022 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -80,8 +80,8 @@ function initialize_events() {
     $cdate = $month . $day . $year;
 
     if (isset($calendardata[$cdate])){
-        while ( $calfoo = each($calendardata[$cdate])){
-            $daily_events["$calfoo[key]"] = $calendardata[$cdate][$calfoo['key']];
+        foreach ($calendardata[$cdate] as $key => $value){
+            $daily_events[$key] = $calendardata[$cdate][$key];
         }
     }
 }
@@ -96,28 +96,28 @@ function display_events() {
 
     ksort($daily_events,SORT_STRING);
     $eo=0;
-    while ($calfoo = each($daily_events)){
+    foreach ($daily_events as $key => $value) {
         if ($eo==0){
             $eo=4;
         } else {
             $eo=0;
         }
 
-        $ehour = substr($calfoo['key'],0,2);
-        $eminute = substr($calfoo['key'],2,2);
-        if (!is_array($calfoo['value'])){
+        $ehour = substr($key,0,2);
+        $eminute = substr($key,2,2);
+        if (!is_array($value)){
             echo html_tag( 'tr',
                        html_tag( 'td', $ehour . ':' . $eminute, 'left' ) .
                        html_tag( 'td', ' ', 'left' ) .
                        html_tag( 'td',
                            "<font size=\"-1\"><a href=\"event_create.php?year=$year&amp;month=$month&amp;day=$day&amp;hour="
-                           .substr($calfoo['key'],0,2)."\">".
+                           .substr($key,0,2)."\">".
                            _("ADD") . "</a></font>" ,
                        'center' ) ,
                    '', $color[$eo]);
 
         } else {
-            $calbar=$calfoo['value'];
+            $calbar=$value;
             if ($calbar['length']!=0){
                 $elength = '-'.date_intl(_("H:i"),mktime($ehour,$eminute+$calbar['length'],0,1,1,0));
             } else {
@@ -133,10 +133,10 @@ function display_events() {
                         html_tag( 'td',
                             "<font size=\"-1\"><nobr>\n" .
                             "<a href=\"event_edit.php?year=$year&amp;month=$month&amp;day=$day&amp;hour=".
-                            substr($calfoo['key'],0,2)."&amp;minute=".substr($calfoo['key'],2,2)."\">".
+                            substr($key,0,2)."&amp;minute=".substr($key,2,2)."\">".
                             _("EDIT") . "</a>&nbsp;|&nbsp;\n" .
                             "<a href=\"event_delete.php?dyear=$year&amp;dmonth=$month&amp;dday=$day&amp;dhour=".
-                            substr($calfoo['key'],0,2)."&amp;dminute=".substr($calfoo['key'],2,2).
+                            substr($key,0,2)."&amp;dminute=".substr($key,2,2).
                             "&amp;year=$year&amp;month=$month&amp;day=$day\">" .
                             _("DEL") . '</a>' .
                             "</nobr></font>\n" ,