From 2f06b25d70170b7cc33dac8a6d5b9003089c0237 Mon Sep 17 00:00:00 2001 From: llaffont <laurent.laffont@gmail.com> Date: Mon, 20 Jan 2014 15:16:59 +0100 Subject: [PATCH] =?UTF-8?q?Fil=20d'arianne:=20n'affiche=20plus=20le=20titr?= =?UTF-8?q?e=20de=20la=20page=20(par=20rapport=20=C3=A0=20l'action)=20=20m?= =?UTF-8?q?ais=20le=20titre=20du=20contenu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/ZendAfi/Controller/Action/Helper/View.php | 13 ++++++++++++- library/ZendAfi/View/Helper/BarreNav.php | 6 ++++-- .../controllers/AbonneControllerFormationsTest.php | 7 ------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/library/ZendAfi/Controller/Action/Helper/View.php b/library/ZendAfi/Controller/Action/Helper/View.php index a89e93a476e..315d52f6404 100644 --- a/library/ZendAfi/Controller/Action/Helper/View.php +++ b/library/ZendAfi/Controller/Action/Helper/View.php @@ -30,7 +30,9 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View { private $ouverture_boite; // Html du haut de la boite private $fermeture_boite; // Html du bas de la boite - protected $_is_popup = false; + protected + $_is_popup = false, + $_first_subtitle = ''; public function __set($key, $val) { @@ -194,10 +196,19 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View { public function titreAdd($subtitle) { + if (!isset($this->_main_title)) + $this->_main_title = $subtitle; $this->titre = $this->getTitre() . ' - ' . $subtitle; } + public function getMainTitle() { + if (!isset($this->_main_title)) + return $this->titre; + return $this->_main_title; + } + + public function newForm($options = null) { return ZendAfi_Form::newWithOptions($options); diff --git a/library/ZendAfi/View/Helper/BarreNav.php b/library/ZendAfi/View/Helper/BarreNav.php index 73718e6614b..54a0bc3d497 100644 --- a/library/ZendAfi/View/Helper/BarreNav.php +++ b/library/ZendAfi/View/Helper/BarreNav.php @@ -36,8 +36,10 @@ class ZendAfi_View_Helper_BarreNav extends Zend_View_Helper_HtmlElement { foreach($links as $link) $html .= '<span>'.$this->view->tagAnchor($link['url'], $link['label']).'</span>'; - if ($current_action = $this->view->_current_module['preferences']['barre_nav']) - $html .= '<span>'.$current_action.'</span>'; +// if ($current_action = $this->view->_current_module['preferences']['barre_nav']) +// $html .= '<span>'.$current_action.'</span>'; + + $html .= '<span>'.$this->view->getMainTitle().'</span>'; return $html.'</div>'; } diff --git a/tests/application/modules/opac/controllers/AbonneControllerFormationsTest.php b/tests/application/modules/opac/controllers/AbonneControllerFormationsTest.php index 2e5e42930e9..a80151b7866 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerFormationsTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerFormationsTest.php @@ -305,13 +305,6 @@ class AbonneControllerFormationsListTest extends AbstractAbonneControllerFormati } - /** @test */ - public function barreNavShouldContainsLesFormations() { - $this->assertXPathContentContains('//div[@class="barre_nav"]//span', - 'Les formations'); - } - - /** @test */ public function barreNavShouldContainsMonCompte() { $this->assertXPathContentContains('//div[@class="barre_nav"]//span//a[contains(@href, "index/index?id_profil=2")]', -- GitLab