You are here

public function OAuthHTTPFetcher::configForm in Feeds OAuth 6

Same name and namespace in other branches
  1. 7 OAuthHTTPFetcher.inc \OAuthHTTPFetcher::configForm()

Add form options.

Overrides FeedsHTTPFetcher::configForm

File

./OAuthHTTPFetcher.inc, line 81

Class

OAuthHTTPFetcher
Support OAuth authentication.

Code

public function configForm(&$form_state) {
  $form = parent::configForm($form_state);
  $form['use_pubsubhubbub'] = array(
    '#type' => 'value',
    '#value' => FALSE,
  );
  $form['authenticator'] = array(
    '#type' => 'select',
    '#title' => t('OAuth authenticator'),
    '#default_value' => $this->config['authenticator'],
    '#options' => module_invoke_all('feeds_oauth_authenticator'),
    '#description' => t('Choose the authentication module that provides the needed OAuth tokens.'),
  );
  $form['site_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Site identifier'),
    '#default_value' => $this->config['site_id'],
    '#description' => t('Internal identifier for this connection. Callback URL on OAuth server should be suffixed with this identifier.
                           For the current configuration, callback URL will be: <code>%url</code>', array(
      '%url' => url('feeds/oauth/callback/' . $this->config['site_id'], array(
        'absolute' => TRUE,
      )),
    )),
    '#required' => TRUE,
  );
  $form['consumer_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Consumer key'),
    '#default_value' => $this->config['consumer_key'],
    '#required' => TRUE,
  );
  $form['consumer_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('Consumer secret'),
    '#default_value' => $this->config['consumer_secret'],
    '#required' => TRUE,
  );
  $form['request_token_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Request token URL'),
    '#default_value' => $this->config['request_token_url'],
    '#required' => TRUE,
  );
  $form['access_token_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Access token URL'),
    '#default_value' => $this->config['access_token_url'],
    '#required' => TRUE,
  );
  $form['authorize_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Authorize URL'),
    '#default_value' => $this->config['authorize_url'],
    '#required' => TRUE,
  );
  return $form;
}