page_primary_links.inc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @file
  4. * Plugin to handle the 'page' content type which allows the standard page
  5. * template variables to be embedded into a panel.
  6. */
  7. /**
  8. * Plugins are described by creating a $plugin array which will be used
  9. * by the system that includes this file.
  10. */
  11. $plugin = array(
  12. 'title' => t('Primary navigation links'),
  13. 'single' => TRUE,
  14. 'icon' => 'icon_page.png',
  15. 'description' => t('Add the primary_links (local tasks) as content.'),
  16. 'category' => t('Page elements'),
  17. 'render last' => TRUE,
  18. );
  19. /**
  20. * Output function for the 'page_primary_links' content type.
  21. *
  22. * Outputs the primary_links (local tasks) of the current page.
  23. */
  24. function ctools_page_primary_links_content_type_render($subtype, $conf, $panel_args) {
  25. $block = new stdClass();
  26. $block->content = theme('links', array('links' => menu_main_menu(), 'attributes' => array('class' => 'links primary-links')));
  27. return $block;
  28. }
  29. /**
  30. * Returns an edit form for custom type settings.
  31. */
  32. function ctools_page_primary_links_content_type_edit_form($form, &$form_state) {
  33. // Empty so that we can have title override.
  34. return $form;
  35. }