summaryrefslogtreecommitdiff
path: root/app/php/controls/UrlBasedCalendarControl.php
blob: 1f737e8e4417e229f5595d217928a2d83c704486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.facades.CalendarFacade');

class UrlBasedCalendarControl extends FacadeTemplateControl {

    public function setCalendarUrl($url) {
        if ($url) {
            $calendar = $this->getFacade()->resolveUrl($url);
            if ($calendar) {
                $this->setViewState('Calendar', $calendar);
                return;
            }
        }
        throw new THttpException(404, 'Page not found');
    }

    public function getCalendar() {
        return $this->getViewState('Calendar');
    }

}

?>