コード例 #1
0
     $ikonky = $this->ikonka->findAll()->fetchPairs('id', 'nazov');
     $outDir = 'http://' . $nazov_stranky . '/www/ikonky/128/';
     foreach ($ikonky as $key => $nazov) {
         $iko[$key] = Html::el('img', ['class' => 'ikonkySmall'])->src($outDir . $nazov . '128.png');
     }
     $form->addRadiolist('id_ikonka', 'Ikonka pred článkom:', $iko)->setAttribute('class', 'ikons-set')->getSeparatorPrototype()->setName(NULL);
 }
 $form->addTextArea('text', 'Text:')->setAttribute('cols', 60)->setAttribute('class', 'jquery_ckeditor');
 //    $form->onValidate[] = [$this, 'validateEditOznamForm'];
 $form->addSubmit('uloz', 'Ulož')->setAttribute('class', 'btn btn-success')->onClick[] = [$this, 'editOznamFormSubmitted'];
コード例 #2
0
ファイル: OznamPresenter.php プロジェクト: petak23/echo-msz
 /** 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");
         }
     }
 }
コード例 #3
0
ファイル: OznamPresenter.php プロジェクト: petak23/scspp
 /** Funkcia pre spracovanie signálu vymazavania
  * @param int $id Id oznamu */
 function confirmedDelete($id)
 {
     if ($this->oznam->vymazOznam($id) == 1) {
         $this->flashMessage('Aktualita(oznam) bola úspešne vymazaná!', 'success');
     } else {
         $this->flashMessage('Došlo k chybe a aktualita(oznam) nebola vymazaná!', 'danger');
     }
     if (!$this->isAjax()) {
         $this->redirect('Oznam:');
     }
 }
コード例 #4
0
ファイル: Aktualne.php プロジェクト: petak23/echo-msz
 public function __construct(DbTable\Oznam $oznam)
 {
     parent::__construct();
     $this->oznam = $oznam->aktualne();
 }