コード例 #1
0
ファイル: SignPresenter.php プロジェクト: soundake/pd
 public function startup()
 {
     parent::startup();
     $this->users = $this->context->createServiceUsers();
     $this->fbuser = $this->context->facebook->getUser();
     $this->template->fbLoginUrl = $this->context->facebook->getLoginUrl(array('scope' => 'email', 'redirect_uri' => $this->link('//fblogin')));
 }
コード例 #2
0
ファイル: AddPresenter.php プロジェクト: soundake/pd
 protected function startup()
 {
     $this->context->authorizator->allow('guest', 'smallbackend');
     parent::startup();
     $this->places = $this->context->createServicePlaces();
     $this->events = $this->context->createServiceTerms();
     $this->sess = $this->getSession('events');
 }
コード例 #3
0
ファイル: ArticlesPresenter.php プロジェクト: soundake/pd
 public function startup()
 {
     parent::startup();
     $this->items = new \Model\Articles($this->ns);
     $vp = new \VisualPaginator($this, 'vp');
     $this->paginator = $vp->getPaginator();
     $this->paginator->itemsPerPage = 15;
     $this->template->items = $this->articles = $this->items->fetchAllEx($this->paginator->page, $this->paginator->itemsPerPage, 'published', 'DESC');
     $this->paginator->itemCount = $this->template->count = $this->items->getCount();
 }
コード例 #4
0
ファイル: CalendarPresenter.php プロジェクト: soundake/pd
 /**
  * (non-phpDoc)
  *
  * @see Nette\Application\Presenter#startup()
  */
 protected function startup()
 {
     $this->pagerPlaces = new \Pager($this, 'pagingPlaces');
     parent::startup();
     $this->items = $this->context->createService('times')->fetchPublic()->group('event_time.event_id');
     if (is_string($this->category)) {
         $this->categories = array();
         $id = $this->context->createServiceCategories()->where('code', $this->category)->order('shift DESC, name')->fetch()->id;
         $this->categories[$id] = 1;
     }
 }
コード例 #5
0
ファイル: CatalogPresenter.php プロジェクト: soundake/pd
 protected function startup()
 {
     $this->pagerPlaces = new \Pager($this, 'pagingPlaces');
     $this->pagerPlaces->itemsPerPage = $this->limit;
     parent::startup();
     $this->items = $this->context->createServicePlaces();
     if (is_string($this->category)) {
         $this->categories = array();
         $id = $this->context->createServiceCategories()->where('code', $this->category)->order('shift DESC, name')->fetch();
         if (!$id) {
             throw new \Nette\Application\BadRequestException('No category', 404);
         }
         $this->categories[$id->id] = 1;
     }
 }
コード例 #6
0
ファイル: UserPresenter.php プロジェクト: soundake/pd
 public function startup()
 {
     parent::startup();
     /**
      * Nastaveni obecneho pristupu do administrace
      */
     if (!$this->user->isAllowed('frontend', 'default')) {
         $backlink = $this->presenter->storeRequest();
         $this->redirect('Sign:in', $backlink);
     }
     /**
      * Zkontroluje zda je uživatel vůbec přihlášen
      */
     if (!$this->user->isLoggedIn()) {
         $backlink = $this->presenter->storeRequest();
         $this->redirect('Sign:in', $backlink);
     }
     $this->item = $this->context->createServiceUsers()->get($this->user->id);
     $this->subjects = $this->context->createServicePlaces()->where('user_id', $this->user->id);
     $this->events = $this->context->createServiceEvents()->where('subject_id', $this->subjects);
     $this->template->item = $this->item;
 }
コード例 #7
0
ファイル: ServicePresenter.php プロジェクト: soundake/pd
 protected function startup()
 {
     parent::startup();
 }
コード例 #8
0
ファイル: PartnersPresenter.php プロジェクト: soundake/pd
 public function startup()
 {
     parent::startup();
 }
コード例 #9
0
ファイル: CompetitionsPresenter.php プロジェクト: soundake/pd
 public function startup()
 {
     parent::startup();
     $this->items = $this->context->createServiceCompetitions()->order('published DESC, changed DESC');
 }