node_form_publishing.inc 1.7 KB

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