node_body.inc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * @file
  4. * Plugins are described by creating a $plugin array which will be used
  5. * by the system that includes this file.
  6. */
  7. $plugin = array(
  8. 'single' => TRUE,
  9. 'title' => t('Node body'),
  10. 'icon' => 'icon_node.png',
  11. 'description' => t('The body of the referenced node.'),
  12. 'required context' => new ctools_context_required(t('Node'), 'node'),
  13. 'category' => t('Node'),
  14. 'no ui' => TRUE,
  15. );
  16. /**
  17. * Render the custom content type.
  18. */
  19. function ctools_node_body_content_type_render($subtype, $conf, $panel_args, $context) {
  20. $plugin = ctools_get_content_type('entity_field');
  21. $conf['formatter'] = 'text_default';
  22. $conf['formatter_settings'] = array();
  23. return $plugin['render callback']('node:body', $conf, $panel_args, $context);
  24. }
  25. /**
  26. * Returns an edit form for custom type settings.
  27. */
  28. function ctools_node_body_content_type_edit_form($form, &$form_state) {
  29. // Provide a blank form so we have a place to have context setting.
  30. return $form;
  31. }
  32. /**
  33. * Returns the administrative title for a type.
  34. */
  35. function ctools_node_body_content_type_admin_title($subtype, $conf, $context) {
  36. return t('"@s" body', array('@s' => $context->identifier));
  37. }