node_form_log.inc 1.6 KB

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