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