'CTools plugin example', 'description' => t("Demonstration code, advanced help, and a demo panel to show how to build ctools plugins."), 'page callback' => 'ctools_plugin_example_explanation_page', 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); return $items; } /** * Implements hook_ctools_plugin_directory(). * * It simply tells panels where to find the .inc files that define various * args, contexts, content_types. In this case the subdirectories of * ctools_plugin_example/panels are used. */ function ctools_plugin_example_ctools_plugin_directory($module, $plugin) { if ($module == 'ctools' && !empty($plugin)) { return "plugins/$plugin"; } } /** * Implement hook_ctools_plugin_api(). * * If you do this, CTools will pick up default panels pages in * .pages_default.inc. */ function ctools_plugin_example_ctools_plugin_api($module, $api) { // @todo -- this example should explain how to put it in a different file. if ($module == 'panels_mini' && $api == 'panels_default') { return array('version' => 1); } if ($module == 'page_manager' && $api == 'pages_default') { return array('version' => 1); } } /** * Just provide an explanation page for the admin section. * * @return unknown_type */ function ctools_plugin_example_explanation_page() { $content = '

' . t("The CTools Plugin Example is simply a developer's demo of how to create plugins for CTools. It provides no useful functionality for an ordinary user.") . '

'; $content .= '

' . t( 'There is a demo panel demonstrating much of the functionality provided at CTools demo panel, and you can find documentation on the examples at !ctools_plugin_example_help. CTools itself provides documentation at !ctools_help. Mostly, though, the code itself is intended to be the teacher. You can find it in %path.', array( '@demo_url' => url('ctools_plugin_example/xxxxx'), '!ctools_plugin_example_help' => theme('advanced_help_topic', array('module' => 'ctools_plugin_example', 'topic' => 'Chaos-Tools--CTools--Plugin-Examples', 'type' => 'title')), '!ctools_help' => theme('advanced_help_topic', array('module' => 'ctools', 'topic' => 'plugins', 'type' => 'title')), '%path' => drupal_get_path('module', 'ctools_plugin_example'), )) . '

'; return $content; }