You are here

function auto_menutitle_node_settings_form in Auto Menu Title 6.2

Implementation of node_settings_form().

1 call to auto_menutitle_node_settings_form()
auto_menutitle_form_alter in ./auto_menutitle.module
Implementation of hook_form_alter().

File

./auto_menutitle.module, line 110
Allows the menu title field to be automatically populated with the contents written into the node Title field

Code

function auto_menutitle_node_settings_form(&$form) {
  $form['auto_menutitle'] = array(
    '#type' => 'fieldset',
    '#title' => t('Automatic Menu title generation'),
    '#weight' => 2,
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['auto_menutitle']['amt'] = array(
    '#type' => 'radios',
    '#default_value' => auto_menutitle_get_default_setting($form['#node_type']->type),
    '#options' => array(
      t('Disabled'),
      t('Copy the node title into the menu title field'),
      t('Copy the node title into the menu title field, but only after manually checking on'),
    ),
  );
  if (module_exists('token')) {
    $form['auto_menutitle']['amt']['#options'][] = t('Copy the pattern contents below, into the menu title field');
    $form['auto_menutitle']['amt_pattern'] = array(
      '#type' => 'textarea',
      '#title' => t('Pattern for the title'),
      '#description' => t('Leave blank for using the per default generated title. Otherwise this string will be used as title.'),
      '#default_value' => variable_get('amt_pattern_' . $form['#node_type']->type, ''),
    );
    $form['auto_menutitle']['token_help'] = array(
      '#title' => t('Replacement patterns'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('Prefer raw-text replacements for text to avoid problems with HTML entities!'),
    );
    $form['auto_menutitle']['token_help']['help'] = array(
      '#value' => theme('token_help', 'node'),
    );
  }
  $form['auto_menutitle']['amt_collapsed'] = array(
    '#type' => 'checkbox',
    '#title' => 'Collapse the menu fieldset',
    '#default_value' => variable_get("amt_collapsed_" . $form['#node_type']->type, FALSE),
    '#description' => t('When checked, the fielset will be collapsed. Note: if using the verticaltabs module, this setting will have no impact.'),
  );
}