PHRAS-1279_SUBSTITUTE-UNKNOWN-TYPE

- new : added missing options (settings) "size", "resolution", ... to "unknown"-type subdef
This commit is contained in:
Jean-Yves Gaulier
2016-11-03 18:48:57 +01:00
parent 4e5d0758e6
commit b526d0ecdc
3 changed files with 78 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ use Alchemy\Phrasea\Media\Subdef\Audio;
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\Subdef as SubdefSpecs;
use Alchemy\Phrasea\Media\Type\Type as SubdefType;
use MediaAlchemyst\Specification\SpecificationInterface;
@@ -46,6 +47,7 @@ class databox_subdef
SubdefType::TYPE_FLASH => [SubdefSpecs::TYPE_IMAGE],
SubdefType::TYPE_IMAGE => [SubdefSpecs::TYPE_IMAGE],
SubdefType::TYPE_VIDEO => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_VIDEO, SubdefSpecs::TYPE_ANIMATION],
SubdefType::TYPE_UNKNOWN => [SubdefSpecs::TYPE_IMAGE],
];
const CLASS_THUMBNAIL = 'thumbnail';
@@ -106,6 +108,9 @@ class databox_subdef
case SubdefSpecs::TYPE_FLEXPAPER:
$this->subdef_type = $this->buildFlexPaperSubdef($sd);
break;
case SubdefSpecs::TYPE_UNKNOWN:
$this->subdef_type = $this->buildImageSubdef($sd);
break;
}
}
@@ -229,6 +234,9 @@ class databox_subdef
case SubdefSpecs::TYPE_VIDEO:
$mediatype_obj = new Video($this->translator);
break;
case SubdefSpecs::TYPE_UNKNOWN:
$mediatype_obj = new Unknown($this->translator);
break;
default:
continue;
break;