Merge pull request #2651 from aynsix/PHRAS-2115-admin-subview-create-mediatype

PHRAS-2115  admin - database -subwiew create, PDF option don't appear is media type dropdown
This commit is contained in:
Nicolas Maillat
2018-06-21 13:31:46 +00:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -208,10 +208,10 @@ class SubdefsController extends Controller
protected function getSubviewsMapping()
{
$mapping = [
Type::TYPE_IMAGE => [Subdef::TYPE_IMAGE],
Type::TYPE_IMAGE => [Subdef::TYPE_IMAGE, Subdef::TYPE_PDF],
Type::TYPE_VIDEO => [Subdef::TYPE_IMAGE, Subdef::TYPE_VIDEO, Subdef::TYPE_ANIMATION],
Type::TYPE_AUDIO => [Subdef::TYPE_IMAGE, Subdef::TYPE_AUDIO],
Type::TYPE_DOCUMENT => [Subdef::TYPE_IMAGE, Subdef::TYPE_FLEXPAPER],
Type::TYPE_DOCUMENT => [Subdef::TYPE_IMAGE, Subdef::TYPE_FLEXPAPER, Subdef::TYPE_PDF],
Type::TYPE_FLASH => [Subdef::TYPE_IMAGE]
];

View File

@@ -197,7 +197,10 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
$subdef->setAttribute('class', $class);
$subdef->setAttribute('name', mb_strtolower($name));
$subdef->setAttribute('presets', $preset);
$subdef->setAttribute('mediaType', $mediatype);
$mediaTypeElement = $dom_struct->createElement('mediatype');
$mediaTypeElement->appendChild($dom_struct->createTextNode($mediatype));
$subdef->appendChild($mediaTypeElement);
$dom_xp = $this->databox->get_xpath_structure();
$query = '//record/subdefs/subdefgroup[@name="' . $groupname . '"]';