You are here

function xmlsitemap_node_form_alter in XML sitemap 6.2

Same name and namespace in other branches
  1. 5.2 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_form_alter()
  2. 5 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_form_alter()
  3. 6 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_form_alter()

Implements hook_form_alter().

Add the XML sitemap individual link options for a node.

See also

xmlsitemap_add_form_link_options()

File

xmlsitemap_node/xmlsitemap_node.module, line 160

Code

function xmlsitemap_node_form_alter(array &$form, array &$form_state, $form_id) {
  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {

    // Add the link options.
    module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin');
    xmlsitemap_add_form_link_options($form, 'node', $form['type']['#value'], $form['nid']['#value']);
    $form['xmlsitemap']['#weight'] = 30;
  }
}