Commit 132b4148 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #71664 replace pretty-photo by simple anchor

parent 2f0fee1f
- ticket #71664 : Accessibilité RGAA : remplacement de la visualisation en popup par l'ouverture dans un nouvel onglet.
......@@ -38,7 +38,8 @@ $editable = $catalog->canBeDeletedOrModifyByUser($user);
'id_catalogue' => $catalog->getId()],
null, true);
echo $this->tagPreview($catalogue_url, $this->_('Visualiser le domaine : %s', $catalog->getLibelle()));
echo $this->tagPreview($catalogue_url,
$this->_('Visualiser le domaine "%s" dans un nouvel onglet', $catalog->getLibelle()));
echo $this->permalink($catalogue_url);
?>
......
......@@ -4,7 +4,7 @@
$paniers = $this->catalogue->getPanierNotices();
foreach($paniers as $panier) {
$panier_url = $this->absoluteUrl(['module' => 'opac',
$panier_url = $this->absoluteUrl(['module' => 'opac',
'controller' => 'recherche',
'action' => 'simple',
'id_panier' => $panier->getId()],
......@@ -14,9 +14,10 @@ foreach($paniers as $panier) {
echo sprintf('<li>%s %s %s %s</li>',
$panier_libelle,
$this->tagPreview($panier_url, 'Visualisation du panier: '.$panier_libelle),
$this->permalink($panier_url),
$this->tagAnchor(['remove' => $panier->getId()],
$this->tagPreview($panier_url,
$this->_('Visualisation du panier "%s" dans un nouvel onglet', $panier_libelle)),
$this->permalink($panier_url),
$this->tagAnchor(['remove' => $panier->getId()],
'<img src="'.URL_ADMIN_IMG.'ico/del.gif'.'" alt="Supprimer" title="Supprimer" />'));
}
......@@ -24,4 +25,4 @@ echo $this->renderForm($this->form_paniers);
?>
</ul>
\ No newline at end of file
</ul>
......@@ -7,7 +7,9 @@ if (!$this->article->isNew()) {
'action' => 'articleview',
'id' => $this->article->getId()],
null, true);
echo $this->tagPreview($article_url, "Visualisation de l'article: " . $this->article->getTitre());
echo $this->tagPreview($article_url,
$this->_('Visualisation de l\'article "%s" dans un nouvel onglet',
$this->article->getTitre()));
echo $this->permalink($this->absoluteUrl($article_url));
}
......
......@@ -62,7 +62,7 @@ $description = (new Class_TableDescription('features'))
if(!$feature->getTest())
return '';
return $this->tagPreview(Class_Url::relative($feature->getTest()),
$this->_('Essayer'));
$this->_('Essayer "%s" dans un nouvel onglet', $feature->getLabel()));
})
;
......
......@@ -31,7 +31,7 @@ $url_delete_profil = $this->url(['module' => 'admin',
<?php
echo $this->tagPreview($this->url(['id_profil' => $this->profil->getId()], null, true),
sprintf("Visualisation de la page '%s'", $this->profil->getLibelle()));
$this->_('Ouvrir la page "%s" dans un nouvel onglet', $this->profil->getLibelle()));
?>
<a href="<?php echo $url_copy_profil ?>">
......
......@@ -11,7 +11,6 @@
| Simple color picker (jQuery Plugin) | ? | X | formulaires, sélection couleur | | http://vreboton.blogspot.fr/2010/01/simple-color-picker-jquery-color-picker.html |
| CkEditor | GPL/LGPL/MPL | X | CMS / Formations / bib num | | http://ckeditor.com/ |
| C5 FileManager | MIT | X | CMS | X | http://labs.corefive.com/projects/filemanager/ |
| PrettyPhoto (js) | Creative C. Attribution 2.5 | X | previews, bib num | | http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ |
| Notify (jQuery plugin) | Creative Commons ? | - | module formations | | http://www.greepit.com/notify/ , http://www.greepit.com/2011/07/designing-user-friendly-websites-and-applications-with-notify/ |
| Slimbox2 (jQuery plugin) | MIT-style license (?) | X | photos un peu partout | | http://www.digitalia.be |
| Tooltip (jQuery plugin) | MIT/GPL | X | réseau bib | | http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ |
......
......@@ -142,19 +142,6 @@ class Class_ScriptLoader {
}
/**
* @return ScriptLoader
*/
public function loadPrettyPhoto() {
return $this
->addStyleSheet(URL_ADMIN_JS.'prettyphoto/css/prettyPhoto')
->addAdminScript('prettyphoto/js/jquery.prettyPhoto')
->addJQueryReady('var new_pretty_photo_tags = $("a[data-prettyphoto=\'true\']");'.
'new_pretty_photo_tags.each(function(){$(this).attr("rel", $(this).attr("data-rel"));});'.
'$("a[rel^=\'prettyPhoto\']").add(new_pretty_photo_tags).prettyPhoto({opacity: 0.20, social_tools: ""})');
}
/**
* @return ScriptLoader
*/
......
......@@ -47,7 +47,7 @@ class ZendAfi_View_Helper_Accueil_Panier extends ZendAfi_View_Helper_Accueil_Abo
'action' => 'simple',
'id_panier' => $this->_selection->getId(),
'retour_panier' => $this->_selection->getId()]),
$this->_('Prévisualisation du panier %s dans le résultat de recherche', $this->_selection->getLibelle()));
$this->_('Prévisualisation du panier "%s" en résultat de recherche dans un nouvel onglet', $this->_selection->getLibelle()));
$html .= $this->view->permalink($this->view->absoluteUrl(['module' => 'opac',
'controller' => 'recherche',
'action' => 'simple',
......
......@@ -32,8 +32,7 @@ class ZendAfi_View_Helper_Admin_Head extends ZendAfi_View_Helper_BaseHelper {
'global',
'toolbar'])
->addOPACScript('subModal')
->showNotifications()
->loadPrettyPhoto();
->showNotifications();
Class_Admin_Skin::current()->renderScriptsOn($head_scripts);
......
......@@ -30,7 +30,7 @@ class ZendAfi_View_Helper_ListeNotices_TableauPanier extends ZendAfi_View_Helper
return $this->view->tagPreview($this->view->url(['controller' => 'recherche',
'action' => 'viewnotice',
'id' => $model->getId()], null, true),
$this->_('Prévisualisation de la notice %s', $model->getTitrePrincipal()));
$this->_('Voir la notice "%s" dans un nouvel onglet', $model->getTitrePrincipal()));
},
function($model) use($selection){
return $this->view->tagAnchor($this->view->url(['action' => 'delete-record',
......
......@@ -45,8 +45,8 @@ class ZendAfi_View_Helper_Panier_Table extends ZendAfi_View_Helper_BaseHelper {
return $this->view->tagPreview($this->view->url(['controller' => 'recherche',
'action' => 'simple',
'id_panier' => $model->getId(),
'retour_panier' => $model->getId()]),
$this->_('Prévisualisation du panier %s dans le résultat de recherche', $model->getLibelle()));
'retour_panier' => $model->getId()]),
$this->_('Prévisualisation du panier "%s" en résultat de recherche dans un nouvel onglet', $model->getLibelle()));
};
$permalink = function($model) {
return $this->view->permalink($this->view->absoluteUrl(['module' => 'opac',
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
* Copyright (c) 2012-2017, 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
......@@ -18,22 +18,16 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_TagPreview extends ZendAfi_View_Helper_BaseHelper {
public function tagPreview($url, $libelle) {
Class_ScriptLoader::getinstance()->loadPrettyPhoto();
$url .= '?' . http_build_query(['iframe' => 'true',
'width' => '95%',
'height' => '95%'], '', '&amp;');
class ZendAfi_View_Helper_TagPreview extends ZendAfi_View_Helper_BaseHelper {
public function tagPreview($url, $title) {
$icon = Class_Admin_Skin::current()->renderActionIconOn('view', $this->view,
['title' => $libelle,
'alt' => $libelle]);
['title' => $title,
'alt' => $title]);
return
$this->view->tagAnchor($url, $icon, ['data-prettyphoto' => 'true',
'title' => $libelle]);
return $this->view->tagAnchor($url,
$icon,
['title' => $title]);
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -121,8 +121,7 @@ class ZendAfi_View_Helper_TagSlideshow extends Zend_View_Helper_HtmlElement {
$(\'%1$s\').cycle(\'next\') } );
container.find(\'.controls a\').css(\'top\', (container.parent().height()/3)+\'px\')',
$selector,
json_encode($cycle_options)))
->loadPrettyPhoto();
json_encode($cycle_options)));
return $this;
}
......@@ -189,14 +188,12 @@ class ZendAfi_View_Helper_TagSlideshow extends Zend_View_Helper_HtmlElement {
$media->getLinkTo(),
$data);
} else {
$datas['content'] = sprintf('<a href="%s" data-prettyphoto="true" data-rel="prettyphoto[%s]" title="%s">%s</a>',
$this->view->url(array('module' => 'opac',
'controller' => 'bib-numerique',
'action' => 'get-resource',
'id' => $media->getId())),
htmlentities($media->getAlbum()->getTitre()),
$media->getTitre(),
$content);
$datas['content'] = $this->view->tagAnchor($this->view->url(['module' => 'opac',
'controller' => 'bib-numerique',
'action' => 'get-resource',
'id' => $media->getId()]),
$content,
['title' => $this->_('Accéder à la ressource "%s" dans un nouvel onglet', $media->getTitre())]);
}
......
......@@ -366,7 +366,7 @@ class CatalogueControllerWithModoPortailTotalAccessIndexTest extends AdminCatalo
/** @test */
public function pageShouldContainsCataloguePolitiquePreview() {
$this->assertXPath('//a[@data-prettyphoto="true"][contains(@href, "recherche/simple/id_catalogue/200")]');
$this->assertXPath('//a[contains(@href, "recherche/simple/id_catalogue/200")]');
}
......@@ -1298,7 +1298,7 @@ class CatalogueControllerPaniersHistoireTest extends AdminCatalogueControllerTes
/** @test */
public function pageShouldContainsPanierPreview() {
$this->assertXPath('//a[@data-prettyphoto="true"][contains(@href, "recherche/simple/id_panier/8")]');
$this->assertXPath('//a[contains(@href, "recherche/simple/id_panier/8")]');
}
}
......
......@@ -771,13 +771,13 @@ class CmsControllerArticleConcertEditActionTest extends CmsControllerWithPermiss
/** @test */
function previewShouldContainsArticleUrl() {
$this->assertXPath('//a[@data-prettyphoto="true"][contains(@href, "/cms/articleview/id/4")]');
$this->assertXPath('//a[contains(@href, "/cms/articleview/id/4")]');
}
/** @test */
function previewTitleShouldBeVisualisationDeLArticle() {
$this->assertXPath('//a[@data-prettyphoto="true"][contains(@title, "Visualisation de l\'article: Erik Truffaz en concert")]');
$this->assertXPath('//a[contains(@title, "Erik Truffaz en concert")]');
}
......@@ -2607,7 +2607,7 @@ class CmsControllerArticleExistingTraductionEditTest extends CmsControllerWithPe
/** @test */
function previewShouldContainsArticleUrl() {
$this->assertXPath('//a[@data-prettyphoto="true"][contains(@href, "cms/articleview/id/41")]');
$this->assertXPath('//a[contains(@href, "cms/articleview/id/41")]');
}
}
......
......@@ -124,7 +124,7 @@ class Admin_ProfilControllerWithAdminPortailIndexTest extends Admin_ProfilContro
/** @test */
function previewPageAccueilAnchorTitleShouldBeVisualisationDeLaPageAdulte() {
$this->assertXPath('//div/ul[1]//li[1]//a[@data-prettyphoto="true"][contains(@title, "Visualisation de la page \'Adulte\'")][@href="/index/index/id_profil/8?iframe=true&width=95%25&height=95%25"]');
$this->assertXPath("//div/ul[1]//li[1]//a[contains(@title, 'Ouvrir la page \"Adulte\"')][@href='/index/index/id_profil/8']");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment