diff --git a/library/ZendAfi/Controller/Action/Helper/View.php b/library/ZendAfi/Controller/Action/Helper/View.php index e9e72e10f943c3833cb36db890400572d3d3ba94..a89e93a476ebf3ef5a2e198cc54f691aeed16de0 100644 --- a/library/ZendAfi/Controller/Action/Helper/View.php +++ b/library/ZendAfi/Controller/Action/Helper/View.php @@ -152,13 +152,18 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View { //------------------------------------------------------------------------------------------------------ // ouverture d'une boite //------------------------------------------------------------------------------------------------------ - public function openBoite($titre) { + + public function openBoiteContent($titre) { if ($titre) $titre = $this->_($titre); $html=str_replace("[=TITRE=]", $titre, $this->ouverture_boite); - print($html); - $this->titreAdd(strip_tags($titre)); + return $html; + } + + + public function openBoite($titre) { + print($this->openBoiteContent($titre)); } //------------------------------------------------------------------------------------------------------ @@ -170,6 +175,12 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View { } + public function closeBoiteContent() + { + return $this->fermeture_boite; + } + + // Génère le titre de la page public function getTitre() { if (isset($this->titre)) diff --git a/library/ZendAfi/View/Helper/Article/RenderContainer/Boite.php b/library/ZendAfi/View/Helper/Article/RenderContainer/Boite.php index 4cd9a8c796f050952203587c3585cb89da98914e..55f5abde7b0e6fe7a1295dbdf07a30caf5f127c6 100644 --- a/library/ZendAfi/View/Helper/Article/RenderContainer/Boite.php +++ b/library/ZendAfi/View/Helper/Article/RenderContainer/Boite.php @@ -26,11 +26,11 @@ class ZendAfi_View_Helper_Article_RenderContainer_Boite extends ZendAfi_View_Hel public function renderArticleHTML($html, $article) { return - $this->view->openBoite($article->getCacherTitre() + $this->view->openBoiteContent($article->getCacherTitre() ? '' : $this->view->getHelper('Article_RenderContainer_Empty')->renderTitre($article)) .$html - .$this->view->closeBoite(); + .$this->view->closeBoiteContent(); } } diff --git a/tests/application/modules/opac/controllers/CmsControllerTest.php b/tests/application/modules/opac/controllers/CmsControllerTest.php index 6b14ff504735148a37533f0c0a0a4e1de59de4a3..6e124ccb07707b51acdc1b10949ccedd0d48b8f3 100644 --- a/tests/application/modules/opac/controllers/CmsControllerTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerTest.php @@ -673,7 +673,7 @@ class CmsControllerArticleViewTest extends CmsControllerWithFeteDeLaFriteTestCas /** @test */ public function titleShouldBeFeteDeLaFrite() { - $this->assertXpathContentContains('//h1', 'La fête de la frite'); + $this->assertXpathContentContains('//h1', 'La fête de la frite',$this->_response->getBody()); } @@ -767,7 +767,7 @@ class CmsControllerArticleViewTest extends CmsControllerWithFeteDeLaFriteTestCas /** @test */ public function contentShouldBePresent() { - $this->assertXpathContentContains('//div', 'Une fête appétissante'); + $this->assertXpathContentContains('//div[@class="contenu"]', 'Une fête appétissante'); }