diff --git a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php index 0fef3ee23e..b9c92f5015 100644 --- a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php +++ b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php @@ -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) { diff --git a/templates/web/common/macros.html.twig b/templates/web/common/macros.html.twig index a8abb904d6..50091a8af3 100644 --- a/templates/web/common/macros.html.twig +++ b/templates/web/common/macros.html.twig @@ -126,9 +126,9 @@ {% macro caption(record, can_see_business, display_exif, limitedWidth = false) %}