mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
resolve conflict
This commit is contained in:
@@ -220,13 +220,13 @@ class XmlStatusStructureProvider implements StatusStructureProviderInterface
|
||||
$status['searchable'] = (Boolean) $properties['searchable'];
|
||||
$status['printable'] = (Boolean) $properties['printable'];
|
||||
|
||||
if (!isset($properties['img_on'])) {
|
||||
$status['img_on'] = null;
|
||||
}
|
||||
|
||||
if (!isset($properties['img_off'])) {
|
||||
$status['img_off'] = null;
|
||||
}
|
||||
// if (!isset($properties['img_on'])) {
|
||||
// $status['img_on'] = null;
|
||||
// }
|
||||
//
|
||||
// if (!isset($properties['img_off'])) {
|
||||
// $status['img_off'] = null;
|
||||
// }
|
||||
|
||||
$statusStructure->setStatus($bit, $status);
|
||||
|
||||
|
@@ -47,37 +47,12 @@ class PhraseanetExtension extends \Twig_Extension
|
||||
new \Twig_SimpleFunction('record_flags', array($this, 'getRecordFlags')),
|
||||
new \Twig_SimpleFunction('border_checker_from_fqcn', array($this, 'getCheckerFromFQCN')),
|
||||
new \Twig_SimpleFunction('caption_field', array($this, 'getCaptionField')),
|
||||
new \Twig_SimpleFunction('caption_field_label', array($this, 'getCaptionFieldLabel')),
|
||||
new \Twig_SimpleFunction('caption_field_order', array($this, 'getCaptionFieldOrder')),
|
||||
|
||||
new \Twig_SimpleFunction('flag_slugify', array(Flag::class, 'normalizeName')),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* get localized field's label
|
||||
* @param RecordInterface $record
|
||||
* @param $fieldName
|
||||
* @return string - the name label
|
||||
*/
|
||||
public function getCaptionFieldLabel(RecordInterface $record, $fieldName)
|
||||
{
|
||||
if ($record) {
|
||||
/** @var \appbox $appbox */
|
||||
$appbox = $this->app['phraseanet.appbox'];
|
||||
$databox = $appbox->get_databox($record->getDataboxId());
|
||||
|
||||
foreach ($databox->get_meta_structure() as $meta) {
|
||||
/** @var \databox_field $meta */
|
||||
if ($meta->get_name() === $fieldName) {
|
||||
return $meta->get_label($this->app['locale']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getCaptionField(RecordInterface $record, $field, $value)
|
||||
{
|
||||
if ($record instanceof ElasticsearchRecord) {
|
||||
|
Reference in New Issue
Block a user