You are here

function node_noindex_form_node_type_form_alter in Node Noindex 7

Same name and namespace in other branches
  1. 6 node_noindex.module \node_noindex_form_node_type_form_alter()

Implements hook_form_FORM_ID_alter().

Alter the content type (ct) form.

File

./node_noindex.module, line 154

Code

function node_noindex_form_node_type_form_alter(&$form, $form_state) {
  $form['#validate'][] = 'node_noindex_ct_validate';
  $form['#submit'][] = 'node_noindex_ct_submit';
  $form['node_noindex_ct'] = array(
    '#type' => 'fieldset',
    '#title' => t('Search engine settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#tree' => TRUE,
    '#group' => 'additional_settings',
    '#attached' => array(
      'js' => array(
        'vertical-tabs' => drupal_get_path('module', 'node_noindex') . '/node_noindex.js',
      ),
    ),
  );
  $form['node_noindex_ct']['node_noindex'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable noindex option.'),
    '#default_value' => variable_get('node_noindex_' . $form['#node_type']->type, 0),
    '#description' => t('Should this content type display the noindex setting in the node edit form?'),
  );
  $form['node_noindex_ct']['node_noindex_default'] = array(
    '#type' => 'checkbox',
    '#title' => t('Set noindex as default'),
    '#default_value' => variable_get('node_noindex_default_' . $form['#node_type']->type, 0),
    '#description' => t('Should this content type display have noindex as default?'),
  );
}