You are here

function _option_nfs_title_edit in Node and Comments Form Settings 6.3

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

Change the page title when editing a node

File

includes/option_nfs_title_edit.inc, line 6

Code

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