You are here

function nodewords_extra_geo_region_form in Nodewords: D6 Meta Tags 6

Set the form fields used to implement the options for the meta tag.

File

nodewords_extra/nodewords_extra.module, line 740
Define extra meta tags for Drupal pages.

Code

function nodewords_extra_geo_region_form(&$form, $content, $options) {
  $form['geo.region'] = array(
    '#tree' => TRUE,
    '#weight' => -150,
  );
  $form['geo.region']['value'] = array(
    '#type' => 'textfield',
    '#title' => t('Geotagging: Region'),
    '#description' => t('This is a restricted field that should only be used for storing the ISO 3166-2 country subdivision code, or the two-character country code if the preferred version is not know.'),
    '#default_value' => empty($content['value']) ? '' : $content['value'],
    '#size' => 10,
    '#maxlength' => variable_get('nodewords_max_size', 350),
  );

  // Show the current default.
  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {

    // Load the current default.
    if (!empty($options['default']['geo.region']['value'])) {
      $default = $options['default']['geo.region']['value'];
    }
    else {
      $default = t('Not set.');
    }
    $form['geo.region']['value']['#description'] .= '<br />' . t('The default is: %default', array(
      '%default' => $default,
    ));
  }
}