function node_noindex_form_alter in Node Noindex 6
Same name and namespace in other branches
- 7 node_noindex.module \node_noindex_form_alter()
Implementation of hook_form_alter().
File
- ./
node_noindex.module, line 63
Code
function node_noindex_form_alter(&$form, $form_state, $form_id) {
if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {
if (user_access('administer node_noindex') && variable_get('node_noindex_' . $form['type']['#value'], 0)) {
$node = $form['#node'];
$form['node_noindex'] = array(
'#type' => 'fieldset',
'#title' => t('Search engine settings'),
'#description' => t('Settings related to search engines'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#access' => user_access('administer node_noindex'),
'#weight' => 20,
);
$form['node_noindex']['noindex'] = array(
'#type' => 'checkbox',
'#title' => t('Exclude from searchengines'),
'#description' => t('If enabled a "noindex"-header will be set on this node. This should mean that this node will not be indexed and not occur in search engine results'),
'#default_value' => $node->noindex,
'#weight' => 5,
);
}
}
}