Happy 2014
[squirrelmail.git] / plugins / calendar / calendar.php
index 389503ae0dbbd348c8c8bdebb60faac27430be2f..f9fcda5503e22773beaf5ef34abc286f39ee51ce 100644 (file)
@@ -3,18 +3,18 @@
 /**
  * Displays the main calendar page (month view).
  *
- * @copyright © 2002-2006 The SquirrelMail Project Team
+ * @copyright 2002-2014 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage calendar
  */
 
-/** @ignore */
-define('SM_PATH','../../');
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../../include/init.php');
 
-/* SquirrelMail required files. */
-include_once(SM_PATH . 'include/validate.php');
 /* load date_intl() */
 include_once(SM_PATH . 'functions/date.php');
 
@@ -114,11 +114,11 @@ function drawmonthview() {
                     $calbar = $calendardata[$cdate][$calfoo['key']];
                     // FIXME: how to display multiline task
                     $title = '['. $calfoo['key']. '] ' .
-                        str_replace(array("\r","\n"),array(' ',' '),htmlspecialchars($calbar['message']));
+                        str_replace(array("\r","\n"),array(' ',' '),sm_encode_html_special_chars($calbar['message']));
                     // FIXME: link to nowhere
                     echo "<a href=\"#\" style=\"text-decoration:none; color: "
                         .($calbar['priority']==1 ? $color[1] : $color[6])
-                        ."\" title=\"$title\">".htmlspecialchars($calbar['title'])."</a><br />\n";
+                        ."\" title=\"$title\">".sm_encode_html_special_chars($calbar['title'])."</a><br />\n";
                     $i=$i+1;
                     if($i==2){
                         break;
@@ -135,11 +135,10 @@ function drawmonthview() {
 /**
  * end of monthly view and form to jump to any month and year
  * @return void
- * @
  * @access private
  */
 function endcalendar() {
-    global $year, $month, $day, $color;
+    global $year, $month;
 
     echo html_tag( 'tr' ) ."\n" .
            html_tag( 'td', '', 'left', '', 'colspan="7"' ) ."\n" .
@@ -170,7 +169,7 @@ if( !isset($day) || $day <= 0){
 $todayis = date( 'mdY' );
 $calself=basename($PHP_SELF);
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 calendar_header();
 readcalendardata();
 startcalendar();
@@ -178,4 +177,4 @@ drawmonthview();
 endcalendar();
 
 ?>
-</body></html>
\ No newline at end of file
+</body></html>