function upload_views_data_alter

2.x upload.views.inc upload_views_data_alter(&$data)

Implementation of hook_views_data_alter()

Related topics

File

modules/upload.views.inc, line 110
Provide views data and handlers for upload tables that are not represented by their own module.

Code

function upload_views_data_alter(&$data) {
  $data['node']['upload_fid'] = array(
    'group' => t('Upload'),
    'title' => t('Attached files'),
    'help' => t('All files attached to a node with upload.module.'),
    'real field' => 'vid',
    'field' => array(
      'handler' => 'views_handler_field_upload_fid',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_upload_fid',
      'title' => t('Has attached files'),
      'type' => 'yes-no',
      'help' => t('Only display items with attached files. This can cause duplicates if there are multiple attached files.'),
    ),
    'relationship' => array(
      'title' => t('Attached files'),
      'help' => t('Add a relationship to gain access to more file data for files uploaded by upload.module. Note that this relationship will cause duplicate nodes if there are multiple files attached to the node.'),
      'relationship table' => 'upload',
      'relationship field' => 'fid',
      'base' => 'files',
      'base field' => 'fid',
      'handler' => 'views_handler_relationship',
      'label' => t('Files'),
    ),
  );
}