function _janrain_capture_share_button in Janrain Registration 7.3
Same name and namespace in other branches
- 7.4 janrain_capture.module \_janrain_capture_share_button()
- 7.2 janrain_capture.module \_janrain_capture_share_button()
Returns HTML markup for the social share button.
1 call to _janrain_capture_share_button()
- janrain_capture_node_view in ./
janrain_capture.module - Implements hook_node_view().
File
- ./
janrain_capture.module, line 894 - This module implements authentication endpoints for Janrain Capture.
Code
function _janrain_capture_share_button($node) {
global $user;
$conf = variable_get('janrain_capture_share', array());
// Prepare arguments for the share widget.
$args = array();
foreach (array(
'message',
'title',
'summary',
) as $arg) {
$args[$arg] = $conf['nodes']['default_' . $arg];
// We disable sanitize for token_replace() to prevent it from encoding
// apostrophes and such.
$args[$arg] = filter_xss(token_replace($args[$arg], array(
'node' => $node,
'user' => $user,
), array(
'clear' => TRUE,
'sanitize' => FALSE,
)));
}
$args['summary'] = addslashes(text_summary(strip_tags($args['summary']), NULL, 128) . '...');
$args['url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . request_uri();
janrain_capture_share_js();
return theme('janrain_capture_share_button', array(
'args' => $args,
'node' => $node,
));
}