You are here

function twitter_post_admin_settings in Twitter 7.5

Same name and namespace in other branches
  1. 6.5 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  2. 6.3 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  3. 6.4 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  4. 7.3 twitter_post/twitter_post.pages.inc \twitter_post_admin_settings()
  5. 7.4 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($form, &$form_state) {
  $form['twitter_post_types'] = array(
    '#title' => t('Node types'),
    '#type' => 'checkboxes',
    '#description' => t('Choose which node types should support posting to Twitter.'),
    '#options' => node_type_get_names(),
    '#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'),
  );
  $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),
    '#states' => array(
      'visible' => array(
        'input[name="twitter_post_default_value"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  return system_settings_form($form);
}