diff --git a/VERSIONS_HOTLINE/73645 b/VERSIONS_HOTLINE/73645 new file mode 100644 index 0000000000000000000000000000000000000000..cbec1e8c24b285774c1f559286178fc7785dad34 --- /dev/null +++ b/VERSIONS_HOTLINE/73645 @@ -0,0 +1,2 @@ + - ticket #73645 : Boite sitothèque : correction de la prise en charge de l'option 'flux rss'. + \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Accueil/Base.php b/library/ZendAfi/View/Helper/Accueil/Base.php index 74f50efdecd4d62fe20d27b2b398a41e1617d5e0..d8deea37c330fecf4be9457aa9cdba8554338ea0 100644 --- a/library/ZendAfi/View/Helper/Accueil/Base.php +++ b/library/ZendAfi/View/Helper/Accueil/Base.php @@ -241,16 +241,14 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac //------------------------------------------------------------------------------------------------------ public function getBoiteFromTemplate($template, $html_array) { - // Fil rss interne - if (array_isset('RSS', $html_array)) - $html_array["RSS"]= sprintf('<a href="%s" target="_blank"><img src="%s" style="border:0px" alt="%s"/></a>', - $html_array["RSS"], - URL_IMG.'rss.gif', - $this->translate()->_('flux RSS de la boite %s', - $this->preferences['titre'])); - else - $html_array["RSS"]=""; - + $html_array['RSS'] = array_isset('RSS', $html_array) + ? $this->view->tagAnchor($html_array['RSS'], + $this->view->tagImg(URL_IMG . 'rss.gif', + ['alt' => $this->_('flux RSS de la boite %s', + $this->preferences['titre'])]), + ['target' => '_blank', + 'style' => 'border: 0px;']) + : ''; // Lire le template if(file_exists($template)) diff --git a/library/ZendAfi/View/Helper/Accueil/Sito.php b/library/ZendAfi/View/Helper/Accueil/Sito.php index 733ddf6599f6fa37e074b125567cd5651be3f28a..57624a1a952a96ca081389ddb130c0ff2152ea24 100644 --- a/library/ZendAfi/View/Helper/Accueil/Sito.php +++ b/library/ZendAfi/View/Helper/Accueil/Sito.php @@ -80,7 +80,7 @@ class ZendAfi_View_Helper_Accueil_Sito extends ZendAfi_View_Helper_Accueil_Base public function getHtml() { - if ($this->getPreference('rss')) + if ($this->getPreference('rss') || $this->getPreference('rss_avis')) $this->rss_interne = $this->_getRSSurl('sito', 'sito-rss'); $strategy = $this->getStrategy(); diff --git a/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php b/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php index 2f47d8507c9fa4daa7d9c65cd6a14414593e0e1b..d8576828602b350f30e2a0dc5ba4fb88d57bcac0 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php @@ -129,6 +129,7 @@ class SitoViewHelperSelectItemsBySelectionOrderTest extends SitoViewHelperTestCa 'id_items' => '12-15', 'id_categorie' => '', 'nb_aff' => 0, + 'rss' => 1, 'display_order' => 'Selection']; /** @test */ @@ -145,6 +146,12 @@ class SitoViewHelperSelectItemsBySelectionOrderTest extends SitoViewHelperTestCa '//div/div[2]//h2//a', 'RMLL'); } + + + /** @test */ + public function rssLinkShouldBePresent() { + $this->assertXPath($this->html, '//a[contains(@href, "/sito/sito-rss")]/img'); + } } @@ -156,8 +163,16 @@ class SitoViewHelperSelectItemsBySelectionOrderPaginationTest extends SitoViewHe 'id_items' => '12-15', 'id_categorie' => '', 'nb_aff' => 1, + 'rss_avis' => 1, 'display_order' => 'Selection']; + + /** @test */ + public function rssLinkShouldBePresent() { + $this->assertXPath($this->html, '//a[contains(@href, "/sito/sito-rss")]/img'); + } + + /** @test */ public function firstPageShoulNotContainsRMLL() { $this->assertNotXPathContentContains($this->html,