-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoticeme.theme.inc
More file actions
87 lines (82 loc) · 2.19 KB
/
Copy pathnoticeme.theme.inc
File metadata and controls
87 lines (82 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* @file
* Theme functions for our social media buttons.
*/
/**
* Theme the global share buttons block.
*/
function theme_global_share_buttons_block($variables) {
$element = array();
if ($variables['facebook_like']) {
$element['facebook_like'] = array(
'#markup' => theme('facebook_like', $variables['facebook_like']),
);
}
if ($variables['google_plus_one']) {
$element['google_plus_one'] = array(
'#markup' => theme('google_plus', $variables['google_plus_one']),
);
}
if ($variables['twitter_tweet']) {
$element['twitter_tweet'] = array(
'#markup' => theme('twitter_tweet', $variables['twitter_tweet']),
);
}
return render($element);
}
/**
* Theme a facebook like button.
*/
function theme_facebook_like($variables) {
$element = array(
'#prefix' => '<div class="fb-like-wrapper noticeme-wrapper">',
'#suffix' => '</div>',
'#theme' => 'html_tag',
'#tag' => 'div',
'#attributes' => array('class' => array('fb-like')),
'#value' => ' ',
);
foreach ($variables as $key => $value) {
$element['#attributes']['data-' . $key] = $value;
}
return render($element);
}
/**
* Theme a google +1 button.
*/
function theme_google_plus($variables) {
$element = array(
'#prefix' => '<div class="g-plusone-wrapper noticeme-wrapper">',
'#suffix' => '</div>',
'#theme' => 'html_tag',
'#tag' => 'div',
'#attributes' => array('class' => array('g-plusone')),
'#value' => ' ',
);
foreach ($variables as $key => $value) {
$element['#attributes']['data-' . $key] = $value;
}
return render($element);
}
/**
* Theme a tweet button.
*/
function theme_twitter_tweet($variables) {
global $language;
$element = array(
'#prefix' => '<div class="tweet-this-wrapper noticeme-wrapper">',
'#suffix' => '</div>',
'#type' => 'link',
'#title' => t('Tweet'),
'#href' => 'https://twitter.com/share',
'#attributes' => array(
'class' => array('twitter-share-button'),
'data-lang' => variable_get('noticeme_' . $language->language . '_twitter', 'en'),
),
);
foreach ($variables as $key => $value) {
$element['#attributes']['data-' . $key] = $value;
}
return render($element);
}