ctools_plugin_example.pages_default.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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. );
  96. $display = new panels_display;
  97. $display->layout = 'threecol_33_34_33_stacked';
  98. $display->layout_settings = array();
  99. $display->panel_settings = array(
  100. 'style' => 'rounded_corners',
  101. 'style_settings' => array(
  102. 'default' => array(
  103. 'corner_location' => 'pane',
  104. ),
  105. ),
  106. );
  107. $display->cache = array();
  108. $display->title = 'CTools plugin example panel';
  109. $display->hide_title = FALSE;
  110. $display->title_pane = 1;
  111. $display->content = array();
  112. $display->panels = array();
  113. $pane = new stdClass;
  114. $pane->pid = 'new-1';
  115. $pane->panel = 'left';
  116. $pane->type = 'no_context_content_type';
  117. $pane->subtype = 'no_context_content_type';
  118. $pane->shown = TRUE;
  119. $pane->access = array();
  120. $pane->configuration = array(
  121. 'item1' => 'contents of config item 1',
  122. 'item2' => 'contents of config item 2',
  123. 'override_title' => 0,
  124. 'override_title_text' => '',
  125. );
  126. $pane->cache = array();
  127. $pane->style = array();
  128. $pane->css = array();
  129. $pane->extras = array();
  130. $pane->position = 0;
  131. $display->content['new-1'] = $pane;
  132. $display->panels['left'][0] = 'new-1';
  133. $pane = new stdClass;
  134. $pane->pid = 'new-2';
  135. $pane->panel = 'left';
  136. $pane->type = 'custom';
  137. $pane->subtype = 'custom';
  138. $pane->shown = TRUE;
  139. $pane->access = array(
  140. 'plugins' => array(
  141. '0' => array(
  142. 'name' => 'arg_length',
  143. 'settings' => array(
  144. 'greater_than' => '1',
  145. 'arg_length' => '4',
  146. ),
  147. 'context' => 'argument_simplecontext_arg_2',
  148. ),
  149. ),
  150. );
  151. $pane->configuration = array(
  152. 'title' => 'Long Arg Visibility Block',
  153. '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.',
  154. 'format' => '1',
  155. 'substitute' => 1,
  156. );
  157. $pane->cache = array();
  158. $pane->style = array();
  159. $pane->css = array();
  160. $pane->extras = array();
  161. $pane->position = 1;
  162. $display->content['new-2'] = $pane;
  163. $display->panels['left'][1] = 'new-2';
  164. $pane = new stdClass;
  165. $pane->pid = 'new-3';
  166. $pane->panel = 'left';
  167. $pane->type = 'custom';
  168. $pane->subtype = 'custom';
  169. $pane->shown = TRUE;
  170. $pane->access = array(
  171. 'plugins' => array(
  172. '0' => array(
  173. 'name' => 'arg_length',
  174. 'settings' => array(
  175. 'greater_than' => '0',
  176. 'arg_length' => '4',
  177. ),
  178. 'context' => 'argument_simplecontext_arg_2',
  179. ),
  180. ),
  181. );
  182. $pane->configuration = array(
  183. 'title' => 'Short Arg Visibility',
  184. 'body' => 'This block appears when the simplecontext argument is <i>less than</i> the configured length.',
  185. 'format' => '1',
  186. 'substitute' => 1,
  187. );
  188. $pane->cache = array();
  189. $pane->style = array();
  190. $pane->css = array();
  191. $pane->extras = array();
  192. $pane->position = 2;
  193. $display->content['new-3'] = $pane;
  194. $display->panels['left'][2] = 'new-3';
  195. $pane = new stdClass;
  196. $pane->pid = 'new-4';
  197. $pane->panel = 'middle';
  198. $pane->type = 'simplecontext_content_type';
  199. $pane->subtype = 'simplecontext_content_type';
  200. $pane->shown = TRUE;
  201. $pane->access = array();
  202. $pane->configuration = array(
  203. 'buttons' => NULL,
  204. '#validate' => NULL,
  205. '#submit' => NULL,
  206. '#action' => NULL,
  207. 'context' => 'argument_simplecontext_arg_2',
  208. 'aligner_start' => NULL,
  209. 'override_title' => 1,
  210. 'override_title_text' => 'Simplecontext (with an arg)',
  211. 'aligner_stop' => NULL,
  212. 'override_title_markup' => NULL,
  213. 'config_item_1' => 'Config item 1 contents',
  214. '#build_id' => NULL,
  215. '#type' => NULL,
  216. '#programmed' => NULL,
  217. 'form_build_id' => 'form-19c4ae6cb54fad8f096da46e95694e5a',
  218. '#token' => NULL,
  219. 'form_token' => '17141d3531eaa7b609da78afa6f3b560',
  220. 'form_id' => 'simplecontext_content_type_edit_form',
  221. '#id' => NULL,
  222. '#description' => NULL,
  223. '#attributes' => NULL,
  224. '#required' => NULL,
  225. '#tree' => NULL,
  226. '#parents' => NULL,
  227. '#method' => NULL,
  228. '#post' => NULL,
  229. '#processed' => NULL,
  230. '#defaults_loaded' => NULL,
  231. );
  232. $pane->cache = array();
  233. $pane->style = array();
  234. $pane->css = array();
  235. $pane->extras = array();
  236. $pane->position = 0;
  237. $display->content['new-4'] = $pane;
  238. $display->panels['middle'][0] = 'new-4';
  239. $pane = new stdClass;
  240. $pane->pid = 'new-5';
  241. $pane->panel = 'middle';
  242. $pane->type = 'simplecontext_content_type';
  243. $pane->subtype = 'simplecontext_content_type';
  244. $pane->shown = TRUE;
  245. $pane->access = array();
  246. $pane->configuration = array(
  247. 'buttons' => NULL,
  248. '#validate' => NULL,
  249. '#submit' => NULL,
  250. '#action' => NULL,
  251. 'context' => 'context_simplecontext_1',
  252. 'aligner_start' => NULL,
  253. 'override_title' => 1,
  254. 'override_title_text' => 'Configured simplecontext content type (not from arg)',
  255. 'aligner_stop' => NULL,
  256. 'override_title_markup' => NULL,
  257. 'config_item_1' => '(configuration for simplecontext)',
  258. '#build_id' => NULL,
  259. '#type' => NULL,
  260. '#programmed' => NULL,
  261. 'form_build_id' => 'form-d016200490abd015dc5b8a7e366d76ea',
  262. '#token' => NULL,
  263. 'form_token' => '17141d3531eaa7b609da78afa6f3b560',
  264. 'form_id' => 'simplecontext_content_type_edit_form',
  265. '#id' => NULL,
  266. '#description' => NULL,
  267. '#attributes' => NULL,
  268. '#required' => NULL,
  269. '#tree' => NULL,
  270. '#parents' => NULL,
  271. '#method' => NULL,
  272. '#post' => NULL,
  273. '#processed' => NULL,
  274. '#defaults_loaded' => NULL,
  275. );
  276. $pane->cache = array();
  277. $pane->style = array();
  278. $pane->css = array();
  279. $pane->extras = array();
  280. $pane->position = 1;
  281. $display->content['new-5'] = $pane;
  282. $display->panels['middle'][1] = 'new-5';
  283. $pane = new stdClass;
  284. $pane->pid = 'new-6';
  285. $pane->panel = 'middle';
  286. $pane->type = 'custom';
  287. $pane->subtype = 'custom';
  288. $pane->shown = TRUE;
  289. $pane->access = array();
  290. $pane->configuration = array(
  291. 'admin_title' => 'Simplecontext keyword usage',
  292. 'title' => 'Simplecontext keyword usage',
  293. 'body' => 'Demonstrating context keyword usage:
  294. item1 is %sc:item1
  295. item2 is %sc:item2
  296. description is %sc:description',
  297. 'format' => '1',
  298. 'substitute' => 1,
  299. );
  300. $pane->cache = array();
  301. $pane->style = array();
  302. $pane->css = array();
  303. $pane->extras = array();
  304. $pane->position = 2;
  305. $display->content['new-6'] = $pane;
  306. $display->panels['middle'][2] = 'new-6';
  307. $pane = new stdClass;
  308. $pane->pid = 'new-7';
  309. $pane->panel = 'right';
  310. $pane->type = 'relcontext_content_type';
  311. $pane->subtype = 'relcontext_content_type';
  312. $pane->shown = TRUE;
  313. $pane->access = array();
  314. $pane->configuration = array(
  315. 'buttons' => NULL,
  316. '#validate' => NULL,
  317. '#submit' => NULL,
  318. '#action' => NULL,
  319. 'context' => 'relationship_relcontext_from_simplecontext_1',
  320. 'aligner_start' => NULL,
  321. 'override_title' => 0,
  322. 'override_title_text' => '',
  323. 'aligner_stop' => NULL,
  324. 'override_title_markup' => NULL,
  325. 'config_item_1' => 'some stuff in this one',
  326. '#build_id' => NULL,
  327. '#type' => NULL,
  328. '#programmed' => NULL,
  329. 'form_build_id' => 'form-8485f84511bd06e51b4a48e998448054',
  330. '#token' => NULL,
  331. 'form_token' => '1c3356396374d51d7d2531a10fd25310',
  332. 'form_id' => 'relcontext_edit_form',
  333. '#id' => NULL,
  334. '#description' => NULL,
  335. '#attributes' => NULL,
  336. '#required' => NULL,
  337. '#tree' => NULL,
  338. '#parents' => NULL,
  339. '#method' => NULL,
  340. '#post' => NULL,
  341. '#processed' => NULL,
  342. '#defaults_loaded' => NULL,
  343. );
  344. $pane->cache = array();
  345. $pane->style = array();
  346. $pane->css = array();
  347. $pane->extras = array();
  348. $pane->position = 0;
  349. $display->content['new-7'] = $pane;
  350. $display->panels['right'][0] = 'new-7';
  351. $pane = new stdClass;
  352. $pane->pid = 'new-8';
  353. $pane->panel = 'top';
  354. $pane->type = 'custom';
  355. $pane->subtype = 'custom';
  356. $pane->shown = TRUE;
  357. $pane->access = array();
  358. $pane->configuration = array(
  359. 'title' => 'Demonstrating ctools plugins',
  360. 'body' => 'The CTools Plugin Example module (and this panel page) are just here to demonstrate how to build CTools plugins.
  361. ',
  362. 'format' => '2',
  363. 'substitute' => 1,
  364. );
  365. $pane->cache = array();
  366. $pane->style = array();
  367. $pane->css = array();
  368. $pane->extras = array();
  369. $pane->position = 0;
  370. $display->content['new-8'] = $pane;
  371. $display->panels['top'][0] = 'new-8';
  372. $handler->conf['display'] = $display;
  373. $page->default_handlers[$handler->name] = $handler;
  374. // end of exported panel.
  375. $pages['ctools_plugin_example_demo_page'] = $page;
  376. // begin exported panel
  377. $page = new stdClass;
  378. $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
  379. $page->api_version = 1;
  380. $page->name = 'ctools_plugin_example_base';
  381. $page->task = 'page';
  382. $page->admin_title = 'CTools Plugin Example base page';
  383. $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.';
  384. $page->path = 'ctools_plugin_example';
  385. $page->access = array();
  386. $page->menu = array();
  387. $page->arguments = array();
  388. $page->conf = array();
  389. $page->default_handlers = array();
  390. $handler = new stdClass;
  391. $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
  392. $handler->api_version = 1;
  393. $handler->name = 'page_ctools_plugin_example_base_panel_context';
  394. $handler->task = 'page';
  395. $handler->subtask = 'ctools_plugin_example_base';
  396. $handler->handler = 'panel_context';
  397. $handler->weight = 0;
  398. $handler->conf = array(
  399. 'title' => 'Panel',
  400. 'no_blocks' => FALSE,
  401. 'css_id' => '',
  402. 'css' => '',
  403. 'contexts' => array(),
  404. 'relationships' => array(),
  405. );
  406. $display = new panels_display;
  407. $display->layout = 'onecol';
  408. $display->layout_settings = array();
  409. $display->panel_settings = array();
  410. $display->cache = array();
  411. $display->title = '';
  412. $display->hide_title = FALSE;
  413. $display->content = array();
  414. $display->panels = array();
  415. $pane = new stdClass;
  416. $pane->pid = 'new-1';
  417. $pane->panel = 'middle';
  418. $pane->type = 'custom';
  419. $pane->subtype = 'custom';
  420. $pane->shown = TRUE;
  421. $pane->access = array();
  422. $pane->configuration = array(
  423. 'title' => 'Use this page with an argument',
  424. 'body' => 'This demo page works if you use an argument, like <a href="ctools_plugin_example/xxxxx">ctools_plugin_example/xxxxx</a>.',
  425. 'format' => '1',
  426. 'substitute' => NULL,
  427. );
  428. $pane->cache = array();
  429. $pane->style = array();
  430. $pane->css = array();
  431. $pane->extras = array();
  432. $pane->position = 0;
  433. $display->content['new-1'] = $pane;
  434. $display->panels['middle'][0] = 'new-1';
  435. $handler->conf['display'] = $display;
  436. $page->default_handlers[$handler->name] = $handler;
  437. // end exported panel.
  438. $pages['base_page'] = $page;
  439. return $pages;
  440. }