You are here

function google_appliance_form_alter in Google Search Appliance 5

Same name and namespace in other branches
  1. 6.2 google_appliance.module \google_appliance_form_alter()

File

./google_appliance.module, line 469
GSA integration

Code

function google_appliance_form_alter($form_id, &$form) {
  if ($form_id == 'block_admin_configure') {
    $module = $form['module']['#value'];
    $delta = $form['delta']['#value'];
    $var_name = $module . '-' . $delta;
    $ga_blocksettings = google_appliance_blocksettings_get();
    $form['block_settings']['google_appliance'] = array(
      '#type' => 'fieldset',
      '#title' => t("Google Appliance Settings"),
      '#description' => t(''),
      '#collapsed' => true,
      '#collapsible' => true,
      '#tree' => true,
      '#weight' => -1,
    );
    $form['block_settings']['google_appliance']['hide'] = array(
      '#type' => 'radios',
      '#title' => t("Do you want to hide this block from the GSA crawler?"),
      '#description' => t('Select No if you want this block content to be crawled with the page content.'),
      '#options' => array(
        1 => t('Yes'),
        0 => t('No'),
      ),
      '#default_value' => isset($ga_blocksettings[$var_name]) ? $ga_blocksettings[$var_name] : 1,
      '#collapsed' => true,
      '#collapsible' => true,
      '#tree' => true,
    );
    $form['#submit']['google_appliance_block_save'] = array();
    return $form;
  }
}