From 77b67d3da7819e1c0b49dac17562e47d543c9e39 Mon Sep 17 00:00:00 2001
From: gloas <gloas@afi-sa.fr>
Date: Tue, 26 Feb 2019 15:01:57 +0100
Subject: [PATCH] dev #64573 fix rt

---
 VERSIONS_WIP/64573                            |  1 -
 .../opac/controllers/BlogController.php       |  2 --
 .../opac/controllers/IndexController.php      | 28 -------------------
 library/Class/Xml.php                         |  7 ++---
 .../Intonation/View/RenderRecordReview.php    | 21 --------------
 .../opac/java/accessibility/accessibility.js  | 15 +++++-----
 6 files changed, 10 insertions(+), 64 deletions(-)
 delete mode 100644 VERSIONS_WIP/64573

diff --git a/VERSIONS_WIP/64573 b/VERSIONS_WIP/64573
deleted file mode 100644
index 4277278b9cb..00000000000
--- a/VERSIONS_WIP/64573
+++ /dev/null
@@ -1 +0,0 @@
- - ticket #64573 : Templates pour l'interface publique libraire bootstrap
\ No newline at end of file
diff --git a/application/modules/opac/controllers/BlogController.php b/application/modules/opac/controllers/BlogController.php
index b0e61479fbd..d0239f063cc 100644
--- a/application/modules/opac/controllers/BlogController.php
+++ b/application/modules/opac/controllers/BlogController.php
@@ -178,8 +178,6 @@ class BlogController extends ZendAfi_Controller_Action {
     $this->view->models =
       (new Class_ReviewsByRecord)->applyOrder($this->_getParam('order'),
                                               Class_AvisNotice::groupByRecords(Class_AvisNotice::findAllBy($params)));
-
-    $this->renderScript('blog/list.phtml');
   }
 
 
diff --git a/application/modules/opac/controllers/IndexController.php b/application/modules/opac/controllers/IndexController.php
index 054ed55c63d..f58922a4de8 100644
--- a/application/modules/opac/controllers/IndexController.php
+++ b/application/modules/opac/controllers/IndexController.php
@@ -151,32 +151,4 @@ class IndexController extends ZendAfi_Controller_Action {
   public function statusAction() {
     $this->_helper->json(json_decode($this->view->status_Json(), true));
   }
-
-
-  public function pictureAction() {
-    session_write_close();
-    $this->_helper->getHelper('viewRenderer')->setNoRender();
-
-    if (!$url = $this->_getParam('url'))
-      return $this->_response->setHttpResponseCode(404);
-
-    try {
-
-      $response = (new Class_UrlManager)->getWebClient()->getResponse($url);
-      $this->_redirect($url);
-
-    } Catch(Exception $e) {
-
-      if (!$path = Class_Template::current()->getIco($this->view, 'image_place_holder', 'utils'))
-        return $this->_response->setHttpResponseCode(404);
-
-      Class_FileManager::beOpenBar();
-      if (!$file = Class_FileManager::find($path))
-        return $this->_response->setHttpResponseCode(404);
-
-      $this->_response
-        ->setHeader('Content-Type', Class_File_Mime::getTypeFromPath($file->getPath()))
-        ->setBody($file->getContent());
-    }
-  }
 }
\ No newline at end of file
diff --git a/library/Class/Xml.php b/library/Class/Xml.php
index c608b68107a..75f50922049 100644
--- a/library/Class/Xml.php
+++ b/library/Class/Xml.php
@@ -85,11 +85,8 @@ class Class_Xml {
 
 
   public function getNode($tag) {
-    $tag = strToUpper($tag);
-
-    if(isset($this->index[$tag]))
-      return $this->index[$tag][0];
-
+    $tag=strToUpper($tag);
+    if(isset($this->index[$tag])) return $this->index[$tag][0];
     return -1;
   }
 
diff --git a/library/templates/Intonation/View/RenderRecordReview.php b/library/templates/Intonation/View/RenderRecordReview.php
index 5dfc862d1a4..2dd160e5625 100644
--- a/library/templates/Intonation/View/RenderRecordReview.php
+++ b/library/templates/Intonation/View/RenderRecordReview.php
@@ -28,26 +28,5 @@ class Intonation_View_RenderRecordReview extends ZendAfi_View_Helper_BaseHelper
       ->setModel($record_review);
 
     return $this->view->cardify($wrapped);
-
-    $body_content = [$this->_tag('h2',
-                                 $wrapped->getTitle(),
-                                 ['class' => 'card-title']),
-
-                     $this->_tag('p',
-                                 $wrapped->getAuthor(),
-                                 ['class' => 'card-subtitle text-muted']),
-
-                     $this->_tag('p',
-                                 $wrapped->getFullDescription(),
-                                 ['class' => 'card-text']),
-    ];
-
-    $body = $this->_tag('div',
-                        implode($body_content),
-                        ['class' => 'card-body']);
-
-    return $this->_tag('div',
-                       $body,
-                       ['class' => 'card card_record_review']);
   }
 }
\ No newline at end of file
diff --git a/public/opac/java/accessibility/accessibility.js b/public/opac/java/accessibility/accessibility.js
index 41a36ec92a1..2f85288bbc4 100644
--- a/public/opac/java/accessibility/accessibility.js
+++ b/public/opac/java/accessibility/accessibility.js
@@ -25,23 +25,24 @@
     widget.find('[data-stylesheet-url]').click(function(event) {
       event.preventDefault();
 
-      var button = $(event.target);
+      $('link[rel="stylesheet"]').prop('disabled', null);
+      $('link[data-accessibility]').remove();
 
-      if ($('head').find('link[data-accessibility]').length < 1)
-	$('head').append('<link media="screen" rel="stylesheet" type="text/css" data-accessibility="1"></link>');
+      var button = $(this);
 
-      $('head').find('link[data-accessibility]').prop('href', button.attr('data-stylesheet-url'));
+      $('head').append('<link media="screen" rel="stylesheet" type="text/css" data-accessibility="1" href="'
+		       + button.attr('data-stylesheet-url') + '"></link>');
 
       saveStyleInCookie(button.attr('data-cookie-key'));
     });
 
     widget.find('[data-stylesheet-default]').click(function(event) {
       event.preventDefault();
-      
+     
       $('link[data-accessibility]').remove();
       $('link[rel="stylesheet"]').prop('disabled', null);
 
-      var button = $(event.target);
+      var button = $(this);
       saveStyleInCookie(button.attr('data-cookie-key'));
     });
 
@@ -51,7 +52,7 @@
       $('link[data-accessibility]').remove();
       $('link[rel="stylesheet"]').prop('disabled', true);
 
-      var button = $(event.target);
+      var button = $(this);
       saveStyleInCookie(button.attr('data-cookie-key'));
     });
     
-- 
GitLab