function views_menu_reference_views_data_alter in Views Menu Reference 7
Implements hook_views_data_alter().
File
- ./
views_menu_reference.views.inc, line 27 - Declares the Views plugin to add filter and argument handlers for field_views_menu_reference - fields to enable processing in views.
Code
function views_menu_reference_views_data_alter(&$data) {
foreach (field_info_fields() as $field) {
// Only handle field_views_menu_reference fields.
if ($field['type'] == 'field_views_menu_reference') {
// Get a quick alias for the field name, for readability.
$field =& $field['field_name'];
// Add the mlid field to views.
$data['field_data_' . $field][$field . '_mlid'] = array(
'group' => t('Views Menu Reference'),
'title' => t('@field', array(
'@field' => $field,
)),
'field' => $field . '_mlid',
// Add the filter handler for fields of this type.
'filter' => array(
'field' => $field . '_mlid',
'table' => 'field_data_' . $field,
'help' => t('A filter matching the path and rules from views_menu_reference_fields against an URL.'),
'handler' => 'views_menu_reference_handler_filter_path',
),
// Add the argument handler for fields of this type.
'argument' => array(
'handler' => 'views_menu_reference_handler_argument_current_path',
'table' => 'field_data_' . $field,
'help' => t('An argument handler matching the path and rules from views_menu_reference_fields against an URL.'),
),
);
}
}
}