aFontAwesome = $aFontAwesome; $this->oIconManager = $oIconManager; $this->loadData(); $this->registerDesignSettings(); $this->registerPlacingSettings(); $this->registerAdvancedSettings(); $this->registerSocialSettings(); $this->registerOther(); $this->generatePage(); } private function loadData() { $this->aSavedData = (array) get_option( 'buttonizer_general_settings' ); } private function generatePage() { $sTabs = ''; $sTabsContent = ''; $bFirstTab = true; // Get tabs foreach ( $this->aSubCatagories as $sKey => $sTitle ) { $sTabs .= '' . $sTitle . ''; $sTabsContent .= '
' . $this->aSubPages[$sKey] . '
'; $bFirstTab = false; } echo '
' . $sTabs . ' ' . $sTabsContent . '
' ; } /* * Register settings */ public function registerPlacingSettings() { $this->aSubCatagories['placing'] = __( 'Placing & animations', BUTTONIZER_SLUG ); $this->aSubPages['placing'] = ''; $this->aSubPages['placing'] .= ''; $this->aSubPages['placing'] .= $this->createFormField( 'Button placing', array( &$this, 'field_button_placing' ) ); $this->aSubPages['placing'] .= $this->createFormField( 'Horizontal placing', array( &$this, 'field_position_horizontal' ), 'intro-position' ); $this->aSubPages['placing'] .= $this->createFormField( 'Bottom', array( &$this, 'field_position_bottom' ) ); $this->aSubPages['placing'] .= $this->createFormField( 'Label placing', array( &$this, 'field_label_placing' ) ); $this->aSubPages['placing'] .= ''; $this->aSubPages['placing'] .= $this->createFormField( 'Button animation', array( &$this, 'field_button_animation' ), 'intro-animaton' ); $this->aSubPages['placing'] .= $this->createFormField( 'Attention animation', array( &$this, 'field_attention_animation' ), 'intro-attention' ); $this->aSubPages['placing'] .= '

Placing & animations

You can change here the button position and the button animation.


'; } /* * Register settings */ public function registerDesignSettings() { $this->aSubCatagories['design'] = __( 'Design', BUTTONIZER_SLUG ); $this->aSubPages['design'] = ''; $this->aSubPages['design'] .= ''; $this->aSubPages['design'] .= '

Design

Style your button, make it blinky as you wish. You can change here the main color, main label and set the label hover types.

'; $this->aSubPages['design'] .= ''; $this->aSubPages['design'] .= $this->createFormField( 'Color button unpushed', array( &$this, 'field_button_unpushed' ) ); $this->aSubPages['design'] .= $this->createFormField( 'Color button pushed', array( &$this, 'field_button_pushed' ) ); $this->aSubPages['design'] .= $this->createFormField( 'Icon color', array( &$this, 'field_icon_color' ) ); $this->aSubPages['design'] .= $this->createFormField( 'Button size

The default size of the button is 56px.', array( &$this, 'field_icon_size' ) ); $this->aSubPages['design'] .= $this->createFormField( 'Button size mobile

Recommended is 56px (phones are small).', array( &$this, 'field_icon_mobile_size' ) ); $this->aSubPages['design'] .= '
'; $this->aSubPages['design'] .= ''; $this->aSubPages['design'] .= $this->createFormField( 'Main icon

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​.', array( &$this, 'field_icon_icon' ), 'intro-icon' ); $this->aSubPages['design'] .= $this->createFormField( 'Main label

This label will apear next to the \'main button\' when you have multiple floating action buttons on one page.', array( &$this, 'field_icon_label' ), 'intro-label' ); $this->aSubPages['design'] .= $this->createFormField( 'Main label settings

With the label settings you can show the label on hover, or always show the label', array( &$this, 'field_label_show_on_hover' ) ); $this->aSubPages['design'] .= '
'; } public function registerAdvancedSettings() { $this->aSubCatagories['advanced'] = __( 'Advanced settings', BUTTONIZER_SLUG ); $this->aSubPages['advanced'] = ''; $this->aSubPages['advanced'] .= ''; $this->aSubPages['advanced'] .= $this->createFormField( ' 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) Google Analytics', array( &$this, 'field_analytics_code' ) ); $this->aSubPages['advanced'] .= $this->createFieldset( 'Show on scroll' ); // Show on scroll $this->aSubPages['advanced'] .= $this->createFormField( ' When selected, the buttons will be shown after the user has scrolled a percentage of the page. Show on scroll?', array( &$this, 'field_show_on_scroll' ) ); $this->aSubPages['advanced'] .= $this->createFormField( ' Enter a percentage, starting from 0, up to 100. % from top to show:', array( &$this, 'field_procent_to_scroll' ) ); $this->aSubPages['advanced'] .= $this->closeFieldset(); // Show after timeout $this->aSubPages['advanced'] .= $this->createFieldset( 'Show after timeout' ); $this->aSubPages['advanced'] .= $this->createFormField( ' When selected, the buttons will be shown when the user browsers more than the given seconds. So when you say: Show after 20000ms, the button shows after the user browsed on the website for 20 seconds. Show after timeout?', array( &$this, 'field_show_on_timeout' ) ); $this->aSubPages['advanced'] .= $this->createFormField( ' Enter the miliseconds from when the buttons must get shown to the user.

