Skip to content
Snippets Groups Projects
Commit 27e37955 authored by ayjuillet's avatar ayjuillet
Browse files

Téléphone : Skin jquery Bibnumerique

parent 7ad76351
No related merge requests found
......@@ -2150,6 +2150,8 @@ library/ZendAfi/View/Helper/Telephone/Kiosque.php -text
library/ZendAfi/View/Helper/Telephone/ListeNotices.php -text
library/ZendAfi/View/Helper/Telephone/News.php -text
library/ZendAfi/View/Helper/Telephone/Pager.php -text
library/ZendAfi/View/Helper/Telephone/RenderAlbum.php -text
library/ZendAfi/View/Helper/Telephone/TagAlbumMediaList.php -text
library/ZendAfi/View/Helper/Telephone/Tags/NoticeDetaillee.php -text
library/ZendAfi/View/Helper/Telephone/Tags/ResumeAvis.php -text
library/ZendAfi/View/Helper/Telephone/Tags/Toolbar.php -text
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 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).
*
* AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Telephone_RenderAlbum extends ZendAfi_View_Helper_RenderAlbum {
public function renderAlbum($album) {
return $album
? sprintf('<div id="resnum">%s</div>', $this->renderAlbumHelper($album))
: '';
}
public function renderAlbumHelper($album) {
if ($album->isLivreNumerique()) {
Class_ScriptLoader::getInstance()->loadBooklet($album->getId(), '#resnum');
return '';
}
if ($album->isDiaporama() && $album->hasOnlyImages())
return $this->view->tagSlideshow($album);
if ($album->isGallica())
return $this->view->gallicaPlayer($album);
if ($album->isArteVod())
return $this->view->tagVideo($album);
return $this->view->tagAlbumMediaList($album);
}
}
?>
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 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).
*
* AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Telephone_TagAlbumMediaList extends ZendAfi_View_Helper_TagAlbumMediaList {
protected $_builder;
public function tagAlbumMediaList($album) {
$ressources = $album->getRessources();
$xspf_url = $this->view->url(['module' => 'telephone',
'controller' => 'bib-numerique',
'action' => 'album-xspf-playlist',
'id' => $album->getId()]);
$podcast_url = $this->view->url(['module' => 'telephone',
'controller' => 'bib-numerique',
'action' => 'Album-rss-feed',
'id' => $album->getId()]);
$html='';
foreach($ressources as $ressource) {
$html .= sprintf('<li data-role="list-divider" ><a href=%s rel="external"><img src=%s><h3>%s</h3></a></li>',
$this->view->absoluteUrl($ressource->getOriginalUrl()),
$this->view->absoluteurl($ressource->getThumbnailUrl()),
$ressource->getTitre());}
$playlist = sprintf('<a href="%s" data-role="button" data-mini="true" data-icon="list-alt" rel="external">%s</a>',
$this->view->absoluteUrl($xspf_url.'.xspf'),
$this->view->_('Playlist'),
['data-ajax' => 'false']);
$rss = sprintf('<a href="%s" data-role="button" data-mini="true" data-icon="rss" rel="external">%s</a>',
$this->view->absoluteUrl($podcast_url.'.xml'),
$this->view->_('RSS'));
return '<ul data-role="listview">' . $html . '</ul><fieldset class="ui-grid-a"><div class="ui-block-a">' .$playlist.'</div><div class="ui-block-b">' .$rss . '</div></fieldset>' ;
}
}
?>
\ No newline at end of file
......@@ -73,14 +73,13 @@ class BibNumeriqueControllerTelephoneViewCategorieEPUBTest extends BibNumeriqueC
class BibNumeriqueControllerTelephoneViewAlbumMonumentsTest extends BibNumeriqueControllerTelephoneTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/bib-numerique/view-album/id/234');
$this->dispatch('/bib-numerique/view-album/id/234', true);
}
/** @test */
public function pageShouldContainsLinkToDownloadEPub() {
$this->assertXPathContentContains('//a[contains(@href, "bib-numerique/download-resource/id/123")][@data-ajax="false"]',
'versailles.epub');
$this->assertXPath('//a[contains(@href, "media/versailles.epub")]');
}
}
......@@ -112,14 +111,21 @@ class BibNumeriqueControllerTelephoneViewAlbumMultiMedia extends TelephoneAbstra
/** @test */
public function pageShouldContainsLinkToXSPFPlayList() {
$this->assertXPath('//a[@href="http://localhost'.BASE_URL.'/bib-numerique/album-xspf-playlist/id/999.xspf"][@data-ajax="false"]', $this->_response->getBody());
$this->assertXPath('//a[contains(@href, "bib-numerique/album-xspf-playlist/id/999.xspf")]');
}
/** @test */
public function pageShouldContainsLinkToRSSPodcast() {
$this->assertXPath('//a[@href="http://localhost'.BASE_URL.'/bib-numerique/album-rss-feed/id/999.xml"][@data-ajax="false"]');
$this->assertXPath('//a[contains(@href, "bib-numerique/Album-rss-feed/id/999.xml")]');
}
/** @test */
public function pageShouldContainLinkIntroductionMp3() {
$this->assertXPath('//a[contains(@href, "media/introduction.mp3")]');
}
}
......
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