You are here

function socialfeed_twitter_settings in Social Feed 7.2

Same name and namespace in other branches
  1. 7 socialfeed.admin.inc \socialfeed_twitter_settings()

Form builder; Configure social feeds settings for this site.

See also

system_settings_form()

1 string reference to 'socialfeed_twitter_settings'
socialfeed_menu in ./socialfeed.module
Implements hook_menu().

File

./socialfeed.admin.inc, line 162
Social Feed module admin inc file.

Code

function socialfeed_twitter_settings($form, &$form_state) {
  $form['socialfeed_twitter_consumer_key'] = [
    '#type' => 'textfield',
    '#title' => t('Twitter Consumer Key'),
    '#default_value' => variable_get('socialfeed_twitter_consumer_key'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  ];
  $form['socialfeed_twitter_consumer_secret'] = [
    '#type' => 'textfield',
    '#title' => t('Twitter Consumer Secret'),
    '#default_value' => variable_get('socialfeed_twitter_consumer_secret'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  ];
  $form['socialfeed_twitter_username'] = [
    '#type' => 'textfield',
    '#title' => t('Twitter User Name'),
    '#default_value' => variable_get('socialfeed_twitter_username'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  ];
  $form['socialfeed_twitter_tweets_count'] = [
    '#type' => 'textfield',
    '#title' => t('Tweetes Count'),
    '#default_value' => variable_get('socialfeed_twitter_tweets_count', 3),
    '#size' => 60,
    '#maxlength' => 100,
  ];
  $form['socialfeed_twitter_hashtag'] = [
    '#type' => 'checkbox',
    '#title' => t('Link to Hashtag'),
    '#default_value' => variable_get('socialfeed_twitter_hashtag', FALSE),
  ];
  $form['socialfeed_twitter_time_stamp'] = [
    '#type' => 'checkbox',
    '#title' => t('Show Date/Time'),
    '#default_value' => variable_get('socialfeed_twitter_time_stamp', FALSE),
  ];
  $form['socialfeed_twitter_time_format'] = [
    '#type' => 'textfield',
    '#title' => t('Date/Time format'),
    '#default_value' => variable_get('socialfeed_twitter_time_format', 'd-M-Y'),
    '#description' => t('You can check for PHP Date Formats <a href="@datetime" target="@blank">here</a>', [
      '@datetime' => 'http://php.net/manual/en/function.date.php',
      '@blank' => '_blank',
    ]),
    '#size' => 60,
    '#maxlength' => 100,
    '#states' => [
      'visible' => [
        ':input[name="socialfeed_twitter_time_stamp"]' => [
          'checked' => TRUE,
        ],
      ],
    ],
  ];
  $form['socialfeed_twitter_time_ago'] = [
    '#type' => 'checkbox',
    '#title' => t('Show Twitter Style Date'),
    '#default_value' => variable_get('socialfeed_twitter_time_ago', FALSE),
  ];
  $form['socialfeed_twitter_trim_length'] = [
    '#type' => 'textfield',
    '#title' => t('Trim Length'),
    '#default_value' => variable_get('socialfeed_twitter_trim_length', 280),
    '#size' => 60,
    '#maxlength' => 280,
  ];
  $form['socialfeed_twitter_teaser_text'] = [
    '#type' => 'textfield',
    '#title' => t('Teaser Text'),
    '#default_value' => variable_get('socialfeed_twitter_teaser_text', 'View Media on Twitter'),
    '#size' => 60,
    '#maxlength' => 60,
  ];
  return system_settings_form($form);
}