PluginProbe
Social Share Buttons / 1.1.2
Social Share Buttons v1.1.2
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | classes/class-network.php +9 -65 1.21.1.2 View file →
@@ -14,9 +14,9 @@
14 14 protected $countable = false; // If network supports count of likes / shares / favs
15 15 protected $count_api = ''; // API URL for requesting counts
16 16 protected $count_check_time = 14400; // (PHP 5.3) 4 * HOUR_IN_SECONDS; // Transient time, how often to check network for new counts
17 17 protected $share_url = null; // URL to link to when sharing something
18 - protected $is_popup = true; // Open in Popup or not
18 + protected $popup = true; // Open in Popup or not
19 19 protected $popup_dimensions = array(400,300); // Default popup dimensions
20 20 protected $return_var; // Count API return var ( JSON format )
21 21
22 22 // mobile or not settings - not yet developed
@@ -25,13 +25,13 @@
25 25
26 26 /** Options for Share Icons */
27 27 protected $profile_url = null; // URL to the network's profiles.
28 28 protected $profile_placeholder; // Placeholder for profile input text field [aka 'user name' or so ]
29 - protected $profile_label; // Not in use at the moment?
29 + protected $profile_label;
30 30
31 31 protected $nice_name; // Nice name for display in the Editor interface
32 32
33 - protected $label; // Label (default) Text. This will be in the button, e.g. on hover
33 + protected $label; // Lavel (default) Text. This will be in the button, e.g. on hover
34 34
35 35 protected $icon_type = 'fab'; // Icon library set
36 36 protected $icon = 'fa-circle'; // Icon
37 37
@@ -37,13 +37,10 @@
37 37
38 38 protected $color = '#fff';
39 39
40 40 // extra options [internal]
41 - protected $is_native = true; // is this network built-in, or imported? Relevant for network settings
42 - protected $is_editable = true; // should this network be user-editable?
43 - protected $is_active = true;
44 - protected $is_limitedpro = false; // the network is only intended for MB PRO
45 - protected $forcesamewindow = false; // never open this in a new window / i.e. email / print type networks
41 + protected $limitedpro = false; // the network is only intended for MB PRO
42 + protected $forcesamewindow = false; // never open this in a new window
46 43
47 44 public function __construct()
48 45 {
49 46 $this->profile_placeholder = __('User Name','mbsocial');
@@ -49,8 +46,9 @@
49 46 $this->profile_placeholder = __('User Name','mbsocial');
50 47 $this->profile_label = __('Follow', 'mbsocial');
51 48 }
52 49
50 +
53 51 public function get($name)
54 52 {
55 53 if (isset($this->$name))
56 54 return $this->$name;
@@ -55,62 +53,11 @@
55 53 if (isset($this->$name))
56 54 return $this->$name;
57 55 else
58 56 return null;
59 - }
60 57
61 - public function get_all_options()
62 - {
63 - $popup_width = isset($this->popup_dimensions[0]) ? $this->popup_dimensions[0] : 0;
64 - $popup_height = isset($this->popup_dimensions[1]) ? $this->popup_dimensions[1] : 0;
65 -
66 - $options = array(
67 - 'active' => $this->is_active, // no nw setting for this
68 - 'popup' => $this->is_popup,
69 - 'label' => $this->label,
70 - 'share_url' => $this->share_url,
71 - 'profile_url' => $this->profile_url,
72 - 'popup_width' => $popup_width,
73 - 'popup_height' => $popup_height,
74 - 'icon_type' => $this->icon_type,
75 - 'icon' => $this->icon,
76 - 'color' => $this->color,
77 - );
78 -
79 - return $options;
80 58 }
81 59
82 - public function load_settings($settings)
83 - {
84 - if (! $settings)
85 - return;
86 - foreach($settings as $setting => $value)
87 - {
88 - if (is_null($value) || strlen($value) == 0)
89 - continue;
90 -
91 - switch($setting)
92 - {
93 - case 'active':
94 - $this->is_active = ($value == 1) ? true : false;
95 - break;
96 - case 'popup':
97 - $this->is_popup = ($value == 1) ? true : false;
98 - break;
99 - case 'popup_width':
100 - $this->popup_dimensions[0] = $value;
101 - break;
102 - case 'popup_height':
103 - $this->popup_dimensions[1] = $value;
104 - break;
105 - default:
106 - $this->{$setting} = $value;
107 - break;
108 - }
109 - }
110 - }
111 -
112 -
113 60 public function forMobile()
114 61 {
115 62 return $this->displayMobile;
116 63 }
@@ -119,13 +66,8 @@
119 66 {
120 67 return $this->displayDesktop;
121 68 }
122 69
123 - /** If current running setting of network should display count
124 - *
125 - * Even if network supports displaying a counter, this should not be the case when showing the 'profile'
126 - * @return boolean
127 - */
128 70 public function isCountable()
129 71 {
130 72 $use_profile = MBSocial()->whistle()->ask('editor/profile/use');
131 73 if ($use_profile == 1)
@@ -158,9 +100,9 @@
158 100 $use_profile = MBSocial()->whistle()->ask('editor/profile/use');
159 101 if ($use_profile == 1)
160 102 return false;
161 103 else {
162 - return $this->is_popup;
104 + return $this->popup;
163 105 }
164 106 }
165 107
166 108 /** Return the label for this network and use **/
@@ -210,8 +152,10 @@
210 152 return $this->share_url;
211 153 }
212 154
213 155 }
156 +
157 +
214 158 }
215 159
216 160 /* Network dependent creating of a button. Called from collection class */
217 161 public function createButton($args = array())