diff --git a/classes/components/forms/FieldBaseAutosuggest.php b/classes/components/forms/FieldBaseAutosuggest.php index 8e49b5de674..e081989e7c1 100644 --- a/classes/components/forms/FieldBaseAutosuggest.php +++ b/classes/components/forms/FieldBaseAutosuggest.php @@ -32,6 +32,31 @@ abstract class FieldBaseAutosuggest extends Field /** @var array List of selected items. */ public $selected = []; + /** + * @var array List of controlled vocabularies available for selection. + * Each vocabulary should be structured as: + * [ + * 'locale' => string // The locale this vocabulary applies to (e.g., 'en') + * 'addButtonLabel' => string // Label for the button to add from this vocabulary + * 'title' => string // Title to display in the vocabulary selection modal + * 'modalComponent' => string // (Optional) Custom modal component to use for this vocabulary. Defaults to VocabularyModal + * 'items' => [ // Hierarchical tree of vocabulary items + * [ + * 'identifier' => string // Unique identifier for the vocabulary item + * 'name' => string // Display name of the vocabulary item + * 'source' => string // (Optional) Source of the vocabulary (e.g., 'Frascati') + * 'items' => [ // (Optional) Child items for hierarchical vocabularies + * // Each child follows the same structure (identifier, name, source, items) + * ] + * ], + * // Additional top-level vocabulary items... + * ] + * ] + */ + public array $vocabularies = []; + + + /** * @copydoc Field::getConfig() */ @@ -43,6 +68,7 @@ public function getConfig() $config['getParams'] = empty($this->getParams) ? new \stdClass() : $this->getParams; $config['selectedLabel'] = __('common.selectedPrefix'); $config['selected'] = $this->selected; + $config['vocabularies'] = $this->vocabularies; return $config; } diff --git a/locale/en/common.po b/locale/en/common.po index 9936b701ffb..921f102745f 100644 --- a/locale/en/common.po +++ b/locale/en/common.po @@ -2105,6 +2105,12 @@ msgstr "Expand all" msgid "list.collapseAll" msgstr "Collapse all" +msgid "list.expand" +msgstr "Expand" + +msgid "list.collapse" +msgstr "Collapse" + msgid "showAll" msgstr "Show All"