function twitter_actions_account_options in Twitter 6.5
Same name and namespace in other branches
- 7.6 twitter_actions/twitter_actions.module \twitter_actions_account_options()
- 7.5 twitter_actions/twitter_actions.module \twitter_actions_account_options()
Returns a list of authenticated Twitter accounts to be used as options.
This will only list accounts that are either global or are owned by the current user.
Return value
array of screen_name => screen_name entries.
1 call to twitter_actions_account_options()
- twitter_actions_set_status_action_form in twitter_actions/
twitter_actions.module - Return a form definition so the Send email action can be configured.
File
- twitter_actions/
twitter_actions.module, line 94 - Exposes Drupal actions for sending Twitter messages.
Code
function twitter_actions_account_options() {
global $user;
module_load_include('inc', 'twitter');
$twitter_accounts = twitter_load_authenticated_accounts($user->uid);
$options = array();
foreach ($twitter_accounts as $twitter_account) {
$options[$twitter_account->screen_name] = '@' . $twitter_account->screen_name;
}
// Extra token to use current user's account.
$options['[current user]'] = '[current user]';
return $options;
}