~spreadubuntu/spreadubuntu/devel-drupal6

« back to all changes in this revision

Viewing changes to sites/all/modules/views/modules/search.views_default.inc

  • Committer: ruben
  • Date: 2009-06-08 09:38:49 UTC
  • Revision ID: ruben@captive-20090608093849-s1qtsyctv2vwp1x1
SpreadUbuntu moving to Drupal6. Based on ubuntu-drupal theme and adding our modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
// $Id: search.views_default.inc,v 1.6 2008/06/10 21:30:43 merlinofchaos Exp $
 
3
/**
 
4
 * @file
 
5
 * Contains default views on behalf of the search module.
 
6
 */
 
7
 
 
8
/**
 
9
 * Implementation of hook_default_view_views().
 
10
 */
 
11
function search_views_default_views() {
 
12
  $view = new view;
 
13
  $view->name = 'backlinks';
 
14
  $view->description = 'Displays a list of nodes that link to the node, using the search backlinks table.';
 
15
  $view->tag = 'default';
 
16
  $view->view_php = '';
 
17
  $view->base_table = 'node';
 
18
  $view->is_cacheable = '0';
 
19
  $view->api_version = 2;
 
20
  $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
 
21
  $handler = $view->new_display('default', 'Defaults', 'default');
 
22
  $handler->override_option('fields', array(
 
23
    'title' => array(
 
24
      'id' => 'title',
 
25
      'table' => 'node',
 
26
      'field' => 'title',
 
27
      'label' => '',
 
28
      'relationship' => 'none',
 
29
      'link_to_node' => 1,
 
30
    ),
 
31
  ));
 
32
  $handler->override_option('arguments', array(
 
33
    'nid' => array(
 
34
      'id' => 'nid',
 
35
      'table' => 'search_node_links_to',
 
36
      'field' => 'nid',
 
37
      'default_action' => 'not found',
 
38
      'style_plugin' => 'default_summary',
 
39
      'style_options' => array(
 
40
        'count' => TRUE,
 
41
        'override' => FALSE,
 
42
        'items_per_page' => 25,
 
43
      ),
 
44
      'wildcard' => '',
 
45
      'wildcard_substitution' => '',
 
46
      'title' => 'Pages that link to %1',
 
47
      'default_argument_type' => 'fixed',
 
48
      'default_argument' => '',
 
49
      'validate_type' => 'node',
 
50
      'validate_fail' => 'not found',
 
51
      'relationship' => 'none',
 
52
      'default_argument_fixed' => '',
 
53
      'default_argument_php' => '',
 
54
      'validate_argument_node_type' => array(),
 
55
      'validate_argument_php' => '',
 
56
    ),
 
57
  ));
 
58
  $handler->override_option('filters', array(
 
59
    'status' => array(
 
60
      'id' => 'status',
 
61
      'table' => 'node',
 
62
      'field' => 'status',
 
63
      'operator' => '=',
 
64
      'value' => 1,
 
65
      'group' => 0,
 
66
      'exposed' => FALSE,
 
67
      'expose' => array(
 
68
        'operator' => FALSE,
 
69
        'label' => '',
 
70
      ),
 
71
      'relationship' => 'none',
 
72
    ),
 
73
  ));
 
74
  $handler->override_option('access', array(
 
75
    'type' => 'none',
 
76
    'role' => array(),
 
77
    'perm' => '',
 
78
  ));
 
79
  $handler->override_option('empty', 'No backlinks found.');
 
80
  $handler->override_option('empty_format', '1');
 
81
  $handler->override_option('items_per_page', 30);
 
82
  $handler->override_option('use_pager', '1');
 
83
  $handler->override_option('style_plugin', 'list');
 
84
  $handler->override_option('style_options', array(
 
85
    'type' => 'ol',
 
86
  ));
 
87
  $handler = $view->new_display('page', 'Page', 'page');
 
88
  $handler->override_option('path', 'node/%/backlinks');
 
89
  $handler->override_option('menu', array(
 
90
    'type' => 'tab',
 
91
    'title' => 'What links here',
 
92
    'weight' => '0',
 
93
  ));
 
94
  $handler->override_option('tab_options', array(
 
95
    'type' => 'none',
 
96
    'title' => '',
 
97
    'weight' => 0,
 
98
  ));
 
99
  $handler = $view->new_display('block', 'Block', 'block');
 
100
  $handler->override_option('arguments', array(
 
101
    'nid' => array(
 
102
      'id' => 'nid',
 
103
      'table' => 'search_node_links_to',
 
104
      'field' => 'nid',
 
105
      'default_action' => 'default',
 
106
      'style_plugin' => 'default_summary',
 
107
      'style_options' => array(
 
108
        'count' => TRUE,
 
109
        'override' => FALSE,
 
110
        'items_per_page' => 25,
 
111
      ),
 
112
      'wildcard' => '',
 
113
      'wildcard_substitution' => '',
 
114
      'title' => 'What links here',
 
115
      'default_argument_type' => 'node',
 
116
      'default_argument' => '',
 
117
      'validate_type' => 'node',
 
118
      'validate_fail' => 'not found',
 
119
      'relationship' => 'none',
 
120
      'default_argument_fixed' => '',
 
121
      'default_argument_php' => 'return ($node = menu_get_object()) ? $node->nid : FALSE;',
 
122
      'validate_argument_node_type' => array(
 
123
        'album' => 0,
 
124
        'artist' => 0,
 
125
        'book' => 0,
 
126
        'page' => 0,
 
127
        'story' => 0,
 
128
        'track' => 0,
 
129
      ),
 
130
      'validate_argument_php' => '',
 
131
      'default_argument_user' => 0,
 
132
      'validate_argument_vocabulary' => array(
 
133
        '3' => 0,
 
134
        '4' => 0,
 
135
        '1' => 0,
 
136
        '5' => 0,
 
137
        '2' => 0,
 
138
      ),
 
139
      'validate_argument_type' => 'tid',
 
140
    ),
 
141
  ));
 
142
  $handler->override_option('items_per_page', 6);
 
143
  $handler->override_option('use_more', 1);
 
144
  $handler->override_option('style_plugin', 'list');
 
145
  $handler->override_option('style_options', array(
 
146
    'type' => 'ul',
 
147
  ));
 
148
  $handler->override_option('block_description', 'What links here');
 
149
  $views[$view->name] = $view;
 
150
 
 
151
  return $views;
 
152
}