diff --git a/application/modules/opac/controllers/DomainsController.php b/application/modules/opac/controllers/DomainsController.php index 593948728ad5a117f3351a1de86895292105a2af..65b152c5c16e9c9d1f67d5a328ecdedb59c62bae 100644 --- a/application/modules/opac/controllers/DomainsController.php +++ b/application/modules/opac/controllers/DomainsController.php @@ -26,17 +26,20 @@ class DomainsController extends ZendAfi_Controller_Action { return; } + + $id_module = $this->_getParam('id_module'); if (!$catalog->hasSousDomaines()){ $this->_redirect($this->view->url(array_filter(['controller' => 'recherche', 'action' => 'simple', 'id_catalogue' => $catalog->getId(), - 'id_module' => $this->_getParam('id_module')]), + 'id_module' => $id_module]), null, true)); return; } + $this->view->module_preferences = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences($id_module); $this->view->current_domain = $catalog; - $this->view->id_module = $this->_getParam('id_module'); + $this->view->id_module = $id_module; $this->view->current_breadcrumb = $this->_getParam('parents'); } } diff --git a/application/modules/opac/views/scripts/domains/browse.phtml b/application/modules/opac/views/scripts/domains/browse.phtml index 4d78fa2aa43085a47b349f1ad8a01259fdba2fe6..2ce8d569424a56311b7b9000deed8c3ef1fe9601 100644 --- a/application/modules/opac/views/scripts/domains/browse.phtml +++ b/application/modules/opac/views/scripts/domains/browse.phtml @@ -2,6 +2,6 @@ $this->openBoite(''); echo $this->renderDomainBrowser($this->current_domain, $this->id_module, - $this->preferences); + $this->module_preferences); $this->closeBoite(); ?> diff --git a/library/Class/Systeme/ModulesAccueil/DomainBrowser.php b/library/Class/Systeme/ModulesAccueil/DomainBrowser.php index 84285ffb3f350290c5ef6b51ce30d89586f2902f..bc165282540694286086e015eb765cc0147b5ba1 100644 --- a/library/Class/Systeme/ModulesAccueil/DomainBrowser.php +++ b/library/Class/Systeme/ModulesAccueil/DomainBrowser.php @@ -35,7 +35,7 @@ class Class_Systeme_ModulesAccueil_DomainBrowser extends Class_Systeme_ModulesAc protected $_defaultValues = ['titre' => 'Domaines', 'root_domain_id' => 0, - 'display_mode' => Class_Systeme_ModulesAppli::LISTE_FORMAT_MUR]; + 'display_mode' => Class_Systeme_ModulesAppli::LISTE_FORMAT_ACCORDEON]; diff --git a/library/ZendAfi/Controller/Action/Helper/View.php b/library/ZendAfi/Controller/Action/Helper/View.php index 2516decd3358742ef9b604b92aa7f1a85bed67cc..8f53b86a20bdc9ec2b16ec209e4e674aafaa2b7a 100644 --- a/library/ZendAfi/Controller/Action/Helper/View.php +++ b/library/ZendAfi/Controller/Action/Helper/View.php @@ -44,7 +44,7 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View { $this->setEncoding('UTF-8'); $this->setEscape('htmlentities'); - $this->doctype('XHTML1_TRANSITIONAL'); + $this->doctype('HTML5'); } diff --git a/library/ZendAfi/View/Helper/RenderDomainBrowser.php b/library/ZendAfi/View/Helper/RenderDomainBrowser.php index a2560297b37e1e1d2ac8feef595e1f84d0d7d0b3..91e3cff574be17728fc5974aa38781fb10fe1bdc 100644 --- a/library/ZendAfi/View/Helper/RenderDomainBrowser.php +++ b/library/ZendAfi/View/Helper/RenderDomainBrowser.php @@ -31,6 +31,7 @@ class ZendAfi_View_Helper_RenderDomainBrowser extends ZendAfi_View_Helper_BaseHe $this->_pref = $preferences; $display_mode = $this->_pref["display_mode"]; + xdebug_break(); $this->renderer = $display_mode == Class_Systeme_ModulesAppli::LISTE_FORMAT_MUR ? new ZendAfi_View_Helper_RenderDomainBrowser_Wall($this->view) : new ZendAfi_View_Helper_RenderDomainBrowser_List($this->view); @@ -75,7 +76,6 @@ class ZendAfi_View_Helper_RenderDomainBrowser extends ZendAfi_View_Helper_BaseHe protected function getBrowsingUrl($domain) { - xdebug_break(); if ($domain->getId()==$this->_pref['root_domain_id']) return $this->view->url([], null, true); $params = $domain->hasSousDomaines() @@ -102,37 +102,28 @@ class ZendAfi_View_Helper_RenderDomainBrowser_Wall{ public function __construct($view) { $this->_view = $view; - Class_ScriptLoader::getInstance() - ->addOPACScript('liste_notices_mur') - ->loadPrettyPhoto(); } - public function children($html) { return $this->_view->tag('div', - $this->_view->tag('div', $html), - ['class' => 'liste_mur children_domains']); + $html, + ['class' => 'liste_mur children_domains']); } public function breadcrumb($html) { - return $this->_view->tag('div', - $this->_view->tag('div', $html), - ['class' => 'liste_mur breadcrumb_domains']); + return $this->_view->tag('div', + $html, + ['class' => 'liste_mur breadcrumb_domains']); } public function display($url, $img, $title){ - $view = $this->_view; - return $view->tag('div', - $view->tag('div', - $view->tag('div',$view->tagAnchor($url, - $img . $view->tag('span', - $title, - ['class' => 'titre_auteur'])), - ['class' => 'notice']), - ['class' => 'notice_wrapper']), - ['style' => 'float:left;list-style-type:none;']); + return $this->_view->tag('div', + $this->_view->tagAnchor($url, + $img . $this->_view->tag('span', + $title, + ['class' => 'titre_auteur']))); } } diff --git a/library/ZendAfi/View/Helper/Tag.php b/library/ZendAfi/View/Helper/Tag.php index cffaa71a1f5b0a8aa0faee969c6876be4fa4f7b4..8459b6c41d76244bdecb0b95444cf3bf1459db90 100644 --- a/library/ZendAfi/View/Helper/Tag.php +++ b/library/ZendAfi/View/Helper/Tag.php @@ -20,9 +20,9 @@ */ class ZendAfi_View_Helper_Tag extends Zend_View_Helper_HtmlElement { - public function tag($name, $content='', $attribs=[]) { + public function tag($name, $content=null, $attribs=[]) { $html = '<' . $name . ' ' . $this->_htmlAttribs($attribs); - if (!$content) + if (null === $content) return $html . $this->getClosingBracket(); return $html . '>' . $content . '</' . $name . '>'; } diff --git a/library/storm b/library/storm index ce4ba4ba1adcae6c4c8c647a7cc6ff4991f5d86d..730b5eac0be527ed2df482e21f7ba9b9489653c8 160000 --- a/library/storm +++ b/library/storm @@ -1 +1 @@ -Subproject commit ce4ba4ba1adcae6c4c8c647a7cc6ff4991f5d86d +Subproject commit 730b5eac0be527ed2df482e21f7ba9b9489653c8 diff --git a/public/opac/css/global.css b/public/opac/css/global.css index 361d20a7f5552aa39b3e241e2229905781f387aa..5c7873f4db8541e32cd9c1367ba3576dbc99098c 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -1399,10 +1399,12 @@ body.abonne_multimedia-hold-view .actions a { .liste_mur { float: left; + width: 100%; } -.liste_mur .notice_wrapper { +.liste_mur .notice_wrapper, +.liste_mur>div { float: left; height: 150px; width: 100px; diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index a6abf1baa63bd71406a61ebf8c138298b18de19b..2e101cf3c0b9cd5a888c9deb5c59fbd8f4567015 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -1467,7 +1467,7 @@ class RechercheControllerSimpleActionWithCatalogueAndDomainBrowserWidgetTest ext 'root_domain_id' =>4 ]]) ->updateModuleConfigAccueil(10, - ['type_module' => 'NEWS', + ['type_module' => 'RSS', 'division' => 1, 'id_module' => 10, ]); @@ -1499,6 +1499,13 @@ class RechercheControllerSimpleActionWithCatalogueAndDomainBrowserWidgetTest ext } + /** @test */ + public function onRechercheSimpleCatalogue3IdModule9BreadcrumbPageShouldBeHtml5Valid() { + $this->dispatch('/recherche/simple/id_catalogue/3/id_module/9', true); + $this->assertHTML5(); + } + + /** @test */ public function onRechercheSimpleCatalogue3IdModule10BreadcrumbShouldNotBeDisplayed() { $this->dispatch('/recherche/simple/id_catalogue/3/id_module/10', true); diff --git a/tests/library/ZendAfi/View/Helper/Accueil/DomainBrowserTest.php b/tests/library/ZendAfi/View/Helper/Accueil/DomainBrowserTest.php index 20f206e458e7855c29b19270292db05304d5ec17..ff584bfc18d46895e65941f3170b887d403b445b 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/DomainBrowserTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/DomainBrowserTest.php @@ -94,14 +94,6 @@ abstract class ZendAfi_View_Helper_Accueil_DomainBrowserWithDefaultSettingsTestC public function setUp() { parent::setUp(); - Class_Profil::getCurrentProfil()-> - updateModuleConfigAccueil(9, - ['type_module' => 'DOMAIN_BROWSER', - 'division' => 1, - 'id_module' => 9, - 'preferences' => ['display_mode' => Class_Systeme_ModulesAppli::LISTE_FORMAT_ACCORDEON, - 'root_domain_id' =>0 - ]]); $this->helper = new ZendAfi_View_Helper_Accueil_DomainBrowser(9, [ 'division' => 1,