Commit cb911b34 authored by alexweber's avatar alexweber

tweak code comments in widget definitions

parent 067ee32f
......@@ -119,6 +119,8 @@ function easy_social_easy_social_widget() {
// Facebook.
$widgets['facebook'] = array(
'name' => t('Facebook'),
// This widget has some specific requirements when dealing with multiple
// languages so we handle the js in it's pre-process callback instead.
);
// Google+.
......@@ -135,7 +137,7 @@ function easy_social_easy_social_widget() {
// LinkedIn,
$widgets['linkedin'] = array(
'name' => t('LinkedIn'),
// LinkedIn widget has some specific requirements when dealing with multiple
// This widget has some specific requirements when dealing with multiple
// languages so we handle the js in it's pre-process callback instead.
);
......@@ -217,6 +219,28 @@ function easy_social_preprocess_easy_social(&$variables) {
$variables['widgets'] = array_filter($widgets);
}
/**
* Implements hook_preprocess_HOOK() for easy_social_facebook theme.
*
* @see easy_social_theme()
* @see theme_easy_social_facebook()
*/
function easy_social_preprocess_easy_social_facebook(&$variables) {
// @TODO implement this.
$lang = 'en_US';
$script = <<<JS
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/{$lang}/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
JS;
drupal_add_js($script, 'inline');
}
/**
* Implements hook_preprocess_HOOK() for easy_social_googleplus theme.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment