/
helper.php
94 lines (78 loc) · 2.24 KB
/
helper.php
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
88
89
90
91
92
93
94
<?php
/**
* @package sgo_social_mod
* @subpackage mod_sgo_social
* @copyright Copyright (C) 2005 - 2012 s-go consulting, llc
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
class modSgoSocialHelper
{
static function &getIcons($params)
{
$theme = $params->get('theme', "extra");
$size = $params->get('size', "39x40");
$i = 0;
// check twitter
if ($params->get('twitter')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "twitter.png";
$icons->$i->url = $params->get('twitter_url');
$i++;
}
// check Facebook
if ($params->get('facebook')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "facebook.png";
$icons->$i->url = $params->get('facebook_url');
$i++;
}
// check flickr
if ($params->get('flickr')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "flickr.png";
$icons->$i->url = $params->get('flickr_url');
$i++;
}
// check google plus
if ($params->get('google_plus')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "google_plus.png";
$icons->$i->url = $params->get('google_plus_url');
$i++;
}
// check linked in
if ($params->get('linked_in')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "linkedin.png";
$icons->$i->url = $params->get('linked_in_url');
$i++;
}
// check youtube
if ($params->get('youtube')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "youtube.png";
$icons->$i->url = $params->get('youtube_url');
$i++;
}
// check pinterest
if ($params->get('pinterest')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "pinterest.png";
$icons->$i->url = $params->get('pinterest_url');
$i++;
}
// check rss
if ($params->get('rss')) {
$icons->$i->icon = $theme . "/" . $size . "/" . "rss.png";
$icons->$i->url = $params->get('rss_url');
$i++;
}
// check custom 1
if ($params->get('custom1')) {
$icons->$i->icon = $params->get('custom1_src');
$icons->$i->url = $params->get('custom1_url');
$i++;
}
// check custom 2
if ($params->get('custom2')) {
$icons->$i->icon = $theme . "/" . $size . "/" . $params->get('custom2_src');
$icons->$i->url = $params->get('custom2_url');
}
return $icons;
}
}