1
|
<?php
|
2
|
|
3
|
if (module_exists('menu')) {
|
4
|
/**
|
5
|
* Plugins are described by creating a $plugin array which will be used
|
6
|
* by the system that includes this file.
|
7
|
*/
|
8
|
$plugin = array(
|
9
|
'single' => TRUE,
|
10
|
'icon' => 'icon_node_form.png',
|
11
|
'title' => t('Node form menu settings'),
|
12
|
'description' => t('Menu settings on the Node form.'),
|
13
|
'required context' => new ctools_context_required(t('Form'), 'node_form'),
|
14
|
'category' => t('Form'),
|
15
|
);
|
16
|
}
|
17
|
|
18
|
function ctools_node_form_menu_content_type_render($subtype, $conf, $panel_args, &$context) {
|
19
|
$block = new stdClass();
|
20
|
$block->module = t('node_form');
|
21
|
|
22
|
$block->title = t('Menu options');
|
23
|
$block->delta = 'menu-options';
|
24
|
|
25
|
if (isset($context->form)) {
|
26
|
if (isset($context->form['menu'])) {
|
27
|
$block->content['menu'] = $context->form['menu'];
|
28
|
unset($block->content['menu']['#pre_render']);
|
29
|
unset($block->content['menu']['#theme_wrappers']);
|
30
|
$block->content['menu']['#type'] = '';
|
31
|
|
32
|
// Set access to false on the original rather than removing so that
|
33
|
// vertical tabs doesn't clone it. I think this is due to references.
|
34
|
$context->form['menu']['#access'] = FALSE;
|
35
|
}
|
36
|
}
|
37
|
else {
|
38
|
$block->content = t('Menu options.');
|
39
|
}
|
40
|
return $block;
|
41
|
}
|
42
|
|
43
|
function ctools_node_form_menu_content_type_admin_title($subtype, $conf, $context) {
|
44
|
return t('"@s" node form menu settings', array('@s' => $context->identifier));
|
45
|
}
|
46
|
|
47
|
function ctools_node_form_menu_content_type_edit_form($form, &$form_state) {
|
48
|
// provide a blank form so we have a place to have context setting.
|
49
|
return $form;
|
50
|
}
|