You are here

function hook_references_dialog_widgets in References dialog 7

Define a widget to which you want to attach add, search or edit links.

Return value

An array keyed by the widget you want to attach links to. This array should contain the following keys:

  • 'element_type': The type of FAPI element the widget is.
  • 'format': The format in which the data should be inserted as a value into the form element. The following patterns are provided, $label, $entity_id and $entity_type.
  • operations: An array of available operations. Usually search, edit and add should be provided. Each array should contain a callback funciton to render the links and a label that will be shown on the widget administration page.

Related topics

1 function implements hook_references_dialog_widgets()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

references_dialog_references_dialog_widgets in ./references_dialog.dialog_widgets.inc
Implements hook_references_dialog_widgets().
1 invocation of hook_references_dialog_widgets()
references_dialog_widgets in ./references_dialog.module
Return an array of supported widgets.

File

./references_dialog.api.php, line 27
This file contains documentation on hooks provided by this module.

Code

function hook_references_dialog_widgets() {
  return array(
    'node_reference_autocomplete' => array(
      'element_type' => 'textfield',
      'format' => '$label [nid: $entity_id]',
      'views_query' => 'references_dialog_node_reference_views_query',
      'operations' => array(
        'search' => array(
          'function' => 'references_dialog_get_field_search_links',
          'title' => t('Search Dialog'),
        ),
        'edit' => array(
          'function' => 'references_dialog_node_reference_edit_link',
          'title' => t('Edit dialog'),
        ),
        'add' => array(
          'function' => 'references_dialog_node_reference_add_link',
          'title' => t('Add dialog'),
        ),
      ),
    ),
  );
}