workflow_node_form.inc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * @file
  4. * Describes Workflow content pane for Panels.
  5. */
  6. /**
  7. * Defines the Plugin.
  8. *
  9. * Plugins are described by creating a $plugin array which will be used
  10. * by the system that includes this file.
  11. */
  12. $plugin = array(
  13. 'single' => TRUE,
  14. 'icon' => 'icon_node_form.png',
  15. 'title' => t('Workflow'),
  16. 'description' => t('Workflow states.'),
  17. 'required context' => new ctools_context_required(t('Form'), 'node_form'),
  18. 'category' => t('Form'),
  19. 'render callback' => 'workflownode_node_form_workflow_content_type_render',
  20. );
  21. /**
  22. * Implements pane render callback.
  23. */
  24. function workflownode_node_form_workflow_content_type_render($subtype, $conf, $panel_args, &$context) {
  25. $block = new stdClass();
  26. $block->module = t('node_form');
  27. $block->title = t('Workflow');
  28. $block->delta = 'workflow';
  29. if (isset($context->form)) {
  30. if (isset($context->form['workflow'])) {
  31. $block->content['workflow'] = $context->form['workflow'];
  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. unset($context->form['workflow']);
  35. }
  36. }
  37. else {
  38. $block->content = t('Workflow.');
  39. }
  40. return $block;
  41. }
  42. /**
  43. * Returns the administrative title for a type.
  44. */
  45. function workflownode_node_form_workflow_content_type_admin_title($subtype, $conf, $context) {
  46. return t('"@s" node form workflow', array('@s' => $context->identifier));
  47. }
  48. /**
  49. * Implements pane edit callback.
  50. */
  51. function workflownode_node_form_workflow_content_type_edit_form($form, &$form_state) {
  52. // Provide a blank form so we have a place to have context setting.
  53. return $form;
  54. }