mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Fix #802 : Edit subdefs target devices
This commit is contained in:
@@ -85,8 +85,8 @@ class Subdefs implements ControllerProviderInterface
|
||||
|
||||
$post_sub_ex = explode('_', $post_sub);
|
||||
|
||||
$group = $post_sub_ex[0];
|
||||
$name = $post_sub_ex[1];
|
||||
$group = array_shift($post_sub_ex);
|
||||
$name = implode('_', $post_sub_ex);
|
||||
|
||||
$class = $request->get($post_sub . '_class');
|
||||
$downloadable = $request->get($post_sub . '_downloadable');
|
||||
|
@@ -221,7 +221,7 @@ class databox_subdef
|
||||
}
|
||||
}
|
||||
|
||||
$mediatype_obj->registerOption(new \Alchemy\Phrasea\Media\Subdef\OptionType\Multi(_('Target Device'), 'device', $availableDevices, $this->devices));
|
||||
$mediatype_obj->registerOption(new \Alchemy\Phrasea\Media\Subdef\OptionType\Multi(_('Target Device'), 'devices', $availableDevices, $this->devices));
|
||||
|
||||
$subdefTypes[] = $mediatype_obj;
|
||||
}
|
||||
|
@@ -261,13 +261,15 @@ class databox_subdefsStructure implements IteratorAggregate
|
||||
. 'subdef[@name="' . $name . '"]'
|
||||
);
|
||||
|
||||
$refNode = null;
|
||||
if ($nodes->length > 0) {
|
||||
for ($i = 0; $i < $nodes->length; $i ++ ) {
|
||||
$refNode = $nodes->item($i)->nextSibling;
|
||||
$dom_group->removeChild($nodes->item($i));
|
||||
}
|
||||
}
|
||||
|
||||
$dom_group->appendChild($subdef);
|
||||
$dom_group->insertBefore($subdef, $refNode);
|
||||
|
||||
$this->databox->saveStructure($dom_struct);
|
||||
|
||||
|
Reference in New Issue
Block a user