function hook_fboauth_actions in Facebook OAuth (FBOAuth) 7
Same name and namespace in other branches
- 6 fboauth.api.php \hook_fboauth_actions()
- 7.2 fboauth.api.php \hook_fboauth_actions()
Hook to register new Facebook OAuth actions.
The Facebook OAuth module includes two default actions. The "connect" action links a Facebook account with a Drupal user account. The "deauth" action revokes Drupal's Facebook access for a user and deassociates the accounts. You can write additional actions (such as data imports) by using this hook in your own modules.
A full example of implementing this hook is included with the README.txt file included with the Facebook OAuth module.
Return value
An array of Facebook OAuth actions keyed by a unique action name. Each action must specify at least the following properties:
- title: A title for the action.
- callback: The name of a function to execute after gaining access.
- permissions: A list of Facebook permissions to request.
See also
1 function implements hook_fboauth_actions()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- fboauth_fboauth_actions in ./
fboauth.module - Implements hook_fboauth_actions().
1 invocation of hook_fboauth_actions()
- fboauth_action_load in ./
fboauth.module - Load a Facebook OAuth action.
File
- ./
fboauth.api.php, line 30 - This file contains API documentation for the Facebook OAuth module. Note that all of this code is merely for example purposes, it is never executed when using the Facebook OAuth module.
Code
function hook_fboauth_actions() {
// Give each action a unique key, such as "mymodule_photo_import" for a photo
// import. This function should begin with the name of your module.
$actions['mymodule_photo_import'] = array(
// Give you action a human-readable name. This will be used when showing
// the user a link to start this action.
'title' => t('Import my Facebook photos'),
// Specify the name of your callback function that contains the import.
'callback' => 'mymodule_fboauth_action_photo_import',
// Specify permissions you need to do this action. See the Facebook API for
// a list: http://developers.facebook.com/docs/authentication/permissions/
'permissions' => array(
'user_photos',
),
);
return $actions;
}