Skip to content

Instantly share code, notes, and snippets.

@aneek aneek/View Export
Created Jun 2, 2017

Embed
What would you like to do?
$view = new view();
$view->name = 'manage_products';
$view->description = 'List of all products';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Manage Products';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Manage Products';
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
9 => '9',
3 => '3',
12 => '12',
);
$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'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '25';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['pager']['options']['expose']['items_per_page'] = TRUE;
$handler->display->display_options['pager']['options']['expose']['items_per_page_options'] = '25, 30, 40, 50, 60';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = TRUE;
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
'nid' => 'nid',
'title' => 'title',
'total_subscriptions' => 'total_subscriptions',
'unused_subscriptions' => 'unused_subscriptions',
'expire_in_thirty_days' => 'expire_in_thirty_days',
'field_isbn' => 'field_isbn',
'field_product_status' => 'field_product_status',
);
$handler->display->display_options['style_options']['default'] = 'title';
$handler->display->display_options['style_options']['info'] = array(
'nid' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'title' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'total_subscriptions' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'unused_subscriptions' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'expire_in_thirty_days' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'field_isbn' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'field_product_status' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
);
/* Field: Content: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['label'] = '';
$handler->display->display_options['fields']['nid']['exclude'] = TRUE;
$handler->display->display_options['fields']['nid']['element_label_colon'] = FALSE;
/* 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'] = 'Product Name';
$handler->display->display_options['fields']['title']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['title']['alter']['path'] = 'node/[nid]/edit';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['title']['link_to_node'] = FALSE;
/* Field: Manage Product View: Total Subscriptions */
$handler->display->display_options['fields']['total_subscriptions']['id'] = 'total_subscriptions';
$handler->display->display_options['fields']['total_subscriptions']['table'] = 'clms_view_manage_products';
$handler->display->display_options['fields']['total_subscriptions']['field'] = 'total_subscriptions';
/* Field: Manage Product View: Unused Subscriptions */
$handler->display->display_options['fields']['unused_subscriptions']['id'] = 'unused_subscriptions';
$handler->display->display_options['fields']['unused_subscriptions']['table'] = 'clms_view_manage_products';
$handler->display->display_options['fields']['unused_subscriptions']['field'] = 'unused_subscriptions';
/* Field: Manage Product View: Expire in 30 days */
$handler->display->display_options['fields']['expire_in_thirty_days']['id'] = 'expire_in_thirty_days';
$handler->display->display_options['fields']['expire_in_thirty_days']['table'] = 'clms_view_manage_products';
$handler->display->display_options['fields']['expire_in_thirty_days']['field'] = 'expire_in_thirty_days';
/* Field: Content: ISBN */
$handler->display->display_options['fields']['field_isbn']['id'] = 'field_isbn';
$handler->display->display_options['fields']['field_isbn']['table'] = 'field_data_field_isbn';
$handler->display->display_options['fields']['field_isbn']['field'] = 'field_isbn';
/* Field: Content: Product Status */
$handler->display->display_options['fields']['field_product_status']['id'] = 'field_product_status';
$handler->display->display_options['fields']['field_product_status']['table'] = 'field_data_field_product_status';
$handler->display->display_options['fields']['field_product_status']['field'] = 'field_product_status';
/* 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(
'product' => 'product',
);
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'manage-products';
$handler->display->display_options['menu']['type'] = 'normal';
$handler->display->display_options['menu']['title'] = 'Manage Products';
$handler->display->display_options['menu']['description'] = 'Manage a list of Products';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['name'] = 'menu-my-tools';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
$translatables['manage_products'] = array(
t('Master'),
t('Manage Products'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t('‹ previous'),
t('next ›'),
t('last »'),
t('Product Name'),
t('Total Subscriptions'),
t('Unused Subscriptions'),
t('Expire in 30 days'),
t('ISBN'),
t('Product Status'),
t('Page'),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.