1 second = 1000 miliseconds
10 seconds = 10000 miliseconds
1 minute = 60000 miliseconds
Milliseconds: ', array( &$this, 'field_time_to_timeout' ) ); $this->aSubPages['advanced'] .= $this->closeFieldset(); // Exit intent $this->aSubPages['advanced'] .= $this->createFieldset( 'Exit intent' ); $this->aSubPages['advanced'] .= $this->createFormField( ' 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. Exit intent', array( &$this, 'field_exit_intent' ) ); $this->aSubPages['advanced'] .= $this->createFormField( ' When the exit intent activates, there will be shown some text next to the head-button. You can edit that here.

When empty, no message will be shown.
Exit intent text', array( &$this, 'field_exit_intent_text' ) ); $this->aSubPages['advanced'] .= $this->closeFieldset(); $this->aSubPages['advanced'] .= '

Advanced settings

'; if ( !ButtonizerLicense()->is_not_paying() && !ButtonizerLicense()->is_plan( 'premium' ) ) { $this->aSubPages['advanced'] .= '
You are missing the fun! When upgrading to Buttonizer Pro you will get these features.
'; } } public function registerSocialSettings() { $this->aSubCatagories['social'] = __( 'Social share settings', BUTTONIZER_SLUG ); $this->aSubPages['social'] = ''; $this->aSubPages['social'] .= ''; // Facebook share button $this->aSubPages['social'] .= $this->createFormField( 'Share on Facebook', array( &$this, 'field_share_facebook' ) ); // Twitter share button $this->aSubPages['social'] .= $this->createFormField( 'Share on Twitter', array( &$this, 'field_share_twitter' ) ); // LinkedIn share button $this->aSubPages['social'] .= $this->createFormField( 'Share on LinkedIn', array( &$this, 'field_share_linkedin' ) ); // Email share button $this->aSubPages['social'] .= $this->createFormField( 'Share on Email', array( &$this, 'field_share_email' ) ); // Whatsapp share button $this->aSubPages['social'] .= $this->createFormField( 'Share on Whatsapp', array( &$this, 'field_share_whatsapp' ) ); // // Pinterest share button // $this->aSubPages['social'] .= $this->createFormField('Share on Pinterest', array(&$this, 'field_share_pinterest')); $this->aSubPages['social'] .= ''; $this->aSubPages['social'] .= '

Social sharing buttons

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

You can enable them by clicking the checkbox, to change the label click on the text. Don\'t forget to save your changes!

Do you want us to add more social media options? Contact us

'; } public function registerOther() { $this->aSubCatagories['other'] = __( 'Other', BUTTONIZER_SLUG ); $this->aSubPages['other'] = ''; $this->aSubPages['other'] .= ''; $this->aSubPages['other'] .= ''; $this->aSubPages['other'] .= '

Other

Nothing really specials here, just a way to reset the buttonizer to the default settings.

Click the button below to get some more information.

Reset ButtonizerMore info
'; } private function createFormField( $sLabel, $aFunction, $sClass = '' ) { return '' . $sLabel . '' . $aFunction() . ''; } private function createFieldset( $sLabel ) { return '
' . $sLabel . ''; } private function closeFieldset() { return '
'; } /* * Form */ function field_button_unpushed() { $button_unpushed = ( isset( $this->aSavedData['button_unpushed'] ) ? $this->aSavedData['button_unpushed'] : '#48A4DC' ); return ''; } function field_button_pushed() { $button_pushed = ( isset( $this->aSavedData['button_pushed'] ) ? $this->aSavedData['button_pushed'] : '#1D9BDB' ); return ''; } function field_icon_color() { $icon_color = ( isset( $this->aSavedData['icon_color'] ) ? $this->aSavedData['icon_color'] : '#fffff' ); return ''; } function field_icon_size() { $icon_size = ( isset( $this->aSavedData['icon_size'] ) ? $this->aSavedData['icon_size'] : '56' ); return '

Size: px

'; } function field_icon_mobile_size() { $icon_size = ( isset( $this->aSavedData['mobile_icon_size'] ) ? $this->aSavedData['mobile_icon_size'] : '56' ); return '

Size: px

