You are here

function _option_nfs_title_create in Node and Comments Form Settings 6.3

Same name and namespace in other branches
  1. 6.2 includes/option_nfs_title_create.inc \_option_nfs_title_create()
  2. 7.3 includes/option_nfs_title_create.inc \_option_nfs_title_create()
  3. 7.2 includes/option_nfs_title_create.inc \_option_nfs_title_create()

Change the page title when creating a node

File

includes/option_nfs_title_create.inc, line 6

Code

function _option_nfs_title_create($form, &$form_state, $settings, $node) {
  if (empty($node->nid) && !empty($settings['nfs_title_create'])) {
    $replace_pairs = array(
      '!node_type' => t(node_get_types('name', $node)),
    );
    $title = t(check_plain($settings['nfs_title_create']), $replace_pairs);
    drupal_set_title($title);
  }
  return $form;
}