123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <?php
- /**
- * @file
- * Views integration and data for the redirect module.
- */
- /**
- * Implements hook_views_data().
- */
- function redirect_views_data() {
- // Basic table information.
- $data['redirect']['table']['group'] = t('Redirect');
- // Advertise this table as a possible base table
- $data['redirect']['table']['base'] = array(
- 'field' => 'rid',
- 'title' => t('URL redirects'),
- 'help' => t('Listings of URL redirects.'),
- 'weight' => 10,
- );
- // {redirect}.rid
- $data['redirect']['rid'] = array(
- 'title' => t('Redirect ID'),
- 'help' => t('The internal ID of the redirect.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_numeric',
- 'allow empty' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_numeric',
- ),
- );
- // {redirect}.type
- $data['redirect']['type'] = array(
- 'title' => t('Type'),
- 'help' => t('The type of redirect.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'filter' => array(
- 'handler' => 'redirect_handler_filter_redirect_type',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
- // {redirect}.uid
- $data['users']['table']['join']['redirect'] = array(
- 'left_field' => 'uid',
- 'field' => 'uid',
- );
- $data['redirect']['uid'] = array(
- 'title' => t('User ID'),
- 'help' => t('ID of user who created the URL redirect.'),
- 'field' => array(
- 'handler' => 'views_handler_field_user',
- 'click sortable' => TRUE,
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_user_uid',
- 'name field' => 'name',
- ),
- 'filter' => array(
- 'title' => t('Name'),
- 'handler' => 'views_handler_filter_user_name',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'relationship' => array(
- 'handler' => 'views_handler_relationship',
- 'base' => 'users',
- 'base field' => 'uid',
- 'label' => t('user'),
- ),
- );
- $data['redirect']['uid_current'] = array(
- 'real field' => 'uid',
- 'title' => t('Current user'),
- 'help' => t('Filter the view to the currently logged in user.'),
- 'filter' => array(
- 'handler' => 'views_handler_filter_user_current',
- 'type' => 'yes-no',
- ),
- );
- // {redirect}.source
- $data['redirect']['source'] = array(
- 'title' => t('Source URL'),
- 'help' => t('The source URL which generates a redirect'),
- 'field' => array(
- 'handler' => 'redirect_handler_field_redirect_source',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
- // {redirect}.redirect
- $data['redirect']['redirect'] = array(
- 'title' => t('Redirect URL'),
- 'help' => t('The destination URL'),
- 'field' => array(
- 'handler' => 'redirect_handler_field_redirect_redirect',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
- // Language field
- if (module_exists('locale')) {
- $data['redirect']['language'] = array(
- 'title' => t('Language'),
- 'help' => t('The language the redirect is for.'),
- 'field' => array(
- 'handler' => 'views_handler_field_locale_language',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_locale_language',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_locale_language',
- ),
- );
- }
- // {redirect}.count
- $data['redirect']['count'] = array(
- 'title' => t('Clicks'),
- 'help' => t('Number of times this URL redirect has been followed.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_numeric',
- 'allow empty' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_numeric',
- ),
- );
- // {redirect}.access
- $data['redirect']['access'] = array(
- 'title' => t('Last accessed date'),
- 'help' => t('The date/time the URL redirect was last accessed.'),
- 'field' => array(
- 'handler' => 'views_handler_field_date',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_date',
- ),
- );
- $data['redirect']['operations'] = array(
- 'field' => array(
- 'title' => t('Operations'),
- 'help' => t('Provide links to operations the user can perform for the URL redirect.'),
- 'handler' => 'redirect_handler_field_redirect_operations',
- ),
- );
- $data['redirect']['edit_redirect'] = array(
- 'field' => array(
- 'title' => t('Edit link'),
- 'help' => t('Provide a simple link to edit the URL redirect.'),
- 'handler' => 'redirect_handler_field_redirect_link_edit',
- ),
- );
- $data['redirect']['delete_redirect'] = array(
- 'field' => array(
- 'title' => t('Delete link'),
- 'help' => t('Provide a simple link to delete the URL redirect.'),
- 'handler' => 'redirect_handler_field_redirect_link_delete',
- ),
- );
- return $data;
- }
|