From 5d28de62c91e49bca3bbfa5f3b10b190f5446db7 Mon Sep 17 00:00:00 2001
From: llaffont <laurent.laffont@gmail.com>
Date: Mon, 20 Jan 2014 17:24:30 +0100
Subject: [PATCH] Correction fil Ariane en index de sous page

---
 library/ZendAfi/Controller/Action/Helper/View.php  | 14 +++++++-------
 library/ZendAfi/View/Helper/BarreNav.php           |  3 ++-
 .../controllers/ProfilOptionsControllerTest.php    |  7 +++++++
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/library/ZendAfi/Controller/Action/Helper/View.php b/library/ZendAfi/Controller/Action/Helper/View.php
index 87e507f23e6..0f899cc9af5 100644
--- a/library/ZendAfi/Controller/Action/Helper/View.php
+++ b/library/ZendAfi/Controller/Action/Helper/View.php
@@ -35,11 +35,6 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View {
 		$_first_subtitle = '';
 
 
-	public function __set($key, $val) {
-		 $this->$key = $val;
-	}
-
-
 	public function init() {
 		parent::init();
 
@@ -207,12 +202,17 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View {
 
 
 	public function getMainTitle() {
-		if (!isset($this->_main_title))
-			return $this->titre;
 		return $this->_main_title;
 	}
 
 
+	public function __set($key, $val) {
+		$this->$key = $val;
+		//	if (($key == 'titre') && !isset($this->_main_title))
+//			$this->_main_title = $val;
+	}
+
+
 
 	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 54a0bc3d497..c5de207b96d 100644
--- a/library/ZendAfi/View/Helper/BarreNav.php
+++ b/library/ZendAfi/View/Helper/BarreNav.php
@@ -39,7 +39,8 @@ class ZendAfi_View_Helper_BarreNav extends Zend_View_Helper_HtmlElement {
 //		if ($current_action = $this->view->_current_module['preferences']['barre_nav'])
 //			$html .= '<span>'.$current_action.'</span>';
 
-		$html .= '<span>'.$this->view->getMainTitle().'</span>';
+		if ($content = $this->view->getMainTitle())
+			$html .= '<span>'.$content.'</span>';
 
 		return $html.'</div>';
 	}
diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php
index dc408ab468e..4bd6e62fbf1 100644
--- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php
+++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php
@@ -860,6 +860,13 @@ class ProfilOptionsControllerProfilJeunesseViewPageJeuxTest extends ProfilOption
 	public function boiteKiosqueTitleShouldLinkToMenuCatalogue() {
 		$this->assertXPath("//div[@class='boite kiosque']//div//a[contains(@href, 'recherche/simple/titre/Kiosque/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/rss_avis/1/id_catalogue/0/id_panier/0/boite/boite_de_la_division_gauche')]");
 	}
+
+
+	/** @test */
+	public function barreNavShouldContainsOneLinkToPageJeux() {
+		$this->assertXPathCount('//div[@class="barre_nav"]//span//a[contains(@href, "?id_profil=12")]', 1);
+	}
+
 }
 
 
-- 
GitLab