Happy New Year
[squirrelmail.git] / plugins / calendar / functions.php
index 16d83720c5cd39dc41268c0608a8bb7ff958d8fe..bdfb6bc5a9917fa1b007b5bb1c4ade3631626608 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Other calendar plugin functions.
  *
- * @copyright © 2002-2007 The SquirrelMail Project Team
+ * @copyright 2002-2021 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -18,8 +18,7 @@
   */
 function calendar_do() {
 
-    global $oTemplate;
-    $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
+    global $oTemplate, $nbsp;
     $output = makeInternalLink('plugins/calendar/calendar.php',_("Calendar"),'right')
             . $nbsp . $nbsp;
     return array('menuline' => $output);
@@ -33,15 +32,16 @@ function calendar_do() {
 function calendar_header() {
     global $color,$year,$day,$month;
 
+// FIXME: Don't echo HTML from core.  This whole function should probably be moved into a template file
     echo html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
          html_tag( 'tr' ) .
          html_tag( 'td', '', 'left', '', 'width="100%"' );
 
-    displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
+    echo makeInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
     echo "  \n";
-    displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
+    echo makeInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
     echo "  \n";
-    // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
+    // echo makeInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
     // echo "  \n";
     echo '</td></tr>';
 
@@ -71,11 +71,11 @@ function select_option_length($selected) {
         '360' => _("6 hr.")
     );
 
-    while( $bar = each($eventlength)) {
-        if($bar['key']==$selected){
-            echo '        <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
+    foreach($eventlength as $key => $value) {
+        if($key==$selected){
+            echo '        <option value="'.$key.'" selected="selected">'.$value."</option>\n";
         } else {
-            echo '        <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
+            echo '        <option value="'.$key.'">'.$value."</option>\n";
         }
     }
 }
@@ -103,11 +103,11 @@ function select_option_minute($selected) {
         '55'=>'55'
     );
 
-    while ( $bar = each($eventminute)) {
-        if ($bar['key']==$selected){
-            echo '        <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
+    foreach ($eventminute as $key => $value) {
+        if ($key==$selected){
+            echo '        <option value="'.$key.'" selected="selected">'.$value."</option>\n";
         } else {
-            echo '        <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
+            echo '        <option value="'.$key.'">'.$value."</option>\n";
         }
     }
 }
@@ -141,11 +141,11 @@ function select_option_priority($selected) {
         '1' => _("High"),
     );
 
-    while( $bar = each($eventpriority)) {
-        if($bar['key']==$selected){
-            echo '        <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
+    foreach($eventpriority as $key => $value) {
+        if($key==$selected){
+            echo '        <option value="'.$key.'" selected="selected">'.$value."</option>\n";
         } else {
-            echo '        <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
+            echo '        <option value="'.$key.'">'.$value."</option>\n";
         }
     }
 }