uc_addresses.views_default.inc in Ubercart Addresses 6.2
Same filename and directory in other branches
Contains a View to replace the address book page.
File
views/uc_addresses.views_default.incView source
<?php
/**
* @file
* Contains a View to replace the address book page.
*/
/**
* Implements hook_views_default_views().
*
* Provides the following Views:
* - uc_addresses_address_book
* A View for the address book.
*/
function uc_addresses_views_default_views() {
$export = array();
$view = new view();
$view->name = 'uc_addresses_address_book';
$view->description = 'Manage your addresses';
$view->tag = 'uc_addresses';
$view->base_table = 'uc_addresses';
$view->core = 6;
$view->api_version = '2';
$view->disabled = TRUE;
$handler = $view
->new_display('default', 'Defaults', 'default');
$handler
->override_option('sorts', array(
'default_billing' => array(
'order' => 'DESC',
'id' => 'default_billing',
'table' => 'uc_addresses',
'field' => 'default_billing',
'relationship' => 'none',
),
'default_shipping' => array(
'order' => 'DESC',
'id' => 'default_shipping',
'table' => 'uc_addresses',
'field' => 'default_shipping',
'relationship' => 'none',
),
'address_name' => array(
'order' => 'ASC',
'id' => 'address_name',
'table' => 'uc_addresses',
'field' => 'address_name',
'relationship' => 'none',
),
));
$handler
->override_option('arguments', array(
'uid' => array(
'id' => 'uid',
'table' => 'uc_addresses',
'field' => 'uid',
'default_action' => 'not found',
'style_plugin' => 'default_summary',
'default_argument_type' => 'fixed',
'default_argument_skip_url' => 0,
'validate_type' => 'user',
'validate_fail' => 'not found',
'validate_user_argument_type' => 'uid',
'validate_user_restrict_roles' => FALSE,
'validate_user_roles' => array(),
'break_phrase' => 0,
'not' => 0,
),
));
$handler
->override_option('filters', array(
'access_view' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'access_view',
'table' => 'uc_addresses',
'field' => 'access_view',
'relationship' => 'none',
),
));
$handler
->override_option('access', array(
'type' => 'uc_addresses_views_access',
'uid_argument' => 'uid',
'aid_argument' => '',
'access_type' => 'view',
));
$handler
->override_option('cache', array(
'type' => 'none',
));
$handler
->override_option('title', 'Address book');
$handler
->override_option('empty', 'No addresses have been saved.');
$handler
->override_option('empty_format', '1');
$handler
->override_option('items_per_page', 0);
$handler
->override_option('style_plugin', 'grid');
$handler
->override_option('style_options', array(
'columns' => '2',
'alignment' => 'horizontal',
'fill_single_line' => 1,
'summary' => '',
));
$handler
->override_option('row_plugin', 'uc_addresses');
$handler
->override_option('row_options', array(
'relationship' => 'none',
'view_link' => 0,
'edit_link' => 1,
'delete_link' => 1,
'default_flags' => 1,
));
$handler = $view
->new_display('page', 'Page', 'page_1');
$handler
->override_option('path', 'user/%/addresses');
$handler
->override_option('menu', array(
'type' => 'tab',
'title' => 'Address book',
'description' => 'Manage your addresses',
'weight' => '0',
'name' => 'navigation',
));
$handler
->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$export['uc_addresses_address_book'] = $view;
return $export;
}
Functions
Name | Description |
---|---|
uc_addresses_views_default_views | Implements hook_views_default_views(). |