You are here

function twitter_post_form_node_type_form_alter in Twitter 7.5

Implements hook_form_FORM_ID_alter() for node_type_form().

File

twitter_post/twitter_post.module, line 52
Hook implementations for twitter_post module.

Code

function twitter_post_form_node_type_form_alter(&$form, $form_state, $form_id) {
  $type = $form['#node_type']->type;
  $allowed_types = variable_get('twitter_post_types', array());
  $form['workflow']['twitter_post'] = array(
    '#type' => 'checkbox',
    '#title' => t('May be posted to twitter.com'),
    '#default_value' => !empty($allowed_types[$type]),
    '#description' => t('There are also <a href="@url">global options</a> that affect this option.', array(
      '@url' => url('admin/config/services/twitter/post'),
    )),
  );
  $form['#submit'][] = 'twitter_post_form_node_type_form_submit';
}