node_form_title.inc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 title field'),
  11. 'description' => t('The node title form.'),
  12. 'required context' => new ctools_context_required(t('Form'), 'node_form'),
  13. 'category' => t('Form'),
  14. );
  15. function ctools_node_form_title_content_type_render($subtype, $conf, $panel_args, &$context) {
  16. $block = new stdClass();
  17. $block->module = 'node_form';
  18. $block->delta = 'title-options';
  19. if (isset($context->form)) {
  20. if (!empty($context->form['title'])) {
  21. $block->content['title'] = $context->form['title'];
  22. unset($context->form['title']);
  23. }
  24. }
  25. else {
  26. $block->content = t('Node title form.');
  27. }
  28. return $block;
  29. }
  30. function ctools_node_form_title_content_type_admin_title($subtype, $conf, $context) {
  31. return t('"@s" node form title field', array('@s' => $context->identifier));
  32. }
  33. function ctools_node_form_title_content_type_edit_form($form, &$form_state) {
  34. // Provide a blank form so we have a place to have context setting.
  35. return $form;
  36. }