Projet

Général

Profil

Paste
Télécharger (13,7 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / ctools_plugin_example / ctools_plugin_example.pages_default.inc @ 6e3ce7c2

1
<?php
2

    
3
/**
4
 * @file
5
 * This module provides default panels to demonstrate the behavior of the plugins.
6
 */
7

    
8
/**
9
 * Default panels pages for CTools Plugin Example.
10
 *
11
 * To pick up this file, your module needs to implement
12
 * hook_ctools_plugin_api() - See ctools_plugin_example_ctools_plugin_api() in
13
 * ctools_plugin_example.module.
14
 *
15
 *
16
 * Note the naming of the file: <modulename>.pages_default.inc
17
 * With this naming, no additional code needs to be provided. CTools will just find the file.
18
 * The name of the hook is <modulename>_default_page_manager_pages()
19
 *
20
 * This example provides two pages, but the returned array could
21
 * have several pages.
22
 *
23
 * @return
24
 *   Array of pages, normally exported from Panels.
25
 */
26
function ctools_plugin_example_default_page_manager_pages() {
27

    
28
  // Begin exported panel.
29
  $page = new stdClass();
30
  $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
31
  $page->api_version = 1;
32
  $page->name = 'ctools_plugin_example';
33
  $page->task = 'page';
34
  $page->admin_title = 'CTools plugin example';
35
  $page->admin_description = 'This panel provides no functionality to a working Drupal system. It\'s intended to display the various sample plugins provided by the CTools Plugin Example module. ';
36
  $page->path = 'ctools_plugin_example/%sc';
37
  $page->access = array(
38
    'logic' => 'and',
39
  );
40
  $page->menu = array(
41
    'type' => 'normal',
42
    'title' => 'CTools plugin example',
43
    'name' => 'navigation',
44
    'weight' => '0',
45
    'parent' => array(
46
      'type' => 'none',
47
      'title' => '',
48
      'name' => 'navigation',
49
      'weight' => '0',
50
    ),
51
  );
52
  $page->arguments = array(
53
    'sc' => array(
54
      'id' => 2,
55
      'identifier' => 'simplecontext-arg',
56
      'name' => 'simplecontext_arg',
57
      'settings' => array(),
58
    ),
59
  );
60
  $page->conf = array();
61
  $page->default_handlers = array();
62
  $handler = new stdClass();
63
  $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
64
  $handler->api_version = 1;
65
  $handler->name = 'page_ctools_panel_context';
66
  $handler->task = 'page';
67
  $handler->subtask = 'ctools_plugin_example';
68
  $handler->handler = 'panel_context';
69
  $handler->weight = 0;
70
  $handler->conf = array(
71
    'title' => 'Panel',
72
    'no_blocks' => FALSE,
73
    'css_id' => '',
74
    'css' => '',
75
    'contexts' => array(
76
      '0' => array(
77
        'name' => 'simplecontext',
78
        'id' => 1,
79
        'identifier' => 'Configured simplecontext (not from argument)',
80
        'keyword' => 'configured_simplecontext',
81
        'context_settings' => array(
82
          'sample_simplecontext_setting' => 'default simplecontext setting',
83
        ),
84
      ),
85
    ),
86
    'relationships' => array(
87
      '0' => array(
88
        'context' => 'argument_simplecontext_arg_2',
89
        'name' => 'relcontext_from_simplecontext',
90
        'id' => 1,
91
        'identifier' => 'Relcontext from simplecontext (from relationship)',
92
        'keyword' => 'relcontext',
93
      ),
94
    ),
95
    'access' => array(
96
      'logic' => 'and',
97
    ),
98
    'pipeline' => 'standard',
99
  );
100
  $display = new panels_display();
101
  $display->layout = 'threecol_33_34_33_stacked';
102
  $display->layout_settings = array();
103
  $display->panel_settings = array(
104
    'style' => 'rounded_corners',
105
    'style_settings' => array(
106
      'default' => array(
107
        'corner_location' => 'pane',
108
      ),
109
    ),
110
  );
111
  $display->cache = array();
112
  $display->title = 'CTools plugin example panel';
113
  $display->hide_title = FALSE;
114
  $display->title_pane = 1;
115
  $display->content = array();
116
  $display->panels = array();
117
  $pane = new stdClass();
118
  $pane->pid = 'new-1';
119
  $pane->panel = 'left';
120
  $pane->type = 'no_context_content_type';
121
  $pane->subtype = 'no_context_content_type';
122
  $pane->shown = TRUE;
123
  $pane->access = array();
124
  $pane->configuration = array(
125
    'item1' => 'contents of config item 1',
126
    'item2' => 'contents of config item 2',
127
    'override_title' => 0,
128
    'override_title_text' => '',
129
  );
130
  $pane->cache = array();
131
  $pane->style = array();
132
  $pane->css = array();
133
  $pane->extras = array();
134
  $pane->position = 0;
135
  $display->content['new-1'] = $pane;
136
  $display->panels['left'][0] = 'new-1';
137
  $pane = new stdClass();
138
  $pane->pid = 'new-2';
139
  $pane->panel = 'left';
140
  $pane->type = 'custom';
141
  $pane->subtype = 'custom';
142
  $pane->shown = TRUE;
143
  $pane->access = array(
144
    'plugins' => array(
145
      '0' => array(
146
        'name' => 'arg_length',
147
        'settings' => array(
148
          'greater_than' => '1',
149
          'arg_length' => '4',
150
        ),
151
        'context' => 'argument_simplecontext_arg_2',
152
      ),
153
    ),
154
  );
155
  $pane->configuration = array(
156
    'title' => 'Long Arg Visibility Block',
157
    'body' => 'This block will be here when the argument is longer than configured arg length. It uses the \'arg_length\' access plugin to test against the length of the argument used for Simplecontext.',
158
    'format' => 'filtered_html',
159
    'substitute' => 1,
160
  );
161
  $pane->cache = array();
162
  $pane->style = array();
163
  $pane->css = array();
164
  $pane->extras = array();
165
  $pane->position = 1;
166
  $display->content['new-2'] = $pane;
167
  $display->panels['left'][1] = 'new-2';
168
  $pane = new stdClass();
169
  $pane->pid = 'new-3';
170
  $pane->panel = 'left';
171
  $pane->type = 'custom';
172
  $pane->subtype = 'custom';
173
  $pane->shown = TRUE;
174
  $pane->access = array(
175
    'plugins' => array(
176
      '0' => array(
177
        'name' => 'arg_length',
178
        'settings' => array(
179
          'greater_than' => '0',
180
          'arg_length' => '4',
181
        ),
182
        'context' => 'argument_simplecontext_arg_2',
183
      ),
184
    ),
185
  );
186
  $pane->configuration = array(
187
    'title' => 'Short Arg Visibility',
188
    'body' => 'This block appears when the simplecontext argument is <i>less than</i> the configured length.',
189
    'format' => 'filtered_html',
190
    'substitute' => 1,
191
  );
192
  $pane->cache = array();
193
  $pane->style = array();
194
  $pane->css = array();
195
  $pane->extras = array();
196
  $pane->position = 2;
197
  $display->content['new-3'] = $pane;
198
  $display->panels['left'][2] = 'new-3';
199
  $pane = new stdClass();
200
  $pane->pid = 'new-4';
201
  $pane->panel = 'middle';
202
  $pane->type = 'simplecontext_content_type';
203
  $pane->subtype = 'simplecontext_content_type';
204
  $pane->shown = TRUE;
205
  $pane->access = array();
206
  $pane->configuration = array(
207
    'buttons' => NULL,
208
    '#validate' => NULL,
209
    '#submit' => NULL,
210
    '#action' => NULL,
211
    'context' => 'argument_simplecontext_arg_2',
212
    'aligner_start' => NULL,
213
    'override_title' => 1,
214
    'override_title_text' => 'Simplecontext (with an arg)',
215
    'aligner_stop' => NULL,
216
    'override_title_markup' => NULL,
217
    'config_item_1' => 'Config item 1 contents',
218
    '#build_id' => NULL,
219
    '#type' => NULL,
220
    '#programmed' => NULL,
221
    'form_build_id' => 'form-19c4ae6cb54fad8f096da46e95694e5a',
222
    '#token' => NULL,
223
    'form_token' => '17141d3531eaa7b609da78afa6f3b560',
224
    'form_id' => 'simplecontext_content_type_edit_form',
225
    '#id' => NULL,
226
    '#description' => NULL,
227
    '#attributes' => NULL,
228
    '#required' => NULL,
229
    '#tree' => NULL,
230
    '#parents' => NULL,
231
    '#method' => NULL,
232
    '#post' => NULL,
233
    '#processed' => NULL,
234
    '#defaults_loaded' => NULL,
235
  );
236
  $pane->cache = array();
237
  $pane->style = array();
238
  $pane->css = array();
239
  $pane->extras = array();
240
  $pane->position = 0;
241
  $display->content['new-4'] = $pane;
242
  $display->panels['middle'][0] = 'new-4';
243
  $pane = new stdClass();
244
  $pane->pid = 'new-5';
245
  $pane->panel = 'middle';
246
  $pane->type = 'simplecontext_content_type';
247
  $pane->subtype = 'simplecontext_content_type';
248
  $pane->shown = TRUE;
249
  $pane->access = array();
250
  $pane->configuration = array(
251
    'buttons' => NULL,
252
    '#validate' => NULL,
253
    '#submit' => NULL,
254
    '#action' => NULL,
255
    'context' => 'context_simplecontext_1',
256
    'aligner_start' => NULL,
257
    'override_title' => 1,
258
    'override_title_text' => 'Configured simplecontext content type (not from arg)',
259
    'aligner_stop' => NULL,
260
    'override_title_markup' => NULL,
261
    'config_item_1' => '(configuration for simplecontext)',
262
    '#build_id' => NULL,
263
    '#type' => NULL,
264
    '#programmed' => NULL,
265
    'form_build_id' => 'form-d016200490abd015dc5b8a7e366d76ea',
266
    '#token' => NULL,
267
    'form_token' => '17141d3531eaa7b609da78afa6f3b560',
268
    'form_id' => 'simplecontext_content_type_edit_form',
269
    '#id' => NULL,
270
    '#description' => NULL,
271
    '#attributes' => NULL,
272
    '#required' => NULL,
273
    '#tree' => NULL,
274
    '#parents' => NULL,
275
    '#method' => NULL,
276
    '#post' => NULL,
277
    '#processed' => NULL,
278
    '#defaults_loaded' => NULL,
279
  );
280
  $pane->cache = array();
281
  $pane->style = array();
282
  $pane->css = array();
283
  $pane->extras = array();
284
  $pane->position = 1;
285
  $display->content['new-5'] = $pane;
286
  $display->panels['middle'][1] = 'new-5';
287
  $pane = new stdClass();
288
  $pane->pid = 'new-6';
289
  $pane->panel = 'middle';
290
  $pane->type = 'custom';
291
  $pane->subtype = 'custom';
292
  $pane->shown = TRUE;
293
  $pane->access = array();
294
  $pane->configuration = array(
295
    'admin_title' => 'Simplecontext keyword usage',
296
    'title' => 'Simplecontext keyword usage',
297
    'body' => 'Demonstrating context keyword usage:
298
    item1 is %sc:item1
299
    item2 is %sc:item2
300
    description is %sc:description',
301
    'format' => 'filtered_html',
302
    'substitute' => 1,
303
  );
304
  $pane->cache = array();
305
  $pane->style = array();
306
  $pane->css = array();
307
  $pane->extras = array();
308
  $pane->position = 2;
309
  $display->content['new-6'] = $pane;
310
  $display->panels['middle'][2] = 'new-6';
311
  $pane = new stdClass();
312
  $pane->pid = 'new-7';
313
  $pane->panel = 'right';
314
  $pane->type = 'relcontext_content_type';
315
  $pane->subtype = 'relcontext_content_type';
316
  $pane->shown = TRUE;
317
  $pane->access = array();
318
  $pane->configuration = array(
319
    'buttons' => NULL,
320
    '#validate' => NULL,
321
    '#submit' => NULL,
322
    '#action' => NULL,
323
    'context' => 'relationship_relcontext_from_simplecontext_1',
324
    'aligner_start' => NULL,
325
    'override_title' => 0,
326
    'override_title_text' => '',
327
    'aligner_stop' => NULL,
328
    'override_title_markup' => NULL,
329
    'config_item_1' => 'some stuff in this one',
330
    '#build_id' => NULL,
331
    '#type' => NULL,
332
    '#programmed' => NULL,
333
    'form_build_id' => 'form-8485f84511bd06e51b4a48e998448054',
334
    '#token' => NULL,
335
    'form_token' => '1c3356396374d51d7d2531a10fd25310',
336
    'form_id' => 'relcontext_edit_form',
337
    '#id' => NULL,
338
    '#description' => NULL,
339
    '#attributes' => NULL,
340
    '#required' => NULL,
341
    '#tree' => NULL,
342
    '#parents' => NULL,
343
    '#method' => NULL,
344
    '#post' => NULL,
345
    '#processed' => NULL,
346
    '#defaults_loaded' => NULL,
347
  );
348
  $pane->cache = array();
349
  $pane->style = array();
350
  $pane->css = array();
351
  $pane->extras = array();
352
  $pane->position = 0;
353
  $display->content['new-7'] = $pane;
354
  $display->panels['right'][0] = 'new-7';
355
  $pane = new stdClass();
356
  $pane->pid = 'new-8';
357
  $pane->panel = 'top';
358
  $pane->type = 'custom';
359
  $pane->subtype = 'custom';
360
  $pane->shown = TRUE;
361
  $pane->access = array();
362
  $pane->configuration = array(
363
    'title' => 'Demonstrating ctools plugins',
364
    'body' => 'The CTools Plugin Example module (and this panel page) are just here to demonstrate how to build CTools plugins.
365

    
366
            ',
367
    'format' => 'full_html',
368
    'substitute' => 1,
369
  );
370
  $pane->cache = array();
371
  $pane->style = array();
372
  $pane->css = array();
373
  $pane->extras = array();
374
  $pane->position = 0;
375
  $display->content['new-8'] = $pane;
376
  $display->panels['top'][0] = 'new-8';
377
  $handler->conf['display'] = $display;
378
  $page->default_handlers[$handler->name] = $handler;
379

    
380
  // End of exported panel.
381
  $pages['ctools_plugin_example_demo_page'] = $page;
382

    
383
  // Begin exported panel.
384
  $page = new stdClass();
385
  $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
386
  $page->api_version = 1;
387
  $page->name = 'ctools_plugin_example_base';
388
  $page->task = 'page';
389
  $page->admin_title = 'CTools Plugin Example base page';
390
  $page->admin_description = 'This panel is for when people hit /ctools_plugin_example without an argument. We can use it to tell people to move on.';
391
  $page->path = 'ctools_plugin_example';
392
  $page->access = array();
393
  $page->menu = array();
394
  $page->arguments = array();
395
  $page->conf = array();
396
  $page->default_handlers = array();
397
  $handler = new stdClass();
398
  $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
399
  $handler->api_version = 1;
400
  $handler->name = 'page_ctools_plugin_example_base_panel_context';
401
  $handler->task = 'page';
402
  $handler->subtask = 'ctools_plugin_example_base';
403
  $handler->handler = 'panel_context';
404
  $handler->weight = 0;
405
  $handler->conf = array(
406
    'title' => 'Panel',
407
    'no_blocks' => FALSE,
408
    'css_id' => '',
409
    'css' => '',
410
    'contexts' => array(),
411
    'relationships' => array(),
412
    'pipeline' => 'standard',
413
  );
414
  $display = new panels_display();
415
  $display->layout = 'onecol';
416
  $display->layout_settings = array();
417
  $display->panel_settings = array();
418
  $display->cache = array();
419
  $display->title = '';
420
  $display->hide_title = FALSE;
421
  $display->content = array();
422
  $display->panels = array();
423
  $pane = new stdClass();
424
  $pane->pid = 'new-1';
425
  $pane->panel = 'middle';
426
  $pane->type = 'custom';
427
  $pane->subtype = 'custom';
428
  $pane->shown = TRUE;
429
  $pane->access = array();
430
  $pane->configuration = array(
431
    'title' => 'Use this page with an argument',
432
    'body' => 'This demo page works if you use an argument, like <a href="ctools_plugin_example/xxxxx">ctools_plugin_example/xxxxx</a>.',
433
    'format' => 'filtered_html',
434
    'substitute' => NULL,
435
  );
436
  $pane->cache = array();
437
  $pane->style = array();
438
  $pane->css = array();
439
  $pane->extras = array();
440
  $pane->position = 0;
441
  $display->content['new-1'] = $pane;
442
  $display->panels['middle'][0] = 'new-1';
443
  $handler->conf['display'] = $display;
444
  $page->default_handlers[$handler->name] = $handler;
445
  // End exported panel.
446
  $pages['base_page'] = $page;
447

    
448
  return $pages;
449
}