[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/ctools/ctools_plugin_example/ -> ctools_plugin_example.pages_default.inc (source)

   1  <?php
   2  // $Id: ctools_plugin_example.pages_default.inc,v 1.1.2.1 2010/01/29 19:54:02 merlinofchaos Exp $
   3  
   4  /**
   5   * @file
   6   * This module provides default panels to demonstrate the behavior of the plugins.
   7   */
   8  
   9  /**
  10   * Default panels pages for CTools Plugin Example
  11   *
  12   * To pick up this file, your module needs to implement
  13   * hook_ctools_plugin_api() - See ctools_plugin_example_ctools_plugin_api() in
  14   * ctools_plugin_example.module.
  15   *
  16   *
  17   * Note the naming of the file: <modulename>.pages_default.inc
  18   * With this naming, no additional code needs to be provided. CTools will just find the file.
  19   * The name of the hook is <modulename>_default_page_manager_pages()
  20   *
  21   * This example provides two pages, but the returned array could
  22   * have several pages.
  23   *
  24   * @return
  25   *   Array of pages, normally exported from Panels.
  26   */
  27  
  28  function ctools_plugin_example_default_page_manager_pages() {
  29  
  30    // begin exported panel.
  31  
  32    $page = new stdClass;
  33    $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
  34    $page->api_version = 1;
  35    $page->name = 'ctools_plugin_example';
  36    $page->task = 'page';
  37    $page->admin_title = 'CTools plugin example';
  38    $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. ';
  39    $page->path = 'ctools_plugin_example/%sc';
  40    $page->access = array(
  41    'logic' => 'and',
  42    );
  43    $page->menu = array(
  44    'type' => 'normal',
  45    'title' => 'CTools plugin example',
  46    'name' => 'navigation',
  47    'weight' => '0',
  48    'parent' => array(
  49      'type' => 'none',
  50      'title' => '',
  51      'name' => 'navigation',
  52      'weight' => '0',
  53    ),
  54    );
  55    $page->arguments = array(
  56    'sc' => array(
  57      'id' => 2,
  58      'identifier' => 'simplecontext-arg',
  59      'name' => 'simplecontext_arg',
  60      'settings' => array(),
  61    ),
  62    );
  63    $page->conf = array();
  64    $page->default_handlers = array();
  65    $handler = new stdClass;
  66    $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
  67    $handler->api_version = 1;
  68    $handler->name = 'page_ctools_panel_context';
  69    $handler->task = 'page';
  70    $handler->subtask = 'ctools_plugin_example';
  71    $handler->handler = 'panel_context';
  72    $handler->weight = 0;
  73    $handler->conf = array(
  74    'title' => 'Panel',
  75    'no_blocks' => FALSE,
  76    'css_id' => '',
  77    'css' => '',
  78    'contexts' => array(
  79      '0' => array(
  80        'name' => 'simplecontext',
  81        'id' => 1,
  82        'identifier' => 'Configured simplecontext (not from argument)',
  83        'keyword' => 'configured_simplecontext',
  84        'context_settings' => array(
  85          'sample_simplecontext_setting' => 'default simplecontext setting',
  86    ),
  87    ),
  88    ),
  89    'relationships' => array(
  90      '0' => array(
  91        'context' => 'argument_simplecontext_arg_2',
  92        'name' => 'relcontext_from_simplecontext',
  93        'id' => 1,
  94        'identifier' => 'Relcontext from simplecontext (from relationship)',
  95        'keyword' => 'relcontext',
  96    ),
  97    ),
  98    'access' => array(
  99      'logic' => 'and',
 100    ),
 101    );
 102    $display = new panels_display;
 103    $display->layout = 'threecol_33_34_33_stacked';
 104    $display->layout_settings = array();
 105    $display->panel_settings = array(
 106    'style' => 'rounded_corners',
 107    'style_settings' => array(
 108      'default' => array(
 109        'corner_location' => 'pane',
 110    ),
 111    ),
 112    );
 113    $display->cache = array();
 114    $display->title = 'CTools plugin example panel';
 115    $display->hide_title = FALSE;
 116    $display->title_pane = 1;
 117    $display->content = array();
 118    $display->panels = array();
 119    $pane = new stdClass;
 120    $pane->pid = 'new-1';
 121    $pane->panel = 'left';
 122    $pane->type = 'no_context_content_type';
 123    $pane->subtype = 'no_context_content_type';
 124    $pane->shown = TRUE;
 125    $pane->access = array();
 126    $pane->configuration = array(
 127      'item1' => 'contents of config item 1',
 128      'item2' => 'contents of config item 2',
 129      'override_title' => 0,
 130      'override_title_text' => '',
 131    );
 132    $pane->cache = array();
 133    $pane->style = array();
 134    $pane->css = array();
 135    $pane->extras = array();
 136    $pane->position = 0;
 137    $display->content['new-1'] = $pane;
 138    $display->panels['left'][0] = 'new-1';
 139    $pane = new stdClass;
 140    $pane->pid = 'new-2';
 141    $pane->panel = 'left';
 142    $pane->type = 'custom';
 143    $pane->subtype = 'custom';
 144    $pane->shown = TRUE;
 145    $pane->access = array(
 146      'plugins' => array(
 147        '0' => array(
 148          'name' => 'arg_length',
 149          'settings' => array(
 150            'greater_than' => '1',
 151            'arg_length' => '4',
 152    ),
 153          'context' => 'argument_simplecontext_arg_2',
 154    ),
 155    ),
 156    );
 157    $pane->configuration = array(
 158      'title' => 'Long Arg Visibility Block',
 159      '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.',
 160      'format' => '1',
 161      'substitute' => 1,
 162    );
 163    $pane->cache = array();
 164    $pane->style = array();
 165    $pane->css = array();
 166    $pane->extras = array();
 167    $pane->position = 1;
 168    $display->content['new-2'] = $pane;
 169    $display->panels['left'][1] = 'new-2';
 170    $pane = new stdClass;
 171    $pane->pid = 'new-3';
 172    $pane->panel = 'left';
 173    $pane->type = 'custom';
 174    $pane->subtype = 'custom';
 175    $pane->shown = TRUE;
 176    $pane->access = array(
 177      'plugins' => array(
 178        '0' => array(
 179          'name' => 'arg_length',
 180          'settings' => array(
 181            'greater_than' => '0',
 182            'arg_length' => '4',
 183    ),
 184          'context' => 'argument_simplecontext_arg_2',
 185    ),
 186    ),
 187    );
 188    $pane->configuration = array(
 189      'title' => 'Short Arg Visibility',
 190      'body' => 'This block appears when the simplecontext argument is <i>less than</i> the configured length.',
 191      'format' => '1',
 192      'substitute' => 1,
 193    );
 194    $pane->cache = array();
 195    $pane->style = array();
 196    $pane->css = array();
 197    $pane->extras = array();
 198    $pane->position = 2;
 199    $display->content['new-3'] = $pane;
 200    $display->panels['left'][2] = 'new-3';
 201    $pane = new stdClass;
 202    $pane->pid = 'new-4';
 203    $pane->panel = 'middle';
 204    $pane->type = 'simplecontext_content_type';
 205    $pane->subtype = 'simplecontext_content_type';
 206    $pane->shown = TRUE;
 207    $pane->access = array();
 208    $pane->configuration = array(
 209      'buttons' => NULL,
 210      '#validate' => NULL,
 211      '#submit' => NULL,
 212      '#action' => NULL,
 213      'context' => 'argument_simplecontext_arg_2',
 214      'aligner_start' => NULL,
 215      'override_title' => 1,
 216      'override_title_text' => 'Simplecontext (with an arg)',
 217      'aligner_stop' => NULL,
 218      'override_title_markup' => NULL,
 219      'config_item_1' => 'Config item 1 contents',
 220      '#build_id' => NULL,
 221      '#type' => NULL,
 222      '#programmed' => NULL,
 223      'form_build_id' => 'form-19c4ae6cb54fad8f096da46e95694e5a',
 224      '#token' => NULL,
 225      'form_token' => '17141d3531eaa7b609da78afa6f3b560',
 226      'form_id' => 'simplecontext_content_type_edit_form',
 227      '#id' => NULL,
 228      '#description' => NULL,
 229      '#attributes' => NULL,
 230      '#required' => NULL,
 231      '#tree' => NULL,
 232      '#parents' => NULL,
 233      '#method' => NULL,
 234      '#post' => NULL,
 235      '#processed' => NULL,
 236      '#defaults_loaded' => NULL,
 237    );
 238    $pane->cache = array();
 239    $pane->style = array();
 240    $pane->css = array();
 241    $pane->extras = array();
 242    $pane->position = 0;
 243    $display->content['new-4'] = $pane;
 244    $display->panels['middle'][0] = 'new-4';
 245    $pane = new stdClass;
 246    $pane->pid = 'new-5';
 247    $pane->panel = 'middle';
 248    $pane->type = 'simplecontext_content_type';
 249    $pane->subtype = 'simplecontext_content_type';
 250    $pane->shown = TRUE;
 251    $pane->access = array();
 252    $pane->configuration = array(
 253      'buttons' => NULL,
 254      '#validate' => NULL,
 255      '#submit' => NULL,
 256      '#action' => NULL,
 257      'context' => 'context_simplecontext_1',
 258      'aligner_start' => NULL,
 259      'override_title' => 1,
 260      'override_title_text' => 'Configured simplecontext content type (not from arg)',
 261      'aligner_stop' => NULL,
 262      'override_title_markup' => NULL,
 263      'config_item_1' => '(configuration for simplecontext)',
 264      '#build_id' => NULL,
 265      '#type' => NULL,
 266      '#programmed' => NULL,
 267      'form_build_id' => 'form-d016200490abd015dc5b8a7e366d76ea',
 268      '#token' => NULL,
 269      'form_token' => '17141d3531eaa7b609da78afa6f3b560',
 270      'form_id' => 'simplecontext_content_type_edit_form',
 271      '#id' => NULL,
 272      '#description' => NULL,
 273      '#attributes' => NULL,
 274      '#required' => NULL,
 275      '#tree' => NULL,
 276      '#parents' => NULL,
 277      '#method' => NULL,
 278      '#post' => NULL,
 279      '#processed' => NULL,
 280      '#defaults_loaded' => NULL,
 281    );
 282    $pane->cache = array();
 283    $pane->style = array();
 284    $pane->css = array();
 285    $pane->extras = array();
 286    $pane->position = 1;
 287    $display->content['new-5'] = $pane;
 288    $display->panels['middle'][1] = 'new-5';
 289    $pane = new stdClass;
 290    $pane->pid = 'new-6';
 291    $pane->panel = 'middle';
 292    $pane->type = 'custom';
 293    $pane->subtype = 'custom';
 294    $pane->shown = TRUE;
 295    $pane->access = array();
 296    $pane->configuration = array(
 297      'admin_title' => 'Simplecontext keyword usage',
 298      'title' => 'Simplecontext keyword usage',
 299      'body' => 'Demonstrating context keyword usage:
 300      item1 is %sc:item1
 301      item2 is %sc:item2
 302      description is %sc:description',
 303      'format' => '1',
 304      'substitute' => 1,
 305    );
 306    $pane->cache = array();
 307    $pane->style = array();
 308    $pane->css = array();
 309    $pane->extras = array();
 310    $pane->position = 2;
 311    $display->content['new-6'] = $pane;
 312    $display->panels['middle'][2] = 'new-6';
 313    $pane = new stdClass;
 314    $pane->pid = 'new-7';
 315    $pane->panel = 'right';
 316    $pane->type = 'relcontext_content_type';
 317    $pane->subtype = 'relcontext_content_type';
 318    $pane->shown = TRUE;
 319    $pane->access = array();
 320    $pane->configuration = array(
 321      'buttons' => NULL,
 322      '#validate' => NULL,
 323      '#submit' => NULL,
 324      '#action' => NULL,
 325      'context' => 'relationship_relcontext_from_simplecontext_1',
 326      'aligner_start' => NULL,
 327      'override_title' => 0,
 328      'override_title_text' => '',
 329      'aligner_stop' => NULL,
 330      'override_title_markup' => NULL,
 331      'config_item_1' => 'some stuff in this one',
 332      '#build_id' => NULL,
 333      '#type' => NULL,
 334      '#programmed' => NULL,
 335      'form_build_id' => 'form-8485f84511bd06e51b4a48e998448054',
 336      '#token' => NULL,
 337      'form_token' => '1c3356396374d51d7d2531a10fd25310',
 338      'form_id' => 'relcontext_edit_form',
 339      '#id' => NULL,
 340      '#description' => NULL,
 341      '#attributes' => NULL,
 342      '#required' => NULL,
 343      '#tree' => NULL,
 344      '#parents' => NULL,
 345      '#method' => NULL,
 346      '#post' => NULL,
 347      '#processed' => NULL,
 348      '#defaults_loaded' => NULL,
 349    );
 350    $pane->cache = array();
 351    $pane->style = array();
 352    $pane->css = array();
 353    $pane->extras = array();
 354    $pane->position = 0;
 355    $display->content['new-7'] = $pane;
 356    $display->panels['right'][0] = 'new-7';
 357    $pane = new stdClass;
 358    $pane->pid = 'new-8';
 359    $pane->panel = 'top';
 360    $pane->type = 'custom';
 361    $pane->subtype = 'custom';
 362    $pane->shown = TRUE;
 363    $pane->access = array();
 364    $pane->configuration = array(
 365      'title' => 'Demonstrating ctools plugins',
 366      'body' => 'The CTools Plugin Example module (and this panel page) are just here to demonstrate how to build CTools plugins.
 367  
 368              ',
 369      'format' => '2',
 370      'substitute' => 1,
 371    );
 372    $pane->cache = array();
 373    $pane->style = array();
 374    $pane->css = array();
 375    $pane->extras = array();
 376    $pane->position = 0;
 377    $display->content['new-8'] = $pane;
 378    $display->panels['top'][0] = 'new-8';
 379    $handler->conf['display'] = $display;
 380    $page->default_handlers[$handler->name] = $handler;
 381  
 382    // end of exported panel.
 383    $pages['ctools_plugin_example_demo_page'] = $page;
 384  
 385    // begin exported panel
 386  
 387    $page = new stdClass;
 388    $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
 389    $page->api_version = 1;
 390    $page->name = 'ctools_plugin_example_base';
 391    $page->task = 'page';
 392    $page->admin_title = 'CTools Plugin Example base page';
 393    $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.';
 394    $page->path = 'ctools_plugin_example';
 395    $page->access = array();
 396    $page->menu = array();
 397    $page->arguments = array();
 398    $page->conf = array();
 399    $page->default_handlers = array();
 400    $handler = new stdClass;
 401    $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
 402    $handler->api_version = 1;
 403    $handler->name = 'page_ctools_plugin_example_base_panel_context';
 404    $handler->task = 'page';
 405    $handler->subtask = 'ctools_plugin_example_base';
 406    $handler->handler = 'panel_context';
 407    $handler->weight = 0;
 408    $handler->conf = array(
 409    'title' => 'Panel',
 410    'no_blocks' => FALSE,
 411    'css_id' => '',
 412    'css' => '',
 413    'contexts' => array(),
 414    'relationships' => array(),
 415    );
 416    $display = new panels_display;
 417    $display->layout = 'onecol';
 418    $display->layout_settings = array();
 419    $display->panel_settings = array();
 420    $display->cache = array();
 421    $display->title = '';
 422    $display->hide_title = FALSE;
 423    $display->content = array();
 424    $display->panels = array();
 425    $pane = new stdClass;
 426    $pane->pid = 'new-1';
 427    $pane->panel = 'middle';
 428    $pane->type = 'custom';
 429    $pane->subtype = 'custom';
 430    $pane->shown = TRUE;
 431    $pane->access = array();
 432    $pane->configuration = array(
 433      'title' => 'Use this page with an argument',
 434      'body' => 'This demo page works if you use an argument, like <a href="ctools_plugin_example/xxxxx">ctools_plugin_example/xxxxx</a>.',
 435      'format' => '1',
 436      'substitute' => NULL,
 437    );
 438    $pane->cache = array();
 439    $pane->style = array();
 440    $pane->css = array();
 441    $pane->extras = array();
 442    $pane->position = 0;
 443    $display->content['new-1'] = $pane;
 444    $display->panels['middle'][0] = 'new-1';
 445    $handler->conf['display'] = $display;
 446    $page->default_handlers[$handler->name] = $handler;
 447    // end exported panel.
 448  
 449    $pages['base_page'] = $page;
 450  
 451    return $pages;
 452  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7