Customize the input for a particular element. This only applies to forms generated by the element_form() helper function.
The name of the filter is an array:
array('ElementInput', $recordType, $elementSet, $elementName);
array $components
The input components, like:
$components = array( 'input' => $formTextarea, 'form_controls' => $removeButton, 'html_checkbox' => $useHtmlCheckbox, 'html' => null );
string input_name_stem
The name of the input, e.g., Elements[1][0]
string value
The value for the input
Omeka_Record_AbstractRecord record
The model being edited
Element element
The element being edited
string index
The index of the input for the element
boolean is_html
Whether the input uses html
class MyPlugin extends Omeka_Plugin_AbstractPlugin
{
$_filters = array('shortenSubjectField', array('ElementInput', 'Item', 'Dublin Core', 'Title'));
public function shortenSubjectField($components, $args)
{
$components['input'] = get_view()->formText($args['input_name_stem'], $args['value']);
return $components;
}
}