protected function init($args)
 {
     parent::init($args);
     if (isset($args['CATEGORY_FILTER_FIELD'])) {
         $this->categoryFilter = $args['CATEGORY_FILTER_FIELD'];
     }
 }
 protected function init($args)
 {
     parent::init($args);
     if (isset($args['USER'])) {
         $this->setUser($args['USER']);
     }
 }
    public function url()
    {
        if (empty($this->startDate) || empty($this->endDate)) {
            throw new Exception('Start or end date cannot be blank');
        }
        
        $diff = $this->endTimestamp() - $this->startTimestamp();

        if ($diff<86400 || $diff == 89999) { // fix for DST
            if (count($this->trumbaFilters)>0) {
                $this->setRequiresDateFilter(false);
                $this->addFilter('startdate', $this->startDate->format('Ymd'));
                $this->addFilter('days', 1);
            } else {
                $this->setRequiresDateFilter(true);
                $this->addFilter('startdate', $this->startDate->format('Ym').'01');
                $this->addFilter('months', 1);
           }
        } elseif ($diff % 86400 == 0) {
            $this->setRequiresDateFilter(false);
            $this->addFilter('startdate', $this->startDate->format('Ymd'));
            $this->addFilter('days', $diff / 86400);
        } else {
            trigger_error("Non day integral duration specified $diff", E_USER_ERROR);
        }
        
        return parent::url();
    }
 protected function init($args)
 {
     parent::init($args);
     //either get the specified authority or attempt to get a GoogleApps authority
     $authorityIndex = isset($args['AUTHORITY']) ? $args['AUTHORITY'] : 'GoogleAppsAuthentication';
     $authority = AuthenticationAuthority::getAuthenticationAuthority($authorityIndex);
     //make sure we're getting a google apps authority
     if ($authority instanceof GoogleAppsAuthentication) {
         $this->authority = $authority;
     }
     $this->addStandardFilters();
 }
 public function getFeed($index, $type) {
     $feeds = $this->getFeeds($type);
     if (isset($feeds[$index])) {
         $feedData = $feeds[$index];
         if (!isset($feedData['CONTROLLER_CLASS'])) {
             $feedData['CONTROLLER_CLASS'] = 'CalendarDataController';
         }
         $controller = CalendarDataController::factory($feedData['CONTROLLER_CLASS'],$feedData);
         $controller->setDebugMode(Kurogo::getSiteVar('DATA_DEBUG'));
         return $controller;
     } else {
         throw new Exception("Error getting calendar feed for index $index");
     }
 }
Ejemplo n.º 6
0
 public function getFeed($index, $type)
 {
     $feeds = $this->getFeeds($type);
     if (isset($feeds[$index])) {
         $feedData = $feeds[$index];
         if (!isset($feedData['CONTROLLER_CLASS'])) {
             $feedData['CONTROLLER_CLASS'] = 'CalendarDataController';
         }
         $controller = CalendarDataController::factory($feedData['CONTROLLER_CLASS'], $feedData);
         return $controller;
     } else {
         throw new KurogoConfigurationException($this->getLocalizedString("ERROR_NO_CALENDAR_FEED", $index));
     }
 }
Ejemplo n.º 7
0
 public function getFeed($index, $type)
 {
     $feeds = $this->getFeeds($type);
     if (isset($feeds[$index])) {
         $feedData = $feeds[$index];
         try {
             if (isset($feedData['CONTROLLER_CLASS'])) {
                 $modelClass = $feedData['CONTROLLER_CLASS'];
             } else {
                 $modelClass = isset($feedData['MODEL_CLASS']) ? $feedData['MODEL_CLASS'] : self::$defaultModel;
             }
             $controller = CalendarDataModel::factory($modelClass, $feedData);
         } catch (KurogoException $e) {
             $controller = CalendarDataController::factory($feedData['CONTROLLER_CLASS'], $feedData);
             $this->legacyController = true;
         }
         return $controller;
     } else {
         throw new KurogoConfigurationException($this->getLocalizedString("ERROR_NO_CALENDAR_FEED", $index));
     }
 }