Filters/Element Flatten Filter

Customize the form input value for a particular element after form is posted but before validation.

Filter Name

This filter's name is actually an array of strings. The first string must always be 'Flatten', but the last three can change depending on exactly what values you want to filter.

array('Flatten', $recordType, $elementSetName, $elementName)
  • $recordType: The type of Omeka object to filter the metadata for.
  • $elementSetName: The name of the element set containing the metadata field to be filtered. Possible values will include 'Dublin Core' and 'Item Type Metadata'.
  • $elementName: The name of the specific element within the set to be filtered.

For example, the filter name for filtering the Dublin Core Date element for Items would be:

array('Flatten', 'Item', 'Dublin Core', 'Date')

Parameters

string $flatText {{#if
| (optional)}}
An empty string.
{{#if: | Default: {{{default}}}}}
array $postArray {{#if
| (optional)}}
An array containing the identifying parts of the form corresponding to the element, e.g. 'Elements[40][0]'. Note that this does not include the [text] or [html] that is included in the field name.
{{#if: | Default: {{{default}}}}}
Element $element {{#if
| (optional)}}
The Element object for the filtered element.
{{#if: | Default: {{{default}}}}}

Return

Implementations of this filter must return a string containing the filtered text of the input value. If an empty string is returned, the original input value (unfiltered) will be used.