You are here

function activity_views_default_views in Activity 6

Same name and namespace in other branches
  1. 6.2 views/activity.views_default.inc \activity_views_default_views()
  2. 7 views/activity.views_default.inc \activity_views_default_views()

Implementation of hook_views_default_views().

File

./activity.views.inc, line 175

Code

function activity_views_default_views() {
  $views = array();
  $view = new view();
  $view->name = 'all_activity';
  $view->description = 'View all activity';
  $view->tag = 'activity';
  $view->view_php = '';
  $view->base_table = 'activity';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE;

  /* Edit this to true to make a default view disabled initially */
  $handler = $view
    ->new_display('default', 'Defaults', 'default');
  $handler
    ->override_option('relationships', array(
    'uid' => array(
      'label' => 'Users',
      'required' => 1,
      'id' => 'uid',
      'table' => 'activity',
      'field' => 'uid',
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('fields', array(
    'name' => array(
      'label' => 'Name',
      'link_to_user' => 1,
      'exclude' => 0,
      'id' => 'name',
      'table' => 'users',
      'field' => 'name',
      'relationship' => 'uid',
    ),
    'created' => array(
      'label' => 'Date',
      'date_format' => 'small',
      'custom_date_format' => '',
      'exclude' => 0,
      'id' => 'created',
      'table' => 'activity',
      'field' => 'created',
      'relationship' => 'none',
      'override' => array(
        'button' => 'Override',
      ),
    ),
    'data' => array(
      'label' => 'Data',
      'alter' => array(
        'alter_text' => FALSE,
        'text' => '',
        'make_link' => FALSE,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'trim' => FALSE,
        'max_length' => '',
        'word_boundary' => TRUE,
        'ellipsis' => TRUE,
        'strip_tags' => FALSE,
        'html' => FALSE,
      ),
      'exclude' => 0,
      'id' => 'data',
      'table' => 'activity',
      'field' => 'data',
      'relationship' => 'none',
      'link_object' => '1',
      'override' => array(
        'button' => 'Override',
      ),
      'target_role' => 'all',
    ),
    'module' => array(
      'label' => 'Module',
      'exclude' => 0,
      'id' => 'module',
      'table' => 'activity',
      'field' => 'module',
      'relationship' => 'none',
    ),
    'operation' => array(
      'label' => 'Operation',
      'exclude' => 0,
      'id' => 'operation',
      'table' => 'activity',
      'field' => 'operation',
      'relationship' => 'none',
    ),
    'type' => array(
      'label' => 'Type',
      'exclude' => 0,
      'id' => 'type',
      'table' => 'activity',
      'field' => 'type',
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('access', array(
    'type' => 'perm',
    'perm' => 'view public activity',
  ));
  $handler
    ->override_option('title', 'All Activity');
  $handler
    ->override_option('items_per_page', 25);
  $handler
    ->override_option('style_plugin', 'table');
  $handler
    ->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'columns' => array(
      'name' => 'name',
      'created' => 'created',
      'data' => 'data',
      'module' => 'module',
      'operation' => 'operation',
      'type' => 'type',
    ),
    'info' => array(
      'name' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'created' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'data' => array(
        'separator' => '',
      ),
      'module' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'operation' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'type' => array(
        'sortable' => 0,
        'separator' => '',
      ),
    ),
    'default' => '-1',
  ));
  $handler
    ->override_option('row_plugin', 'activity');
  $handler
    ->override_option('row_options', array(
    'messages' => 1,
  ));
  $handler = $view
    ->new_display('page', 'Page', 'page_1');
  $handler
    ->override_option('use_pager', '1');
  $handler
    ->override_option('style_plugin', 'default');
  $handler
    ->override_option('style_options', NULL);
  $handler
    ->override_option('path', 'activity/view');
  $handler
    ->override_option('menu', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
    'name' => 'navigation',
  ));
  $handler
    ->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
  ));
  $views[$view->name] = $view;
  return $views;
}