Some renaming.
[timetracker.git] / WEB-INF / lib / form / Calendar.class.php
index b2cdf33..01bd354 100644 (file)
@@ -45,9 +45,9 @@ class Calendar extends FormElement {
     var $controlName = "";
     var $highlight = "time"; // Determines what type of active days to highlight ("time" or "expenses"). 
     // var $mAllDays       = true;
-    var $cClassName    = "Calendar";
+    var $class = "Calendar";
 
-    function Calendar($name) {
+    function __construct($name) {
         $this->controlName = $name;
         $this->mMonthNames = array('January','February','March','April','May','June','July','August','September','October','November','December');
         $this->mWeekDayShortNames = array('Su','Mo','Tu','We','Th','Fr','Sa');
@@ -73,7 +73,7 @@ class Calendar extends FormElement {
       $this->weekStartDay = $user->week_start;
     }
 
-    function setStyle($style) { $this->mStyle = $style; }
+    function setStyle($style) { $this->style = $style; }
     function setCellStyle($style) { $this->mCellStyle = $style; }
     function setACellStyle($style) { $this->mACellStyle = $style; }
     function setLinkStyle($style) { $this->mLinkStyle = $style; }
@@ -90,11 +90,9 @@ class Calendar extends FormElement {
     function toString($date="") {
       global $i18n;
        
-      $indate = $this->mValue;
+      $indate = $this->value;
       if (!$indate) $indate = strftime(DB_DATEFORMAT);
 
-      if (!$this->isRenderable()) return "";
-
       //current year and month
       if ( strlen ( $indate ) > 0 ) {
         $indateObj = new DateAndTime(DB_DATEFORMAT, $indate);
@@ -166,7 +164,7 @@ class Calendar extends FormElement {
             $stl_cell = "";
             $stl_link = "";
 
-            // weeekend
+            // weekend
             if ($j==$weekend_start || $j==$weekend_end) {
               $stl_cell = ' class="CalendarDayWeekend"';
               $stl_link = ' class="CalendarLinkWeekend"';