You are here

hosting_client.views_default.inc in Hosting 7.4

Same filename and directory in other branches
  1. 7.3 client/includes/views/hosting_client.views_default.inc

Provide a default view listing clients.

File

client/includes/views/hosting_client.views_default.inc
View source
<?php

/**
 * @file
 * Provide a default view listing clients.
 */

/**
 * Implements hook_views_default_views().
 */
function hosting_client_views_default_views() {
  $views = array();

  // Exported view: hosting_client_list
  $view = new view();
  $view->name = 'hosting_client_list';
  $view->description = 'Display a list of clients in Aegir.';
  $view->tag = 'hosting_client';
  $view->base_table = 'node';
  $view->human_name = 'Hosting Clients List';
  $view->core = 6;
  $view->api_version = '3.0';
  $view->disabled = FALSE;

  /* Edit this to true to make a default view disabled initially */

  /* Display: Defaults */
  $handler = $view
    ->new_display('default', 'Defaults', 'default');
  $handler->display->display_options['title'] = 'Clients';
  $handler->display->display_options['use_more_always'] = FALSE;
  $handler->display->display_options['access']['type'] = 'perm';
  $handler->display->display_options['access']['perm'] = 'view client';
  $handler->display->display_options['cache']['type'] = 'none';
  $handler->display->display_options['query']['type'] = 'views_query';
  $handler->display->display_options['exposed_form']['type'] = 'basic';
  $handler->display->display_options['pager']['type'] = 'none';
  $handler->display->display_options['pager']['options']['offset'] = '0';
  $handler->display->display_options['style_plugin'] = 'table';
  $handler->display->display_options['style_options']['columns'] = array(
    'title' => 'title',
    'uname' => 'uname',
    'created' => 'created',
  );
  $handler->display->display_options['style_options']['default'] = 'title';
  $handler->display->display_options['style_options']['info'] = array(
    'title' => array(
      'sortable' => 1,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
    ),
    'uname' => array(
      'sortable' => 1,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
    ),
    'created' => array(
      'sortable' => 1,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
    ),
  );

  /* Field: Content: Title */
  $handler->display->display_options['fields']['title']['id'] = 'title';
  $handler->display->display_options['fields']['title']['table'] = 'node';
  $handler->display->display_options['fields']['title']['field'] = 'title';
  $handler->display->display_options['fields']['title']['label'] = 'Client name';
  $handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;

  /* Filter criterion: Content: Type */
  $handler->display->display_options['filters']['type']['id'] = 'type';
  $handler->display->display_options['filters']['type']['table'] = 'node';
  $handler->display->display_options['filters']['type']['field'] = 'type';
  $handler->display->display_options['filters']['type']['value'] = array(
    'client' => 'client',
  );

  /* Display: Page */
  $handler = $view
    ->new_display('page', 'Page', 'page_clients');
  $handler->display->display_options['path'] = 'hosting/clients';
  $handler->display->display_options['menu']['type'] = 'normal';
  $handler->display->display_options['menu']['title'] = 'Clients';
  $handler->display->display_options['menu']['description'] = 'List of clients';
  $handler->display->display_options['menu']['weight'] = '5';
  $handler->display->display_options['menu']['name'] = 'main-menu';
  $handler->display->display_options['menu']['context'] = 0;
  $handler->display->display_options['menu']['context_only_inline'] = 0;

  /* Display: Block */
  $handler = $view
    ->new_display('block', 'Block', 'block_1');
  $handler->display->display_options['defaults']['footer'] = FALSE;

  /* Footer: Global: Text area */
  $handler->display->display_options['footer']['area']['id'] = 'area';
  $handler->display->display_options['footer']['area']['table'] = 'views';
  $handler->display->display_options['footer']['area']['field'] = 'area';
  $handler->display->display_options['footer']['area']['content'] = '<a href="/node/add/client" class="add-new-client">Add new client</a>';
  $handler->display->display_options['footer']['area']['format'] = '1';
  $handler->display->display_options['block_description'] = 'Clients block';
  $views[$view->name] = $view;
  return $views;
}