mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
PHRAS-3712 admin - sudefinition - property to define building rules on subdefinition (#4104)
* add building rules * setting in first position attribute `tobuild` on subdefinition limit subdef name to 64 like db taken account tobuild in tools rebuild GUI taken account tobuild in command `bin/console records:build-subdefs` * add check * add tobuild in api response * fix command `bin/console records:build-subdefs`
This commit is contained in:
@@ -242,10 +242,11 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
* @param array $labels
|
||||
* @param boolean $orderable
|
||||
* @param string $preset
|
||||
* @param boolean $toBuild
|
||||
* @return databox_subdefsStructure
|
||||
* @throws Exception
|
||||
*/
|
||||
public function set_subdef($group, $name, $class, $downloadable, $options, $labels, $orderable = true, $preset = "Custom")
|
||||
public function set_subdef($group, $name, $class, $downloadable, $options, $labels, $orderable = true, $preset = "Custom", $toBuild = true)
|
||||
{
|
||||
$dom_struct = $this->databox->get_dom_structure();
|
||||
|
||||
@@ -254,6 +255,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
$subdef->setAttribute('name', mb_strtolower($name));
|
||||
$subdef->setAttribute('downloadable', ($downloadable ? 'true' : 'false'));
|
||||
$subdef->setAttribute('orderable', ($orderable ? 'true' : 'false'));
|
||||
$subdef->setAttribute('tobuild', ($toBuild ? 'true' : 'false'));
|
||||
$subdef->setAttribute('presets', $preset);
|
||||
|
||||
foreach ($labels as $code => $label) {
|
||||
|
Reference in New Issue
Block a user