Пример #1
0
 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
 public function beforeRender()
 {
     parent::beforeRender();
     if (isset($this->sess->hideHelp) && $this->sess->hideHelp == true) {
         $this->template->showHelp = false;
     } else {
         $this->template->showHelp = true;
     }
 }
Пример #3
0
 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
 /**
  * (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
 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
 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
 protected function startup()
 {
     parent::startup();
 }
Пример #8
0
 public function startup()
 {
     parent::startup();
 }
Пример #9
0
 public function startup()
 {
     parent::startup();
     $this->items = $this->context->createServiceCompetitions()->order('published DESC, changed DESC');
 }