示例#1
0
 public function renderDetail($idOffer, $lang)
 {
     $offer = $this->offer->getOffer($idOffer, $lang);
     if (!$offer) {
         $this->error($this->translator->translate('admin.offer.notFound'), 404);
     }
     if ($offer->keywords == null) {
         $this->flashMessage('admin.offer.form.keywordsRequired', Flash::WARNING);
     }
     if ($offer->description == null) {
         $this->flashMessage('admin.offer.form.descriptionRequired', Flash::WARNING);
     }
     if ($offer->keywords == null || $offer->description == null) {
         $this->flashMessage('admin.offer.form.keywordsInfo', Flash::INFO);
     }
     //todo: flashmessage který by se zobrazil jen jednou, aby nemusel být další if
     $this->title($offer->title);
     $this->template->offer = $offer;
     $this->template->imagePath = offerImagesPath;
     $this->navigation->addItem('admin.offer.title', 'Offer:');
     $data = $offer->toArray();
     $data['idOffer'] = $offer->idOffer;
     $data['language'] = $offer->lang;
     $this['addOfferForm']->setDefaults($data);
 }
示例#2
0
 public function renderDetail($id)
 {
     $this->template->offer = $this->offer->getOffer($id, $this->translator->getLocale());
 }