mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
generate pdf subdef
This commit is contained in:
@@ -13,6 +13,7 @@ use Alchemy\Phrasea\Media\Subdef\Video;
|
||||
use Alchemy\Phrasea\Media\Subdef\FlexPaper;
|
||||
use Alchemy\Phrasea\Media\Subdef\Gif;
|
||||
use Alchemy\Phrasea\Media\Subdef\Unknown;
|
||||
use Alchemy\Phrasea\Media\Subdef\Pdf;
|
||||
use Alchemy\Phrasea\Media\Subdef\Subdef as SubdefSpecs;
|
||||
use Alchemy\Phrasea\Media\Type\Type as SubdefType;
|
||||
use MediaAlchemyst\Specification\SpecificationInterface;
|
||||
@@ -40,9 +41,9 @@ class databox_subdef
|
||||
protected $translator;
|
||||
protected static $mediaTypeToSubdefTypes = [
|
||||
SubdefType::TYPE_AUDIO => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_AUDIO],
|
||||
SubdefType::TYPE_DOCUMENT => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_FLEXPAPER],
|
||||
SubdefType::TYPE_DOCUMENT => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_FLEXPAPER, SubdefSpecs::TYPE_PDF],
|
||||
SubdefType::TYPE_FLASH => [SubdefSpecs::TYPE_IMAGE],
|
||||
SubdefType::TYPE_IMAGE => [SubdefSpecs::TYPE_IMAGE],
|
||||
SubdefType::TYPE_IMAGE => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_PDF],
|
||||
SubdefType::TYPE_VIDEO => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_VIDEO, SubdefSpecs::TYPE_ANIMATION],
|
||||
SubdefType::TYPE_UNKNOWN => [SubdefSpecs::TYPE_IMAGE],
|
||||
];
|
||||
@@ -100,6 +101,9 @@ class databox_subdef
|
||||
case SubdefSpecs::TYPE_FLEXPAPER:
|
||||
$this->subdef_type = $this->buildFlexPaperSubdef($sd);
|
||||
break;
|
||||
case SubdefSpecs::TYPE_PDF:
|
||||
$this->subdef_type = $this->buildPdfSubdef($sd);
|
||||
break;
|
||||
case SubdefSpecs::TYPE_UNKNOWN:
|
||||
$this->subdef_type = $this->buildImageSubdef($sd);
|
||||
break;
|
||||
@@ -216,6 +220,16 @@ class databox_subdef
|
||||
{
|
||||
return new FlexPaper($this->translator);
|
||||
}
|
||||
/**
|
||||
* Build Pdf Subdef object depending the SimpleXMLElement
|
||||
*
|
||||
* @param SimpleXMLElement $sd
|
||||
* @return Pdf
|
||||
*/
|
||||
protected function buildPdfSubdef(SimpleXMLElement $sd)
|
||||
{
|
||||
return new Pdf($this->translator);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
@@ -360,6 +374,9 @@ class databox_subdef
|
||||
case SubdefSpecs::TYPE_VIDEO:
|
||||
$mediatype_obj = new Video($this->translator);
|
||||
break;
|
||||
case SubdefSpecs::TYPE_PDF:
|
||||
$mediatype_obj = new Pdf($this->translator);
|
||||
break;
|
||||
case SubdefSpecs::TYPE_UNKNOWN:
|
||||
$mediatype_obj = new Unknown($this->translator);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user