You are here

public function SocialContentTwitter::instanceSettingsForm in Social Content 7.2

Instance settings form.

Return value

array Any instance settings that will be included on all instance forms for the current global.

Overrides SocialContent::instanceSettingsForm

File

modules/twitter/social_content_twitter.class.inc, line 208
Social Content Twitter class.

Class

SocialContentTwitter
@file Social Content Twitter class.

Code

public function instanceSettingsForm() {
  $settings = $this->settings['instance'];
  $form = parent::instanceSettingsForm($settings);
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Import'),
    '#options' => $this
      ->getImportTypes(),
    '#description' => t('What should be imported.'),
    '#default_value' => isset($settings['type']) ? $settings['type'] : NULL,
    '#attributes' => array(
      'class' => array(
        'social-content-twitter-type',
      ),
    ),
  );
  $form['account'] = array(
    '#type' => 'textfield',
    '#title' => t('Twitter account'),
    '#description' => t("The Twitter @username to pull the statuses from. Do not include leading '@'."),
    '#default_value' => isset($settings['account']) ? $settings['account'] : NULL,
    '#states' => array(
      'visible' => array(
        '.social-content-twitter-type' => array(
          'value' => 'account',
        ),
      ),
    ),
  );
  $form['hashtag'] = array(
    '#type' => 'textfield',
    '#title' => t('Twitter hashtag'),
    '#description' => t("The Twitter #hashtag to pull the statuses from. Include leading '#'."),
    '#default_value' => isset($settings['hashtag']) ? $settings['hashtag'] : NULL,
    '#states' => array(
      'visible' => array(
        '.social-content-twitter-type' => array(
          'value' => 'hashtag',
        ),
      ),
    ),
  );
  $form['exclude_retweets'] = array(
    '#type' => 'checkbox',
    '#title' => t('Exclude retweets'),
    '#description' => t('If checked, retweets will not be imported.'),
    '#default_value' => isset($settings['exclude_retweets']) ? $settings['exclude_retweets'] : NULL,
  );
  return $form;
}