diff --git a/drupal/sites/all/modules/contrib/twitter_pull/twitter_pull.module b/drupal/sites/all/modules/contrib/twitter_pull/twitter_pull.module index 664c91e..f23a5f6 100644 --- a/drupal/sites/all/modules/contrib/twitter_pull/twitter_pull.module +++ b/drupal/sites/all/modules/contrib/twitter_pull/twitter_pull.module @@ -10,6 +10,73 @@ define ('TWITTER_PULL_CACHE_LENGTH', 20); //-- cache for 20 minutes define ('TWITTER_PULL_EMPTY_MESSAGE', 'No Tweets'); define ('TWITTER_PULL_CACHE_TABLE', 'cache_pulled_tweets'); +/** + * Implements hook_menu(). + */ +function twitter_pull_menu() { + $items = array(); + + $items['admin/config/services/twitter-pull-config'] = array( + 'title' => 'Twitter pull', + 'description' => 'Configuration settings for the twitter pull module', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('twitter_pull_admin'), + 'access arguments' => array('administer twitter pull'), + 'type' => MENU_NORMAL_ITEM, + ); + + return $items; +} + +/** + * Implements hook_permission(). + */ +function twitter_pull_permission() { + return array( + 'administer twitter pull' => array( + 'title' => t('Administer twitter pull'), + 'description' => t('Administer twitter pull configurations.'), + ), + ); +} + +/** + * Settings form for the twitter pull configurations + */ +function twitter_pull_admin() { + $form = array(); + + $form['consumer_key'] = array( + '#type' => 'textfield', + '#title' => t('Consumer key'), + '#default_value' => variable_get('consumer_key', ''), + '#description' => t("Consumer key from your twitter application."), + ); + + $form['consumer_secret'] = array( + '#type' => 'textfield', + '#title' => t('Consumer_secret'), + '#default_value' => variable_get('consumer_secret', ''), + '#description' => t("Consumer secret from your twitter application. Remember this should not be shared."), + ); + + $form['oauth_token'] = array( + '#type' => 'textfield', + '#title' => t('Access token'), + '#default_value' => variable_get('oauth_token', ''), + '#description' => t("Access token from your twitter application."), + ); + + $form['oauth_token_secret'] = array( + '#type' => 'textfield', + '#title' => t('Access token secret'), + '#default_value' => variable_get('oauth_token_secret', ''), + '#description' => t("Access token secret from your twitter application. Remember this should not be shared."), + ); + + return system_settings_form($form); +} + function twitter_pull_num_items() { return variable_get('twitter_pull_num_items', TWITTER_PULL_NUM_ITEMS); }