示例#1
0
 /** Akcia pre nacitanie aktualnych oznamov */
 public function actionDefault()
 {
     //Z DB zisti ako budu oznamy usporiadane
     if (($pomocna = $this->udaje->getKluc("oznam_usporiadanie")) !== FALSE) {
         $oznamy_usporiadanie = (bool) $pomocna->text;
     } else {
         $oznamy_usporiadanie = FALSE;
     }
     $this->aktualne = $this->oznam->aktualne($oznamy_usporiadanie);
     //Ak nie su oznamy najdi 1. clanok cez udaje a ak je tak presmeruj na neho
     if ($this->aktualne->count() == 0) {
         if (($id = $this->udaje->getUdajInt('oznam_prva_stranka')) > 0) {
             $this->flashRedirect(['Clanky:default', $id], $this->trLang('ziaden_aktualny'), 'info');
         } else {
             $this->setView("prazdne");
         }
     }
 }
示例#2
0
 public function __construct(DbTable\Oznam $oznam)
 {
     parent::__construct();
     $this->oznam = $oznam->aktualne();
 }