node_form_menu.inc

  1. cis7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  2. cle7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  3. ecd7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  4. elmsmedia7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  5. harmony7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  6. icor7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  7. meedjum_blog7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
  8. mooc7 sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc

Functions

File

sites/all/modules/ulmus/ctools/plugins/content_types/node_form/node_form_menu.inc
View source
  1. <?php
  2. if (module_exists('menu')) {
  3. /**
  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 menu settings'),
  11. 'description' => t('Menu settings on the Node form.'),
  12. 'required context' => new ctools_context_required(t('Form'), 'node_form'),
  13. 'category' => t('Form'),
  14. );
  15. }
  16. function ctools_node_form_menu_content_type_render($subtype, $conf, $panel_args, &$context) {
  17. $block = new stdClass();
  18. $block->module = t('node_form');
  19. $block->title = t('Menu options');
  20. $block->delta = 'menu-options';
  21. if (isset($context->form)) {
  22. if (isset($context->form['menu'])) {
  23. $block->content['menu'] = $context->form['menu'];
  24. unset($block->content['menu']['#pre_render']);
  25. unset($block->content['menu']['#theme_wrappers']);
  26. $block->content['menu']['#type'] = '';
  27. // Set access to false on the original rather than removing so that
  28. // vertical tabs doesn't clone it. I think this is due to references.
  29. $context->form['menu']['#access'] = FALSE;
  30. }
  31. }
  32. else {
  33. $block->content = t('Menu options.');
  34. }
  35. return $block;
  36. }
  37. function ctools_node_form_menu_content_type_admin_title($subtype, $conf, $context) {
  38. return t('"@s" node form menu settings', array('@s' => $context->identifier));
  39. }
  40. function ctools_node_form_menu_content_type_edit_form($form, &$form_state) {
  41. // provide a blank form so we have a place to have context setting.
  42. return $form;
  43. }