node_body.inc 1.1 KB

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