Skip to content
Snippets Groups Projects
Commit 8f636db5 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #78660 implement viewer

parent c5d68798
Branches
Tags
4 merge requests!2871Wip,!2869Master,!2865Dev#78660 explo melun recuperation des infos oai de la plateforme decalog,!2863Dev#78660 explo melun recuperation des infos oai de la plateforme decalog
Pipeline #5185 failed with stage
in 27 minutes and 11 seconds
......@@ -20,4 +20,27 @@
*/
class EntrepotNumeriqueMelun_View_Helper_Album extends Class_DigitalResource_AlbumViewHelper {}
\ No newline at end of file
class EntrepotNumeriqueMelun_View_Helper_Album extends Class_DigitalResource_AlbumViewHelper {
public function album($album) {
if (!$album)
return '';
if (!$viewer = $album->getExternalUri())
return '';
$class = $this->_config->getName(). '_viewer';
Class_ScriptLoader::getInstance()
->addInlineStyle(sprintf('iframe.%s { height: %dpx; width: %dpx }',
$class,
900,
600));
return
$this->_tagAnchor($viewer, $viewer, ['target' => '_blank'])
. $this->_tag('iframe',
null,
['src' => $viewer,
'class' => $class]);
}
}
\ No newline at end of file
......@@ -205,4 +205,15 @@ class EntrepotNumeriqueMelunHarvestTests extends EntrepotNumeriqueMelunActivated
public function origineDocTypeShouldBeTexteManuscrit() {
$this->assertEquals('texte manuscrit', $this->_album->getNote('915$a'));
}
/** @test */
public function dispatchResnumeriquesOnIndexedAlbumShouldRenderViewer() {
$this->_album->index();
$id = $this->_album->getNotice()->getId();
$this->dispatch('/opac/noticeajax/resnumeriques/id/' . $id, true);
$this->assertXPath('//iframe[@src="http://melun.preprod-osiros.decalog.net//viewer.php?docId=100"]');
$this->assertXPathContentContains('//style', 'height: 900px', $this->_response->getBody());
}
}
\ No newline at end of file
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