panels.pages.inc 6.3 KB

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