X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FCalendar.class.php;h=ab2dcf5738f634e20010a3112fa43c5e11381f18;hb=4fdb2cd8b1c8990a7ea8ed40b275dc51174e6585;hp=e9d5097622e374ae1036b1d93e63c9215ea5edf6;hpb=bd569da4f1d6ada00f5e48eac9716c068003748a;p=timetracker.git diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index e9d50976..ab2dcf57 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -44,25 +44,23 @@ 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"; 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'); + $this->class = 'Calendar'; + $this->controlName = $name; // TODO: why controlName? Other classes have "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'); } - + function setHighlight($highlight) { if ($highlight && $highlight != 'time') $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) { @@ -93,8 +91,6 @@ class Calendar extends FormElement { $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 +221,7 @@ class Calendar extends FormElement { return $str; } - function toStringControl() { + function getHtml() { return $this->toString(); }