diff --git a/VERSIONS_WIP/156997 b/VERSIONS_WIP/156997 new file mode 100644 index 0000000000000000000000000000000000000000..654255f081f8db9f4f0f47d5e30d28351dd6c7b9 --- /dev/null +++ b/VERSIONS_WIP/156997 @@ -0,0 +1 @@ + - fonctionnalité #156997 : Amélioration du système de fichiers du magasin de thèmes. \ No newline at end of file diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index 15289125c4f0962ca896aba40507f8ade08fabb0..3422f8cf9edf17b0529dd5838761afd63e46f9d5 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -272,8 +272,8 @@ class CmsController extends ZendAfi_Controller_Action { if (!$this->_getParam('render') === 'ajax') return; - $content = $this->view->calendarLinkToAll($this->view->calendar, - $this->view->preferences); + $content = $this->view->calendarContentForAjax($this->view->calendar, + $this->view->preferences); $this->_helper->getHelper('HTMLAjaxResponse') ->htmlAjaxResponseWithScript($content); diff --git a/doc/magasin_themes.fr.md b/doc/magasin_themes.fr.md index e7f94c36213f722258de5d15921017785dd05eca..0b771ba665286e87c5325414fa2815b2fd3d3133 100644 --- a/doc/magasin_themes.fr.md +++ b/doc/magasin_themes.fr.md @@ -15,9 +15,9 @@ Un profil te donnera toujours un thème courant : historique si la colonne templ Intonation est le theme "parent". Tous les autres themes apportent des petites variations, a l'exception du theme Chili qui surcharge certaines fonctions de Intonation. -La librairie de composant graphique utilisee se trouve dans Intonation/View. +La librairie de composant graphique utilisee se trouve dans library/ZendAfi/View/Helper/Template ainsi que dans library/ZendAfi/View/Helper/[thème courant ex:Intonation]. -C'est un objet wrapper qui utilise une interface qui va faire la liaison entre un modele et un composant d'affichage. +C'est un objet wrapper qui utilise une API qui va faire la liaison entre un modele et un composant d'affichage. Le Wrapper est l'objet qui va permettre a la vue de recuperer des proprietes d'objets, quelle que soit le type d'objet qui est affiché. @@ -41,9 +41,10 @@ Intonation/Library/Widget/Carousell/View.php Intonation_View_RenderWallGrid Intonation_View_RenderMap -Les rendus de wrapper Intonation/View: - CardifyFullDescription.php - CardifyHorizontal.php - CardifyOnlyDescription.php - Cardify.php - CardifyWithOverlay.php \ No newline at end of file +Les rendus de wrapper library/ZendAfi/View/Helper/Template: + + RenderingAllDescription.php + RenderingHorizontal.php + RenderingDescription.php + RenderingVertical.php + RenderingOnlyImage.php \ No newline at end of file diff --git a/library/ZendAfi/Controller/Action/Helper/Ajax.php b/library/ZendAfi/Controller/Action/Helper/Ajax.php index 5df238e84adcc0b00abbcf411c434aebefbbe352..955443be47915208ca7a304c26c79aeee08707f8 100644 --- a/library/ZendAfi/Controller/Action/Helper/Ajax.php +++ b/library/ZendAfi/Controller/Action/Helper/Ajax.php @@ -34,7 +34,7 @@ class ZendAfi_Controller_Action_Helper_Ajax extends ZendAfi_Controller_Action_He if (!$html = $callback()) return $this->getResponse()->setHttpResponseCode(404); - $ajax = (new Intonation_View_Ajax(Class_Template::current(), $this->_view)) + $ajax = (new ZendAfi_View_Helper_Template_Ajax(Class_Template::current(), $this->_view)) ->setBody($html); $this->_response->setHeader('Content-Type', 'text/html;charset=utf-8'); diff --git a/library/ZendAfi/Controller/Action/Helper/ViewRenderer.php b/library/ZendAfi/Controller/Action/Helper/ViewRenderer.php index 0bec9b470e4e9c0b104191be8e059f46f1345efe..f1a1c6e6be4ecc68f26b69a638624366678a19cc 100644 --- a/library/ZendAfi/Controller/Action/Helper/ViewRenderer.php +++ b/library/ZendAfi/Controller/Action/Helper/ViewRenderer.php @@ -84,6 +84,7 @@ class ZendAfi_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Acti $this->view->addHelperPath('ZendAfi/View/Helper/Java', 'ZendAfi_View_Helper_Java'); $this->view->addHelperPath('ZendAfi/View/Helper/Accueil', 'ZendAfi_View_Helper_Accueil'); $this->view->addScriptPath('.' . $profil_path . 'html'); + Class_Template::current()->addAdminHelperPath($this->view); Class_Template::current()->addHelperPath($this->view); return $this; diff --git a/library/templates/Intonation/View/Abonne.php b/library/ZendAfi/View/Helper/Template/Abonne.php similarity index 85% rename from library/templates/Intonation/View/Abonne.php rename to library/ZendAfi/View/Helper/Template/Abonne.php index 6883f51cf755f787e968f830bd75ea09bc85f4e8..4822b4b13dfef5e6514a665cf6cae6cb5d67e6fb 100644 --- a/library/templates/Intonation/View/Abonne.php +++ b/library/ZendAfi/View/Helper/Template/Abonne.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2019, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2022, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,7 +20,7 @@ */ -class Intonation_View_Abonne extends ZendAfi_View_Helper_BaseHelper { +class ZendAfi_View_Helper_Template_Abonne extends ZendAfi_View_Helper_BaseHelper { public function abonne($user) { return $this->view->jumbotron_Abonne($user); diff --git a/library/templates/Intonation/View/AddBootstrap.php b/library/ZendAfi/View/Helper/Template/AddBootstrap.php similarity index 95% rename from library/templates/Intonation/View/AddBootstrap.php rename to library/ZendAfi/View/Helper/Template/AddBootstrap.php index f71fbb754db53aa94690b8eff5f251b73a810b23..83978940413fefed5106caf9655f5bdb093d9fb2 100644 --- a/library/templates/Intonation/View/AddBootstrap.php +++ b/library/ZendAfi/View/Helper/Template/AddBootstrap.php @@ -20,7 +20,7 @@ */ -class Intonation_View_AddBootstrap extends ZendAfi_View_Helper_BaseHelper { +class ZendAfi_View_Helper_Template_AddBootstrap extends ZendAfi_View_Helper_BaseHelper { public function addBootstrap($script_loader = null) { $script_loader = $script_loader ? $script_loader diff --git a/library/templates/Intonation/View/AdvancedSearch.php b/library/ZendAfi/View/Helper/Template/AdvancedSearch.php similarity index 86% rename from library/templates/Intonation/View/AdvancedSearch.php rename to library/ZendAfi/View/Helper/Template/AdvancedSearch.php index 0b815986d468505ffe3e37148c74d8ab88f15d74..51588af932dec7fa4a45d6e23136a4c0a5db1250 100644 --- a/library/templates/Intonation/View/AdvancedSearch.php +++ b/library/ZendAfi/View/Helper/Template/AdvancedSearch.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2019, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2022, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,8 +20,10 @@ */ -class Intonation_View_AdvancedSearch extends ZendAfi_View_Helper_AdvancedSearch { - protected function _renderHtml($html) { +class ZendAfi_View_Helper_Template_AdvancedSearch + extends ZendAfi_View_Helper_AdvancedSearch { + + protected function _renderHtml($html) { $this->view->titre = $this->view->_current_module['preferences']['titre']; $title = $this->_tag('h1', diff --git a/library/templates/Intonation/View/Ajax.php b/library/ZendAfi/View/Helper/Template/Ajax.php similarity index 94% rename from library/templates/Intonation/View/Ajax.php rename to library/ZendAfi/View/Helper/Template/Ajax.php index 24e5de528bd92900ef87b59c84fe1cbb48696e77..d2fa3a182297fec94588ec868b79c310394922ee 100644 --- a/library/templates/Intonation/View/Ajax.php +++ b/library/ZendAfi/View/Helper/Template/Ajax.php @@ -20,7 +20,7 @@ */ -class Intonation_View_Ajax extends Intonation_View_Opac { +class ZendAfi_View_Helper_Template_Ajax extends Intonation_View_Opac { protected $_body; @@ -40,4 +40,4 @@ class Intonation_View_Ajax extends Intonation_View_Opac { return $head . $this->_body; } -} \ No newline at end of file +} diff --git a/library/templates/Intonation/View/AlbumAudioJsPlayer.php b/library/ZendAfi/View/Helper/Template/AlbumAudioJsPlayer.php similarity index 93% rename from library/templates/Intonation/View/AlbumAudioJsPlayer.php rename to library/ZendAfi/View/Helper/Template/AlbumAudioJsPlayer.php index f57f0027b42cacb8374578f67d7df36f92ee3b5f..e25d40cfed3fa574003bfc3fdebcf0f3e1ee6a42 100644 --- a/library/templates/Intonation/View/AlbumAudioJsPlayer.php +++ b/library/ZendAfi/View/Helper/Template/AlbumAudioJsPlayer.php @@ -20,7 +20,8 @@ */ -class Intonation_View_AlbumAudioJsPlayer extends ZendAfi_View_Helper_BaseHelper { +class ZendAfi_View_Helper_Template_AlbumAudioJsPlayer extends ZendAfi_View_Helper_BaseHelper { + public function albumAudioJsPlayer($album) { $tracks = (new Storm_Model_Collection($album->getAudioTracks())) ->collect(function($track) diff --git a/library/templates/Intonation/View/BookmarkedSearches.php b/library/ZendAfi/View/Helper/Template/BookmarkedSearches.php similarity index 94% rename from library/templates/Intonation/View/BookmarkedSearches.php rename to library/ZendAfi/View/Helper/Template/BookmarkedSearches.php index 13043d396620ff6a3c7f55f80d29e4acb4e60a9f..f53c5e6c1586dd99bf1be7bcbd8dd0bddcc5fee0 100644 --- a/library/templates/Intonation/View/BookmarkedSearches.php +++ b/library/ZendAfi/View/Helper/Template/BookmarkedSearches.php @@ -20,7 +20,7 @@ */ -class Intonation_View_BookmarkedSearches extends ZendAfi_View_Helper_BaseHelper { +class ZendAfi_View_Helper_Template_BookmarkedSearches extends ZendAfi_View_Helper_BaseHelper { public function bookmarkedSearches($searches) { $searches = array_map(function($search) @@ -31,7 +31,7 @@ class Intonation_View_BookmarkedSearches extends ZendAfi_View_Helper_BaseHelper }, $searches); $callback = function($wrapped) { - return $this->view->cardifyHorizontal($wrapped); + return $this->view->renderingHorizontal($wrapped); }; $html = $this->_tag('h3', @@ -57,4 +57,4 @@ class Intonation_View_BookmarkedSearches extends ZendAfi_View_Helper_BaseHelper ->setImage($this->view->templateIco('no-selection', 'library'))]); } -} \ No newline at end of file +} diff --git a/library/templates/Intonation/View/CalendarContent.php b/library/ZendAfi/View/Helper/Template/CalendarContent.php similarity index 94% rename from library/templates/Intonation/View/CalendarContent.php rename to library/ZendAfi/View/Helper/Template/CalendarContent.php index bfbf21fc4d11360079ccf6cfbc96459e4b5e1352..0038be375e5993bb8c18114b5003aa3b103d4c32 100644 --- a/library/templates/Intonation/View/CalendarContent.php +++ b/library/ZendAfi/View/Helper/Template/CalendarContent.php @@ -20,7 +20,8 @@ */ -class Intonation_View_CalendarContent extends ZendAfi_View_Helper_CalendarContent { +class ZendAfi_View_Helper_Template_CalendarContent extends ZendAfi_View_Helper_CalendarContent { + protected function _renderHTML($calendar, $settings) { Class_ScriptLoader::getInstance()->addOPACScript('calendrier'); diff --git a/library/templates/Intonation/View/CalendarLinkToAll.php b/library/ZendAfi/View/Helper/Template/CalendarContentForAjax.php similarity index 89% rename from library/templates/Intonation/View/CalendarLinkToAll.php rename to library/ZendAfi/View/Helper/Template/CalendarContentForAjax.php index fbff5ab69e2656d6674bc3668183fcd1cf423d48..1622b148eb2a86dc185a8f176f27aac0195c66f0 100644 --- a/library/templates/Intonation/View/CalendarLinkToAll.php +++ b/library/ZendAfi/View/Helper/Template/CalendarContentForAjax.php @@ -20,8 +20,8 @@ */ -class Intonation_View_CalendarLinkToAll extends Intonation_View_CalendarContent { - public function calendarLinkToAll($calendar, $settings) { +class ZendAfi_View_Helper_Template_CalendarContentForAjax extends ZendAfi_View_Helper_Template_CalendarContent { + public function calendarContentForAjax($calendar, $settings) { $temp_settings = []; if (is_array($settings)) { foreach($settings as $key => $value) diff --git a/library/templates/Intonation/View/CardHelper.php b/library/ZendAfi/View/Helper/Template/CardHelper.php similarity index 92% rename from library/templates/Intonation/View/CardHelper.php rename to library/ZendAfi/View/Helper/Template/CardHelper.php index 65524d34f8cf90c81172464f2fa39bfb97aaa265..3a0b6bf5210eb16cf1a0fa441a06c4446e587409 100644 --- a/library/templates/Intonation/View/CardHelper.php +++ b/library/ZendAfi/View/Helper/Template/CardHelper.php @@ -20,7 +20,8 @@ */ -class Intonation_View_CardHelper extends ZendAfi_View_Helper_BaseHelper { +abstract class ZendAfi_View_Helper_Template_CardHelper extends ZendAfi_View_Helper_BaseHelper { + protected function _addTitle($element, $content) { $element_class = get_class($element); if (!$main_title = $element->getMainTitle()) @@ -35,8 +36,7 @@ class Intonation_View_CardHelper extends ZendAfi_View_Helper_BaseHelper { } - - public function _getTitleLink($main_title, $element) { + protected function _getTitleLink($main_title, $element) { if (! $link = $element->getMainLink()) return $main_title; diff --git a/library/templates/Intonation/View/DriveCheckoutPlan.php b/library/ZendAfi/View/Helper/Template/DriveCheckoutPlan.php similarity index 92% rename from library/templates/Intonation/View/DriveCheckoutPlan.php rename to library/ZendAfi/View/Helper/Template/DriveCheckoutPlan.php index 1b55a8767737a021b9d41fa76f638b9b3e120536..93a3736faba51bd9a58f7dd3c6afe774130483bc 100644 --- a/library/templates/Intonation/View/DriveCheckoutPlan.php +++ b/library/ZendAfi/View/Helper/Template/DriveCheckoutPlan.php @@ -20,7 +20,9 @@ */ -class Intonation_View_DriveCheckoutPlan extends Intonation_View_Jumbotron_Abstract { +class ZendAfi_View_Helper_Template_DriveCheckoutPlan + extends Intonation_View_Jumbotron_Abstract { + public function driveCheckoutPlan($plan) { return $this->_core($plan); } diff --git a/library/templates/Intonation/View/DNone.php b/library/ZendAfi/View/Helper/Template/HideContentForJS.php similarity index 86% rename from library/templates/Intonation/View/DNone.php rename to library/ZendAfi/View/Helper/Template/HideContentForJS.php index af78c652013e95a592049d2a641bb7aa33d36eae..6c0d0e93cfc636729565fac81357129248cf0ca2 100644 --- a/library/templates/Intonation/View/DNone.php +++ b/library/ZendAfi/View/Helper/Template/HideContentForJS.php @@ -20,8 +20,10 @@ */ -class Intonation_View_DNone extends ZendAfi_View_Helper_BaseHelper { - public function dNone($html) { +class ZendAfi_View_Helper_Template_HideContentForJS + extends ZendAfi_View_Helper_BaseHelper { + + public function hideContentForJS($html) { $text = preg_replace('/(<(script|style|link)\b[^>]*>).*?(<\/\2>)/is', "", $html); $text = str_replace( '<', ' <', $text); @@ -30,6 +32,6 @@ class Intonation_View_DNone extends ZendAfi_View_Helper_BaseHelper { $text = preg_replace('/(\p{P}|\t|\n|\v|\f|\r| |\xC2\x85|\xc2\xa0|\xe1\xa0\x8e|\xe2\x80[\x80-\x8D]|\xe2\x80\xa8|\xe2\x80\xa9|\xe2\x80\xaF|\xe2\x81\x9f|\xe2\x81\xa0|\xe3\x80\x80|\xef\xbb\xbf)+/', ' ', $text); - return $this->view->div(['class' => 'hidde_content'], $text); + return $this->_div(['class' => 'hidde_content'], $text); } } diff --git a/library/templates/Intonation/View/CardifyFullDescription.php b/library/ZendAfi/View/Helper/Template/RenderingAllDescription.php similarity index 89% rename from library/templates/Intonation/View/CardifyFullDescription.php rename to library/ZendAfi/View/Helper/Template/RenderingAllDescription.php index d516debe3c8656fa8e9d69aa3779a12dbf1aaefc..dbfa27f6dd6e4303f78e16fa323cdb241f3fe421 100644 --- a/library/templates/Intonation/View/CardifyFullDescription.php +++ b/library/ZendAfi/View/Helper/Template/RenderingAllDescription.php @@ -20,9 +20,9 @@ */ -class Intonation_View_CardifyFullDescription extends Intonation_View_CardHelper { +class ZendAfi_View_Helper_Template_RenderingAllDescription extends ZendAfi_View_Helper_Template_CardHelper { - public function cardifyFullDescription($element) { + public function renderingAllDescription($element) { $content = [$element->getContentForJSSearch()]; $content = $this->_addTitle($element, $content); @@ -48,7 +48,7 @@ class Intonation_View_CardifyFullDescription extends Intonation_View_CardHelper $html [] = $this->view->renderActionsInRow(array_merge([$element->getMainLink()], $element->getActions())); - return $this->view->div(['class' => 'card'], + return $this->view->div(['class' => 'card rendering_all_description'], implode($html)); } -} \ No newline at end of file +} diff --git a/library/templates/Intonation/View/CardifyOnlyDescription.php b/library/ZendAfi/View/Helper/Template/RenderingDescription.php similarity index 94% rename from library/templates/Intonation/View/CardifyOnlyDescription.php rename to library/ZendAfi/View/Helper/Template/RenderingDescription.php index 92aa9b276523a0b2c7782c7ab142a2a7ac1dbb5b..3b788fbabafe70ec8b75c4ccd75f7d868589e8d3 100644 --- a/library/templates/Intonation/View/CardifyOnlyDescription.php +++ b/library/ZendAfi/View/Helper/Template/RenderingDescription.php @@ -20,9 +20,9 @@ */ -class Intonation_View_CardifyOnlyDescription extends Intonation_View_CardHelper { +class ZendAfi_View_Helper_Template_RenderingDescription extends ZendAfi_View_Helper_Template_CardHelper { - public function cardifyOnlyDescription($element, $img = '') { + public function renderingDescription($element, $img = '') { $element_class = get_class($element); $content = [$element->getContentForJSSearch()]; $content = $this->_addTitle($element, $content); @@ -68,4 +68,4 @@ class Intonation_View_CardifyOnlyDescription extends Intonation_View_CardHelper . implode($html), ['class' => 'card card_template card_' . $element_class]); } -} \ No newline at end of file +} diff --git a/library/templates/Intonation/View/CardifyHorizontal.php b/library/ZendAfi/View/Helper/Template/RenderingHorizontal.php similarity index 94% rename from library/templates/Intonation/View/CardifyHorizontal.php rename to library/ZendAfi/View/Helper/Template/RenderingHorizontal.php index f4fc8b0a356c1be136cc1e4b08898d06ff7fa609..3121da15cb381c52ee20615ec4aebf78acfe2fe4 100644 --- a/library/templates/Intonation/View/CardifyHorizontal.php +++ b/library/ZendAfi/View/Helper/Template/RenderingHorizontal.php @@ -20,7 +20,7 @@ */ -class Intonation_View_CardifyHorizontal extends Intonation_View_CardHelper { +class ZendAfi_View_Helper_Template_RenderingHorizontal extends ZendAfi_View_Helper_Template_CardHelper { protected @@ -29,7 +29,7 @@ class Intonation_View_CardifyHorizontal extends Intonation_View_CardHelper { $_actions_class = 'cardify_horizontal_actions'; - public function cardifyHorizontal($element) { + public function renderingHorizontal($element) { $img = $this->view->tagMedia($element, ['class' => 'img-thumbnail', 'aria-hidden' => 'true']); diff --git a/library/templates/Intonation/View/CardifyWithOverlay.php b/library/ZendAfi/View/Helper/Template/RenderingOnlyImage.php similarity index 90% rename from library/templates/Intonation/View/CardifyWithOverlay.php rename to library/ZendAfi/View/Helper/Template/RenderingOnlyImage.php index bd362ede92e5dae08bed3253a36b0ca7ce013322..5ef02f205fba4a1f0f95d9f332ca9f74d96f3661 100644 --- a/library/templates/Intonation/View/CardifyWithOverlay.php +++ b/library/ZendAfi/View/Helper/Template/RenderingOnlyImage.php @@ -20,10 +20,10 @@ */ -class Intonation_View_CardifyWithOverlay extends ZendAfi_View_Helper_BaseHelper { +class ZendAfi_View_Helper_Template_RenderingOnlyImage + extends ZendAfi_View_Helper_BaseHelper { - - public function cardifyWithOverlay($element) { + public function renderingOnlyImage($element) { return $this->_tag('div', $element->getAnchor() . $this->_cardWithPicture($element), @@ -42,4 +42,4 @@ class Intonation_View_CardifyWithOverlay extends ZendAfi_View_Helper_BaseHelper return $img . $this->view->div(['class' => 'card_overlay'], $overlay); } -} \ No newline at end of file +} diff --git a/library/templates/Intonation/View/Cardify.php b/library/ZendAfi/View/Helper/Template/RenderingVertical.php similarity index 83% rename from library/templates/Intonation/View/Cardify.php rename to library/ZendAfi/View/Helper/Template/RenderingVertical.php index 6cd6b2834ba1a75b9b46a224b08a94b9342e7c7c..3e0b36debf9457e1b5ebf0889cfcfdf06a37b64e 100644 --- a/library/templates/Intonation/View/Cardify.php +++ b/library/ZendAfi/View/Helper/Template/RenderingVertical.php @@ -20,12 +20,13 @@ */ -class Intonation_View_Cardify extends ZendAfi_View_Helper_BaseHelper { - public function cardify($element) { +class ZendAfi_View_Helper_Template_RenderingVertical extends ZendAfi_View_Helper_BaseHelper { + + public function renderingVertical($element) { $img = $this->view->tagMedia($element, ['class' => 'card-img-top text-center'], ['class' => 'card-img']); - return $this->view->cardifyOnlyDescription($element, $img); + return $this->view->renderingDescription($element, $img); } -} \ No newline at end of file +} diff --git a/library/templates/Chili/Library/Wrapper/Record/RichContent/Related.php b/library/templates/Chili/Library/Wrapper/Record/RichContent/Related.php index 2650e1a307d01c5c10c7f51742960ae670151a1d..15b155b4b52b7bd855ee9e4623d189527cb929b5 100644 --- a/library/templates/Chili/Library/Wrapper/Record/RichContent/Related.php +++ b/library/templates/Chili/Library/Wrapper/Record/RichContent/Related.php @@ -25,7 +25,7 @@ class Chili_Library_Wrapper_Record_RichContent_Related protected function _renderElementCallback() { return function($record) { - return $this->_view->cardify(Class_Template::current()->newWrapper($record, $this->_view)); + return $this->_view->renderingVertical(Class_Template::current()->newWrapper($record, $this->_view)); }; } } diff --git a/library/templates/Chili/View/Abonne.php b/library/templates/Chili/View/Abonne.php index 5e7c0c62b153503015c7de2356ef0f306eb9c66f..1a78a3b1379b2782bfab068abb119ab956ae60c0 100644 --- a/library/templates/Chili/View/Abonne.php +++ b/library/templates/Chili/View/Abonne.php @@ -52,7 +52,7 @@ class Chili_View_Abonne extends ZendAfi_View_Helper_BaseHelper { protected function _renderCarouselForSmallScreen($sections) { $content = $this->view->renderMultipleCarousel($sections, - [$this->view, 'cardify'], + [$this->view, 'renderingVertical'], 3); return $this->_div(['class' => 'big_buttons_sm'], @@ -64,7 +64,7 @@ class Chili_View_Abonne extends ZendAfi_View_Helper_BaseHelper { $helper = (new Intonation_View_RenderWallGrid()) ->setView($this->view); $content = $helper->renderWallGrid($sections, - [$this->view, 'cardify']); + [$this->view, 'renderingVertical']); return $this->_div(['class' => 'big_buttons_lg'], $content); diff --git a/library/templates/Chili/View/HighlightCardify.php b/library/templates/Chili/View/HighlightCardify.php index 73f7617ea1f768801890a2fd586aa94c8d148af3..64695056465b186fc9ce5a48563c53c2cbe8aa7d 100644 --- a/library/templates/Chili/View/HighlightCardify.php +++ b/library/templates/Chili/View/HighlightCardify.php @@ -20,14 +20,14 @@ */ -class Chili_View_HighlightCardify extends Intonation_View_CardifyWithOverlay { +class Chili_View_HighlightCardify extends ZendAfi_View_Helper_Template_RenderingOnlyImage { public function highlightCardify($element) { - return parent::cardifyWithOverlay($element); + return parent::renderingOnlyImage($element); } protected function _overlay($element) { - return $this->view->cardifyOnlyDescription($element); + return $this->view->renderingDescription($element); } } \ No newline at end of file diff --git a/library/templates/Intonation/Library/View/Wrapper/Abstract.php b/library/templates/Intonation/Library/View/Wrapper/Abstract.php index 9a4f6e15c873618d1d7b66c3adf0a6505db93c34..e2901a7ba07907a388bc291d82b7557c739a7989 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Abstract.php +++ b/library/templates/Intonation/Library/View/Wrapper/Abstract.php @@ -173,10 +173,11 @@ abstract class Intonation_Library_View_Wrapper_Abstract { return $this->_search_content; return $this->_search_content = $this->_in_js_search - ? $this->_view->dNone(implode(' ', [$this->getMainTitle(), - $this->getSecondaryTitle(), - $this->getDescription(), - '%s'])) + ? $this->_view->hideContentForJS(implode(' ', + [$this->getMainTitle(), + $this->getSecondaryTitle(), + $this->getDescription(), + '%s'])) : ''; } @@ -226,7 +227,7 @@ abstract class Intonation_Library_View_Wrapper_Abstract { /** @return string html */ public function asPage() { - return $this->_view->cardify($this); + return $this->_view->renderingVertical($this); } diff --git a/library/templates/Intonation/Library/View/Wrapper/DriveCheckoutPlan/RichContent/Library.php b/library/templates/Intonation/Library/View/Wrapper/DriveCheckoutPlan/RichContent/Library.php index cf4e988d0a457c3d8c7f273b80d272473d952baf..b44047ba3e80b8b833b07b95daf35506224d45a7 100644 --- a/library/templates/Intonation/Library/View/Wrapper/DriveCheckoutPlan/RichContent/Library.php +++ b/library/templates/Intonation/Library/View/Wrapper/DriveCheckoutPlan/RichContent/Library.php @@ -52,11 +52,11 @@ class Intonation_Library_View_Wrapper_DriveCheckoutPlan_RichContent_Library ->renderList($librairies, function($library) use($wrapper_class) { - return $this->_view->cardifyHorizontal((new $wrapper_class()) - ->setPlan($this->_model) - ->setHtmlId($this->_getHtmlId()) - ->setModel($library) - ->setView($this->_view)); + return $this->_view->renderingHorizontal((new $wrapper_class()) + ->setPlan($this->_model) + ->setHtmlId($this->_getHtmlId()) + ->setModel($library) + ->setView($this->_view)); }); } diff --git a/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Team.php b/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Team.php index 3478ef332806fbd35c651cabda928813c4b2416f..792194c36ea392dd6ef459a5c7ab3db11bf8f58a 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Team.php +++ b/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Team.php @@ -68,7 +68,7 @@ class Intonation_Library_View_Wrapper_Library_RichContent_Team extends Intonatio }, $pros); $callback = function($wrapped) { - return $this->_view->cardify($wrapped); + return $this->_view->renderingVertical($wrapped); }; return $this->_view->renderMultipleCarousel(new Storm_Collection($pros), $callback); diff --git a/library/templates/Intonation/Library/View/Wrapper/Record/RichContent/Related.php b/library/templates/Intonation/Library/View/Wrapper/Record/RichContent/Related.php index 5b44311cf6e1b813ec50432c2ad2c036b980617c..19f045bdcbe76180a4a49070f1a22cfdeac21f83 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Record/RichContent/Related.php +++ b/library/templates/Intonation/Library/View/Wrapper/Record/RichContent/Related.php @@ -169,6 +169,6 @@ class Intonation_Library_View_Wrapper_Record_RichContent_Cardify { ->setView($this->_view) ->setModel($record); - return $this->_view->cardifyWithOverlay($wrapped); + return $this->_view->renderingOnlyImage($wrapped); } } diff --git a/library/templates/Intonation/Library/View/Wrapper/ReviewsByRecord.php b/library/templates/Intonation/Library/View/Wrapper/ReviewsByRecord.php index d85e191067c55141e6cc6ecf63ea8c37ff1f00c6..9aec523e3515c67ca12941b8bc358519ac880386 100644 --- a/library/templates/Intonation/Library/View/Wrapper/ReviewsByRecord.php +++ b/library/templates/Intonation/Library/View/Wrapper/ReviewsByRecord.php @@ -112,7 +112,7 @@ class Intonation_Library_View_Wrapper_ReviewsByRecord extends Intonation_Library public function getDescription() { $html = []; foreach ($this->_reviews as $review) - $html [] = $this->_view->cardifyOnlyDescription($review->setWidgetContext($this->_widget_context)); + $html [] = $this->_view->renderingDescription($review->setWidgetContext($this->_widget_context)); return $this->_record->getBadges() . implode($html); } diff --git a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/NewSuggestion.php b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/NewSuggestion.php index da49e649286ded40c0035981f9839a2440a1256e..32cd2134242457ddfef7ca7580ec1896cef72861 100644 --- a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/NewSuggestion.php +++ b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/NewSuggestion.php @@ -110,7 +110,7 @@ class Intonation_Library_View_Wrapper_User_RichContent_NewSuggestion extends Int $callback = function ($record) { $wrapped = Class_Template::current()->newWrapper($record, $this->_view); - return $this->_view->cardifyHorizontal($wrapped); + return $this->_view->renderingHorizontal($wrapped); }; return $this->_view->div(['class' => 'col-12 mt-3 p-0'], diff --git a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Selection.php b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Selection.php index 6fc106508387df88a4261bafdc2bfbd141838fc9..696d71bfb27f13eddccf076ac2161ec7a642e3ab 100644 --- a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Selection.php +++ b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Selection.php @@ -46,7 +46,7 @@ class Intonation_Library_View_Wrapper_User_RichContent_Selection extends Intonat { return $this->_view - ->cardifyHorizontal( + ->renderingHorizontal( (new Intonation_Library_View_Wrapper_RecordInSelection) ->setSelection($this->_model) ->setModel($record) diff --git a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Settings.php b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Settings.php index d87682b199386c01e40093f3ef23d9a3c382b447..30edcfd2b133f71b10c795304f4a8f83866562c4 100644 --- a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Settings.php +++ b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Settings.php @@ -106,7 +106,7 @@ class Intonation_Library_View_Wrapper_User_RichContent_Settings extends Intonati }, $cards->getArrayCopy()); $callback = function($wrapped) { - return $this->_view->cardify($wrapped); + return $this->_view->renderingVertical($wrapped); }; return $this->_view->renderMultipleCarousel(new Storm_Collection($cards), $callback); diff --git a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php index c27d07166dd34bdbf1b56fce8aa955094868877d..278f245bf487bb5c0c5404cbcebf4ca0d70c4315 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php @@ -108,7 +108,7 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_ $this->view->titre = $this->_settings->getTitre(); $this->_initCalendar(); $this->_calendar->setSize(Intonation_Library_Widget_Carousel_Definition::LIMIT_SIZE); - return $this->view->calendarLinkToAll($this->_calendar, $this->_settings); + return $this->view->calendarContentForAjax($this->_calendar, $this->_settings); } diff --git a/library/templates/Intonation/Library/Widget/Carousel/View.php b/library/templates/Intonation/Library/Widget/Carousel/View.php index 07c4e0e651ed4d656de4849a81c81fd5fc9128ba..dd6d529b44904182ca943e5858d3d5378077b928 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/View.php @@ -261,25 +261,25 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help if ($rendering == Intonation_Library_Widget_Carousel_Definition::CARD_OVERLAY) return function ($element) { - return $this->view->cardifyWithOverlay($element); + return $this->view->renderingOnlyImage($element); }; if ($rendering == Intonation_Library_Widget_Carousel_Definition::CARD) return function ($element) { - return $this->view->cardify($element); + return $this->view->renderingVertical($element); }; if ($rendering == Intonation_Library_Widget_Carousel_Definition::CARD_DESCRIPTION) return function ($element) { - return $this->view->cardifyOnlyDescription($element); + return $this->view->renderingDescription($element); }; if ($rendering == Intonation_Library_Widget_Carousel_Definition::HORIZONTAL_CARD) return function ($element) { - return $this->view->cardifyHorizontal($element); + return $this->view->renderingHorizontal($element); }; if ($rendering == Intonation_Library_Widget_Carousel_Definition::PAGE) diff --git a/library/templates/Intonation/Template.php b/library/templates/Intonation/Template.php index e017bc6c69a26eaa3a0ac2f182e7b9af5e5b1cae..30d51693ae773b5d2ac1c2c339fc85c522266cd7 100644 --- a/library/templates/Intonation/Template.php +++ b/library/templates/Intonation/Template.php @@ -307,7 +307,10 @@ class Intonation_Template extends Class_Template { public function addHelperPath($view) { - $view->addHelperPath('templates/Intonation/View', 'Intonation_View'); + $view + ->addHelperPath('ZendAfi/View/Helper/Template', 'ZendAfi_View_Helper_Template') + ->addHelperPath('templates/Intonation/View', 'Intonation_View'); + return $this; } diff --git a/library/templates/Intonation/View/Abonne/Holds.php b/library/templates/Intonation/View/Abonne/Holds.php index e720cb25b9209d7f06333b95c8c6ebf7c08b9488..d5c8a467794dbed4594cff41cbb1b085fee4aba5 100644 --- a/library/templates/Intonation/View/Abonne/Holds.php +++ b/library/templates/Intonation/View/Abonne/Holds.php @@ -33,7 +33,7 @@ class Intonation_View_Abonne_Holds extends ZendAfi_View_Helper_BaseHelper { }, $holds->getArrayCopy()); $callback = function($wrapped) { - return $this->view->cardifyHorizontal($wrapped); + return $this->view->renderingHorizontal($wrapped); }; $actions = Class_AdminVar::isModuleEnabled('ENABLE_DRIVE_CHECKOUT') diff --git a/library/templates/Intonation/View/Abonne/PNBHolds.php b/library/templates/Intonation/View/Abonne/PNBHolds.php index 4c19c79141ca8a850c970f46b84699f7d676975b..e30825e349d194fe9ea5ff86d401342946b3f3d4 100644 --- a/library/templates/Intonation/View/Abonne/PNBHolds.php +++ b/library/templates/Intonation/View/Abonne/PNBHolds.php @@ -33,7 +33,7 @@ class Intonation_View_Abonne_PNBHolds extends ZendAfi_View_Helper_BaseHelper { }, $holds->getArrayCopy()); $callback = function($wrapped) { - return $this->view->cardifyHorizontal($wrapped); + return $this->view->renderingHorizontal($wrapped); }; $html = [$this->_div(['class' => 'col-12'], diff --git a/library/templates/Intonation/View/Abonne/Suggestions.php b/library/templates/Intonation/View/Abonne/Suggestions.php index 5c01e138bcbc2504fc495222f9d16014bfeb9590..b59416fd33b496a48558ca256755cb23e936001e 100644 --- a/library/templates/Intonation/View/Abonne/Suggestions.php +++ b/library/templates/Intonation/View/Abonne/Suggestions.php @@ -33,7 +33,7 @@ class Intonation_View_Abonne_Suggestions extends ZendAfi_View_Helper_BaseHelper }, $suggestions->getArrayCopy()); $callback = function($wrapped) { - return $this->view->cardifyOnlyDescription($wrapped); + return $this->view->renderingDescription($wrapped); }; $collection = new Storm_Collection($suggestions); diff --git a/library/templates/Intonation/View/Abstract/Carousel.php b/library/templates/Intonation/View/Abstract/Carousel.php index c1a5f34394be83d6c31b9d1df1a069b7b2fefbd7..5e3775e09a8632742996534911ef582c119f746c 100644 --- a/library/templates/Intonation/View/Abstract/Carousel.php +++ b/library/templates/Intonation/View/Abstract/Carousel.php @@ -30,7 +30,7 @@ abstract class Intonation_View_Abstract_Carousel extends Intonation_View_Abstrac ? $callback : (function($item) { - return $this->view->cardify($item); + return $this->view->renderingVertical($item); }); $id = 'carousel_' . uniqid(); diff --git a/library/templates/Intonation/View/Author/RenderRecords.php b/library/templates/Intonation/View/Author/RenderRecords.php index 042d8b360cd128de3a0d3ad4fe5cf29bbdc3ad83..0e06c64cbfd4023b4f8f7fa193f2a8f5a12b2b1a 100644 --- a/library/templates/Intonation/View/Author/RenderRecords.php +++ b/library/templates/Intonation/View/Author/RenderRecords.php @@ -50,7 +50,7 @@ class Intonation_View_Author_RenderRecords extends ZendAfi_View_Helper_BaseHelpe $records = $this->view->renderMultipleCarousel($elements, function($record) { - return $this->view->cardifyWithOverlay($record); + return $this->view->renderingOnlyImage($record); }); return $this->_div(['class' => 'col-12'], $header . $records); diff --git a/library/templates/Intonation/View/ColumnBreak.php b/library/templates/Intonation/View/ColumnBreak.php deleted file mode 100644 index 1148029ace8326f1642e4cb482c21c3256c3f200..0000000000000000000000000000000000000000 --- a/library/templates/Intonation/View/ColumnBreak.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Copyright (c) 2012-2020, Agence Française Informatique (AFI). All rights reserved. - * - * BOKEH is free software; you can redistribute it and/or modify - * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by - * the Free Software Foundation. - * - * There are special exceptions to the terms and conditions of the AGPL as it - * is applied to this software (see README file). - * - * BOKEH is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE - * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -class Intonation_View_ColumnBreak extends ZendAfi_View_Helper_BaseHelper { - public function columnBreak() { - return $this->_div(['class' => 'w-100'], ''); - } -} diff --git a/library/templates/Intonation/View/Notice/ArticlesPeriodiques.php b/library/templates/Intonation/View/Notice/ArticlesPeriodiques.php index b03e31245af1d99905b3a0f6cb009f322b70dc52..2170664ef87cae9cdd6ddbe5cf5138b62247ee03 100644 --- a/library/templates/Intonation/View/Notice/ArticlesPeriodiques.php +++ b/library/templates/Intonation/View/Notice/ArticlesPeriodiques.php @@ -54,7 +54,7 @@ class Intonation_View_Notice_ArticlesPeriodiques extends ZendAfi_View_Helper_Bas [], (function($item) { - return $this->view->cardifyOnlyDescription($item); + return $this->view->renderingDescription($item); })); diff --git a/library/templates/Intonation/View/OsmCard.php b/library/templates/Intonation/View/OsmCard.php index dc63b6a58c718b848188c527debd2fb261bddc20..311d73d22d5af5cf75da357ccf483363b06176fb 100644 --- a/library/templates/Intonation/View/OsmCard.php +++ b/library/templates/Intonation/View/OsmCard.php @@ -22,6 +22,6 @@ class Intonation_View_OsmCard extends ZendAfi_View_Helper_BaseHelper { public function osmCard($element) { - return $this->view->cardifyOnlyDescription($element); + return $this->view->renderingDescription($element); } } diff --git a/library/templates/Intonation/View/RenderAccordionCarousel.php b/library/templates/Intonation/View/RenderAccordionCarousel.php index f667c013af9b3da13020627db9ba5f93e9d87a95..4942a9788bcbc4a49553c6b6d1b83d74efa79db0 100644 --- a/library/templates/Intonation/View/RenderAccordionCarousel.php +++ b/library/templates/Intonation/View/RenderAccordionCarousel.php @@ -113,7 +113,7 @@ class Intonation_View_RenderAccordionCarousel_Content extends ZendAfi_View_Helpe ? $content_callback : (function($item) { - return $this->view->cardifyHorizontal($item); + return $this->view->renderingHorizontal($item); }); $class = $this->_expanded ? 'show' : ''; diff --git a/library/templates/Intonation/View/RenderArticle.php b/library/templates/Intonation/View/RenderArticle.php index 4c9209cca65fdf1ccf57214515f777e4a91d128b..edb63b5eef59e3a7c9ac431f68b683bb190f9d0e 100644 --- a/library/templates/Intonation/View/RenderArticle.php +++ b/library/templates/Intonation/View/RenderArticle.php @@ -33,7 +33,7 @@ class Intonation_View_RenderArticle extends ZendAfi_View_Helper_BaseHelper { if ( ($osm_data = $wrapper->getOsmData()) && ($osm_wrapper = $osm_data->getwrapper())) $grid_content [] = $this->_div(['class' => 'article_location_data'], - $this->view->cardify($osm_wrapper)); + $this->view->renderingVertical($osm_wrapper)); $location_content = $this->view->grid($grid_content); $full_content = $article->getFullContentWithCookiesConsent(); diff --git a/library/templates/Intonation/View/RenderCollection.php b/library/templates/Intonation/View/RenderCollection.php index 7fbf0a028d02917ca3c6684ee29960e6f4ab3773..ea77058bf11c9d30b85ca6d3ab03672c7354d65e 100644 --- a/library/templates/Intonation/View/RenderCollection.php +++ b/library/templates/Intonation/View/RenderCollection.php @@ -26,7 +26,7 @@ class Intonation_View_RenderCollection extends ZendAfi_View_Helper_BaseHelper { ? $callback : (function($item) { - return $this->view->cardifyHorizontal($item); + return $this->view->renderingHorizontal($item); }); foreach ($actions as $action) diff --git a/library/templates/Intonation/View/RenderNewsletters.php b/library/templates/Intonation/View/RenderNewsletters.php index 6d4d24f9f4fd6dc58187d3ca0fb5638bea9ae551..c369382b9c68bfe31fb28a41116074fbea67c16c 100644 --- a/library/templates/Intonation/View/RenderNewsletters.php +++ b/library/templates/Intonation/View/RenderNewsletters.php @@ -33,7 +33,7 @@ class Intonation_View_RenderNewsletters extends ZendAfi_View_Helper_BaseHelper { }, $newsletters); $callback = function($wrapped) { - return $this->view->cardifyHorizontal($wrapped); + return $this->view->renderingHorizontal($wrapped); }; return diff --git a/library/templates/Intonation/View/RenderRecord/RenderItems.php b/library/templates/Intonation/View/RenderRecord/RenderItems.php index 3098e79055282d37f31acfa80d69d8348407ec11..6d74d7a2acef8495bb05d26fcfa4ae6efaa632f3 100644 --- a/library/templates/Intonation/View/RenderRecord/RenderItems.php +++ b/library/templates/Intonation/View/RenderRecord/RenderItems.php @@ -151,7 +151,7 @@ abstract class Intonation_View_RenderRecord_RenderItemsStrategy { return ($this->_view->newHelper('RenderWall')) ->renderWall($this->_initCollection($this->_sortItems($items), $this->_getItemWrapper()), - fn($element) => $this->_view->cardifyOnlyDescription($element)); + fn($element) => $this->_view->renderingDescription($element)); } diff --git a/library/templates/Intonation/View/RenderRecord/RenderReviews.php b/library/templates/Intonation/View/RenderRecord/RenderReviews.php index f33b1f2d49634a9292a0af4647c1f4fba8213cd1..3b78858f26a4c17075bd101ffd73ae42e29a2a92 100644 --- a/library/templates/Intonation/View/RenderRecord/RenderReviews.php +++ b/library/templates/Intonation/View/RenderRecord/RenderReviews.php @@ -105,7 +105,7 @@ class Intonation_View_RenderRecord_RenderReviews extends ZendAfi_View_Helper_Bas $filtered); $callback = function ($element) { - return $this->view->cardifyFullDescription($element); + return $this->view->renderingAllDescription($element); }; return @@ -138,4 +138,4 @@ class Intonation_View_RenderRecord_RenderReviews extends ZendAfi_View_Helper_Bas $this->_div(['class' => 'card-body'], $this->view->renderReviewForm($new_review)))); } -} \ No newline at end of file +} diff --git a/library/templates/Intonation/View/RenderRecordReview.php b/library/templates/Intonation/View/RenderRecordReview.php index 2dd160e56259ed676cf31db80903eb2823303452..41a01d12c0a932463bbe359a07252c8abe6ed422 100644 --- a/library/templates/Intonation/View/RenderRecordReview.php +++ b/library/templates/Intonation/View/RenderRecordReview.php @@ -27,6 +27,6 @@ class Intonation_View_RenderRecordReview extends ZendAfi_View_Helper_BaseHelper ->setView($this->view) ->setModel($record_review); - return $this->view->cardify($wrapped); + return $this->view->renderingVertical($wrapped); } } \ No newline at end of file diff --git a/library/templates/Intonation/View/RenderTree.php b/library/templates/Intonation/View/RenderTree.php index f37c72952cc7421d6c7e1e63b6f26a3dc5783a4c..f6c21b3ef5c0facb609044dd598ec7699d6fd383 100644 --- a/library/templates/Intonation/View/RenderTree.php +++ b/library/templates/Intonation/View/RenderTree.php @@ -35,13 +35,18 @@ class Intonation_View_RenderTree extends ZendAfi_View_Helper_BaseHelper { $html = array_filter($html); - return $this->view->grid(implode($this->view->columnBreak(), + return $this->view->grid(implode($this->_columnBreak(), $html), ['class' => 'tree_view border-primary']); } + protected function _columnBreak() : string { + return $this->_div(['class' => 'w-100'], ''); + } + + protected function _renderParents($parents, $callback) { if ($parents->isEmpty()) return ''; @@ -52,7 +57,7 @@ class Intonation_View_RenderTree extends ZendAfi_View_Helper_BaseHelper { $html [] = $this->_div(['class' => $this->_parent_classes], $callback($parent)); - return implode($this->view->columnBreak(), + return implode($this->_columnBreak(), $html); } diff --git a/library/templates/Intonation/View/Rss/RenderItems.php b/library/templates/Intonation/View/Rss/RenderItems.php index ade171476313d6a4e98e764b19d4b622a895cb57..06db5b2b56918b7e6eaa3ecc37dc2673a65a73c2 100644 --- a/library/templates/Intonation/View/Rss/RenderItems.php +++ b/library/templates/Intonation/View/Rss/RenderItems.php @@ -31,9 +31,9 @@ class Intonation_View_Rss_RenderItems extends ZendAfi_View_Helper_BaseHelper { $items = new Storm_Collection($items); - return $this->view->renderCollection($items, [], function($rss) - { - return $this->view->cardify($rss); - }); + return + $this->view->renderCollection($items, + [], + fn($rss) => $this->view->renderingVertical($rss)); } } diff --git a/library/templates/Intonation/View/Search/DomainBrowser.php b/library/templates/Intonation/View/Search/DomainBrowser.php index e42debb4fd226ecd3ce5629e9781bc10016bcc55..04409f4dc74be0eab39f90040f41830f29820029 100644 --- a/library/templates/Intonation/View/Search/DomainBrowser.php +++ b/library/templates/Intonation/View/Search/DomainBrowser.php @@ -44,10 +44,7 @@ class Intonation_View_Search_DomainBrowser extends ZendAfi_View_Helper_BaseHelpe return $this->view->renderTree($this->_getParents($current, $root_id), $this->_getCurrent($current), $this->_getChildren($current), - function($wrapper) - { - return $this->view->cardify($wrapper); - }); + fn($wrapper) => $this->view->renderingVertical($wrapper)); } diff --git a/library/templates/Intonation/View/Search/History.php b/library/templates/Intonation/View/Search/History.php index fcc41de6e2f6a398d36915e9d82fa8de19ab6066..41d75a1d9d2114916a17ff2a7338c5bb50933e14 100644 --- a/library/templates/Intonation/View/Search/History.php +++ b/library/templates/Intonation/View/Search/History.php @@ -50,7 +50,7 @@ class Intonation_View_Search_History extends ZendAfi_View_Helper_BaseHelper { }, $history); $callback = function($wrapped) { - return $this->view->cardify($wrapped); + return $this->view->renderingVertical($wrapped); }; $actions = [(new Intonation_Library_Link) diff --git a/library/templates/Intonation/View/Search/Result.php b/library/templates/Intonation/View/Search/Result.php index d4105d63246e2d8e3d14f7b7114984e913018975..e5108d64be17997dab4f3f2ce8c0c9c905e17501 100644 --- a/library/templates/Intonation/View/Search/Result.php +++ b/library/templates/Intonation/View/Search/Result.php @@ -281,14 +281,14 @@ class Intonation_View_Search_Result extends ZendAfi_View_Helper_BaseHelper { return $helper->renderWall(new Storm_Collection($records), function($wrapped) { - return $this->view->cardify($wrapped); + return $this->view->renderingVertical($wrapped); }); } protected function _renderList(array $records) : string { return $this->view->renderList(new Storm_Collection($records), - fn($wrapper) => $this->view->cardifyHorizontal($wrapper)); + fn($wrapper) => $this->view->renderingHorizontal($wrapper)); } diff --git a/library/templates/Intonation/View/SessionActivityInscription.php b/library/templates/Intonation/View/SessionActivityInscription.php index 4c5e6ce80878f98ac56ef57073bf11da61fec1a9..7c16fd4b1b23c944fa3b562b493fc4caf799cdf3 100644 --- a/library/templates/Intonation/View/SessionActivityInscription.php +++ b/library/templates/Intonation/View/SessionActivityInscription.php @@ -20,7 +20,7 @@ */ -class Intonation_View_SessionActivityInscription extends Intonation_View_Abonne { +class Intonation_View_SessionActivityInscription extends ZendAfi_View_Helper_Template_Abonne { protected $_section; public function sessionActivityInscription($inscription) { diff --git a/library/templates/Intonation/View/SessionActivityRegister.php b/library/templates/Intonation/View/SessionActivityRegister.php index 549f9abdef6a27bb0f6078b8adf8f7ceae369ad3..c1acc74629bd22fbaefa2a48f1a0d2cc7a20bd9a 100644 --- a/library/templates/Intonation/View/SessionActivityRegister.php +++ b/library/templates/Intonation/View/SessionActivityRegister.php @@ -20,7 +20,7 @@ */ -class Intonation_View_SessionActivityRegister extends Intonation_View_Abonne { +class Intonation_View_SessionActivityRegister extends ZendAfi_View_Helper_Template_Abonne { protected $_section; public function sessionActivityRegister($inscription, $form) { diff --git a/tests/scenarios/Templates/MuscleTemplateTest.php b/tests/scenarios/Templates/MuscleTemplateTest.php index 0fede21d83097974a79363171444dba1ad475aa5..57ed718f826e83052de67eca21fa2e37d698dcf9 100644 --- a/tests/scenarios/Templates/MuscleTemplateTest.php +++ b/tests/scenarios/Templates/MuscleTemplateTest.php @@ -551,6 +551,12 @@ class MuscleTemplateSearchResultWithDomainBrowserTest extends MuscleTemplateTest } + /** @test */ + public function divClassW100ShouldBeInTreeView() { + $this->assertXPath('//div[@class="tree_view border-primary container-fluid"]//div[@class="w-100"]'); + } + + /** @test */ public function domainBrowserShouldContainsRomans() { $this->assertXPathContentContains('//div[contains(@class, "tree_view_current")]', 'Romans'); diff --git a/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php b/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php index ec1f0f819e72ce385aa2f0f2ad41ae4efcad8862..6c4f3bb6a595723884d00f49c49ac725cba2bede 100644 --- a/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php +++ b/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php @@ -83,6 +83,13 @@ class TemplatesAdvancedSearchWithProfilRedirectTest extends TemplatesAdvancedSea public function formActionShouldContainsIdProfilThree() { $this->assertXPath('//form[contains(@action, "/form_id/advanced_form/id_profil/3")]'); } + + + /** @test */ + public function h1ShouldBeRecherecheAvancee() { + $this->assertXPathContentContains('//div//h1[@class="col-12 content_title py-2 px-0 my-2 mx-0 border-bottom"]', + 'Recherche avancée'); + } } @@ -164,4 +171,4 @@ class TemplatesDispatchIntonationAdvancedSearchTest extends TemplatesIntonationT public function searchAxeInputShouldBePresent() { $this->assertXPath('//span[@class="search_axe_input"]'); } -} \ No newline at end of file +} diff --git a/tests/scenarios/Templates/TemplatesAgendaTest.php b/tests/scenarios/Templates/TemplatesAgendaTest.php index 6ea023e7b9be08d273204974681423d9618f1cfb..9c7ee244fe14a512d88d9ce84e4a2f9357545342 100644 --- a/tests/scenarios/Templates/TemplatesAgendaTest.php +++ b/tests/scenarios/Templates/TemplatesAgendaTest.php @@ -57,6 +57,8 @@ abstract class TemplatesAgendaTestCase extends AbstractControllerTestCase { ['rendering' => 'card-description', 'layout' => 'list', 'size' => 1, + 'MuscleShowFooter' => 1, + 'link_to_all' => 1, 'description_length' => 4]); } } @@ -65,8 +67,10 @@ abstract class TemplatesAgendaTestCase extends AbstractControllerTestCase { class TemplatesAgendaWidgetTest extends TemplatesAgendaTestCase { + public function setUp() { parent::setUp(); + $this->dispatch('/opac/widget/render/widget_id/1/profile_id/34'); } @@ -76,6 +80,32 @@ class TemplatesAgendaWidgetTest extends TemplatesAgendaTestCase { $this->assertXPathContentContains('//div[contains(@class, "calendar widget")]//p[contains(@class, "model_description")]', 'La description s\'arrête ici …'); } + + + /** @test */ + public function linkToAllShouldBeCmsCalendarRenderAll() { + $this->assertXPathContentContains('//div[@class="widget-footer card-footer"]//a[@href="/widget/render-all/profile_id/34/widget_id/1"]/div/span', + 'Voir tous les événements de la boite Boite agenda dans une liste'); + } +} + + + + +class TemplatesAgendaWidgetRenderAllTest extends TemplatesAgendaTestCase { + + public function setUp() { + parent::setUp(); + + $this->dispatch('/opac/widget/render-all/profile_id/34/widget_id/1'); + } + + + /** @test */ + public function linksUrlShouldUseCmsRenderAll() { + $this->assertXPath('//div[@class="calendar"]//a[contains(@href, "/cms/render-all/")]', + $this->_response->getBody()); + } } diff --git a/tests/scenarios/Templates/TemplatesAjaxPaginatedListTest.php b/tests/scenarios/Templates/TemplatesAjaxPaginatedListTest.php index 3f379a3bd79b092b5224b7f9f0169ef6d897c3fe..cf5211dfb95f11d98f8b33c972521faffe6a7de0 100644 --- a/tests/scenarios/Templates/TemplatesAjaxPaginatedListTest.php +++ b/tests/scenarios/Templates/TemplatesAjaxPaginatedListTest.php @@ -533,7 +533,8 @@ class TemplatesAjaxPaginatedListWithReviewInRecordTest extends TemplatesAjaxPagi protected function _getCollectionAsArray() { $fixture = $this->fixture(Class_AvisNotice::class, ['id' => 332423, - 'entete' => 'ent']); + 'entete' => 'ent', + 'avis' => 'Mon super avis']); return [new Intonation_Library_View_Wrapper_ReviewInRecord($fixture)]; } } @@ -991,7 +992,7 @@ class TemplatesAjaxPaginatedListWithCustomPageSizeTest extends AbstractControlle $this->_ajax_paginated_list_helper = (new Intonation_Library_PaginatedCollectionHelper) ->setCollection($this->_getCollection()) ->setCustomPageSize(12) - ->setRendering('cardifyHorizontal'); + ->setRendering('renderingHorizontal'); $this->_ajax_paginated_list_helper_id = $this->_ajax_paginated_list_helper->getId(); diff --git a/tests/scenarios/Templates/TemplatesAuthorTest.php b/tests/scenarios/Templates/TemplatesAuthorTest.php index 10249589100c16cfe3b6ac160456d519fcba2635..10727d19c51302a3beacd34259bf48c8179b3c51 100644 --- a/tests/scenarios/Templates/TemplatesAuthorTest.php +++ b/tests/scenarios/Templates/TemplatesAuthorTest.php @@ -107,7 +107,7 @@ class TemplatesAuthorWidgetTest extends TemplatesIntonationTestCase { /** @test */ public function victorHugoShouldBePresentInACardTitle() { - $this->assertXPathContentContains('//div[contains(@class, "boite authors widget")]//div[@class="masonry"]//div[contains(@class, "card_title")]', + $this->assertXPathContentContains('//div[contains(@class, "boite authors widget")]//div[@class="masonry"]//div[@class= "card-title card_title card_title_Intonation_Library_View_Wrapper_Author"]', 'Victor Hugo'); } diff --git a/tests/scenarios/Templates/TemplatesReviewsTest.php b/tests/scenarios/Templates/TemplatesReviewsTest.php index e380ee0a87e9fedab5245fcb7df16759bfca10a6..2be9cc823d55ef8e2a7f4276fbef26b6ede73ced 100644 --- a/tests/scenarios/Templates/TemplatesReviewsTest.php +++ b/tests/scenarios/Templates/TemplatesReviewsTest.php @@ -1063,6 +1063,12 @@ class TemplatesReviewsInRecordTest extends AbstractControllerTestCase { } + /** @test */ + public function avisShouldBeInDivRenderingFullDescription() { + $this->assertXPath('//div[@class="card rendering_all_description"]'); + } + + /** @test */ public function currentLoggedUserShouldSeeEditReviewAction() { $this->assertXPathContentContains('//div//a[@href="/abonne/edit-review/id/34"]', @@ -1075,4 +1081,4 @@ class TemplatesReviewsInRecordTest extends AbstractControllerTestCase { $this->assertXPathContentContains('//div//a[@href="/abonne/delete-review/id/34"]', 'Supprimer'); } -} \ No newline at end of file +} diff --git a/tests/scenarios/Templates/TemplatesWebsitesTest.php b/tests/scenarios/Templates/TemplatesWebsitesTest.php index 263ee68185cdf5a64b176f96591571daba27b929..11bf95c56a1532298ad3e021de01a24d49b8b347 100644 --- a/tests/scenarios/Templates/TemplatesWebsitesTest.php +++ b/tests/scenarios/Templates/TemplatesWebsitesTest.php @@ -427,7 +427,7 @@ class TemplatesWebsitesDispatchPaginatedTest extends TemplatesWebsitesFixturesTe $helper = (new Intonation_Library_PaginatedCollectionHelper) ->setCollection(new Storm_Collection($melted_websites)) - ->setRendering('cardifyHorizontal'); + ->setRendering('renderingHorizontal'); $id = $helper->getId(); diff --git a/tests/scenarios/Templates/TemplatesWidgetTest.php b/tests/scenarios/Templates/TemplatesWidgetTest.php index a45d52b6040a567a0071f938eee1a3b6655f182c..ae3856b4ce86c82bd5388fb20fc59e284b019afb 100644 --- a/tests/scenarios/Templates/TemplatesWidgetTest.php +++ b/tests/scenarios/Templates/TemplatesWidgetTest.php @@ -249,7 +249,7 @@ class TemplatesWidgetFilterTest extends TemplatesWidgetRenderAllTestCase { public function setUp() { parent::setUp(); $time_source = new TimeSourceForTest('2020-11-12 23:34:00'); - Intonation_View_CalendarContent::setTimeSource($time_source); + ZendAfi_View_Helper_Template_CalendarContent::setTimeSource($time_source); Class_Calendar::setTimeSource($time_source); Class_Profil::find(1) @@ -369,7 +369,7 @@ class TemplatesWidgetRssTest extends TemplatesIntonationTestCase { /** @test */ public function whenDescriptionContainsImageUrlRssRenderItemsShouldContainsImageLink() { $this->dispatch('/opac/noticeajax/resources/id/' . $this->_record_id); - $this->assertXPathContentContains('//div[contains(@class,"card-img")]/img/@src', + $this->assertXPathContentContains('//div[@class="card-img-top text-center"]/img/@src', 'https://veilles-partagees.org/wp-content/uploads/2020/04/Data-150x150.jpg'); } @@ -1046,7 +1046,7 @@ class TemplatesWidgetCalendarTest extends TemplatesIntonationTestCase { ->assertSave(); $time_source = new TimeSourceForTest('2020-04-12 23:34:00'); - Intonation_View_CalendarContent::setTimeSource($time_source); + ZendAfi_View_Helper_Template_CalendarContent::setTimeSource($time_source); Class_Calendar::setTimeSource($time_source); $this->_vacances = $this->fixture(Class_Article::class, @@ -1649,7 +1649,7 @@ class TemplatesWidgetWithPaginatedListTest extends AbstractControllerTestCase { $helper = (new Intonation_Library_PaginatedCollectionHelper) ->setCollection(new Storm_Collection($records)) ->setCarouselContext($carousel_context) - ->setRendering('cardifyHorizontal'); + ->setRendering('renderingHorizontal'); $id = $helper->getId();