You are here

function _subform_add in Subform 5

Menu add callback

1 string reference to '_subform_add'
subform_menu in ./subform.module

File

./subform.module, line 446

Code

function _subform_add($content_type) {
  global $user;
  drupal_add_js('misc/autocomplete.js');
  drupal_add_js('misc/collapse.js');
  drupal_add_css(drupal_get_path('module', 'content') . '/content.css');
  $node = (object) array(
    'uid' => $user->uid,
    'name' => $user->name,
    'type' => $content_type,
  );
  $form = node_form_array($node);
  $form['#submit']['_subform_redirect'] = array();
  $form['#submit']['node_form_submit'] = array();
  unset($form['preview']);

  // hook_form_alter triggers during drupal_get_form
  $messages = theme_status_messages();
  $content = drupal_get_form($node->type . '_node_form', $form, 'node_form');
  $head = drupal_get_html_head();
  $styles = theme_get_styles();
  include_once 'subform.tpl.php';
}