Commit 2f0a9f99 authored by hass's avatar hass
Browse files

Reorder functions

parent 84ca3c5d
......@@ -379,6 +379,28 @@ function realname_autocomplete($field_name, $entity_type, $bundle_name, $string
drupal_json_output($matches);
}
/**
* Menu Access callback for the autocomplete widget.
*
* @param $field_name
* The name of the entity-reference field.
* @param $entity_type
* The entity type.
* @param $bundle_name
* The bundle name.
* @return
* True if user can access this menu item.
*/
function realname_autocomplete_access_callback($field_name, $entity_type, $bundle_name) {
$field = field_info_field($field_name);
$instance = field_info_instance($entity_type, $field_name, $bundle_name);
if (!$field || !$instance || $field['type'] != 'entityreference' || !field_access('edit', $field, $entity_type)) {
return FALSE;
}
return TRUE;
}
/**
* Implements hook_widget_form_alter().
*
......@@ -414,25 +436,3 @@ function realname_username_raw_token_validate(&$element, &$form_state) {
return $element;
}
/**
* Menu Access callback for the autocomplete widget.
*
* @param $field_name
* The name of the entity-reference field.
* @param $entity_type
* The entity type.
* @param $bundle_name
* The bundle name.
* @return
* True if user can access this menu item.
*/
function realname_autocomplete_access_callback($field_name, $entity_type, $bundle_name) {
$field = field_info_field($field_name);
$instance = field_info_instance($entity_type, $field_name, $bundle_name);
if (!$field || !$instance || $field['type'] != 'entityreference' || !field_access('edit', $field, $entity_type)) {
return FALSE;
}
return TRUE;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment