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 -67 1.31.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,64 +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 - 'displayMobile' => $this->displayMobile,
78 - 'displayDesktop' => $this->displayDesktop,
79 - );
80 -
81 - return $options;
82 58 }
83 59
84 - public function load_settings($settings)
85 - {
86 - if (! $settings)
87 - return;
88 - foreach($settings as $setting => $value)
89 - {
90 - if (is_null($value) || strlen($value) == 0)
91 - continue;
92 -
93 - switch($setting)
94 - {
95 - case 'active':
96 - $this->is_active = ($value == 1) ? true : false;
97 - break;
98 - case 'popup':
99 - $this->is_popup = ($value == 1) ? true : false;
100 - break;
101 - case 'popup_width':
102 - $this->popup_dimensions[0] = $value;
103 - break;
104 - case 'popup_height':
105 - $this->popup_dimensions[1] = $value;
106 - break;
107 - default:
108 - $this->{$setting} = $value;
109 - break;
110 - }
111 - }
112 - }
113 -
114 -
115 60 public function forMobile()
116 61 {
117 62 return $this->displayMobile;
118 63 }
@@ -121,13 +66,8 @@
121 66 {
122 67 return $this->displayDesktop;
123 68 }
124 69
125 - /** If current running setting of network should display count
126 - *
127 - * Even if network supports displaying a counter, this should not be the case when showing the 'profile'
128 - * @return boolean
129 - */
130 70 public function isCountable()
131 71 {
132 72 $use_profile = MBSocial()->whistle()->ask('editor/profile/use');
133 73 if ($use_profile == 1)
@@ -160,9 +100,9 @@
160 100 $use_profile = MBSocial()->whistle()->ask('editor/profile/use');
161 101 if ($use_profile == 1)
162 102 return false;
163 103 else {
164 - return $this->is_popup;
104 + return $this->popup;
165 105 }
166 106 }
167 107
168 108 /** Return the label for this network and use **/
@@ -212,8 +152,10 @@
212 152 return $this->share_url;
213 153 }
214 154
215 155 }
156 +
157 +
216 158 }
217 159
218 160 /* Network dependent creating of a button. Called from collection class */
219 161 public function createButton($args = array())