PluginProbe
Social Share Buttons / 1.5
Social Share Buttons v1.5
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/blocks/profile_block.php +5 -73 1.201.5 View file →
@@ -30,18 +30,13 @@
30 30 if ($network->is_social_share())
31 31 {
32 32 $this->fields['useprofile_' . $name] = array('default' => 0);
33 33 }
34 - if ($network->has_alternate())
35 - {
36 - $this->fields['use_alternate_' . $name] = array('default' => 0);
37 - }
38 34 }
39 35 }
40 36
41 37 MBSocial()->whistle()->listen('display/vars/profile', array($this, 'get_profile'), 'ask'); // somebody asks for profile name
42 38 MBSocial()->whistle()->listen('editor/profile/use', array($this, 'get_profile_use'), 'ask'); // somebody asks for useprofile settings
43 - MBSocial()->whistle()->listen('editor/profile/alternate', array($this, 'get_alternate_use'), 'ask'); // somebody
44 39 }
45 40
46 41 public function get_profile()
47 42 {
@@ -80,40 +75,8 @@
80 75 }
81 76 }
82 77 }
83 78
84 - public function get_alternate_use()
85 - {
86 - $network = MBSocial()->whistle()->ask('display/parse/network');
87 - $name = $network->get('network');
88 - $blockdata = $this->data[$this->blockname];
89 -
90 - if (is_object($network))
91 - {
92 - if ($network->has_alternate())
93 - {
94 - if (isset($blockdata['use_alternate_'. $name]))
95 - {
96 - return $blockdata['use_alternate_' . $name];
97 - }
98 - }
99 - return false;
100 - }
101 - }
102 -
103 - public function save_fields($data, $post)
104 - {
105 - $data = parent::save_fields($data, $post);
106 -
107 - // Filter URL
108 - if (isset($data[$this->blockname]['profile_rss']) && strlen($data[$this->blockname]['profile_rss'] > 0))
109 - {
110 - $data[$this->blockname]['profile_rss'] = esc_url_raw($data[$this->blockname]['profile_rss']);
111 - }
112 -
113 - return $data;
114 - }
115 -
116 79 public function admin()
117 80 {
118 81 $admin = mbSocial()->admin();
119 82 $active_networks = isset($this->data['network']['active']) ? $this->data['network']['active'] : array();
@@ -118,10 +81,8 @@
118 81 $admin = mbSocial()->admin();
119 82 $active_networks = isset($this->data['network']['active']) ? $this->data['network']['active'] : array();
120 83 $networks = mbSocial()->networks()->get(); // all networks!
121 84
122 -
123 -
124 85 foreach($networks as $network)
125 86 {
126 87 if ($network->is_share_icon() )
127 88 {
@@ -157,49 +118,20 @@
157 118 {
158 119 $sw = new maxField('switch');
159 120 $sw->id = 'useprofile_' . $name;
160 121 $sw->name = $sw->id;
161 - $sw->label = __('Share Profile', 'mbsocial');
122 + $sw->label = '';
123 + $sw->label = __('Use Profile', 'mbsocial');
162 124 $sw->value = 1;
163 125 $sw->inputclass = 'check_button icon';
164 126 $sw->checked = checked(1, $this->getValue($sw->name), false);
165 127
166 - // $sw->mainclass = 'switch';
167 -
168 - // dunno about that.
169 - //$admin->addField($sw, 'group_start',array('group_end', 'end'), false);
170 - // $end = $network->has_alternate() ? '' : 'end';
171 - $admin->addField($sw, '', 'end', false);
128 + $admin->addField($sw, '','end', false);
172 129 }
173 130
174 - if ($network->has_alternate())
175 - {
176 - $spacer = new maxField('spacer');
177 - $spacer->id = 'spacer-alternate';
178 - $spacer->name = $spacer->id;
179 - $spacer->label = ' ';
180 - $spacer->main_class = 'option alternate_profile';
181 - $spacer->start_conditional = htmlentities(json_encode(array("target" => 'useprofile_'. $name, 'values' => 'checked')));
131 + }
182 132
183 - $spacer2 = clone $spacer;
184 - $spacer2->id = 'spacer-alt-2';
185 - $spacer2->name = $spacer2->id;
186 133
187 - $admin->addField($spacer, 'start', '', false);
188 - $admin->addField($spacer2, '', '', false);
189 -
190 - $alt = new MaxField('switch');
191 - $alt->id = 'use_alternate_' . $name;
192 - $alt->name = $alt->id;
193 - $alt->label = $network->get('alternate_label');
194 - $alt->value = 1;
195 - $alt->inputclass = 'check_button icon';
196 - $alt->checked = checked($alt->value, $this->getValue($alt->name), false);
197 -
198 - $admin->addField($alt, '','end', false);
199 - }
200 - }
201 -
202 134 }
203 135
204 136 if (count($networks) > 0)
205 137 {
@@ -208,9 +140,9 @@
208 140 <h3><?php _e('Profile Options', 'mbsocial'); ?></h3>
209 141
210 142 <p>Fill out the link to your profile on the network. </p>
211 143
212 - <p><strong>Share Profile :</strong> Check this to share your profile instead of the current page. This option is available for networks supporting both options</p>
144 + <p><strong>Use Profile :</strong> Check this to share your profile instead of the current page. This option is available for networks supporting both options</p>
213 145 </div>
214 146
215 147 <div class='options option-container layout' id='profileBlock' data-refresh='previewBlock' >
216 148 <div class='title'><?php _e('Profiles', 'mbsocial' ); ?></div>