Recent donors view block export code

This module allows users to export all system specific blocks (are those blocks which are created using Drupal interface add block functionality) and then import it into another Drupal installation, or on the same site.

$view = new view;
$view->name = ‘recent_donors’;
$view->description = ”;
$view->tag = ”;
$view->view_php = ”;
$view->base_table = ‘node’;
$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(‘fields’, array(
‘title’ => array(
‘id’ => ‘title’,
‘table’ => ‘node’,
‘field’ => ‘title’,
),
));
$handler->override_option(‘sorts’, array(
‘created’ => array(
‘id’ => ‘created’,
‘table’ => ‘node’,
‘field’ => ‘created’,
),
));
$handler->override_option(‘filters’, array(
‘type’ => array(
‘id’ => ‘type’,
‘table’ => ‘node’,
‘field’ => ‘type’,
),
));
$handler->override_option(‘access’, array(
‘type’ => ‘none’,
));
$handler->override_option(‘cache’, array(
‘type’ => ‘none’,
));
$handler = $view->new_display(‘block’, ‘Recent Donors’, ‘block_1’);
$handler->override_option(‘fields’, array(
‘title’ => array(
‘label’ => ‘Name’,
‘alter’ => array(
‘alter_text’ => 0,
‘text’ => ”,
‘make_link’ => 0,
‘path’ => ”,
‘link_class’ => ”,
‘alt’ => ”,
‘prefix’ => ”,
‘suffix’ => ”,
‘target’ => ”,
‘help’ => ”,
‘trim’ => 0,
‘max_length’ => ”,
‘word_boundary’ => 1,
‘ellipsis’ => 1,
‘strip_tags’ => 0,
‘html’ => 0,
),
’empty’ => ”,
‘hide_empty’ => 0,
’empty_zero’ => 0,
‘link_to_node’ => 0,
‘exclude’ => 0,
‘id’ => ‘title’,
‘table’ => ‘node’,
‘field’ => ‘title’,
‘override’ => array(
‘button’ => ‘Use default’,
),
‘relationship’ => ‘none’,
),
‘field_donor_donation_amount_value’ => array(
‘label’ => ‘Amount ($)’,
‘alter’ => array(
‘alter_text’ => 0,
‘text’ => ”,
‘make_link’ => 0,
‘path’ => ”,
‘link_class’ => ”,
‘alt’ => ”,
‘prefix’ => ”,
‘suffix’ => ”,
‘target’ => ”,
‘help’ => ”,
‘trim’ => 0,
‘max_length’ => ”,
‘word_boundary’ => 1,
‘ellipsis’ => 1,
‘strip_tags’ => 0,
‘html’ => 0,
),
’empty’ => ”,
‘hide_empty’ => 0,
’empty_zero’ => 0,
‘link_to_node’ => 0,
‘label_type’ => ‘custom’,
‘format’ => ‘default’,
‘multiple’ => array(
‘group’ => TRUE,
‘multiple_number’ => ”,
‘multiple_from’ => ”,
‘multiple_reversed’ => FALSE,
),
‘exclude’ => 0,
‘id’ => ‘field_donor_donation_amount_value’,
‘table’ => ‘node_data_field_donor_donation_amount’,
‘field’ => ‘field_donor_donation_amount_value’,
‘override’ => array(
‘button’ => ‘Use default’,
),
‘relationship’ => ‘none’,
),
));
$handler->override_option(‘sorts’, array(
‘created’ => array(
‘order’ => ‘DESC’,
‘granularity’ => ‘second’,
‘id’ => ‘created’,
‘table’ => ‘node’,
‘field’ => ‘created’,
‘override’ => array(
‘button’ => ‘Use default’,
),
‘relationship’ => ‘none’,
),
));
$handler->override_option(‘filters’, array(
‘type’ => array(
‘operator’ => ‘in’,
‘value’ => array(
‘donors_list’ => ‘donors_list’,
),
‘group’ => ‘0’,
‘exposed’ => FALSE,
‘expose’ => array(
‘operator’ => FALSE,
‘label’ => ”,
),
‘id’ => ‘type’,
‘table’ => ‘node’,
‘field’ => ‘type’,
‘override’ => array(
‘button’ => ‘Use default’,
),
‘relationship’ => ‘none’,
),
));
$handler->override_option(‘distinct’, 1);
$handler->override_option(‘style_plugin’, ‘table’);
$handler->override_option(‘style_options’, array(
‘grouping’ => ”,
‘override’ => 1,
‘sticky’ => 0,
‘order’ => ‘desc’,
‘columns’ => array(
‘title’ => ‘title’,
),
‘info’ => array(
‘title’ => array(
‘sortable’ => 0,
‘separator’ => ”,
),
),
‘default’ => ‘-1’,
));
$handler->override_option(‘block_description’, ”);
$handler->override_option(‘block_caching’, -1);

Was this article helpful?

Related Articles