diff --git a/application/modules/admin/views/scripts/newsletter/_newsletter_row.phtml b/application/modules/admin/views/scripts/newsletter/_newsletter_row.phtml index 43802f9199146d337c0949e871ec6618feb4a37f..333088b914364339e4fb821fbdb3533af5cf79d9 100644 --- a/application/modules/admin/views/scripts/newsletter/_newsletter_row.phtml +++ b/application/modules/admin/views/scripts/newsletter/_newsletter_row.phtml @@ -7,8 +7,8 @@ echo date('d/m/Y H:i', strtotime($last_date)); ?></td> - <?php - foreach(['edit' => $this->boutonIco("type=edit"), + <?php + foreach(['edit' => $this->boutonIco("type=edit"), 'delete' => $this->boutonIco("type=del"), 'preview' => $this->boutonIco("type=show"), 'edit-subscribers' => $this->boutonIco("picto=picto/abonnes.gif", "bulle=Membres"), diff --git a/application/modules/opac/views/scripts/cms/article_partial.phtml b/application/modules/opac/views/scripts/cms/article_partial.phtml index 974c1f1fb448be7bc9b73eb45546161512c49ec3..32408cc4015f7a72b3e244aa37f81cd1586a7050 100644 --- a/application/modules/opac/views/scripts/cms/article_partial.phtml +++ b/application/modules/opac/views/scripts/cms/article_partial.phtml @@ -3,46 +3,11 @@ if (!isset($this->show_content)) { $this->show_content = 'FullContent'; } +$helper = $this->show_content == 'FullContent' + ? $this->getHelper('Article_RenderFullContent') + : $this->getHelper('Article_RenderSummary'); -if ($this->show_content == 'FullContent') { - echo $this->article_RenderFullContent($this->article); - return; -} - -$titre = ''; - -if ( - ('FullContent' != $this->show_content) - || !$this->article->getCacherTitre() -) { - $titre = $this->tagAnchor($this->url($this->article->getUrl()), - $this->article->getTitre()); -} +echo $helper->beRenderInBoite() + ->renderArticle($this->article, 'article'); -echo $this->openBoite($titre); -echo $this->tagEditArticle($this->article); ?> - -<div class="auto_resize article"> - <!-- RSPEAK_START --> - <?php - echo $this->readSpeaker( - 'cms', - 'articleread', - array('id' => $this->article->getId()) - ); - echo $this->tagArticleEvent($this->article); - - if ($this->show_content == 'Summary') { ?> - <?php echo $this->article->getSummary();?> - <br /><?php - echo $this->tagAnchor( - $this->url($this->article->getUrl()), - $this->_("Lire l'article complet") - );?> - <?php } ?> - <!-- RSPEAK_STOP --> - -</div> - -<?php echo $this->closeBoite(); ?> diff --git a/library/ZendAfi/View/Helper/Article/RenderAbstract.php b/library/ZendAfi/View/Helper/Article/RenderAbstract.php index 07acc46abb076da4f75c297ae4ed25e6987595a6..7480189fe6a068ceeb43348f7060a2973c1e829c 100644 --- a/library/ZendAfi/View/Helper/Article/RenderAbstract.php +++ b/library/ZendAfi/View/Helper/Article/RenderAbstract.php @@ -40,7 +40,7 @@ abstract class ZendAfi_View_Helper_Article_RenderAbstract extends ZendAfi_View_H public function renderArticleHTML($html, $article) { - return $html; + return $this->getRenderContainerStrategy()->renderArticleHTML($html, $article); } @@ -61,9 +61,20 @@ abstract class ZendAfi_View_Helper_Article_RenderAbstract extends ZendAfi_View_H } + public function beRenderInBoite() { + $this->_render_container_strategy = $this->view->getHelper('Article_RenderContainer_Boite'); + return $this; + } + + + public function getRenderContainerStrategy() { + if (!isset($this->_render_container_strategy)) + $this->_render_container_strategy = $this->view->getHelper('Article_RenderContainer_Empty'); + return $this->_render_container_strategy; + } + public function renderTitre($article) { - return $this->view->tagAnchor($this->view->url($article->getUrl()), - $article->getTitre()); + return $this->getRenderContainerStrategy()->renderTitre($article); } diff --git a/library/ZendAfi/View/Helper/Article/RenderFullContent.php b/library/ZendAfi/View/Helper/Article/RenderFullContent.php index d7e835ea70f0c76205dcd6e1b585f1af259a4daa..83502aae3c4bf7064fa2bdfc68e4b4184106fd10 100644 --- a/library/ZendAfi/View/Helper/Article/RenderFullContent.php +++ b/library/ZendAfi/View/Helper/Article/RenderFullContent.php @@ -27,18 +27,5 @@ class ZendAfi_View_Helper_Article_RenderFullContent extends ZendAfi_View_Helper_ public function renderContent($article) { return $article->getFullContent(); } - - - public function renderTitre($article) { - return ''; - } - - - public function renderArticleHTML($html, $article) { - return - $this->view->openBoite($article->getCacherTitre() ? '' : parent::renderTitre($article)) - .$html - .$this->view->closeBoite(); - } } ?> \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/NewsletterControllerTest.php b/tests/application/modules/admin/controllers/NewsletterControllerTest.php index 076858d001b58b80c1dc0df9fa713f0f7c7692d6..5b0af2c11e0d7c82ccffadc04173708adf51d514 100644 --- a/tests/application/modules/admin/controllers/NewsletterControllerTest.php +++ b/tests/application/modules/admin/controllers/NewsletterControllerTest.php @@ -602,7 +602,8 @@ class Admin_NewsletterControllerPostSendTestActionTest extends Admin_NewsletterC array('getId', 'sendTo', 'getExpediteur', - 'getTitre')); + 'getTitre', + 'getLastDistributionDate')); $this->nouveautes ->expects($this->atLeastOnce()) ->method('getId')