1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
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 |
|
|
/**
|
18 |
|
|
* Render the custom content type.
|
19 |
|
|
*/
|
20 |
|
|
function ctools_node_body_content_type_render($subtype, $conf, $panel_args, $context) {
|
21 |
|
|
$plugin = ctools_get_content_type('entity_field');
|
22 |
|
|
$conf['formatter'] = 'text_default';
|
23 |
|
|
$conf['formatter_settings'] = array();
|
24 |
|
|
return $plugin['render callback']('node:body', $conf, $panel_args, $context);
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
/**
|
28 |
|
|
* Returns an edit form for custom type settings.
|
29 |
|
|
*/
|
30 |
|
|
function ctools_node_body_content_type_edit_form($form, &$form_state) {
|
31 |
|
|
// provide a blank form so we have a place to have context setting.
|
32 |
|
|
return $form;
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
/**
|
36 |
|
|
* Returns the administrative title for a type.
|
37 |
|
|
*/
|
38 |
|
|
function ctools_node_body_content_type_admin_title($subtype, $conf, $context) {
|
39 |
|
|
return t('"@s" body', array('@s' => $context->identifier));
|
40 |
|
|
} |