Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ctools / ctools_plugin_example / ctools_plugin_example.pages_default.inc @ 7e72b748

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
  );
99
  $display = new panels_display();
100
  $display->layout = 'threecol_33_34_33_stacked';
101
  $display->layout_settings = array();
102
  $display->panel_settings = array(
103
    'style' => 'rounded_corners',
104
    'style_settings' => array(
105
      'default' => array(
106
        'corner_location' => 'pane',
107
      ),
108
    ),
109
  );
110
  $display->cache = array();
111
  $display->title = 'CTools plugin example panel';
112
  $display->hide_title = FALSE;
113
  $display->title_pane = 1;
114
  $display->content = array();
115
  $display->panels = array();
116
  $pane = new stdClass();
117
  $pane->pid = 'new-1';
118
  $pane->panel = 'left';
119
  $pane->type = 'no_context_content_type';
120
  $pane->subtype = 'no_context_content_type';
121
  $pane->shown = TRUE;
122
  $pane->access = array();
123
  $pane->configuration = array(
124
    'item1' => 'contents of config item 1',
125
    'item2' => 'contents of config item 2',
126
    'override_title' => 0,
127
    'override_title_text' => '',
128
  );
129
  $pane->cache = array();
130
  $pane->style = array();
131
  $pane->css = array();
132
  $pane->extras = array();
133
  $pane->position = 0;
134
  $display->content['new-1'] = $pane;
135
  $display->panels['left'][0] = 'new-1';
136
  $pane = new stdClass();
137
  $pane->pid = 'new-2';
138
  $pane->panel = 'left';
139
  $pane->type = 'custom';
140
  $pane->subtype = 'custom';
141
  $pane->shown = TRUE;
142
  $pane->access = array(
143
    'plugins' => array(
144
      '0' => array(
145
        'name' => 'arg_length',
146
        'settings' => array(
147
          'greater_than' => '1',
148
          'arg_length' => '4',
149
        ),
150
        'context' => 'argument_simplecontext_arg_2',
151
      ),
152
    ),
153
  );
154
  $pane->configuration = array(
155
    'title' => 'Long Arg Visibility Block',
156
    '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.',
157
    'format' => '1',
158
    'substitute' => 1,
159
  );
160
  $pane->cache = array();
161
  $pane->style = array();
162
  $pane->css = array();
163
  $pane->extras = array();
164
  $pane->position = 1;
165
  $display->content['new-2'] = $pane;
166
  $display->panels['left'][1] = 'new-2';
167
  $pane = new stdClass();
168
  $pane->pid = 'new-3';
169
  $pane->panel = 'left';
170
  $pane->type = 'custom';
171
  $pane->subtype = 'custom';
172
  $pane->shown = TRUE;
173
  $pane->access = array(
174
    'plugins' => array(
175
      '0' => array(
176
        'name' => 'arg_length',
177
        'settings' => array(
178
          'greater_than' => '0',
179
          'arg_length' => '4',
180
        ),
181
        'context' => 'argument_simplecontext_arg_2',
182
      ),
183
    ),
184
  );
185
  $pane->configuration = array(
186
    'title' => 'Short Arg Visibility',
187
    'body' => 'This block appears when the simplecontext argument is <i>less than</i> the configured length.',
188
    'format' => '1',
189
    'substitute' => 1,
190
  );
191
  $pane->cache = array();
192
  $pane->style = array();
193
  $pane->css = array();
194
  $pane->extras = array();
195
  $pane->position = 2;
196
  $display->content['new-3'] = $pane;
197
  $display->panels['left'][2] = 'new-3';
198
  $pane = new stdClass();
199
  $pane->pid = 'new-4';
200
  $pane->panel = 'middle';
201
  $pane->type = 'simplecontext_content_type';
202
  $pane->subtype = 'simplecontext_content_type';
203
  $pane->shown = TRUE;
204
  $pane->access = array();
205
  $pane->configuration = array(
206
    'buttons' => NULL,
207
    '#validate' => NULL,
208
    '#submit' => NULL,
209
    '#action' => NULL,
210
    'context' => 'argument_simplecontext_arg_2',
211
    'aligner_start' => NULL,
212
    'override_title' => 1,
213
    'override_title_text' => 'Simplecontext (with an arg)',
214
    'aligner_stop' => NULL,
215
    'override_title_markup' => NULL,
216
    'config_item_1' => 'Config item 1 contents',
217
    '#build_id' => NULL,
218
    '#type' => NULL,
219
    '#programmed' => NULL,
220
    'form_build_id' => 'form-19c4ae6cb54fad8f096da46e95694e5a',
221
    '#token' => NULL,
222
    'form_token' => '17141d3531eaa7b609da78afa6f3b560',
223
    'form_id' => 'simplecontext_content_type_edit_form',
224
    '#id' => NULL,
225
    '#description' => NULL,
226
    '#attributes' => NULL,
227
    '#required' => NULL,
228
    '#tree' => NULL,
229
    '#parents' => NULL,
230
    '#method' => NULL,
231
    '#post' => NULL,
232
    '#processed' => NULL,
233
    '#defaults_loaded' => NULL,
234
  );
235
  $pane->cache = array();
236
  $pane->style = array();
237
  $pane->css = array();
