You are here

function nodewords_basic_abstract_form in Nodewords: D6 Meta Tags 6

Same name and namespace in other branches
  1. 6.3 nodewords_basic/includes/nodewords_basic.nodewords.tags.inc \nodewords_basic_abstract_form()
  2. 6.2 nodewords_basic/includes/nodewords_basic.nodewords.tags.inc \nodewords_basic_abstract_form()

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

File

nodewords_basic/nodewords_basic.module, line 288
Define basic meta tags for Drupal pages.

Code

function nodewords_basic_abstract_form(&$form, $content, $options) {
  $form['abstract'] = array(
    '#tree' => TRUE,
    '#weight' => -186,
  );
  $form['abstract']['value'] = array(
    '#type' => 'textfield',
    '#title' => t('Abstract'),
    '#description' => t('Enter a short abstract. Typically it is one sentence, with a maximum of %count characters. It should not contain any HTML tags or other formatting.', array(
      '%count' => variable_get('nodewords_max_size', 350),
    )),
    '#default_value' => empty($content['value']) ? '' : $content['value'],
    '#size' => 60,
    '#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']['abstract']['value'])) {
      $default = $options['default']['abstract']['value'];
    }
    else {
      $default = t('Not set.');
    }
    $form['abstract']['value']['#description'] .= '<br />' . t('The default is: %default', array(
      '%default' => $default,
    ));
  }
}