| 1 |
<?php
|
| 2 |
// $Id: ed_classified.views_default.inc,v 1.1.2.1 2009/07/06 12:46:08 milesgillham Exp $
|
| 3 |
/*
|
| 4 |
* @file
|
| 5 |
*
|
| 6 |
* Default views.
|
| 7 |
* By default they will not be enabled.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/*
|
| 11 |
* Implements hook_views_default_views()
|
| 12 |
*/
|
| 13 |
|
| 14 |
function ed_classified_views_default_views() {
|
| 15 |
$views = array();
|
| 16 |
$view = ed_classified_views_default_view_1();
|
| 17 |
if (!empty($view)) {
|
| 18 |
$views[$view->name] = $view;
|
| 19 |
}
|
| 20 |
// TODO - implement a set of other useful default views
|
| 21 |
return $views;
|
| 22 |
}
|
| 23 |
|
| 24 |
function ed_classified_views_default_view_1() {
|
| 25 |
$view = new view;
|
| 26 |
$view->name = 'Classified_Ads_List';
|
| 27 |
$view->description = 'Classified Ads List';
|
| 28 |
$view->tag = '';
|
| 29 |
$view->view_php = '';
|
| 30 |
$view->base_table = 'node';
|
| 31 |
$view->is_cacheable = FALSE;
|
| 32 |
$view->api_version = 2;
|
| 33 |
$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
|
| 34 |
$handler = $view->new_display('default', 'Defaults', 'default');
|
| 35 |
$handler->override_option('fields', array(
|
| 36 |
'title' => array(
|
| 37 |
'label' => 'Title',
|
| 38 |
'alter' => array(
|
| 39 |
'alter_text' => 0,
|
| 40 |
'text' => '',
|
| 41 |
'make_link' => 0,
|
| 42 |
'path' => '',
|
| 43 |
'link_class' => '',
|
| 44 |
'alt' => '',
|
| 45 |
'prefix' => '',
|
| 46 |
'suffix' => '',
|
| 47 |
'help' => '',
|
| 48 |
'trim' => 0,
|
| 49 |
'max_length' => '',
|
| 50 |
'word_boundary' => 1,
|
| 51 |
'ellipsis' => 1,
|
| 52 |
'strip_tags' => 0,
|
| 53 |
'html' => 0,
|
| 54 |
),
|
| 55 |
'link_to_node' => 1,
|
| 56 |
'exclude' => 0,
|
| 57 |
'id' => 'title',
|
| 58 |
'table' => 'node',
|
| 59 |
'field' => 'title',
|
| 60 |
'relationship' => 'none',
|
| 61 |
),
|
| 62 |
'expires_on' => array(
|
| 63 |
'label' => 'Expires On',
|
| 64 |
'alter' => array(
|
| 65 |
'alter_text' => 0,
|
| 66 |
'text' => '',
|
| 67 |
'make_link' => 0,
|
| 68 |
'path' => '',
|
| 69 |
'link_class' => '',
|
| 70 |
'alt' => '',
|
| 71 |
'prefix' => '',
|
| 72 |
'suffix' => '',
|
| 73 |
'help' => '',
|
| 74 |
'trim' => 0,
|
| 75 |
'max_length' => '',
|
| 76 |
'word_boundary' => 1,
|
| 77 |
'ellipsis' => 1,
|
| 78 |
'strip_tags' => 0,
|
| 79 |
'html' => 0,
|
| 80 |
),
|
| 81 |
'date_format' => 'small',
|
| 82 |
'custom_date_format' => '',
|
| 83 |
'exclude' => 0,
|
| 84 |
'id' => 'expires_on',
|
| 85 |
'table' => 'edi_classified_nodes',
|
| 86 |
'field' => 'expires_on',
|
| 87 |
'relationship' => 'none',
|
| 88 |
),
|
| 89 |
'status' => array(
|
| 90 |
'label' => 'Published',
|
| 91 |
'alter' => array(
|
| 92 |
'alter_text' => 0,
|
| 93 |
'text' => '',
|
| 94 |
'make_link' => 0,
|
| 95 |
'path' => '',
|
| 96 |
'link_class' => '',
|
| 97 |
'alt' => '',
|
| 98 |
'prefix' => '',
|
| 99 |
'suffix' => '',
|
| 100 |
'help' => '',
|
| 101 |
'trim' => 0,
|
| 102 |
'max_length' => '',
|
| 103 |
'word_boundary' => 1,
|
| 104 |
'ellipsis' => 1,
|
| 105 |
'strip_tags' => 0,
|
| 106 |
'html' => 0,
|
| 107 |
),
|
| 108 |
'type' => 'yes-no',
|
| 109 |
'not' => 0,
|
| 110 |
'exclude' => 0,
|
| 111 |
'id' => 'status',
|
| 112 |
'table' => 'node',
|
| 113 |
'field' => 'status',
|
| 114 |
'relationship' => 'none',
|
| 115 |
),
|
| 116 |
));
|
| 117 |
$handler->override_option('filters', array(
|
| 118 |
'type' => array(
|
| 119 |
'operator' => 'in',
|
| 120 |
'value' => array(
|
| 121 |
'ed_classified' => 'ed_classified',
|
| 122 |
),
|
| 123 |
'group' => '0',
|
| 124 |
'exposed' => FALSE,
|
| 125 |
'expose' => array(
|
| 126 |
'operator' => FALSE,
|
| 127 |
'label' => '',
|
| 128 |
),
|
| 129 |
'id' => 'type',
|
| 130 |
'table' => 'node',
|
| 131 |
'field' => 'type',
|
| 132 |
'relationship' => 'none',
|
| 133 |
),
|
| 134 |
));
|
| 135 |
$handler->override_option('access', array(
|
| 136 |
'type' => 'none',
|
| 137 |
));
|
| 138 |
$handler->override_option('cache', array(
|
| 139 |
'type' => 'none',
|
| 140 |
));
|
| 141 |
$handler->override_option('style_plugin', 'table');
|
| 142 |
$handler->override_option('style_options', array(
|
| 143 |
'grouping' => '',
|
| 144 |
'override' => 1,
|
| 145 |
'sticky' => 0,
|
| 146 |
'order' => 'asc',
|
| 147 |
'columns' => array(
|
| 148 |
'title' => 'title',
|
| 149 |
),
|
| 150 |
'info' => array(
|
| 151 |
'title' => array(
|
| 152 |
'sortable' => 0,
|
| 153 |
'separator' => '',
|
| 154 |
),
|
| 155 |
),
|
| 156 |
'default' => '-1',
|
| 157 |
));
|
| 158 |
|
| 159 |
return $view;
|
| 160 |
|
| 161 |
}
|