diff options
Diffstat (limited to 'sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc')
-rw-r--r-- | sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc new file mode 100644 index 000000000..b7ac9841d --- /dev/null +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc @@ -0,0 +1,43 @@ +<?php + +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'single' => TRUE, + 'icon' => 'icon_node_form.png', + 'title' => t('Node form submit buttons'), + 'description' => t('Submit buttons for the node form.'), + 'required context' => new ctools_context_required(t('Form'), 'node_form'), + 'category' => t('Form'), +); + +function ctools_node_form_buttons_content_type_render($subtype, $conf, $panel_args, &$context) { + $block = new stdClass(); + $block->module = t('node_form'); + + $block->title = ''; + $block->delta = 'buttons'; + + if (isset($context->form)) { + $block->content = array(); + foreach (array('actions', 'form_token', 'form_build_id', 'form_id') as $element) { + $block->content[$element] = isset($context->form[$element]) ? $context->form[$element] : NULL; + unset($context->form[$element]); + } + } + else { + $block->content = t('Node form buttons.'); + } + return $block; +} + +function ctools_node_form_buttons_content_type_admin_title($subtype, $conf, $context) { + return t('"@s" node form submit buttons', array('@s' => $context->identifier)); +} + +function ctools_node_form_buttons_content_type_edit_form($form, &$form_state) { + // provide a blank form so we have a place to have context setting. + return $form; +} |