node_form_log.inc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @file
  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. function ctools_node_form_log_content_type_render($subtype, $conf, $panel_args, &$context) {
  16. $block = new stdClass();
  17. $block->module = 'node_form';
  18. $block->title = t('Revision information');
  19. if (isset($context->form)) {
  20. if (isset($context->form['revision_information'])) {
  21. $block->content['revision_information'] = $context->form['revision_information'];
  22. unset($block->content['revision_information']['#pre_render']);
  23. unset($block->content['revision_information']['#theme_wrappers']);
  24. $block->content['revision_information']['#type'] = '';
  25. // Set access to false on the original rather than removing so that
  26. // vertical tabs doesn't clone it. I think this is due to references.
  27. $context->form['revision_information']['#access'] = FALSE;
  28. }
  29. }
  30. else {
  31. $block->content = t('Revision information.');
  32. }
  33. return $block;
  34. }
  35. function ctools_node_form_log_content_type_admin_title($subtype, $conf, $context) {
  36. return t('"@s" node form revision log', array('@s' => $context->identifier));
  37. }
  38. function ctools_node_form_log_content_type_edit_form($form, &$form_state) {
  39. // Provide a blank form so we have a place to have context setting.
  40. return $form;
  41. }