Exemplo n.º 1
0
 public function renderDetail($idArticle, $lang)
 {
     $article = $this->article->getArticle($idArticle, $lang);
     if (!$article) {
         $this->error($this->translator->translate('admin.article.notFound'), 404);
     }
     if ($article->keywords == null) {
         $this->flashMessage('admin.article.form.keywordsRequired', Flash::WARNING);
     }
     if ($article->description == null) {
         $this->flashMessage('admin.article.form.descriptionRequired', Flash::WARNING);
     }
     if ($article->keywords == null || $article->description == null) {
         $this->flashMessage('admin.article.form.keywordsInfo', Flash::INFO);
     }
     //todo: flashmessage který by se zobrazil jen jednou, aby nemusel být další if
     $this->title($article->title);
     $this->template->article = $article;
     $this->template->imagePath = articleImagesPath;
     $this->navigation->addItem('admin.article.title', 'Article:');
     $this->lang = $article->lang;
     $this['addArticleForm']->setDefaults($article->toArray());
 }