You are here

function tweet_feed_settings_form in Tweet Feed 6

Same name and namespace in other branches
  1. 7.3 tweet_feed_admin.inc \tweet_feed_settings_form()
  2. 7 tweet_feed.module \tweet_feed_settings_form()
  3. 7.2 tweet_feed_admin.inc \tweet_feed_settings_form()

tweet_feed_settings_form($form,&$form_state) our settings for for oauth tokens and search queries

1 string reference to 'tweet_feed_settings_form'
tweet_feed_menu in ./tweet_feed.module
implementation of hook_menu()

File

./tweet_feed.module, line 31

Code

function tweet_feed_settings_form(&$form_state) {
  $form = array();
  $form['tweet_feed_api_keys'] = array(
    '#type' => 'fieldset',
    '#title' => t('Twitter API Tokens'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#weight' => -10,
  );
  $form['tweet_feed_query_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Twitter Query Settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#weight' => -9,
  );
  $form['tweet_feed_api_keys']['tweet_feed_consumer_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Consumer Key'),
    '#max_length' => 255,
    '#required' => TRUE,
    '#default_value' => variable_get('tweet_feed_consumer_key', NULL),
  );
  $form['tweet_feed_api_keys']['tweet_feed_consumer_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('Consumer Secret'),
    '#max_length' => 255,
    '#required' => TRUE,
    '#default_value' => variable_get('tweet_feed_consumer_secret', NULL),
  );
  $form['tweet_feed_api_keys']['tweet_feed_oauth_token'] = array(
    '#type' => 'textfield',
    '#title' => t('Oauth Token'),
    '#max_length' => 255,
    '#required' => TRUE,
    '#default_value' => variable_get('tweet_feed_oauth_token', NULL),
  );
  $form['tweet_feed_api_keys']['tweet_feed_oauth_token_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('Oauth Token Secret'),
    '#max_length' => 255,
    '#required' => TRUE,
    '#default_value' => variable_get('tweet_feed_oauth_token_secret', NULL),
  );
  $form['tweet_feed_query_settings']['tweet_feed_query_type'] = array(
    '#type' => 'radios',
    '#title' => t('Type of Twitter Query'),
    '#options' => array(
      'search' => t('Twitter Search'),
      'timeline' => t('User Timeline Display'),
    ),
    '#default_value' => variable_get('tweet_feed_query_type', 'search'),
  );
  $form['tweet_feed_query_settings']['tweet_feed_search_query'] = array(
    '#type' => 'textfield',
    '#title' => t('Twitter Search Query'),
    '#max_length' => 255,
    '#default_value' => variable_get('tweet_feed_search_query', NULL),
  );
  $form['tweet_feed_query_settings']['tweet_feed_user_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Exact Twitter User ID For Timline Query'),
    '#description' => t('You can get this by going to mytwitterid.com'),
    '#max_length' => 255,
    '#default_value' => variable_get('tweet_feed_user_id', NULL),
  );
  $form['tweet_feed_query_settings']['tweet_feed_pull_count'] = array(
    '#type' => 'select',
    '#title' => t('Number of Items to Pull'),
    '#max_length' => 2,
    '#options' => array(
      '100' => '100',
      '200' => '200',
      '300' => '300',
      '400' => '400',
      '500' => '500',
      '600' => '600',
      '700' => '700',
      '800' => '800',
      '900' => '900',
      '1000' => '1000',
    ),
    '#description' => t('Twitter limits tweet pulling to 1500 every 15 minutes. Keep this in mind when setting the pull count in conjunction with the frequency of cron runs.'),
    '#required' => TRUE,
    '#default_value' => variable_get('tweet_feed_pull_count', 100),
  );
  $form['tweet_feed_query_settings']['tweet_feed_new_window'] = array(
    '#type' => 'checkbox',
    '#title' => t('Open Links In New Window'),
    '#default_value' => variable_get('tweet_feed_new_window', 0),
  );
  $form['tweet_feed_query_settings']['tweet_feed_truncate'] = array(
    '#type' => 'checkbox',
    '#title' => t('Truncate Tweets Table on Every Import'),
    '#default_value' => variable_get('tweet_feed_truncate', 0),
  );
  return system_settings_form($form);
}