Projet

Général

Profil

Paste
Télécharger (6,33 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / ctools_plugin_example / plugins / panels.pages.inc @ 7e72b748

1
<?php
2

    
3
/**
4
 * @file
5
 * Holds the panels pages export.
6
 */
7

    
8
/**
9
 * Implements hook_default_panel_pages()
10
 */
11
function ctools_plugin_example_default_panel_pages() {
12
  $page = new stdClass();
13
  $page->pid = 'new';
14
  $page->did = 'new';
15
  $page->name = 'ctools_plugin_example_demo_panel';
16
  $page->title = 'Panels Plugin Example Demo Panel';
17
  $page->access = array();
18
  $page->path = 'demo_panel';
19
  $page->load_flags = 1;
20
  $page->css_id = '';
21
  $page->arguments = array(
22
    0 =>
23
  array(
24
    'name' => 'simplecontext_arg',
25
    'id' => 1,
26
    'default' => '404',
27
    'title' => '',
28
    'identifier' => 'Simplecontext arg',
29
    'keyword' => 'simplecontext',
30
  ),
31
  );
32
  $page->relationships = array(
33
    0 =>
34
  array(
35
    'context' => 'argument_simplecontext_arg_1',
36
    'name' => 'relcontext_from_simplecontext',
37
    'id' => 1,
38
    'identifier' => 'Relcontext from Simplecontext',
39
    'keyword' => 'relcontext',
40
  ),
41
  );
42
  $page->no_blocks = '0';
43
  $page->switcher_options = array();
44
  $page->menu = '0';
45
  $page->contexts = array();
46
  $display = new ctools_display();
47
  $display->did = 'new';
48
  $display->layout = 'threecol_33_34_33_stacked';
49
  $display->layout_settings = array();
50
  $display->panel_settings = array();
51
  $display->content = array();
52
  $display->panels = array();
53
  $pane = new stdClass();
54
  $pane->pid = 'new-1';
55
  $pane->panel = 'left';
56
  $pane->type = 'custom';
57
  $pane->shown = '1';
58
  $pane->subtype = 'custom';
59
  $pane->access = array();
60
  $pane->configuration = array(
61
    'style' => 'default',
62
    'override_title' => 0,
63
    'override_title_text' => '',
64
    'css_id' => '',
65
    'css_class' => '',
66
    'title' => '"No Context Item"',
67
    'body' => 'The "no context item" content type is here to demonstrate that you can create a content_type that does not require a context. This is probably the same as just creating a custom php block on the fly, and might serve the same purpose.',
68
    'format' => '1',
69
  );
70
  $pane->cache = array();
71
  $display->content['new-1'] = $pane;
72
  $display->panels['left'][0] = 'new-1';
73
  $pane = new stdClass();
74
  $pane->pid = 'new-2';
75
  $pane->panel = 'left';
76
  $pane->type = 'no_context_item';
77
  $pane->shown = '1';
78
  $pane->subtype = 'description';
79
  $pane->access = array();
80
  $pane->configuration = array(
81
    'style' => 'default',
82
    'override_title' => 0,
83
    'override_title_text' => '',
84
    'css_id' => '',
85
    'css_class' => '',
86
    'item1' => 'one',
87
    'item2' => 'two',
88
    'item3' => 'three',
89
  );
90
  $pane->cache = array();
91
  $display->content['new-2'] = $pane;
92
  $display->panels['left'][1] = 'new-2';
93
  $pane = new stdClass();
94
  $pane->pid = 'new-3';
95
  $pane->panel = 'middle';
96
  $pane->type = 'custom';
97
  $pane->shown = '1';
98
  $pane->subtype = 'custom';
99
  $pane->access = array();
100
  $pane->configuration = array(
101
    'style' => 'default',
102
    'override_title' => 0,
103
    'override_title_text' => '',
104
    'css_id' => '',
105
    'css_class' => '',
106
    'title' => 'Simplecontext',
107
    'body' => 'The "Simplecontext" content and content type demonstrate a very basic context and how to display it.
108

    
109
    Simplecontext includes configuration, so it can get info from the config. It can also get its information to run from a simplecontext context, generated either from an arg to the panels page or via explicitly adding a context to the page.',
110
    'format' => '1',
111
  );
112
  $pane->cache = array();
113
  $display->content['new-3'] = $pane;
114
  $display->panels['middle'][0] = 'new-3';
115
  $pane = new stdClass();
116
  $pane->pid = 'new-4';
117
  $pane->panel = 'middle';
118
  $pane->type = 'simplecontext_item';
119
  $pane->shown = '1';
120
  $pane->subtype = 'description';
121
  $pane->access = array(
122
    0 => '2',
123
    1 => '4',
124
  );
125
  $pane->configuration = array(
126
    'context' => 'argument_simplecontext_arg_1',
127
    'style' => 'default',
128
    'override_title' => 0,
129
    'override_title_text' => '',
130
    'css_id' => '',
131
    'css_class' => '',
132
    'config_item_1' => 'simplecontext called from arg',
133
  );
134
  $pane->cache = array();
135
  $display->content['new-4'] = $pane;
136
  $display->panels['middle'][1] = 'new-4';
137
  $pane = new stdClass();
138
  $pane->pid = 'new-5';
139
  $pane->panel = 'right';
140
  $pane->type = 'custom';
141
  $pane->shown = '1';
142
  $pane->subtype = 'custom';
143
  $pane->access = array();
144
  $pane->configuration = array(
145
    'style' => 'default',
146
    'override_title' => 0,
147
    'override_title_text' => '',
148
    'css_id' => '',
149
    'css_class' => '',
150
    'title' => 'Relcontext',
151
    'body' => 'The relcontext content_type gets its data from a relcontext, which is an example of a relationship. This panel should be run with an argument like "/xxx", which allows the simplecontext to get its context, and then the relcontext is configured in this panel to get (create) its data from the simplecontext.',
152
    'format' => '1',
153
  );
154
  $pane->cache = array();
155
  $display->content['new-5'] = $pane;
156
  $display->panels['right'][0] = 'new-5';
157
  $pane = new stdClass();
158
  $pane->pid = 'new-6';
159
  $pane->panel = 'right';
160
  $pane->type = 'relcontext_item';
161
  $pane->shown = '1';
162
  $pane->subtype = 'description';
163
  $pane->access = array();
164
  $pane->configuration = array(
165
    'context' => 'relationship_relcontext_from_simplecontext_1',
166
    'style' => 'default',
167
    'override_title' => 0,
168
    'override_title_text' => '',
169
    'css_id' => '',
170
    'css_class' => '',
171
    'config_item_1' => 'default1',
172
  );
173
  $pane->cache = array();
174
  $display->content['new-6'] = $pane;
175
  $display->panels['right'][1] = 'new-6';
176
  $pane = new stdClass();
177
  $pane->pid = 'new-7';
178
  $pane->panel = 'top';
179
  $pane->type = 'custom_php';
180
  $pane->shown = '1';
181
  $pane->subtype = 'custom_php';
182
  $pane->access = array();
183
  $pane->configuration = array(
184
    'style' => 'default',
185
    'override_title' => 0,
186
    'override_title_text' => '',
187
    'css_id' => '',
188
    'css_class' => '',
189
    'title' => '',
190
    'body' => '$arg = arg(1);
191
    $arg0 = arg(0);
192
    if (!$arg) {
193
    $block->content = <<<END
194
    <em>This page is intended to run with an arg and you don\'t have one.</em>
195
    <br />
196
    Without an arg, the page doesn\'t have any context.
197
    <br />Please try something like "/$arg0/xxx"
198
END;
199

    
200
    $block->title = "This is intended to run with an argument";
201
    } else {
202
    $block->content = "The arg for this page is \'$arg\'";
203
    }',
204
  );
205
  $pane->cache = array();
206
  $display->content['new-7'] = $pane;
207
  $display->panels['top'][0] = 'new-7';
208
  $page->display = $display;
209
  $page->displays = array();
210
  $pages['ctools_plugin_example'] = $page;
211

    
212
  return $pages;
213
}