Skip to content

Instantly share code, notes, and snippets.

@dmitrig01
Created August 3, 2010 14:47
Show Gist options
  • Save dmitrig01/506496 to your computer and use it in GitHub Desktop.
Save dmitrig01/506496 to your computer and use it in GitHub Desktop.
/**
* Implementation of hook_views_default_views().
*/
function evil_views_default_views() {
/*
* View 'evil1'
*/
$view = new view;
$view->name = 'evil1';
$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(
'label' => 'Title',
'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,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'view' => array(
'label' => 'View',
'alter' => array(
'alter_text' => FALSE,
'text' => '',
'make_link' => FALSE,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => FALSE,
'max_length' => '',
'word_boundary' => TRUE,
'ellipsis' => TRUE,
'html' => FALSE,
'strip_tags' => FALSE,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'view' => 'evil2',
'display' => 'default',
'arguments' => '',
'exclude' => 0,
'id' => 'view',
'table' => 'views',
'field' => 'view',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$views[$view->name] = $view;
/*
* View 'evil2'
*/
$view = new view;
$view->name = 'evil2';
$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(
'label' => 'Title',
'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,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'view' => array(
'label' => 'View',
'alter' => array(
'alter_text' => FALSE,
'text' => '',
'make_link' => FALSE,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => FALSE,
'max_length' => '',
'word_boundary' => TRUE,
'ellipsis' => TRUE,
'html' => FALSE,
'strip_tags' => FALSE,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'view' => 'evil1',
'display' => 'default',
'arguments' => '',
'exclude' => 0,
'id' => 'view',
'table' => 'views',
'field' => 'view',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$views[$view->name] = $view;
return $views;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment