You are here

public function PiwikAnalyticsService::buildConfigurationForm in Analytics 7

Form constructor.

Parameters

array $form: An associative array containing the initial structure of the plugin form.

array $form_state: The current state of the complete form.

Return value

array The form structure.

Overrides AnalyticsService::buildConfigurationForm

File

analytics_piwik/src/PiwikAnalyticsService.php, line 18

Class

PiwikAnalyticsService

Code

public function buildConfigurationForm($form, &$form_state) {
  $options['url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#description' => t('The URL to your Piwik base directory.'),
    '#default_value' => $this
      ->getConfiguration()['url'],
    '#element_validate' => array(
      '_analytics_piwik_validate_url',
    ),
    '#required' => TRUE,
  );
  $options['id'] = array(
    '#type' => 'textfield',
    '#title' => t('Site ID'),
    '#default_value' => $this
      ->getConfiguration()['id'],
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
    '#required' => TRUE,
    '#size' => 10,
  );
  return $options;
}