You are here

function twitter_post_admin_settings in Twitter 6.5

Same name and namespace in other branches
  1. 6.3 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  2. 6.4 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  3. 7.3 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  4. 7.4 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  5. 7.5 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()

Settings form callback

1 string reference to 'twitter_post_admin_settings'
twitter_post_menu in twitter_post/twitter_post.module
Implements hook_menu().

File

twitter_post/twitter_post.pages.inc, line 11
Page callbacks for Twitter Post module.

Code

function twitter_post_admin_settings() {
  $node_types = node_get_types('names');
  $form['twitter_post_types'] = array(
    '#title' => t('Node types'),
    '#type' => 'checkboxes',
    '#description' => t('Choose which node types should support posting to Twitter.'),
    '#options' => $node_types,
    '#default_value' => variable_get('twitter_post_types', array()),
  );
  $form['twitter_post_default_format'] = array(
    '#type' => 'textfield',
    '#title' => t('Default format string'),
    '#maxlength' => 140,
    '#description' => t('The given text will be used as a template for posting to Twitter.com. ' . 'The following token replacements are available: !url, !url-alias, !tinyurl, !title, and !user'),
    '#default_value' => variable_get('twitter_post_default_format', 'New post: !title !tinyurl'),
  );
  twitter_include_token_fields($form);
  $form['twitter_post_default_value'] = array(
    '#type' => 'checkbox',
    '#title' => t('Post to Twitter by default'),
    '#default_value' => variable_get('twitter_post_default_value', 0),
    '#description' => t('When active, tweets will be automatically posted when the node is first published.'),
  );
  $form['twitter_post_on_node_update'] = array(
    '#type' => 'checkbox',
    '#title' => t('Post to Twitter on node update'),
    '#description' => t('When active, tweets will be posted to Twitter on node update; this can lead to apparently duplicate tweets, so may not be wanted.'),
    '#default_value' => variable_get('twitter_post_on_update', 0),
  );
  return system_settings_form($form);
}