function essb_prepare_location_advanced_customization($tab_id, $menu_id, $location = '', $post_type = false)
{
    global $essb_networks, $essb_options;
    $checkbox_list_networks = array();
    foreach ($essb_networks as $key => $object) {
        $checkbox_list_networks[$key] = $object['name'];
    }
    if ($location != 'mobile') {
        ESSBOptionsStructureHelper::field_heading($tab_id, $menu_id, 'heading5', __('Deactivate display of functions', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_section_start_full_panels($tab_id, $menu_id);
        ESSBOptionsStructureHelper::field_switch_panel($tab_id, $menu_id, $location . '_mobile_deactivate', __('Deactivate on mobile', ESSB3_TEXT_DOMAIN), __('Activate this option if you wish that method to be hidden when site is browsed with mobile device.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
        if ($location != 'postbar') {
            ESSBOptionsStructureHelper::field_switch_panel($tab_id, $menu_id, $location . '_native_deactivate', __('Deactivate native buttons', ESSB3_TEXT_DOMAIN), __('Activate this option if you wish to deactivate native buttons for that display method.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
            if (!$post_type) {
                ESSBOptionsStructureHelper::field_switch_panel($tab_id, $menu_id, $location . '_text_deactivate', __('Hide message above, before or below', ESSB3_TEXT_DOMAIN), __('Activate this option if you wish to hide message above, before or below for that display.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
            }
        }
        ESSBOptionsStructureHelper::field_section_end_full_panels($tab_id, $menu_id);
    }
    if ($location == 'mobile') {
        ESSBOptionsStructureHelper::field_checkbox_list_sortable($tab_id, $menu_id, $location . '_networks', __('Change active social networks', ESSB3_TEXT_DOMAIN), __('Do not select anything if you wish to use default network list', ESSB3_TEXT_DOMAIN), $checkbox_list_networks);
    }
    if (!$post_type) {
        ESSBOptionsStructureHelper::field_heading($tab_id, $menu_id, 'heading2', __('Change default button options for that display location', ESSB3_TEXT_DOMAIN));
    } else {
        ESSBOptionsStructureHelper::field_heading($tab_id, $menu_id, 'heading2', __('Change default button options for that post type', ESSB3_TEXT_DOMAIN));
    }
    ESSBOptionsStructureHelper::field_switch($tab_id, $menu_id, $location . '_activate', __('I wish to personalize global button settings', ESSB3_TEXT_DOMAIN), __('Activate this option to apply personalized settings for that display location. That will overwrite the global. <br/><span class="essb-user-notice">After switching option to <b>Yes</b> press <b>Update Settings</b> button and advanced configuration fields will appear.</span>', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
    //print "Location = ".$location.', result = '.ESSBOptionValuesHelper::options_bool_value($essb_options, $location.'_activate');
    $are_active_settings = ESSBOptionValuesHelper::options_bool_value($essb_options, $location . '_activate');
    if (!$are_active_settings) {
        return;
    }
    if ($location != 'postbar') {
        ESSBOptionsStructureHelper::field_heading($tab_id, $menu_id, 'heading4', __('Visual Changes', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Set button style', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_button_style', __('Buttons Style', ESSB3_TEXT_DOMAIN), __('Select your button display style.', ESSB3_TEXT_DOMAIN), essb_avaiable_button_style());
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_button_pos', __('Buttons Align', ESSB3_TEXT_DOMAIN), __('Choose how buttons
			to be aligned. Default position is left but you can also select
			Right or Center', ESSB3_TEXT_DOMAIN), array("" => "Left", "center" => "Center", "right" => "Right"));
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_template', __('Template', ESSB3_TEXT_DOMAIN), __('Select your template for that display location.', ESSB3_TEXT_DOMAIN), essb_available_tempaltes());
        ESSBOptionsStructureHelper::field_switch($tab_id, $menu_id, $location . '_nospace', __('Remove spacing between buttons', ESSB3_TEXT_DOMAIN), __('Activate this option to remove default space between share buttons.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
        $more_options = array("plus" => "Plus icon", "dots" => "Dots icon");
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_more_button_icon', __('More button icon', ESSB3_TEXT_DOMAIN), __('Select more button icon style. You can choose from default + symbol or dots symbol', ESSB3_TEXT_DOMAIN), $more_options);
        $more_options = array("" => "Default function", "1" => "Display all active networks after more button", "2" => "Display all social networks as pop up", "3" => "Display only active social networks as pop up");
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_more_button_func', __('More button function', ESSB3_TEXT_DOMAIN), __('Select networks that you wish to appear in your list. With drag and drop you can rearrange them.', ESSB3_TEXT_DOMAIN), $more_options);
        $animations_container = array();
        $animations_container[""] = "Default value from settings";
        foreach (essb_available_animations() as $key => $text) {
            if ($key != '') {
                $animations_container[$key] = $text;
            } else {
                $animations_container['no'] = 'No amination';
            }
        }
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_css_animations', __('Activate animations', ESSB3_TEXT_DOMAIN), __('Animations
			are provided with CSS transitions and work on best with retina
			templates.', ESSB3_TEXT_DOMAIN), $animations_container);
        ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
        ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Counter settings', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_switch($tab_id, $menu_id, $location . '_show_counter', __('Display counter of sharing', ESSB3_TEXT_DOMAIN), __('Activate display of share counters.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_counter_pos', __('Position of counters', ESSB3_TEXT_DOMAIN), __('Choose your default button counter position', ESSB3_TEXT_DOMAIN), essb_avaliable_counter_positions());
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_total_counter_pos', __('Position of total counter', ESSB3_TEXT_DOMAIN), __('For vertical display methods left means before buttons (top) and right means after buttons (bottom).', ESSB3_TEXT_DOMAIN), essb_avaiable_total_counter_position());
        ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
        ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Set button width', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_button_width', __('Width of buttons'), __('Choose between automatic width, pre defined width or display in columns.'), array('' => 'Automatic Width', 'fixed' => 'Fixed Width', 'full' => 'Full Width', "column" => "Display in columns"));
        ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Fixed width share buttons', ESSB3_TEXT_DOMAIN), __('Customize the fixed width options', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_textbox($tab_id, $menu_id, $location . '_fixed_width_value', __('Custom buttons width', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), '', 'input60', 'fa-arrows-h', 'right');
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_fixed_width_align', __('Choose alignment of network name', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), array("" => "Center", "left" => "Left", "right" => "Right"));
        ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
        ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Full width share buttons', ESSB3_TEXT_DOMAIN), __('Full width option will make buttons to take the width of your post content area.', ESSB3_TEXT_DOMAIN));
        ESSBOptionsStructureHelper::field_textbox($tab_id, $menu_id, $location . '_fullwidth_share_buttons_correction', __('Max width of button on desktop', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), '', 'input60', 'fa-arrows-h', 'right');
        ESSBOptionsStructureHelper::field_textbox($tab_id, $menu_id, $location . '_fullwidth_share_buttons_correction_mobile', __('Max width of button on mobile', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), '', 'input60', 'fa-arrows-h', 'right');
        ESSBOptionsStructureHelper::field_textbox($tab_id, $menu_id, $location . '_fullwidth_share_buttons_container', __('Max width of buttons container element', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), '', 'input60', 'fa-arrows-h', 'right');
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_fullwidth_align', __('Choose alignment of network name', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), array("left" => "Left", "center" => "Center", "right" => "Right"));
        ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
        ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Display in columns', ESSB3_TEXT_DOMAIN), '');
        $listOfOptions = array("1" => "1", "2" => "2", "3" => "3", "4" => "4", "5" => "5");
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_fullwidth_share_buttons_columns', __('Number of columns', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), $listOfOptions);
        ESSBOptionsStructureHelper::field_select($tab_id, $menu_id, $location . '_fullwidth_share_buttons_columns_align', __('Choose alignment of network name', ESSB3_TEXT_DOMAIN), __('', ESSB3_TEXT_DOMAIN), array("" => "Left", "center" => "Center", "right" => "Right"));
        ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
        ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
    }
    //ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Personalize social networks', ESSB3_TEXT_DOMAIN), '');
    ESSBOptionsStructureHelper::field_heading($tab_id, $menu_id, 'heading4', __('Personalize social networks', ESSB3_TEXT_DOMAIN));
    if ($location != 'mobile') {
        ESSBOptionsStructureHelper::field_checkbox_list_sortable($tab_id, $menu_id, $location . '_networks', __('Change active social networks', ESSB3_TEXT_DOMAIN), __('Do not select anything if you wish to use default network list' . ESSB3_TEXT_DOMAIN), $checkbox_list_networks);
    }
    ESSBOptionsStructureHelper::field_section_start($tab_id, $menu_id, __('Rename displayed texts for network names', ESSB3_TEXT_DOMAIN), __('Set texts that will appear on selected display method instead of default network names. Use dash (-) if you wish to remove text for that network name.', ESSB3_TEXT_DOMAIN));
    foreach ($checkbox_list_networks as $key => $text) {
        ESSBOptionsStructureHelper::field_textbox_stretched($tab_id, $menu_id, $location . '_' . $key . '_name', $text, '');
    }
    ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
    //ESSBOptionsStructureHelper::field_section_end($tab_id, $menu_id);
}