ctools_plugin_example.pages_default.inc 14 KB

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