Skip to content
Snippets Groups Projects
Commit 16cabde7 authored by llaffont's avatar llaffont
Browse files

OAI: refactoring + view helper player gallic a

parent 1146189e
Branches
Tags
No related merge requests found
......@@ -6,35 +6,13 @@ foreach ($this->notice->getDataAsArray() as $label => $value)
?>
<?php if ($this->notice->getEntrepot()->isGallica()) {
$id_ark = array_last(explode('/', $this->notice->getIdOai())); ?>
<?php if ($this->notice->isGallica()) {
$id_ark = $this->notice->getGallicaArkId(); ?>
<h3><?php echo $this->_('Consultation') ?></h3>
<object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="640"
height="415"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="id" value="LecteurExportable" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="window" />
<param
name="FlashVars"
value="ark=<?php echo $id_ark ?>&amp;lang=fr&amp;mode=dp&amp;showArrows=1&amp;bgColor=8553603&amp;autoFlip=0&amp;startPage=71&amp;widthWidget=640&amp;heightWidget=415" />
<param
name="src"
value="http://gallica.bnf.fr/flash/LecteurExportable.swf" />
<embed
id="LecteurExportable"
type="application/x-shockwave-flash"
width="640"
height="415"
src="http://gallica.bnf.fr/flash/LecteurExportable.swf"
flashvars="ark=<?php echo $id_ark ?>&amp;lang=fr&amp;mode=dp&amp;showArrows=1&amp;bgColor=8553603&amp;autoFlip=0&amp;startPage=71&amp;widthWidget=640&amp;heightWidget=415"
allowscriptaccess="always"
wmode="window" />
</object>
<?php echo $this->gallicaPlayer($this->notice->getGallicaArkId()) ?>
<?php } ?>
......@@ -82,7 +82,9 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
public function getDataAsArray() {
return unserialize($this->getData());
if ($datas = unserialize($this->getData()))
return $datas;
return array();
}
......@@ -302,6 +304,18 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
return $this->getEntrepot()->getLibelle();
return '';
}
public function isGallica() {
return $this->getEntrepot()->isGallica();
}
public function getGallicaArkId() {
if (!$this->isGallica())
return '';
return array_last(explode('/', $this->getIdOai()));
}
}
?>
\ No newline at end of file
......@@ -210,4 +210,29 @@ class OAIControllerResultatActionTest extends AbstractControllerTestCase {
}
}
class OAIControllerViewNoticeGallicaTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
Class_NoticeOAI::getLoader()
->newInstanceWithId(2)
->setTitre('Fleurs de nice')
->setIdOai('http://gallica.bnf.fr/ark://12345')
->setEntrepot(Class_EntrepotOAI::getLoader()
->newInstanceWithId(3)
->setLibelle('Gallica')
->setHandler('http://oai.bnf.fr'));
$this->dispatch('/opac/rechercheoai/viewnotice/id/2', true);
}
/** @test */
public function playerGallicaShouldBeEmbedded() {
$this->assertXPath('//object//param[@name="FlashVars"][contains(@value, "12345")]', $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