You are here

function mostpopular_disqus_config_form in Drupal Most Popular 7

Implements the 'config_form' callback for the Disqus service.

Parameters

object $service The service definition.:

array $form_state The current state of the form.:

File

modules/mostpopular_disqus/mostpopular_disqus.module, line 141
Uses the Disqus.com API to provide Most Popular data.

Code

function mostpopular_disqus_config_form($service, &$form_state) {
  $form = array();
  $form['auth'] = array(
    '#type' => 'fieldset',
    '#title' => t('Disqus login credentials'),
  );
  $form['auth']['secret_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Secret Key'),
    '#description' => t('Enter your API Secret Key.'),
    '#required' => TRUE,
    '#default_value' => !empty($service->data['auth']['secret_key']) ? $service->data['auth']['secret_key'] : '',
  );
  $form['auth']['forum'] = array(
    '#type' => 'textfield',
    '#title' => t('Forum'),
    '#description' => t('Enter the ID of the forum you wish to retrieve results from.'),
    '#required' => TRUE,
    '#default_value' => !empty($service->data['auth']['forum']) ? $service->data['auth']['forum'] : '',
  );
  return $form;
}