function twitter_admin_form in Twitter 6.2
Same name and namespace in other branches
- 6.5 twitter.pages.inc \twitter_admin_form()
- 6.3 twitter.pages.inc \twitter_admin_form()
- 6.4 twitter.pages.inc \twitter_admin_form()
- 7.6 twitter.pages.inc \twitter_admin_form()
- 7.3 twitter.pages.inc \twitter_admin_form()
- 7.4 twitter.pages.inc \twitter_admin_form()
- 7.5 twitter.pages.inc \twitter_admin_form()
1 string reference to 'twitter_admin_form'
- twitter_menu in ./
twitter.module - Implementation of hook_meu()
File
- ./
twitter.pages.inc, line 6
Code
function twitter_admin_form() {
$form = array();
$form['global_account'] = array(
'#type' => 'fieldset',
'#title' => t('Global account'),
'#description' => t('A site-wide Twitter account to use as the default when tweets are posted. This is useful for single-user blogs or sites where many users post to a single shared Twitter account.'),
);
$form['global_account']['twitter_global_name'] = array(
'#type' => 'textfield',
'#title' => t('Twitter user name'),
'#default_value' => variable_get('twitter_global_name', NULL),
);
$form['global_account']['twitter_global_password'] = array(
'#type' => 'password',
'#title' => t('Password'),
'#description' => t("If your Twitter account is protected, or you wish to post to Twitter from Drupal, you must enter the Twitter account's password."),
'#default_value' => variable_get('twitter_global_password', NULL),
);
$form['import'] = array(
'#type' => 'fieldset',
'#title' => t('Twitter import'),
'#description' => t('Import and display the Twitter statuses of site users who have entered their Twitter account information.'),
);
$form['import']['twitter_import'] = array(
'#type' => 'checkbox',
'#title' => t('Import Twitter statuses'),
'#default_value' => variable_get('twitter_import', TRUE),
);
$periods = array(
0 => t('Never'),
);
$periods += drupal_map_assoc(array(
604800,
2419200,
7257600,
31449600,
), 'format_interval');
$form['import']['twitter_expire'] = array(
'#type' => 'select',
'#title' => t('Delete old statuses'),
'#default_value' => variable_get('twitter_expire', 0),
'#options' => $periods,
);
$form['posting'] = array(
'#type' => 'fieldset',
'#title' => t('Twitter posting'),
'#description' => t('Users with proper permissions will be given the option to post announcements to their Twitter accounts when they create new content.'),
);
$form['posting']['twitter_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Node types'),
'#options' => node_get_types('names'),
'#default_value' => variable_get('twitter_types', array(
'story' => 'story',
'blog' => 'blog',
)),
);
$form['posting']['twitter_default_format'] = array(
'#type' => 'textfield',
'#title' => t('Default format string'),
'#maxlength' => 140,
'#description' => t('The given text will be posted to twitter.com. You can use [url], [url-alias], [shorturl], [title] and [author-name] (as well as other tokens supplied by Token module) as placeholders.'),
'#default_value' => variable_get('twitter_default_format', 'New post: [title] [shorturl]'),
);
$form['twitter_api_url'] = array(
'#type' => 'textfield',
'#title' => t('Alternate API URL'),
'#default_value' => variable_get('twitter_api_url', 'twitter.com'),
'#description' => t("A Twitter-compatible microblogging services like !identica can be used insted of Twitter.com by entering the service's API URL here.", array(
'!identica' => l('Identi.ca', 'http://laconi.ca/trac/wiki/TwitterCompatibleAPI'),
)),
);
$form['twitter_set_source'] = array(
'#type' => 'checkbox',
'#title' => t('Set source to Drupal when updating Twitter status'),
'#default_value' => variable_get('twitter_set_source', TRUE),
);
return system_settings_form($form);
}