PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 1.5.1
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v1.5.1
3.6.0 3.5.0 trunk 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 All 110 releases
buttonizer-multifunctional-button / classes / Admin / General.php

General.php in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 1.5.1, at classes/Admin/General.php

526 lines 31.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 Copyright 2017 Buttonizer
19 */
20 namespace Buttonizer\Admin;
21
22 # No script kiddies
23 defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
24 class General
25 {
26 private $aSavedData = array() ;
27 private $aSubCatagories = array() ;
28 private $aSubPages = array() ;
29 private $aFontAwesome = array() ;
30 private $oIconManager = array() ;
31 private $bHasProFeature = false ;
32 public function __construct( $aFontAwesome, $oIconManager )
33 {
34 $this->aFontAwesome = $aFontAwesome;
35 $this->oIconManager = $oIconManager;
36 $this->loadData();
37 $this->registerDesignSettings();
38 $this->registerPlacingSettings();
39 $this->registerAdvancedSettings();
40 $this->registerSocialSettings();
41 $this->registerOther();
42 $this->generatePage();
43 }
44
45 private function loadData()
46 {
47 $this->aSavedData = (array) get_option( 'buttonizer_general_settings' );
48 }
49
50 private function generatePage()
51 {
52 $sTabs = '';
53 $sTabsContent = '';
54 $bFirstTab = true;
55 // Get tabs
56 foreach ( $this->aSubCatagories as $sKey => $sTitle ) {
57 $sTabs .= '<a href="#tab_' . $sKey . '" onclick="javascript:buttonizer.tabNavigate(\'' . $sKey . '\')" id="tab_container_' . $sKey . '" class="nav-tab ' . (( $bFirstTab ? 'first nav-tab-active' : '' )) . '">' . $sTitle . '</a>';
58 $sTabsContent .= '<div id="tab_container_' . $sKey . '" ' . (( !$bFirstTab ? 'style="display: none;"' : '' )) . ' class="tab-container">' . $this->aSubPages[$sKey] . '</div>';
59 $bFirstTab = false;
60 }
61 echo '<table class="vertical-tabs">
62 <tr>
63 <td class="tabs">' . $sTabs . '</td>
64 <td class="tabsholder">' . $sTabsContent . '</td>
65 </tr>
66 </table>' ;
67 }
68
69 /*
70 * Register settings
71 */
72 public function registerPlacingSettings()
73 {
74 $this->aSubCatagories['placing'] = __( 'Placing &amp; animations', BUTTONIZER_SLUG );
75 $this->aSubPages['placing'] = '<table class="form-table"><tbody>';
76 $this->aSubPages['placing'] .= '<tr>
77 <td colspan="2">
78 <h2>Placing &amp; animations</h2>
79 <p>You can change here the button position and the button animation.</p>
80 </td></tr>';
81 $this->aSubPages['placing'] .= $this->createFormField( 'Button placing', array( &$this, 'field_button_placing' ) );
82 $this->aSubPages['placing'] .= $this->createFormField( 'Horizontal placing', array( &$this, 'field_position_horizontal' ), 'intro-position' );
83 $this->aSubPages['placing'] .= $this->createFormField( 'Bottom', array( &$this, 'field_position_bottom' ) );
84 $this->aSubPages['placing'] .= $this->createFormField( 'Label placing', array( &$this, 'field_label_placing' ) );
85 $this->aSubPages['placing'] .= '<tr>
86 <td colspan="2">
87 <hr style="margin: 20px 0;">
88 </td></tr>';
89 $this->aSubPages['placing'] .= $this->createFormField( 'Button animation', array( &$this, 'field_button_animation' ), 'intro-animaton' );
90 $this->aSubPages['placing'] .= $this->createFormField( 'Attention animation', array( &$this, 'field_attention_animation' ), 'intro-attention' );
91 $this->aSubPages['placing'] .= '</tbody></table>';
92 }
93
94 /*
95 * Register settings
96 */
97 public function registerDesignSettings()
98 {
99 $this->aSubCatagories['design'] = __( 'Design', BUTTONIZER_SLUG );
100 $this->aSubPages['design'] = '<table class="form-table"><tbody>';
101 $this->aSubPages['design'] .= '<tr>
102 <td colspan="2">
103 <h2>Design</h2>
104 <p>Style your button, make it blinky as you wish. You can change here the main color, main label and set the label hover types.</p>
105 </td></tr>';
106 $this->aSubPages['design'] .= '</tbody></table>';
107 $this->aSubPages['design'] .= '<table class="form-table intro-styling"><tbody>';
108 $this->aSubPages['design'] .= $this->createFormField( 'Color button unpushed', array( &$this, 'field_button_unpushed' ) );
109 $this->aSubPages['design'] .= $this->createFormField( 'Color button pushed', array( &$this, 'field_button_pushed' ) );
110 $this->aSubPages['design'] .= $this->createFormField( 'Icon color', array( &$this, 'field_icon_color' ) );
111 $this->aSubPages['design'] .= $this->createFormField( 'Button size<br/><br/><small>The default size of the button is 56px.</small>', array( &$this, 'field_icon_size' ) );
112 $this->aSubPages['design'] .= $this->createFormField( 'Button size mobile<br/><br/><small>Recommended is 56px (phones are small).</small>', array( &$this, 'field_icon_mobile_size' ) );
113 $this->aSubPages['design'] .= '</tbody></table>';
114 $this->aSubPages['design'] .= '<table class="form-table" style="margin-top: 0;"><tbody>';
115 $this->aSubPages['design'] .= $this->createFormField( 'Main icon<br /><br /><small>This icon will appear in a button when you have multiple floating action buttons on one page. When you click on the icon the other floating action button will \'pop\' open​.</small>', array( &$this, 'field_icon_icon' ), 'intro-icon' );
116 $this->aSubPages['design'] .= $this->createFormField( 'Main label<br /><br /><small>This label will apear next to the \'main button\' when you have multiple floating action buttons on one page.</small>', array( &$this, 'field_icon_label' ), 'intro-label' );
117 $this->aSubPages['design'] .= $this->createFormField( 'Label color<br /><br /><small>This is the color for the label that will apear next to the main button</small>', array( &$this, 'field_icon_label_color' ), 'intro-label' );
118 $this->aSubPages['design'] .= $this->createFormField( 'Label text color<br /><br /><small>This is the color of the text for the label</small>', array( &$this, 'field_icon_label_text_color' ), 'intro-label' );
119 $this->aSubPages['design'] .= $this->createFormField( 'Main label settings<br /><br /><small>With the label settings you can show the label on hover, or always show the label</small>', array( &$this, 'field_label_show_on_hover' ) );
120 $this->aSubPages['design'] .= '</tbody></table>';
121 }
122
123 public function registerAdvancedSettings()
124 {
125 $this->aSubCatagories['advanced'] = __( 'Advanced settings', BUTTONIZER_SLUG );
126 $this->aSubPages['advanced'] = '<table class="form-table"><tbody>';
127 $this->aSubPages['advanced'] .= '<tr>
128 <td colspan="2">
129 <h2>Advanced settings</h2>
130 <p></p>
131 </td></tr>';
132 $this->aSubPages['advanced'] .= $this->createFormField( '
133 <span class="info-class">
134 <i class="fa fa-info-circle"></i>
135 <span>If you have your Google Analytics tracking code already installed you can ignore this setting. If you want to be sure that your buttons are tracked in your Google Analytics account? Then go to your Google Analytics account > Click on Real Time > Events and open your website in another tab. Click on a Buttonizer button and check if you see that the click gets tracked in Google Analytics. If this doesn\'t happen than go to your google Analytics settings page > Click on tracking code and copy your tracking-ID. It should look like this (UA-00000000-0)
136 </span>
137 </span>
138 Google Analytics', array( &$this, 'field_analytics_code' ) );
139 $this->aSubPages['advanced'] .= $this->createFieldset( 'Show on scroll' );
140 // Show on scroll
141 $this->aSubPages['advanced'] .= $this->createFormField( '
142 <span class="info-class">
143 <i class="fa fa-info-circle"></i>
144 <span>
145 When selected, the buttons will be shown after the user has scrolled a percentage of the page.
146 </span>
147 </span>
148 Show on scroll?', array( &$this, 'field_show_on_scroll' ) );
149 $this->aSubPages['advanced'] .= $this->createFormField( '
150 <span class="info-class">
151 <i class="fa fa-info-circle"></i>
152 <span>
153 Enter a percentage, starting from 0, up to 100.
154 </span>
155 </span>
156 % from top to show:', array( &$this, 'field_procent_to_scroll' ) );
157 $this->aSubPages['advanced'] .= $this->closeFieldset();
158 // Show after timeout
159 $this->aSubPages['advanced'] .= $this->createFieldset( 'Show after timeout' );
160 $this->aSubPages['advanced'] .= $this->createFormField( '
161 <span class="info-class">
162 <i class="fa fa-info-circle"></i>
163 <span>
164 When selected, the buttons will be shown when the user browsers more than the given seconds. So when you say: Show after 20<i>000</i>ms, the button shows after the user browsed on the website for 20 seconds.
165 </span>
166 </span>
167 Show after timeout?', array( &$this, 'field_show_on_timeout' ) );
168 $this->aSubPages['advanced'] .= $this->createFormField( '
169 <span class="info-class">
170 <i class="fa fa-info-circle"></i>
171 <span>
172 Enter the miliseconds from when the buttons must get shown to the user.<br />
173 <br />
174 1 second = 1000 miliseconds<br />
175 10 seconds = 10000 miliseconds<br />
176 1 minute = 60000 miliseconds<br />
177 </span>
178 </span>
179 Milliseconds: ', array( &$this, 'field_time_to_timeout' ) );
180 $this->aSubPages['advanced'] .= $this->closeFieldset();
181 // Exit intent
182 $this->aSubPages['advanced'] .= $this->createFieldset( 'Exit intent' );
183 $this->aSubPages['advanced'] .= $this->createFormField( '
184 <span class="info-class">
185 <i class="fa fa-info-circle"></i>
186 <span>
187 When selected, the buttons will open with a effect when your guest/user tries to escape from your website. The user gets attracted from your buttons.
188 </span>
189 </span>
190 Exit intent', array( &$this, 'field_exit_intent' ) );
191 $this->aSubPages['advanced'] .= $this->createFormField( '
192 <span class="info-class">
193 <i class="fa fa-info-circle"></i>
194 <span>
195 When the exit intent activates, there will be shown some text next to the head-button. You can edit that here.<br />
196 <br />
197 When empty, no message will be shown.
198 </span>
199 </span>
200 Exit intent text', array( &$this, 'field_exit_intent_text' ) );
201 $this->aSubPages['advanced'] .= $this->closeFieldset();
202 $this->aSubPages['advanced'] .= '</tbody></table>';
203 if ( !ButtonizerLicense()->is_not_paying() && !ButtonizerLicense()->is_plan( 'premium' ) ) {
204 $this->aSubPages['advanced'] .= '<div class="buttonizer-pro-text"><i class="fa fa-lock"></i> You are missing the fun! When upgrading to <a href="Admin.php?page=Buttonizer-pricing">Buttonizer Pro</a> you will get these features.</div>';
205 }
206 }
207
208 public function registerSocialSettings()
209 {
210 $this->aSubCatagories['social'] = __( 'Social share settings', BUTTONIZER_SLUG );
211 $this->aSubPages['social'] = '<table class="form-table"><tbody>';
212 $this->aSubPages['social'] .= '<tr>
213 <td colspan="2">
214 <h2>Social sharing buttons</h2>
215 <p>These are separated pre-configured buttons to share a page. The buttons will be visible at every page, you can let the user share a page on Twitter, Facebook, LinkedIn and Email<p>
216 <p>You can enable them by clicking the checkbox, to change the label click on the text. Don\'t forget to save your changes!</p>
217
218 <div class="input_error warning_text" hidden>
219 <label for="button_text">
220 Warning: You can pick a maximum of 3 options
221 </label>
222 </div>
223
224 </td></tr>';
225 // Facebook share button
226 $this->aSubPages['social'] .= $this->createFormField( 'Share on Facebook', array( &$this, 'field_share_facebook' ) );
227 // Twitter share button
228 $this->aSubPages['social'] .= $this->createFormField( 'Share on Twitter', array( &$this, 'field_share_twitter' ) );
229 // LinkedIn share button
230 $this->aSubPages['social'] .= $this->createFormField( 'Share on LinkedIn', array( &$this, 'field_share_linkedin' ) );
231 // Email share button
232 $this->aSubPages['social'] .= $this->createFormField( 'Share on Email', array( &$this, 'field_share_email' ) );
233 // Whatsapp share button
234 $this->aSubPages['social'] .= $this->createFormField( 'Share on Whatsapp', array( &$this, 'field_share_whatsapp' ) );
235 // // Pinterest share button
236 // $this->aSubPages['social'] .= $this->createFormField('Share on Pinterest', array(&$this, 'field_share_pinterest'));
237 $this->aSubPages['social'] .= '<tr>
238 <td colspan="2" style="text-align: right;">
239 <p>Do you want us to add more social media options? <a href="Admin.php?page=Buttonizer-contact" style="color: #498698">Contact us</a></p>
240 </td></tr>';
241 $this->aSubPages['social'] .= '</tbody></table>';
242 }
243
244 public function registerOther()
245 {
246 $this->aSubCatagories['other'] = __( 'Other', BUTTONIZER_SLUG );
247 $this->aSubPages['other'] = '<table class="form-table"><tbody>';
248 $this->aSubPages['other'] .= '<tr>
249 <td colspan="2">
250 <h2>Other</h2>
251 <p>Nothing really specials here, just a way to reset the buttonizer to the default settings.</p>
252 <p>Click the button below to get some more information.</p>
253 </td></tr>';
254 $this->aSubPages['other'] .= '<tr><th scope="row">Reset Buttonizer</th><td><a href="?page=Buttonizer&tab=buttonizer_page_reset" class="button ">More info</a></td></tr>';
255 $this->aSubPages['other'] .= '</tbody></table>';
256 }
257
258 private function createFormField( $sLabel, $aFunction, $sClass = '' )
259 {
260 return '<tr class="' . $sClass . '"><th scope="row">' . $sLabel . '</th><td class="r-sit">' . $aFunction() . '</td></tr>';
261 }
262
263 private function createFieldset( $sLabel )
264 {
265 return '<tr><td colspan="2"><fieldset><legend>' . $sLabel . '</legend><table class="form-table">';
266 }
267
268 private function closeFieldset()
269 {
270 return '</table></fieldset></td></tr>';
271 }
272
273 /*
274 * Form
275 */
276 function field_button_unpushed()
277 {
278 $button_unpushed = ( isset( $this->aSavedData['button_unpushed'] ) ? $this->aSavedData['button_unpushed'] : '#48A4DC' );
279 return '<input type="text" name="buttonizer_general_settings[button_unpushed]" value="' . $button_unpushed . '" id="button_unpushed" data-default-color="#fffff" />';
280 }
281
282 function field_button_pushed()
283 {
284 $button_pushed = ( isset( $this->aSavedData['button_pushed'] ) ? $this->aSavedData['button_pushed'] : '#1D9BDB' );
285 return '<input type="text" name="buttonizer_general_settings[button_pushed]" value="' . $button_pushed . '" id="button_pushed" data-default-color="#fffff" />';
286 }
287
288 function field_icon_color()
289 {
290 $icon_color = ( isset( $this->aSavedData['icon_color'] ) ? $this->aSavedData['icon_color'] : '#fffff' );
291 return '<input type="text" name="buttonizer_general_settings[icon_color]" value="' . $icon_color . '" id="icon_color" data-default-color="#fffff" />';
292 }
293
294 function field_icon_size()
295 {
296 $icon_size = ( isset( $this->aSavedData['icon_size'] ) ? $this->aSavedData['icon_size'] : '56' );
297 return '<input type="range" name="buttonizer_general_settings[icon_size]" value="' . $icon_size . '" id="icon_size" min="45" max="80" data-default-value="50" /> <br/>
298 <p>Size: <span id="icon_size_output"></span>px</p>
299 <script>
300 var slider = document.getElementById("icon_size");
301 var output = document.getElementById("icon_size_output");
302 output.innerHTML = slider.value;
303
304 slider.oninput = function() {
305 output.innerHTML = this.value;
306 }
307 </script>';
308 }
309
310 function field_icon_mobile_size()
311 {
312 $icon_size = ( isset( $this->aSavedData['mobile_icon_size'] ) ? $this->aSavedData['mobile_icon_size'] : '56' );
313 return '<input type="range" name="buttonizer_general_settings[mobile_icon_size]" value="' . $icon_size . '" id="mobile_icon_size" min="45" max="80" data-default-value="50" /> <br/>
314 <p>Size: <span id="mobile_icon_size_output"></span>px</p>
315 <script>
316 var slider_mobile = document.getElementById("mobile_icon_size");
317 var output_mobile = document.getElementById("mobile_icon_size_output");
318 output_mobile.innerHTML = slider_mobile.value;
319
320 slider_mobile.oninput = function() {
321 output_mobile.innerHTML = this.value;
322 }
323 </script>';
324 }
325
326 function field_icon_icon()
327 {
328 $p = $this->oIconManager->generator( [
329 'icon' => ( isset( $this->aSavedData['icon_icon'] ) ? $this->aSavedData['icon_icon'] : '' ),
330 'icon_fieldname' => 'buttonizer_general_settings[icon_icon]',
331 'image' => ( isset( $this->aSavedData['custom_icon'] ) ? $this->aSavedData['custom_icon'] : '' ),
332 'image_fieldname' => 'buttonizer_general_settings[custom_icon]',
333 ] );
334 return $p;
335 }
336
337 function field_icon_label()
338 {
339 $icon_label = ( isset( $this->aSavedData['icon_label'] ) ? $this->aSavedData['icon_label'] : '' );
340 return '<input type="text" name="buttonizer_general_settings[icon_label]" value="' . $icon_label . '" placeholder="Fill in some text" />';
341 }
342
343 function field_icon_label_color()
344 {
345 return '<div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="PRO feature" style="background-color: #4e4c4c;"></a></div> <span class="buttonizer-pro-feature" style="vertical-align: top;">PRO</span></div>';
346 }
347
348 function field_icon_label_text_color()
349 {
350 return '<div class="wp-picker-container"><a class="wp-color-result" title="PRO feature" style="background-color: #ffffff;"></a></div> <span class="buttonizer-pro-feature" style="vertical-align: top;">PRO</span></div>';
351 }
352
353 /**
354 * Button placing
355 *
356 * @return string
357 */
358 function field_button_placing()
359 {
360 $button_placing = ( isset( $this->aSavedData['buttons_placing'] ) ? $this->aSavedData['buttons_placing'] : 'default' );
361 return '
362 <select name="buttonizer_general_settings[buttons_placing]" style="width: 100%; padding: 0 10px; height: 40px;">
363 <option value="default" ' . (( $button_placing == 'default' ? 'selected' : '' )) . '>Right bottom corner (Default)</option>
364 <option value="left" ' . (( $button_placing == 'left' ? 'selected' : '' )) . '>Left bottom corner</option>
365 </select>';
366 }
367
368 /**
369 * Horizontal placing
370 * When the button placing is set on 'right', this will be the space between the button and the right page corner.
371 *
372 * @return string
373 */
374 function field_position_horizontal()
375 {
376 $position_right = ( isset( $this->aSavedData['position_horizontal'] ) ? $this->aSavedData['position_horizontal'] : (( isset( $this->aSavedData['position_right'] ) ? $this->aSavedData['position_right'] : '5' )) );
377 return '<input type="text" name="buttonizer_general_settings[position_horizontal]" value="' . $position_right . '" onkeypress="return event.charCode >= 48 && event.charCode <= 57" placeholder="Fill in a number from 0 to 100"/><small><i class="after-input">%</i>
378 <div class="buttonizer-note">When the button placing is set on \'right\', this will be the space between the button and the right page corner. When your button placing is at the left corner, this will be the left space of your button. Recommended value is 5%.</div> ';
379 }
380
381 function field_position_bottom()
382 {
383 $position_bottom = ( isset( $this->aSavedData['position_bottom'] ) ? $this->aSavedData['position_bottom'] : '5' );
384 return '<input type="text" name="buttonizer_general_settings[position_bottom]" value="' . $position_bottom . '" onkeypress="return event.charCode >= 48 && event.charCode <= 57" placeholder="Fill in a number from 0 to 100"/><small><i class="after-input">%</i><br>Recommended 5% then it will position itself on the bottom corner</small>';
385 }
386
387 /**
388 * Mirroring the button style
389 *
390 * @return string
391 */
392 function field_label_placing()
393 {
394 $button_placing = ( isset( $this->aSavedData['buttons_label_placing'] ) ? $this->aSavedData['buttons_label_placing'] : 'default' );
395 return '
396 <select name="buttonizer_general_settings[buttons_label_placing]" style="width: 100%; padding: 0 10px; height: 40px;">
397 <option value="default" ' . (( $button_placing == 'default' ? 'selected' : '' )) . '>Label left, icon right</option>
398 <option value="mirrored" ' . (( $button_placing == 'mirrored' ? 'selected' : '' )) . '>Icon left, label right (mirrored)</option>
399 </select>
400 <div class="buttonizer-note">When you change the label place, you will mirror the style &amp; animation of the button also.</div>';
401 }
402
403 function field_button_animation()
404 {
405 $button_animation = ( isset( $this->aSavedData['buttons_animation'] ) ? $this->aSavedData['buttons_animation'] : 'default' );
406 return '
407 <select name="buttonizer_general_settings[buttons_animation]" style="width: 100%; padding: 0 10px; height: 40px;">
408 <option value="default" ' . (( $button_animation == 'default' ? 'selected' : '' )) . '>Default button animation (fade up)</option>
409 <option value="circle" ' . (( $button_animation == 'circle' ? 'selected' : '' )) . '>Circle animation (arround button, right bottom corner)</option>
410 <option value="fade-left-to-right" ' . (( $button_animation == 'fade-left-to-right' ? 'selected' : '' )) . '>Fade animation left to right</option>
411 </select>';
412 }
413
414 function field_attention_animation()
415 {
416 $attention_animation = ( isset( $this->aSavedData['attention_animation'] ) ? $this->aSavedData['attention_animation'] : 'none' );
417 return '
418 <select name="buttonizer_general_settings[attention_animation]" style="width: 100%; padding: 0 10px; height: 40px;">
419 <option value="none" ' . (( $attention_animation == 'none' ? 'selected' : '' )) . '>No attention animation</option>
420 <option value="hello" ' . (( $attention_animation == 'hello' ? 'selected' : '' )) . '>Buttonizer Hello</option>
421 <option value="bounce" ' . (( $attention_animation == 'bounce' ? 'selected' : '' )) . '>Bouncing</option>
422 </select>
423 <small>This will get the button jumping out of the background. So it gets your attention. All animations will be played every 10 seconds. Average animation duration is 1.75 seconds.</small>
424 ';
425 }
426
427 public function field_label_show_on_hover()
428 {
429 $is_selected = ( isset( $this->aSavedData['buttons_label_show_on_hover'] ) ? $this->aSavedData['buttons_label_show_on_hover'] : '' );
430 //return '<input type="checkbox" name="buttonizer_general_settings[buttons_label_show_on_hover]" id="buttons_label_show_on_hover" value="1" '. ($is_selected == '1' ? 'checked="checked"' : '') .' /> <small><label for="buttons_label_show_on_hover">Only show on hover</label></small>';
431 return '
432 <select name="buttonizer_general_settings[buttons_label_show_on_hover]" style="width: 100%; padding: 0 10px; height: 40px;" id="buttons_label_show_on_hover" >
433 <option value="default" ' . (( $is_selected == 'default' ? 'selected' : '' )) . '>Always show label</option>
434 <option value="showOnHover" ' . (( $is_selected == 'showOnHover' ? 'selected' : '' )) . '>Show on hover</option>
435 <option value="showOnHoverDesktop" ' . (( $is_selected == 'showOnHoverDesktop' ? 'selected' : '' )) . '>Show on hover (Desktop only)</option>
436 <option value="showOnHoverMobile" ' . (( $is_selected == 'showOnHoverMobile' ? 'selected' : '' )) . '>Show on hover (Mobile only)</option>
437 </select>
438 ';
439 }
440
441 /*
442 * Advanced
443 */
444 function field_analytics_code()
445 {
446 $google_analytics = ( isset( $this->aSavedData['google_analytics'] ) ? $this->aSavedData['google_analytics'] : '' );
447 return '<input type="text" name="buttonizer_general_settings[google_analytics]" value="' . $google_analytics . '" placeholder="Only when not inserted yet" /><small>Insert here the Google Analytics tracking code. Like UA-000000-2</small>';
448 }
449
450 public function field_show_on_scroll()
451 {
452 return '<input type="checkbox" class="buttonizer-click-to-pro" readonly /> <div class="after-input"><span class="buttonizer-pro-feature">PRO</span></div>';
453 }
454
455 public function field_procent_to_scroll()
456 {
457 return '<input type="text" value="0" class="buttonizer-click-to-pro" readonly /> <div class="after-input"><small><i>%</i></small> <span class="buttonizer-pro-feature">PRO</span></div>';
458 }
459
460 public function field_show_on_timeout()
461 {
462 return '<input type="checkbox" class="buttonizer-click-to-pro" readonly /> <span class="buttonizer-pro-feature">PRO</span>';
463 }
464
465 public function field_time_to_timeout()
466 {
467 return '<input type="text" class="buttonizer-click-to-pro" readonly value="0" /><div class="after-input"><span class="buttonizer-pro-feature">PRO</span></div>';
468 }
469
470 // Exit intent
471 public function field_exit_intent()
472 {
473 return '<input type="checkbox" class="buttonizer-click-to-pro" readonly /> <span class="buttonizer-pro-feature">PRO</span>';
474 }
475
476 public function field_exit_intent_text()
477 {
478 return '<input type="text" class="buttonizer-click-to-pro" readonly value="" /><div class="after-input"><span class="buttonizer-pro-feature">PRO</span></div>';
479 }
480
481 // Share page
482 function field_share_facebook()
483 {
484 $share_facebook = ( isset( $this->aSavedData['share_facebook'] ) ? $this->aSavedData['share_facebook'] : '' );
485 $share_facebook_text = ( isset( $this->aSavedData['share_facebook_text'] ) ? $this->aSavedData['share_facebook_text'] : 'Share this on Facebook' );
486 return '<span class="before-input"><input type="checkbox" name="buttonizer_general_settings[share_facebook]" value="1" ' . (( $share_facebook == '1' ? 'checked="checked"' : '' )) . ' class="socialSharingCheckbox" onchange="checkSelection()"/></span> <input type="text" name="buttonizer_general_settings[share_facebook_text]" value="' . $share_facebook_text . '" class="before-input-padding" placeholder="Share this on Facebook" />';
487 }
488
489 function field_share_linkedin()
490 {
491 $share_linkedin = ( isset( $this->aSavedData['share_linkedin'] ) ? $this->aSavedData['share_linkedin'] : '' );
492 $share_linkedin_text = ( isset( $this->aSavedData['share_linkedin_text'] ) ? $this->aSavedData['share_linkedin_text'] : 'Share this on LinkedIn' );
493 return '<span class="before-input"><input type="checkbox" name="buttonizer_general_settings[share_linkedin]" value="1" ' . (( $share_linkedin == '1' ? 'checked="checked"' : '' )) . ' class="socialSharingCheckbox" onchange="checkSelection()"/></span> <input type="text" name="buttonizer_general_settings[share_linkedin_text]" value="' . $share_linkedin_text . '" class="before-input-padding" placeholder="Share this on LinkedIn" />';
494 }
495
496 function field_share_twitter()
497 {
498 $share_twitter = ( isset( $this->aSavedData['share_twitter'] ) ? $this->aSavedData['share_twitter'] : '' );
499 $share_twitter_text = ( isset( $this->aSavedData['share_twitter_text'] ) ? $this->aSavedData['share_twitter_text'] : 'Share this on Twitter' );
500 return '<span class="before-input"><input type="checkbox" name="buttonizer_general_settings[share_twitter]" value="1" ' . (( $share_twitter == '1' ? 'checked="checked"' : '' )) . ' class="socialSharingCheckbox" onchange="checkSelection()"/></span> <input type="text" name="buttonizer_general_settings[share_twitter_text]" value="' . $share_twitter_text . '" class="before-input-padding" placeholder="Share this on Twitter" />';
501 }
502
503 function field_share_email()
504 {
505 $share_email = ( isset( $this->aSavedData['share_email'] ) ? $this->aSavedData['share_email'] : '' );
506 $share_email_text = ( isset( $this->aSavedData['share_email_text'] ) ? $this->aSavedData['share_email_text'] : 'Share this on Email' );
507 return '<span class="before-input"><input type="checkbox" name="buttonizer_general_settings[share_email]" value="1" ' . (( $share_email == '1' ? 'checked="checked"' : '' )) . ' class="socialSharingCheckbox" onchange="checkSelection()"/></span> <input type="text" name="buttonizer_general_settings[share_email_text]" value="' . $share_email_text . '" class="before-input-padding" placeholder="Share this on Email" />';
508 }
509
510 // Next update social sharing features :)
511 // function field_share_pinterest()
512 // {
513 // $share_pinterest = (isset($this->aSavedData['share_pinterest']) ? ($this->aSavedData['share_pinterest']) : '');
514 // $share_pinterest_text = (isset($this->aSavedData['share_pinterest_text']) ? ($this->aSavedData['share_pinterest_text']) : 'Share this on Pinterest');
515 //
516 // return '<span class="before-input"><input type="checkbox" name="buttonizer_general_settings[share_pinterest]" value="1" ' . ($share_pinterest == '1' ? 'checked="checked"' : '') . ' class="socialSharingCheckbox" onchange="checkSelection()"/></span> <input type="text" name="buttonizer_general_settings[share_pinterest_text]" value="' . $share_pinterest_text . '" class="before-input-padding" placeholder="Share this on Pinterest" />';
517 // }
518 //
519 function field_share_whatsapp()
520 {
521 $share_whatsapp = ( isset( $this->aSavedData['share_whatsapp'] ) ? $this->aSavedData['share_whatsapp'] : '' );
522 $share_whatsapp_text = ( isset( $this->aSavedData['share_whatsapp_text'] ) ? $this->aSavedData['share_whatsapp_text'] : 'Share this on Whatsapp' );
523 return '<span class="before-input"><input type="checkbox" name="buttonizer_general_settings[share_whatsapp]" value="1" ' . (( $share_whatsapp == '1' ? 'checked="checked"' : '' )) . ' class="socialSharingCheckbox" onchange="checkSelection()"/></span> <input type="text" name="buttonizer_general_settings[share_whatsapp_text]" value="' . $share_whatsapp_text . '" class="before-input-padding" placeholder="Share this on Whatsapp" />';
524 }
525
526 }