You are here

public function DrupalDateIntervalMetaTag::getForm in Metatag 7

Build the form for this meta tag.

Return value

array A standard FormAPI array.

Overrides DrupalDefaultMetaTag::getForm

File

./metatag.inc, line 761
Metatag primary classes.

Class

DrupalDateIntervalMetaTag
Date interval meta tag controller.

Code

public function getForm(array $options = array()) {
  $form['value'] = array(
    '#type' => 'textfield',
    '#title' => t('!title interval', array(
      '!title' => $this->info['label'],
    )),
    '#default_value' => isset($this->data['value']) ? $this->data['value'] : '',
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
    '#maxlength' => 4,
    '#description' => isset($this->info['description']) ? $this->info['description'] : '',
  );
  $form['period'] = array(
    '#type' => 'select',
    '#title' => t('!title interval type', array(
      '!title' => $this->info['label'],
    )),
    '#default_value' => isset($this->data['period']) ? $this->data['period'] : '',
    '#options' => array(
      '' => t('- none -'),
      'day' => t('Day(s)'),
      'week' => t('Week(s)'),
      'month' => t('Month(s)'),
      'year' => t('Year(s)'),
    ),
  );
  return $form;
}