node_form_title.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Plugins are described by creating a $plugin array which will be used
  4. * by the system that includes this file.
  5. */
  6. $plugin = array(
  7. 'single' => TRUE,
  8. 'icon' => 'icon_node_form.png',
  9. 'title' => t('Node form title field'),
  10. 'description' => t('The node title form.'),
  11. 'required context' => new ctools_context_required(t('Form'), 'node_form'),
  12. 'category' => t('Form'),
  13. );
  14. function ctools_node_form_title_content_type_render($subtype, $conf, $panel_args, &$context) {
  15. $block = new stdClass();
  16. $block->module = t('node_form');
  17. $block->delta = 'title-options';
  18. if (isset($context->form)) {
  19. if (!empty($context->form['title'])) {
  20. $block->content['title'] = $context->form['title'];
  21. unset($context->form['title']);
  22. }
  23. }
  24. else {
  25. $block->content = t('Node title form.');
  26. }
  27. return $block;
  28. }
  29. function ctools_node_form_title_content_type_admin_title($subtype, $conf, $context) {
  30. return t('"@s" node form title field', array('@s' => $context->identifier));
  31. }
  32. function ctools_node_form_title_content_type_edit_form($form, &$form_state) {
  33. // provide a blank form so we have a place to have context setting.
  34. return $form;
  35. }