238
  $pane->extras = array();
239
  $pane->position = 0;
240
  $display->content['new-4'] = $pane;
241
  $display->panels['middle'][0] = 'new-4';
242
  $pane = new stdClass();
243
  $pane->pid = 'new-5';
244
  $pane->panel = 'middle';
245
  $pane->type = 'simplecontext_content_type';
246
  $pane->subtype = 'simplecontext_content_type';
247
  $pane->shown = TRUE;
248
  $pane->access = array();
249
  $pane->configuration = array(
250
    'buttons' => NULL,
251
    '#validate' => NULL,
252
    '#submit' => NULL,
253
    '#action' => NULL,
254
    'context' => 'context_simplecontext_1',
255
    'aligner_start' => NULL,
256
    'override_title' => 1,
257
    'override_title_text' => 'Configured simplecontext content type (not from arg)',
258
    'aligner_stop' => NULL,
259
    'override_title_markup' => NULL,
260
    'config_item_1' => '(configuration for simplecontext)',
261
    '#build_id' => NULL,
262
    '#type' => NULL,
263
    '#programmed' => NULL,
264
    'form_build_id' => 'form-d016200490abd015dc5b8a7e366d76ea',
265
    '#token' => NULL,
266
    'form_token' => '17141d3531eaa7b609da78afa6f3b560',
267
    'form_id' => 'simplecontext_content_type_edit_form',
268
    '#id' => NULL,
269
    '#description' => NULL,
270
    '#attributes' => NULL,
271
    '#required' => NULL,
272
    '#tree' => NULL,
273
    '#parents' => NULL,
274
    '#method' => NULL,
275
    '#post' => NULL,
276
    '#processed' => NULL,
277
    '#defaults_loaded' => NULL,
278
  );
279
  $pane->cache = array();
280
  $pane->style = array();
281
  $pane->css = array();
282
  $pane->extras = array();
283
  $pane->position = 1;
284
  $display->content['new-5'] = $pane;
285
  $display->panels['middle'][1] = 'new-5';
286
  $pane = new stdClass();
287
  $pane->pid = 'new-6';
288
  $pane->panel = 'middle';
289
  $pane->type = 'custom';
290
  $pane->subtype = 'custom';
291
  $pane->shown = TRUE;
292
  $pane->access = array();
293
  $pane->configuration = array(
294
    'admin_title' => 'Simplecontext keyword usage',
295
    'title' => 'Simplecontext keyword usage',
296
    'body' => 'Demonstrating context keyword usage:
297
    item1 is %sc:item1
298
    item2 is %sc:item2
299
    description is %sc:description',
300
    'format' => '1',
301
    'substitute' => 1,
302
  );
303
  $pane->cache = array();
304
  $pane->style = array();
305
  $pane->css = array();
306
  $pane->extras = array();
307
  $pane->position = 2;
308
  $display->content['new-6'] = $pane;
309
  $display->panels['middle'][2] = 'new-6';
310
  $pane = new stdClass();
311
  $pane->pid = 'new-7';
312
  $pane->panel = 'right';
313
  $pane->type = 'relcontext_content_type';
314
  $pane->subtype = 'relcontext_content_type';
315
  $pane->shown = TRUE;
316
  $pane->access = array();
317
  $pane->configuration = array(
318
    'buttons' => NULL,
319
    '#validate' => NULL,
320
    '#submit' => NULL,
321
    '#action' => NULL,
322
    'context' => 'relationship_relcontext_from_simplecontext_1',
323
    'aligner_start' => NULL,
324
    'override_title' => 0,
325
    'override_title_text' => '',
326
    'aligner_stop' => NULL,
327
    'override_title_markup' => NULL,
328
    'config_item_1' => 'some stuff in this one',
329
    '#build_id' => NULL,
330
    '#type' => NULL,
331
    '#programmed' => NULL,
332
    'form_build_id' => 'form-8485f84511bd06e51b4a48e998448054',
333
    '#token' => NULL,
334
    'form_token' => '1c3356396374d51d7d2531a10fd25310',
335
    'form_id' => 'relcontext_edit_form',
336
    '#id' => NULL,
337
    '#description' => NULL,
338
    '#attributes' => NULL,
339
    '#required' => NULL,
340
    '#tree' => NULL,
341
    '#parents' => NULL,
342
    '#method' => NULL,
343
    '#post' => NULL,
344
    '#processed' => NULL,
345
    '#defaults_loaded' => NULL,
346
  );
347
  $pane->cache = array();
348
  $pane->style = array();
349
  $pane->css = array();
350
  $pane->extras = array();
351
  $pane->position = 0;
352
  $display->content['new-7'] = $pane;
353
  $display->panels['right'][0] = 'new-7';
354
  $pane = new stdClass();
355
  $pane->pid = 'new-8';
356
  $pane->panel = 'top';
357
  $pane->type = 'custom';
358
  $pane->subtype = 'custom';
359
  $pane->shown = TRUE;
360
  $pane->access = array();
361
  $pane->configuration = array(
362
    'title' => 'Demonstrating ctools plugins',
363
    'body' => 'The CTools Plugin Example module (and this panel page) are just here to demonstrate how to build CTools plugins.
364

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

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

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

    
446
  return $pages;
447
}