diff --git a/VERSIONS_HOTLINE/158802 b/VERSIONS_HOTLINE/158802 new file mode 100644 index 0000000000000000000000000000000000000000..36eb6c3ba4e2c74ed212fe128fd99009b9518426 --- /dev/null +++ b/VERSIONS_HOTLINE/158802 @@ -0,0 +1 @@ + - correctif #158802 : Kiosques : Correction du paramètre "Affichage desynchronisé du contenu". \ No newline at end of file diff --git a/library/Class/Systeme/ModulesAccueil/Null.php b/library/Class/Systeme/ModulesAccueil/Null.php index 415a5cdb624c0ae3aa9499c914417d8ad28b98c6..90400cce56491c50b895e3d568688b38136a9989 100644 --- a/library/Class/Systeme/ModulesAccueil/Null.php +++ b/library/Class/Systeme/ModulesAccueil/Null.php @@ -231,7 +231,7 @@ class Class_Systeme_ModulesAccueil_Null { } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return ($widget = ZendAfi_View_Helper_Accueil_Base::getWidget($this->getWidgetContext()->getId(), $this->getWidgetContext()->forForm(), new Zend_View)) diff --git a/library/Class/Systeme/Widget/Menu.php b/library/Class/Systeme/Widget/Menu.php index 2e734da54edcfdf0816377aace8a15f1868e8c59..5719a9b584e279fa271a3f7e8bbb24a2d3f39d6f 100644 --- a/library/Class/Systeme/Widget/Menu.php +++ b/library/Class/Systeme/Widget/Menu.php @@ -389,7 +389,7 @@ class Class_Systeme_Widget_Menu extends Class_Systeme_Widget_Abstract { } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { if ( $this->isWidget()) return $this->_getWidgetResources()->shouldCacheContent(); diff --git a/library/ZendAfi/View/Helper/Accueil/AbonneAbstract.php b/library/ZendAfi/View/Helper/Accueil/AbonneAbstract.php index 640cc66ba16be5a47e5fcf0b2e8205d10380eb79..265d6d32563001bfb425fcdf49e91639988748ed 100644 --- a/library/ZendAfi/View/Helper/Accueil/AbonneAbstract.php +++ b/library/ZendAfi/View/Helper/Accueil/AbonneAbstract.php @@ -66,7 +66,7 @@ abstract class ZendAfi_View_Helper_Accueil_AbonneAbstract extends ZendAfi_View_H } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } } \ 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 aa5f2a4d22991a043b24ca4f2f371ea6aa9e017d..7e40ecb8737d2d698117eb44efab5461913f5c30 100644 --- a/library/ZendAfi/View/Helper/Accueil/Base.php +++ b/library/ZendAfi/View/Helper/Accueil/Base.php @@ -76,7 +76,6 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac public function performAction($action) { - //@see Admin_WidgetController::widgetActionAction() } @@ -86,12 +85,10 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac } - // Par défaut le contenu de la boîte n'est pas en cache - public function shouldCacheContent() { - if (Class_Users::isCurrentUserCanAccesBackend()) - return false; - - return Class_AdminVar::isCacheEnabled(); + public function shouldCacheContent() : bool { + return Class_Users::isCurrentUserCanAccesBackend() + ? false + : Class_AdminVar::isCacheEnabled(); } @@ -246,7 +243,8 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn( Class_ScriptLoader $script_loader) : self { + return $this; } diff --git a/library/ZendAfi/View/Helper/Accueil/BibNumerique.php b/library/ZendAfi/View/Helper/Accueil/BibNumerique.php index c245d4981810d4491bc9007f916d6f4963e9dd84..0ba1baf4b3b536db78f7f02f25a2f957c0a4bbef 100644 --- a/library/ZendAfi/View/Helper/Accueil/BibNumerique.php +++ b/library/ZendAfi/View/Helper/Accueil/BibNumerique.php @@ -31,14 +31,14 @@ class ZendAfi_View_Helper_Accueil_BibNumerique extends ZendAfi_View_Helper_Accue } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return $this->isPaginatedDisplay() ? false : parent::shouldCacheContent(); } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { if (!array_isset('id_albums', $this->preferences)) return $this; @@ -48,6 +48,7 @@ class ZendAfi_View_Helper_Accueil_BibNumerique extends ZendAfi_View_Helper_Accue if ($this->isDisplayBooklet()) Class_ScriptLoader::getInstance()->loadBooklet($this->preferences['id_albums'], '#booklet_'.$this->id_module); + return $this; } diff --git a/library/ZendAfi/View/Helper/Accueil/Calendar.php b/library/ZendAfi/View/Helper/Accueil/Calendar.php index e4aaaf4d02714733e164d991790cf094d96b690d..f34bfbafc9f8dc471eb222bfe1d21c63f916ea6b 100644 --- a/library/ZendAfi/View/Helper/Accueil/Calendar.php +++ b/library/ZendAfi/View/Helper/Accueil/Calendar.php @@ -22,12 +22,14 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_Base { protected $class_calendar; - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $script_loader->addOPACScript('calendrier'); $this->renderScriptForFilters(); if($this->isDisplayDiaporamaNavigation()) $this->renderScriptForDiaporameNavigation($this->preferences); + + return $this; } diff --git a/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php b/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php index c9a71cc2ecc3c677850123f4e83006a9b0854541..93a5c49184ef2c145fa8ab43a91b06987c82b1ec 100644 --- a/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php +++ b/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php @@ -18,12 +18,15 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// OPAC3 - Conteneur sur 2 colonnes pour poser d'autres boîtes -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + class ZendAfi_View_Helper_Accueil_ConteneurDeuxColonnes extends ZendAfi_View_Helper_Accueil_Base { - /* Désactive le cache car si on modifie une sous-boîte le contenu doit être mis à jour*/ - public function shouldCacheContent() { return false; } + + + public function shouldCacheContent() : bool { + return false; + } + public function getHtml() { $this->titre = $this->preferences["titre"]; diff --git a/library/ZendAfi/View/Helper/Accueil/HistoriqueRecherches.php b/library/ZendAfi/View/Helper/Accueil/HistoriqueRecherches.php index 7759f6262047a269b33adde12190042018fb5193..5ba069d39313a8c9ab2de48e06e2e47ebc6ef609 100644 --- a/library/ZendAfi/View/Helper/Accueil/HistoriqueRecherches.php +++ b/library/ZendAfi/View/Helper/Accueil/HistoriqueRecherches.php @@ -20,9 +20,12 @@ */ class ZendAfi_View_Helper_Accueil_HistoriqueRecherches extends ZendAfi_View_Helper_Accueil_Base { - public function shouldCacheContent() { - return false; - } + + + public function shouldCacheContent() : bool { + return false; + } + public function getHTML() { $this->titre = $this->view->tagAnchor(['controller' => 'recherche', 'action' => 'saisie'], diff --git a/library/ZendAfi/View/Helper/Accueil/IdentityProvider.php b/library/ZendAfi/View/Helper/Accueil/IdentityProvider.php index b91844e031037e20c8b386cbabd634251af5fc3e..720a5a2849fa00c3110011bde4f4c1a592ebde52 100644 --- a/library/ZendAfi/View/Helper/Accueil/IdentityProvider.php +++ b/library/ZendAfi/View/Helper/Accueil/IdentityProvider.php @@ -19,10 +19,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + class ZendAfi_View_Helper_Accueil_IdentityProvider extends ZendAfi_View_Helper_Accueil_Base { - /* Désactive le cache: sinon la boîte n'est pas à jour si on se connecte / déconnecte */ - public function shouldCacheContent() { return false; } + + public function shouldCacheContent() : bool { + return false; + } public function isBoiteVisible() { diff --git a/library/ZendAfi/View/Helper/Accueil/Kiosque.php b/library/ZendAfi/View/Helper/Accueil/Kiosque.php index 2404792a93927bc3a80a89ab05b908677e28e3c8..e44e69675ab2c84382d11ed6b32e64805e7fb913 100644 --- a/library/ZendAfi/View/Helper/Accueil/Kiosque.php +++ b/library/ZendAfi/View/Helper/Accueil/Kiosque.php @@ -30,7 +30,7 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $script_loader->addJQueryReady('$(".embedcode-button").click(function(){$(this).next().toggle("fast")})'); if($this->isModeMur() || $this->isModeVignettes()){ $this->view->getHelper('ListeNotices_Mur')->loadScript(); @@ -39,10 +39,12 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba if ($this->isModeChrono()) $this->view->getHelper('ListeNotices_Chrono')->loadScript(); + + return $this; } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return parent::shouldCacheContent() && in_array($this->preferences['style_liste'], ['mur', 'vignettes', 'chrono', 'simple_wall']); diff --git a/library/ZendAfi/View/Helper/Accueil/Library.php b/library/ZendAfi/View/Helper/Accueil/Library.php index 550d94bee6ec9441bf156743e0329af4aef466cf..163ea163c33f14bc516198616aa1c55f2993d613 100644 --- a/library/ZendAfi/View/Helper/Accueil/Library.php +++ b/library/ZendAfi/View/Helper/Accueil/Library.php @@ -28,7 +28,7 @@ class ZendAfi_View_Helper_Accueil_Library extends ZendAfi_View_Helper_Accueil_Ba $_filter_settings; - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } @@ -249,8 +249,9 @@ class ZendAfi_View_Helper_Accueil_Library extends ZendAfi_View_Helper_Accueil_Ba } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $this->renderScriptForFilters($this->_filter_settings); + return $this; } diff --git a/library/ZendAfi/View/Helper/Accueil/Login.php b/library/ZendAfi/View/Helper/Accueil/Login.php index 3deaedbbfa2610704ee45c943cdeb26c0d951b49..99576dc301dd0744af0fc75703be9ea3c13d276c 100644 --- a/library/ZendAfi/View/Helper/Accueil/Login.php +++ b/library/ZendAfi/View/Helper/Accueil/Login.php @@ -19,10 +19,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + class ZendAfi_View_Helper_Accueil_Login extends ZendAfi_View_Helper_Accueil_Base { - /* Désactive le cache: sinon la boîte n'est pas à jour si on se connecte / déconnecte */ - public function shouldCacheContent() { return false; } + + public function shouldCacheContent() : bool { + return false; + } public function getHtml() { diff --git a/library/ZendAfi/View/Helper/Accueil/MenuVertical.php b/library/ZendAfi/View/Helper/Accueil/MenuVertical.php index 02b616b20cee94ca2b7698938cf5998410934464..ebcb0eff36bb63d3f5a0a727cd75875eb7ac333b 100644 --- a/library/ZendAfi/View/Helper/Accueil/MenuVertical.php +++ b/library/ZendAfi/View/Helper/Accueil/MenuVertical.php @@ -31,7 +31,7 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue private $path_ico; - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } diff --git a/library/ZendAfi/View/Helper/Accueil/News.php b/library/ZendAfi/View/Helper/Accueil/News.php index 4d920e42c286649db3d897671131ffe355e04939..146df7db9273684a2216025d31c06dc5c3702933 100644 --- a/library/ZendAfi/View/Helper/Accueil/News.php +++ b/library/ZendAfi/View/Helper/Accueil/News.php @@ -25,7 +25,7 @@ class ZendAfi_View_Helper_Accueil_News extends ZendAfi_View_Helper_Accueil_Base protected $_articles = []; - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { if ($this->isDisplayDiaporama()) $this->renderSlideShowScriptsOn($script_loader, sprintf('.news-%d', $this->id_module), @@ -37,6 +37,8 @@ class ZendAfi_View_Helper_Accueil_News extends ZendAfi_View_Helper_Accueil_Base if ($this->isDisplayAccordionList()) $this->renderScriptForAccordionList(); + + return $this; } diff --git a/library/ZendAfi/View/Helper/Accueil/RechSimple.php b/library/ZendAfi/View/Helper/Accueil/RechSimple.php index 8262179ca07eca61f90793fd9a2091fdb62ecadf..11bd657631ba64db33518839a27f015143c9e7eb 100644 --- a/library/ZendAfi/View/Helper/Accueil/RechSimple.php +++ b/library/ZendAfi/View/Helper/Accueil/RechSimple.php @@ -20,7 +20,7 @@ */ class ZendAfi_View_Helper_Accueil_RechSimple extends ZendAfi_View_Helper_Accueil_Base { - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $script_loader ->addJQueryReady('$("input.expressionRecherche").attr("x-webkit-speech","x-webkit-speech")'); @@ -59,10 +59,9 @@ class ZendAfi_View_Helper_Accueil_RechSimple extends ZendAfi_View_Helper_Accueil } - public function shouldCacheContent() { - if (1 == (int)$this->preferences["select_bib"]) - return false; - - return parent::shouldCacheContent(); + public function shouldCacheContent() : bool { + return (1 == (int) $this->preferences["select_bib"]) + ? false + : parent::shouldCacheContent(); } } \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Accueil/Sito.php b/library/ZendAfi/View/Helper/Accueil/Sito.php index ee3af7942b26fc6cf18c5c07520e1de61c6e926a..d7de4c1651f320e818f4fac35c4355a0b149baef 100644 --- a/library/ZendAfi/View/Helper/Accueil/Sito.php +++ b/library/ZendAfi/View/Helper/Accueil/Sito.php @@ -22,8 +22,9 @@ class ZendAfi_View_Helper_Accueil_Sito extends ZendAfi_View_Helper_Accueil_Base { protected $strategy, $page; - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $this->getStrategy()->renderHeadScriptsOn($script_loader); + return $this; } @@ -50,7 +51,7 @@ class ZendAfi_View_Helper_Accueil_Sito extends ZendAfi_View_Helper_Accueil_Base } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return $this->isPaginatedDisplay() ? false : parent::shouldCacheContent(); diff --git a/library/ZendAfi/View/Helper/Telephone/Kiosque.php b/library/ZendAfi/View/Helper/Telephone/Kiosque.php index 7a8a878f20375359a9b629694948a239862c9866..98387b8aec984e34159f86ce5f260ecce2781a8f 100644 --- a/library/ZendAfi/View/Helper/Telephone/Kiosque.php +++ b/library/ZendAfi/View/Helper/Telephone/Kiosque.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class ZendAfi_View_Helper_Telephone_Kiosque extends ZendAfi_View_Helper_Accueil_Base { - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $script_loader ->addScript(BASE_URL . '/public/opac/mobile/js/kiosque-slideshow') ->addJQueryReady('$(\'#slideshow\').kiosqueSlideshow()') @@ -49,6 +49,7 @@ class ZendAfi_View_Helper_Telephone_Kiosque extends ZendAfi_View_Helper_Accueil_ } '); + return $this; } diff --git a/library/templates/Intonation/Library/View/Wrapper/Record.php b/library/templates/Intonation/Library/View/Wrapper/Record.php index c3d6e5e9b34d1ce6eead06cbc1139f7c52b62dde..3113823a97430f06802fac45fd5e7bbcb695737b 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Record.php +++ b/library/templates/Intonation/Library/View/Wrapper/Record.php @@ -26,6 +26,7 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra $_picture_cache, $_selectable_action = false, $_main_title, + $_secondary_title_cache, $_description, $_badges, $_allow_XSL = false, @@ -40,7 +41,9 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra public function getSecondaryTitle() { - return $this->_model->getMainAuthorFromCodif(); + return $this->_secondary_title_cache = $this->_secondary_title_cache + ? $this->_secondary_title_cache + : $this->_model->getMainAuthorFromCodif(); } diff --git a/library/templates/Intonation/Library/Widget/Accessibility/View.php b/library/templates/Intonation/Library/Widget/Accessibility/View.php index 6bcfbfbb83de1ec24c3613cf1387961e5f04b059..a27ec70fb4acd2b585ac5d1be4236c71910d0f79 100644 --- a/library/templates/Intonation/Library/Widget/Accessibility/View.php +++ b/library/templates/Intonation/Library/Widget/Accessibility/View.php @@ -29,7 +29,7 @@ class Intonation_Library_Widget_Accessibility_View extends Zendafi_View_Helper_A } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $id = 'accessibility_widget_tools_' . $this->getId(); $script_loader @@ -41,6 +41,8 @@ class Intonation_Library_Widget_Accessibility_View extends Zendafi_View_Helper_A if ($this->_settings->getDisplayFontSize()) $script_loader->addOPACStyleSheet('font_size_rules'); + + return $this; } diff --git a/library/templates/Intonation/Library/Widget/AdminTools/View.php b/library/templates/Intonation/Library/Widget/AdminTools/View.php index 7c8fe5a373a52d45b6a6ebe6aa25b7cae9c2daf5..d7c686ef8f2da21b4a9f6420422243eb3e2f3976 100644 --- a/library/templates/Intonation/Library/Widget/AdminTools/View.php +++ b/library/templates/Intonation/Library/Widget/AdminTools/View.php @@ -32,7 +32,7 @@ class Intonation_Library_Widget_Admintools_View extends Zendafi_View_Helper_Accu } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } diff --git a/library/templates/Intonation/Library/Widget/Breadcrumb/View.php b/library/templates/Intonation/Library/Widget/Breadcrumb/View.php index 89a24c36836a56c43aadecf7d437b3c3adf8f327..ea6eb3a3f2eb934faa24114ff2c2effe3edcf449 100644 --- a/library/templates/Intonation/Library/Widget/Breadcrumb/View.php +++ b/library/templates/Intonation/Library/Widget/Breadcrumb/View.php @@ -35,7 +35,7 @@ class Intonation_Library_Widget_Breadcrumb_View extends Zendafi_View_Helper_Accu } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } diff --git a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php index 278f245bf487bb5c0c5404cbcebf4ca0d70c4315..53dfc99af15bf3c0b7b34355f669d58a935f1886 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php @@ -27,7 +27,7 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_ protected $_calendar; - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $script_loader->addOPACScript('calendrier'); parent::_renderHeadScriptsOn($script_loader); return $this; diff --git a/library/templates/Intonation/Library/Widget/Carousel/Library/View.php b/library/templates/Intonation/Library/Widget/Carousel/Library/View.php index 09a30e77b2eb62876f28ec9d37ae32c954896c43..241aded2b52ff06d306fe69ef3e608c09725ab2b 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Library/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Library/View.php @@ -30,7 +30,7 @@ class Intonation_Library_Widget_Carousel_Library_View extends Intonation_Library } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } diff --git a/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php b/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php index 78018e2b637f0b2eb347d4460a62f89dd13daa6b..a266d910f4c08c0aad0462d34dbf7cfc61522641 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php @@ -122,14 +122,14 @@ class Intonation_Library_Widget_Carousel_Menu_View extends Intonation_Library_Wi } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return $this->_useNotCachedWidget() ? false : parent::shouldCacheContent(); } - protected function _useNotCachedWidget() { + protected function _useNotCachedWidget() : bool { if ( ! $menu = $this->_getMenu()) return false; diff --git a/library/templates/Intonation/Library/Widget/Carousel/Newsletter/View.php b/library/templates/Intonation/Library/Widget/Carousel/Newsletter/View.php index aff584ed3a8dc015826e34ce74001f97537feb3e..c0acc4697b88f213304462d3bdc31de35c6c6a97 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Newsletter/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Newsletter/View.php @@ -23,7 +23,8 @@ class Intonation_Library_Widget_Carousel_Newsletter_View extends Intonation_Library_Widget_Carousel_View { - public function shouldCacheContent() { + + public function shouldCacheContent() : bool { return !Class_Users::hasIdentity(); } diff --git a/library/templates/Intonation/Library/Widget/Carousel/View.php b/library/templates/Intonation/Library/Widget/Carousel/View.php index 3a02c930b7a2c1b7ea3324562afc607efd18d7f8..45ad83ab43e2a7b8fa2f83184a3810d7ce977b5b 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/View.php @@ -67,13 +67,21 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help } - protected function _renderHeadScriptsOn($script_loader) { + public function shouldCacheContent() : bool { + return $this->_isDelayed() + ? false + : parent::shouldCacheContent(); + } + + + protected function _renderHeadScriptsOn( Class_ScriptLoader $script_loader) : self { $this->_getLayoutHelper((string) $this->_settings->getLayout()) ->renderHeadScriptsOn($script_loader); + return $this; } - public function getFooter() { + public function getFooter() : string { $rss = $this->_settings->getRss() ? $this->_getTagRss() : ''; @@ -82,6 +90,7 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help ? $this->_getTagEmbededCode() : ''; + $link_to_all = $this->_settings->getLinkToAll() ? $this->_getTagLinkToAll() : ''; @@ -100,7 +109,7 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help } - protected function _getTagRss() { + protected function _getTagRss() : string { return $this->view->tagAnchor( $this->_getRSSUrl(), $this->view @@ -108,7 +117,8 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help 'utils'), ['class' => 'flux-rss', 'type' => 'application/rss+xml', - 'title' => $this->_('Flux RSS de la boite "%s"', $this->_settings->getTitre()) ]); + 'title' => $this->_('Flux RSS de la boite "%s"', + $this->_settings->getTitre()) ]); } diff --git a/library/templates/Intonation/Library/Widget/Login/View.php b/library/templates/Intonation/Library/Widget/Login/View.php index 3fe152948fd5eafb1384f232694609204304cd6d..c067d94c907fc0dfcee1bb39df2a19cbcdcf57c0 100644 --- a/library/templates/Intonation/Library/Widget/Login/View.php +++ b/library/templates/Intonation/Library/Widget/Login/View.php @@ -33,7 +33,7 @@ class Intonation_Library_Widget_Login_View extends Zendafi_View_Helper_Accueil_B } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } diff --git a/library/templates/Intonation/Library/Widget/Notify/View.php b/library/templates/Intonation/Library/Widget/Notify/View.php index b30f0828e951d977b3c82240fb5cc23e36fda3ef..07222a906691d81fbdb0e1b3f775eef9e31a30b7 100644 --- a/library/templates/Intonation/Library/Widget/Notify/View.php +++ b/library/templates/Intonation/Library/Widget/Notify/View.php @@ -32,7 +32,7 @@ class Intonation_Library_Widget_Notify_View extends Zendafi_View_Helper_Accueil_ } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } diff --git a/library/templates/Intonation/Library/Widget/Scroll/View.php b/library/templates/Intonation/Library/Widget/Scroll/View.php index 062625f2c3772b297f5dc2c1903c29b9d7cabd97..59d388df78ff2aa3a81e1112e78ed1585872b5ad 100644 --- a/library/templates/Intonation/Library/Widget/Scroll/View.php +++ b/library/templates/Intonation/Library/Widget/Scroll/View.php @@ -29,7 +29,7 @@ class Intonation_Library_Widget_Scroll_View extends Zendafi_View_Helper_Accueil_ } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $id = 'scroll_widget_' . $this->getId(); $direction = $this->_settings->getDirection(); @@ -39,6 +39,7 @@ class Intonation_Library_Widget_Scroll_View extends Zendafi_View_Helper_Accueil_ ->addJQueryReady(sprintf('$("#%s").scroll_button({direction: "%s"})', $id, $direction)); + return $this; } diff --git a/library/templates/Intonation/Library/Widget/Search/View.php b/library/templates/Intonation/Library/Widget/Search/View.php index 76219df02d73d36c13a2255df5c3a79d9a3d7ff4..a8169965067ffc73ef80f129912125a16864c2f9 100644 --- a/library/templates/Intonation/Library/Widget/Search/View.php +++ b/library/templates/Intonation/Library/Widget/Search/View.php @@ -31,7 +31,7 @@ class Intonation_Library_Widget_Search_View extends ZendAfi_View_Helper_Accueil_ } - public function shouldCacheContent() { + public function shouldCacheContent() : bool { return false; } @@ -58,7 +58,7 @@ class Intonation_Library_Widget_Search_View extends ZendAfi_View_Helper_Accueil_ } - protected function _renderHeadScriptsOn($script_loader) { + protected function _renderHeadScriptsOn(Class_ScriptLoader $script_loader) : self { $id = '#expressionRecherche_' . $this->_settings->getIdForHtml(); $script_loader ->addJQueryReady('$("' . $id . '").attr("x-webkit-speech","x-webkit-speech")') diff --git a/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php b/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php index 537e1c644904313a15947a422da56a86274f333d..aeee070a69fcfba6c58adcc6a303736f1fa1e3ab 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/SitoTest.php @@ -18,10 +18,11 @@ n * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserve * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + require_once 'library/ZendAfi/View/Helper/ViewHelperTestCase.php'; + abstract class SitoViewHelperTestCase extends ViewHelperTestCase { - protected $_storm_default_to_volatile = true; protected $html; protected $_preferences = []; @@ -52,9 +53,11 @@ abstract class SitoViewHelperTestCase extends ViewHelperTestCase { protected function createBoxAndHelper() { - $this->_helper = new ZendAfi_View_Helper_Accueil_Sito(2, ['division' => '1', - 'type_module' => 'SITO', - 'preferences' => $this->_preferences]); + $this->_helper = new ZendAfi_View_Helper_Accueil_Sito(2, + ['division' => '1', + 'type_module' => 'SITO', + 'preferences' => + $this->_preferences]); $view = new ZendAfi_Controller_Action_Helper_View(); $view->setScriptPath('application/modules/opac/views/scripts'); diff --git a/tests/scenarios/Templates/TemplatesWidgetCarouselTest.php b/tests/scenarios/Templates/TemplatesWidgetCarouselTest.php index b4085cd9298d4058e01b6855ea0d35ec1eac59cd..350c7026c2570eb8a2afc16a1a1e78b420b96a64 100644 --- a/tests/scenarios/Templates/TemplatesWidgetCarouselTest.php +++ b/tests/scenarios/Templates/TemplatesWidgetCarouselTest.php @@ -414,4 +414,13 @@ class TemplatesWidgetCarouselDelayedRecordWithDomainTest extends TemplatesWidget $this->dispatch('/admin/widget/edit-widget/id/1/id_profil/1'); $this->assertXPath('//form//input[@name="delayed"][@type="checkbox"][@data-level="expert"][@checked]'); } + + + /** @test */ + public function widgetOneShouldNotBeCached() { + $cache = $this->mock(); + Storm_Cache::setDefaultZendCache($cache); + $this->dispatch('/index'); + $this->assertTrue($cache->methodHasNotBeenCalled('memoize')); + } } \ No newline at end of file