[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/ctools/ctools_plugin_example/plugins/ -> panels.pages.inc (source)

   1  <?php
   2  // $Id: panels.pages.inc,v 1.1.2.1 2009/10/13 20:55:29 merlinofchaos Exp $
   3  
   4  /**
   5   * @file
   6   * Holds the panels pages export.
   7   */
   8  
   9  /**
  10   * Implementation of hook_default_panel_pages()
  11   */
  12  function ctools_plugin_example_default_panel_pages() {
  13    $page = new stdClass();
  14    $page->pid = 'new';
  15    $page->did = 'new';
  16    $page->name = 'ctools_plugin_example_demo_panel';
  17    $page->title = 'Panels Plugin Example Demo Panel';
  18    $page->access = array();
  19    $page->path = 'demo_panel';
  20    $page->load_flags = 1;
  21    $page->css_id = '';
  22    $page->arguments = array(
  23    0 =>
  24    array(
  25        'name' => 'simplecontext_arg',
  26        'id' => 1,
  27        'default' => '404',
  28        'title' => '',
  29        'identifier' => 'Simplecontext arg',
  30        'keyword' => 'simplecontext',
  31    ),
  32    );
  33    $page->relationships = array(
  34    0 =>
  35    array(
  36        'context' => 'argument_simplecontext_arg_1',
  37        'name' => 'relcontext_from_simplecontext',
  38        'id' => 1,
  39        'identifier' => 'Relcontext from Simplecontext',
  40        'keyword' => 'relcontext',
  41    ),
  42    );
  43    $page->no_blocks = '0';
  44    $page->switcher_options = array();
  45    $page->menu = '0';
  46    $page->contexts = array();
  47    $display = new ctools_display();
  48    $display->did = 'new';
  49    $display->layout = 'threecol_33_34_33_stacked';
  50    $display->layout_settings = array();
  51    $display->panel_settings = array();
  52    $display->content = array();
  53    $display->panels = array();
  54    $pane = new stdClass();
  55    $pane->pid = 'new-1';
  56    $pane->panel = 'left';
  57    $pane->type = 'custom';
  58    $pane->shown = '1';
  59    $pane->subtype = 'custom';
  60    $pane->access = array();
  61    $pane->configuration = array(
  62        'style' => 'default',
  63        'override_title' => 0,
  64        'override_title_text' => '',
  65        'css_id' => '',
  66        'css_class' => '',
  67        'title' => '"No Context Item"',
  68        '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.',
  69        'format' => '1',
  70    );
  71    $pane->cache = array();
  72    $display->content['new-1'] = $pane;
  73    $display->panels['left'][0] = 'new-1';
  74    $pane = new stdClass();
  75    $pane->pid = 'new-2';
  76    $pane->panel = 'left';
  77    $pane->type = 'no_context_item';
  78    $pane->shown = '1';
  79    $pane->subtype = 'description';
  80    $pane->access = array();
  81    $pane->configuration = array(
  82        'style' => 'default',
  83        'override_title' => 0,
  84        'override_title_text' => '',
  85        'css_id' => '',
  86        'css_class' => '',
  87        'item1' => 'one',
  88        'item2' => 'two',
  89        'item3' => 'three',
  90    );
  91    $pane->cache = array();
  92    $display->content['new-2'] = $pane;
  93    $display->panels['left'][1] = 'new-2';
  94    $pane = new stdClass();
  95    $pane->pid = 'new-3';
  96    $pane->panel = 'middle';
  97    $pane->type = 'custom';
  98    $pane->shown = '1';
  99    $pane->subtype = 'custom';
 100    $pane->access = array();
 101    $pane->configuration = array(
 102        'style' => 'default',
 103        'override_title' => 0,
 104        'override_title_text' => '',
 105        'css_id' => '',
 106        'css_class' => '',
 107        'title' => 'Simplecontext',
 108        'body' => 'The "Simplecontext" content and content type demonstrate a very basic context and how to display it.
 109  
 110      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.',
 111        'format' => '1',
 112    );
 113    $pane->cache = array();
 114    $display->content['new-3'] = $pane;
 115    $display->panels['middle'][0] = 'new-3';
 116    $pane = new stdClass();
 117    $pane->pid = 'new-4';
 118    $pane->panel = 'middle';
 119    $pane->type = 'simplecontext_item';
 120    $pane->shown = '1';
 121    $pane->subtype = 'description';
 122    $pane->access = array(
 123    0 => '2',
 124    1 => '4',
 125    );
 126    $pane->configuration = array(
 127        'context' => 'argument_simplecontext_arg_1',
 128        'style' => 'default',
 129        'override_title' => 0,
 130        'override_title_text' => '',
 131        'css_id' => '',
 132        'css_class' => '',
 133        'config_item_1' => 'simplecontext called from arg',
 134    );
 135    $pane->cache = array();
 136    $display->content['new-4'] = $pane;
 137    $display->panels['middle'][1] = 'new-4';
 138    $pane = new stdClass();
 139    $pane->pid = 'new-5';
 140    $pane->panel = 'right';
 141    $pane->type = 'custom';
 142    $pane->shown = '1';
 143    $pane->subtype = 'custom';
 144    $pane->access = array();
 145    $pane->configuration = array(
 146        'style' => 'default',
 147        'override_title' => 0,
 148        'override_title_text' => '',
 149        'css_id' => '',
 150        'css_class' => '',
 151        'title' => 'Relcontext',
 152        '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.',
 153        'format' => '1',
 154    );
 155    $pane->cache = array();
 156    $display->content['new-5'] = $pane;
 157    $display->panels['right'][0] = 'new-5';
 158    $pane = new stdClass();
 159    $pane->pid = 'new-6';
 160    $pane->panel = 'right';
 161    $pane->type = 'relcontext_item';
 162    $pane->shown = '1';
 163    $pane->subtype = 'description';
 164    $pane->access = array();
 165    $pane->configuration = array(
 166        'context' => 'relationship_relcontext_from_simplecontext_1',
 167        'style' => 'default',
 168        'override_title' => 0,
 169        'override_title_text' => '',
 170        'css_id' => '',
 171        'css_class' => '',
 172        'config_item_1' => 'default1',
 173    );
 174    $pane->cache = array();
 175    $display->content['new-6'] = $pane;
 176    $display->panels['right'][1] = 'new-6';
 177    $pane = new stdClass();
 178    $pane->pid = 'new-7';
 179    $pane->panel = 'top';
 180    $pane->type = 'custom_php';
 181    $pane->shown = '1';
 182    $pane->subtype = 'custom_php';
 183    $pane->access = array();
 184    $pane->configuration = array(
 185        'style' => 'default',
 186        'override_title' => 0,
 187        'override_title_text' => '',
 188        'css_id' => '',
 189        'css_class' => '',
 190        'title' => '',
 191        'body' => '$arg = arg(1);
 192      $arg0 = arg(0);
 193      if (!$arg) {
 194      $block->content = <<<END
 195      <em>This page is intended to run with an arg and you don\'t have one.</em>
 196      <br />
 197      Without an arg, the page doesn\'t have any context.
 198      <br />Please try something like "/$arg0/xxx"
 199  END;
 200  
 201      $block->title = "This is intended to run with an argument";
 202      } else {
 203      $block->content = "The arg for this page is \'$arg\'";
 204      }',
 205    );
 206    $pane->cache = array();
 207    $display->content['new-7'] = $pane;
 208    $display->panels['top'][0] = 'new-7';
 209    $page->display = $display;
 210    $page->displays = array();
 211    $pages['ctools_plugin_example'] = $page;
 212  
 213  
 214    return $pages;
 215  }


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