1
|
<?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
|
'icon' => 'icon_node_form.png',
|
10
|
'title' => t('Node form revision log message'),
|
11
|
'description' => t('Revision log message for the node.'),
|
12
|
'required context' => new ctools_context_required(t('Form'), 'node_form'),
|
13
|
'category' => t('Form'),
|
14
|
);
|
15
|
|
16
|
function ctools_node_form_log_content_type_render($subtype, $conf, $panel_args, &$context) {
|
17
|
$block = new stdClass();
|
18
|
$block->module = t('node_form');
|
19
|
$block->title = t('Revision information');
|
20
|
|
21
|
if (isset($context->form)) {
|
22
|
if (isset($context->form['revision_information'])) {
|
23
|
$block->content['revision_information'] = $context->form['revision_information'];
|
24
|
unset($block->content['revision_information']['#pre_render']);
|
25
|
unset($block->content['revision_information']['#theme_wrappers']);
|
26
|
$block->content['revision_information']['#type'] = '';
|
27
|
|
28
|
// Set access to false on the original rather than removing so that
|
29
|
// vertical tabs doesn't clone it. I think this is due to references.
|
30
|
$context->form['revision_information']['#access'] = FALSE;
|
31
|
}
|
32
|
}
|
33
|
else {
|
34
|
$block->content = t('Revision information.');
|
35
|
}
|
36
|
|
37
|
return $block;
|
38
|
}
|
39
|
|
40
|
function ctools_node_form_log_content_type_admin_title($subtype, $conf, $context) {
|
41
|
return t('"@s" node form revision log', array('@s' => $context->identifier));
|
42
|
}
|
43
|
|
44
|
function ctools_node_form_log_content_type_edit_form($form, &$form_state) {
|
45
|
// provide a blank form so we have a place to have context setting.
|
46
|
return $form;
|
47
|
}
|