]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/form/Calendar.class.php
Finished refactoring of the FormElement class.
[timetracker.git] / WEB-INF / lib / form / Calendar.class.php
index 46fcd6eba460a0db0932a3be7eddde3a0f78a9bd..dbe29981abad01f77a2bf192e50ccdf215c59ae3 100644 (file)
@@ -45,7 +45,7 @@ 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 __construct($name) {
         $this->controlName = $name;
@@ -58,11 +58,10 @@ class Calendar extends FormElement {
          $this->highlight = $highlight;
     }
 
-    function setLocalization($i18n) {
+    function localize($i18n) {
       global $user;
       
-      FormElement::setLocalization($i18n);
-      $this->mMonthNames    = $i18n->monthNames;
+      $this->mMonthNames = $i18n->monthNames;
       $this->mWeekDayShortNames = $i18n->weekdayShortNames;
       if (is_array($i18n->holidays)) {
         foreach ($i18n->holidays as $fday) {
@@ -73,7 +72,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 +89,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);
@@ -225,7 +222,7 @@ class Calendar extends FormElement {
       return $str;
     }
 
-    function toStringControl() {
+    function getHtml() {
         return $this->toString();
     }