Projet

Général

Profil

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

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

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

    
27
function ctools_plugin_example_default_page_manager_pages() {
28

    
29
  // begin exported panel.
30

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

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

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

    
384
  // begin exported panel
385

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

    
448
  $pages['base_page'] = $page;
449

    
450
  return $pages;
451
}