From 823d71ced9b4947b1a5a5ade7245d521ed490061 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Jun 2016 15:17:49 +0200 Subject: * renaming php directory --- app/frontend/controls/EventList.php | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/frontend/controls/EventList.php (limited to 'app/frontend/controls/EventList.php') diff --git a/app/frontend/controls/EventList.php b/app/frontend/controls/EventList.php new file mode 100644 index 0000000..d40e000 --- /dev/null +++ b/app/frontend/controls/EventList.php @@ -0,0 +1,59 @@ + $date]) + ); + } + $this->setViewState($key, $datetime); + } + + public function setDateFrom($date) { + $this->_setDate('DateFrom', $date); + } + + public function getDateFrom() { + return $this->getViewState('DateFrom'); + } + + public function setDateTo($date) { + $this->_setDate('DateTo', $date); + } + + public function getDateTo() { + return $this->getViewState('DateTo'); + } + + public function setHeaderText($text) { + $this->setViewState('HeaderText', TPropertyValue::ensureString($text)); + } + + public function getHeaderText() { + return $this->getViewState('HeaderText'); + } + + public function setReverse($value) { + $this->setViewState('Reverse', TPropertyValue::ensureBoolean($value)); + } + + public function getReverse() { + return $this->getViewState('Reverse'); + } + + public function getEvents() { + return $this->getFacade()->getEventsForTimeframe( + $this->getCalendar(), + $this->getDateFrom() ?: new DateTime('0000-00-00'), + $this->getDateTo() ?: new DateTime('9999-99-99'), + $this->getReverse() ? 'DESC' : 'ASC' + ); + } + +} + +?> -- cgit v1.2.3