'; } function field_icon_icon() { $p = $this->oIconManager->generator( [ 'icon' => ( isset( $this->aSavedData['icon_icon'] ) ? $this->aSavedData['icon_icon'] : '' ), 'icon_fieldname' => 'buttonizer_general_settings[icon_icon]', 'image' => ( isset( $this->aSavedData['custom_icon'] ) ? $this->aSavedData['custom_icon'] : '' ), 'image_fieldname' => 'buttonizer_general_settings[custom_icon]', ] ); return $p; } function field_icon_label() { $icon_label = ( isset( $this->aSavedData['icon_label'] ) ? $this->aSavedData['icon_label'] : '' ); return ''; } /** * Button placing * * @return string */ function field_button_placing() { $button_placing = ( isset( $this->aSavedData['buttons_placing'] ) ? $this->aSavedData['buttons_placing'] : 'default' ); return ' '; } /** * Horizontal placing * When the button placing is set on 'right', this will be the space between the button and the right page corner. * * @return string */ function field_position_horizontal() { $position_right = ( isset( $this->aSavedData['position_horizontal'] ) ? $this->aSavedData['position_horizontal'] : (( isset( $this->aSavedData['position_right'] ) ? $this->aSavedData['position_right'] : '5' )) ); return '%
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%.
'; } function field_position_bottom() { $position_bottom = ( isset( $this->aSavedData['position_bottom'] ) ? $this->aSavedData['position_bottom'] : '5' ); return '%
Recommended 5% then it will position itself on the bottom corner
'; } /** * Mirroring the button style * * @return string */ function field_label_placing() { $button_placing = ( isset( $this->aSavedData['buttons_label_placing'] ) ? $this->aSavedData['buttons_label_placing'] : 'default' ); return '
When you change the label place, you will mirror the style & animation of the button also.
'; } function field_button_animation() { $button_animation = ( isset( $this->aSavedData['buttons_animation'] ) ? $this->aSavedData['buttons_animation'] : 'default' ); return ' '; } function field_attention_animation() { $attention_animation = ( isset( $this->aSavedData['attention_animation'] ) ? $this->aSavedData['attention_animation'] : 'none' ); return ' 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. '; } public function field_label_show_on_hover() { $is_selected = ( isset( $this->aSavedData['buttons_label_show_on_hover'] ) ? $this->aSavedData['buttons_label_show_on_hover'] : '' ); //return ' '; return ' '; } /* * Advanced */ function field_analytics_code() { $google_analytics = ( isset( $this->aSavedData['google_analytics'] ) ? $this->aSavedData['google_analytics'] : '' ); return 'Insert here the Google Analytics tracking code. Like UA-000000-2'; } public function field_show_on_scroll() { return '
PRO
'; } public function field_procent_to_scroll() { return '
% PRO
'; } public function field_show_on_timeout() { return ' PRO'; } public function field_time_to_timeout() { return '
PRO
'; } // Exit intent public function field_exit_intent() { return ' PRO'; } public function field_exit_intent_text() { return '
PRO
'; } // Share page function field_share_facebook() { $share_facebook = ( isset( $this->aSavedData['share_facebook'] ) ? $this->aSavedData['share_facebook'] : '' ); $share_facebook_text = ( isset( $this->aSavedData['share_facebook_text'] ) ? $this->aSavedData['share_facebook_text'] : 'Share this on Facebook' ); return ' '; } function field_share_linkedin() { $share_linkedin = ( isset( $this->aSavedData['share_linkedin'] ) ? $this->aSavedData['share_linkedin'] : '' ); $share_linkedin_text = ( isset( $this->aSavedData['share_linkedin_text'] ) ? $this->aSavedData['share_linkedin_text'] : 'Share this on LinkedIn' ); return ' '; } function field_share_twitter() { $share_twitter = ( isset( $this->aSavedData['share_twitter'] ) ? $this->aSavedData['share_twitter'] : '' ); $share_twitter_text = ( isset( $this->aSavedData['share_twitter_text'] ) ? $this->aSavedData['share_twitter_text'] : 'Share this on Twitter' ); return ' '; } function field_share_email() { $share_email = ( isset( $this->aSavedData['share_email'] ) ? $this->aSavedData['share_email'] : '' ); $share_email_text = ( isset( $this->aSavedData['share_email_text'] ) ? $this->aSavedData['share_email_text'] : 'Share this on Email' ); return ' '; } // Next update social sharing features :) // function field_share_pinterest() // { // $share_pinterest = (isset($this->aSavedData['share_pinterest']) ? ($this->aSavedData['share_pinterest']) : ''); // $share_pinterest_text = (isset($this->aSavedData['share_pinterest_text']) ? ($this->aSavedData['share_pinterest_text']) : 'Share this on Pinterest'); // // return ' '; // } // function field_share_whatsapp() { $share_whatsapp = ( isset( $this->aSavedData['share_whatsapp'] ) ? $this->aSavedData['share_whatsapp'] : '' ); $share_whatsapp_text = ( isset( $this->aSavedData['share_whatsapp_text'] ) ? $this->aSavedData['share_whatsapp_text'] : 'Share this on Whatsapp' ); return ' '; } }