You are here

function twitter_block_content_type_edit_form in Twitter Block 6

Same name and namespace in other branches
  1. 7 plugins/content_types/twitter_block.inc \twitter_block_content_type_edit_form()

Block configuration form.

1 string reference to 'twitter_block_content_type_edit_form'
twitter_block.inc in plugins/content_types/twitter_block.inc
Ctools content type plugin that shows a Twitter Block.

File

plugins/content_types/twitter_block.inc, line 32
Ctools content type plugin that shows a Twitter Block.

Code

function twitter_block_content_type_edit_form($form, &$form_state) {
  $conf = $form_state['conf'];
  $form['search_string'] = array(
    '#type' => 'textfield',
    '#title' => 'The string or username to search.',
    '#size' => 32,
    '#default_value' => $conf['search_string'],
  );
  $form['search_type'] = array(
    '#type' => 'select',
    '#title' => t('Choose the type of Tweets to return.'),
    '#options' => array(
      'searchHashtag' => t('Tweets mentioning #hashtag or search string.'),
      'getTweetsFrom' => t('Tweets sent from the Twitter user.'),
      'getReplies' => t('Replies to the Twitter user.'),
      'getMentions' => t('Tweets mentioning the Twitter user.'),
    ),
    '#default_value' => $conf['search_type'],
  );
  $form['lang'] = array(
    '#type' => 'textfield',
    '#title' => 'Language',
    '#description' => t('If you would like to limit the search by a language, you can set it here. This should be the specific string expected by Twitter for your language. See the Twitter advanced search page for more information. (Hint: English is "en"). Leave blank if you don\'t want to filter by language at all.'),
    '#size' => 12,
    '#default_value' => $conf['lang'],
  );
  $form['results_per_page'] = array(
    '#type' => 'textfield',
    '#title' => 'Number of tweets to return',
    '#description' => t('Please enter the number of tweets to return per page up to a maximum of 100.'),
    '#size' => 12,
    '#default_value' => $conf['results_per_page'],
  );
  return $form;
}