예제 #1
0
 function prepare()
 {
     parent::prepare();
     if (!empty($_REQUEST['newcalendar'])) {
         $this->addCalendar($_REQUEST['newcalendar']);
     }
     if (!empty($_REQUEST['removecalendar'])) {
         $this->removeCalendar($_REQUEST['removecalendar']);
     }
     if (!empty($_REQUEST['switchcalendar'])) {
         $this->switchCalendar($_REQUEST['switchcalendar']);
     }
     return array_values($this->user->getCalendar());
 }
예제 #2
0
파일: Activity.php 프로젝트: r4mp/Foodle
 function prepare()
 {
     parent::prepare();
     #$entries = $this->fdb->getOwnerEntries($this->user, 10);
     $as = new Data_ActivityStream($this->fdb, $this->user);
     if (count($this->parameters) === 0) {
         $as->prepareUser();
         return $as->getData();
     }
     if (count($this->parameters) > 0) {
         if ($this->parameters[0] === 'feed') {
             $feed = $this->parameters[1];
             $as->prepareFeed($feed);
             return $as->getData();
         }
     }
     throw new Exception('Invalid parameters: ' . var_export($this->parameters, TRUE));
 }
예제 #3
0
파일: Events.php 프로젝트: r4mp/Foodle
 function prepare()
 {
     parent::prepare();
     $as = new Data_EventStream($this->fdb, $this->user);
     // error_log('Accessing API_Events');
     if (count($this->parameters) === 0) {
         $as->prepareUser();
         $limit = null;
         if (isset($_REQUEST['limit'])) {
             $limit = $_REQUEST['limit'];
         }
         return $as->getData($limit);
     }
     if (count($this->parameters) > 0) {
         if ($this->parameters[0] === 'group') {
             $groupid = $this->parameters[1];
             $as->prepareGroup($groupid);
             return $as->getData();
         }
     }
     throw new Exception('Invalid parameters: ' . var_export($this->parameters, TRUE));
 }
예제 #4
0
파일: Foodlelist.php 프로젝트: r4mp/Foodle
 function prepare()
 {
     parent::prepare();
     $entries = $this->fdb->getOwnerEntries($this->user, 10);
     return $entries;
 }