You are here

function scald_views_data in Scald: Media Management made easy 6

Same name and namespace in other branches
  1. 7 includes/scald.views.inc \scald_views_data()

@file Provides support for the Views module.

File

includes/scald.views.inc, line 6
Provides support for the Views module.

Code

function scald_views_data() {
  $data = array();
  $data['scald_atoms']['table']['group'] = t('Atom');
  $data['scald_atoms']['table']['base'] = array(
    'field' => 'sid',
    'title' => t('Atoms'),
    'help' => t("Views related to Scald Atoms."),
  );

  // sid
  $data['scald_atoms']['sid'] = array(
    'title' => t('Scald ID'),
    'help' => t("The atom's unique identifier"),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
  );

  // representation
  $data['scald_atoms']['representation'] = array(
    'title' => t('Representation'),
    'real field' => 'sid',
    'help' => t("The atom's representation, in a specific context"),
    'field' => array(
      'handler' => 'scald_views_handler_field_representation',
      'click sortable' => FALSE,
    ),
  );

  // provider
  $data['scald_atoms']['provider'] = array(
    'title' => t('Provider'),
    'help' => t('The module responsible of this atom'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'scald_views_handler_filter_atom_provider',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
  );

  // Type
  $data['scald_atoms']['type'] = array(
    'title' => t('Type'),
    'help' => t('The type of the atom, such as "image", "audio" ...'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'scald_views_handler_filter_atom_type',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
  );

  // Base ID
  $data['scald_atoms']['base_id'] = array(
    'title' => t('Base ID'),
    'help' => t('The base id, used by the providing module. For example, for atoms based on node, this could be the nid.'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
  );

  // Publisher
  $data['scald_atoms']['publisher'] = array(
    'title' => t('Publisher'),
    'help' => t('Relate an atom to the user who published it.'),
    'relationship' => array(
      'handler' => 'views_handler_relationship',
      'base' => 'users',
      'base field' => 'uid',
      'label' => t('User'),
    ),
  );

  // Title
  $data['scald_atoms']['title'] = array(
    'title' => t('Title'),
    'help' => t("The atom's title"),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
  );

  // Actions
  $data['scald_atoms']['actions'] = array(
    'title' => t('Actions'),
    'help' => t("Possible interactions with this atom"),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'scald_views_handler_filter_actions',
    ),
  );
  return $data;
}