mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Add localized labels in subdef editing
This commit is contained in:
@@ -220,7 +220,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
* @param Array $options
|
||||
* @return databox_subdefsStructure
|
||||
*/
|
||||
public function set_subdef($group, $name, $class, $downloadable, $options)
|
||||
public function set_subdef($group, $name, $class, $downloadable, $options, $labels)
|
||||
{
|
||||
$dom_struct = $this->databox->get_dom_structure();
|
||||
|
||||
@@ -229,6 +229,14 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
$subdef->setAttribute('name', mb_strtolower($name));
|
||||
$subdef->setAttribute('downloadable', ($downloadable ? 'true' : 'false'));
|
||||
|
||||
foreach ($labels as $code => $label) {
|
||||
$child = $dom_struct->createElement('label');
|
||||
$labelElement = $child->appendChild($dom_struct->createTextNode($label));
|
||||
$lang = $child->appendChild($dom_struct->createAttribute('lang'));
|
||||
$lang->value = $code;
|
||||
$subdef->appendChild($child);
|
||||
}
|
||||
|
||||
foreach ($options as $option => $value) {
|
||||
|
||||
if (is_scalar($value)) {
|
||||
|
Reference in New Issue
Block a user