Esempio n. 1
0
function et_fb_backend_helpers()
{
    global $post, $paged;
    $layout_type = '';
    $post_type = isset($post->post_type) ? $post->post_type : false;
    $post_id = isset($post->ID) ? $post->ID : false;
    $post_status = isset($post->post_status) ? $post->post_status : false;
    if ('et_pb_layout' === $post_type) {
        $layout_type = et_fb_get_layout_type($post_id);
    }
    $google_fonts = array_merge(array('Default' => array()), et_builder_get_google_fonts());
    $current_user = wp_get_current_user();
    $current_url = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $export_url = add_query_arg(array('et_core_portability' => true, 'context' => 'et_builder', 'name' => 'temp_name', 'nonce' => wp_create_nonce('et_core_portability_nonce')), admin_url());
    $fb_modules_array = apply_filters('et_fb_modules_array', ET_Builder_Element::get_modules_array($post_type, true, true));
    $helpers = array('debug' => true, 'postId' => $post_id, 'postStatus' => $post_status, 'postType' => $post_type, 'layoutType' => $layout_type, 'publishCapability' => is_page() && !current_user_can('publish_pages') || !is_page() && !current_user_can('publish_posts') ? 'no_publish' : 'publish', 'shortcodeObject' => array(), 'ajaxUrl' => admin_url('admin-ajax.php'), 'tinymceSkinUrl' => ET_FB_ASSETS_URI . '/vendors/tinymce-skin', 'tinymceCSSFiles' => esc_url(includes_url('js/tinymce') . '/skins/wordpress/wp-content.css'), 'images_uri' => ET_BUILDER_URI . '/images', 'generalFields' => array(), 'advancedFields' => array(), 'customCssFields' => array(), 'moduleParentShortcodes' => ET_Builder_Element::get_parent_shortcodes($post_type), 'moduleChildShortcodes' => ET_Builder_Element::get_child_shortcodes($post_type), 'moduleChildSlugs' => ET_Builder_Element::get_child_slugs($post_type), 'moduleRawContentShortcodes' => ET_Builder_Element::get_raw_content_shortcodes($post_type), 'modules' => $fb_modules_array, 'modulesCount' => count($fb_modules_array), 'modulesWithChildren' => ET_Builder_Element::get_shortcodes_with_children($post_type), 'structureModules' => ET_Builder_Element::get_structure_modules($post_type), 'et_builder_css_media_queries' => ET_Builder_Element::get_media_quries('for_js'), 'commentsModuleMarkup' => et_fb_get_comments_markup(), 'shortcode_tags' => et_fb_shortcode_tags(), 'getFontIconSymbols' => et_pb_get_font_icon_symbols(), 'failureNotification' => et_builder_get_failure_notification_modal(), 'exitNotification' => et_builder_get_exit_notification_modal(), 'getTaxonomies' => apply_filters('et_fb_taxonomies', array('category' => get_categories(), 'project_category' => get_categories(array('taxonomy' => 'project_category')), 'product_category' => class_exists('WooCommerce') ? get_terms('product_cat') : '')), 'googleAPIKey' => et_pb_is_allowed('theme_options') ? get_option('et_google_api_settings') : '', 'googleFontsList' => array_keys($google_fonts), 'googleFonts' => $google_fonts, 'gutterWidth' => et_get_option('gutter_width', 3), 'fontIcons' => et_pb_get_font_icon_symbols(), 'fontIconsDown' => et_pb_get_font_down_icon_symbols(), 'widgetAreas' => et_builder_get_widget_areas_list(), 'site_url' => get_site_url(), 'etBuilderAccentColor' => et_builder_accent_color(), 'gmt_offset_string' => et_pb_get_gmt_offset_string(), 'et_builder_fonts_data' => et_builder_get_fonts(), 'currentUserDisplayName' => $current_user->display_name, 'locale' => get_locale(), 'roleSettings' => et_pb_get_role_settings(), 'currentRole' => et_pb_get_current_user_role(), 'exportUrl' => $export_url, 'urls' => array('loginFormUrl' => esc_url(site_url('wp-login.php', 'login_post')), 'forgotPasswordUrl' => esc_url(wp_lostpassword_url()), 'logoutUrl' => esc_url(wp_logout_url()), 'logoutUrlRedirect' => esc_url(wp_logout_url($current_url)), 'themeOptionsUrl' => esc_url(et_pb_get_options_page_link()), 'builderPreviewStyle' => ET_BUILDER_URI . '/styles/preview.css'), 'nonces' => array('moduleContactFormSubmit' => wp_create_nonce('et-pb-contact-form-submit'), 'et_admin_load' => wp_create_nonce('et_admin_load_nonce'), 'computedProperty' => wp_create_nonce('et_pb_process_computed_property_nonce'), 'renderShortcode' => wp_create_nonce('et_pb_render_shortcode_nonce'), 'backendHelper' => wp_create_nonce('et_fb_backend_helper_nonce'), 'renderSave' => wp_create_nonce('et_fb_save_nonce'), 'prepareShortcode' => wp_create_nonce('et_fb_prepare_shortcode_nonce'), 'processImportedData' => wp_create_nonce('et_fb_process_imported_data_nonce'), 'retrieveLibraryModules' => wp_create_nonce('et_fb_retrieve_library_modules_nonce'), 'saveLibraryModules' => wp_create_nonce('et_fb_save_library_modules_nonce'), 'preview' => wp_create_nonce('et_pb_preview_nonce')), 'conditionalTags' => et_fb_conditional_tag_params(), 'currentPage' => et_fb_current_page_params(), 'appPreferences' => et_fb_app_preferences(), 'classNames' => array('hide_on_mobile_class' => 'et-hide-mobile'), 'columnLayouts' => et_builder_get_columns(), 'pageSettingsFields' => et_pb_get_builder_settings_configurations(), 'pageSettingsValues' => et_pb_get_builder_settings_values(), 'splitTestSubjects' => false !== ($all_subjects_raw = get_post_meta($post_id, '_et_pb_ab_subjects', true)) ? explode(',', $all_subjects_raw) : array(), 'defaults' => array('contactFormInputs' => et_fb_process_shortcode(sprintf('[et_pb_contact_field field_title="%1$s" field_type="input" field_id="Name" required_mark="on" fullwidth_field="off" /][et_pb_contact_field field_title="%2$s" field_type="email" field_id="Email" required_mark="on" fullwidth_field="off" /][et_pb_contact_field field_title="%3$s" field_type="text" field_id="Message" required_mark="on" fullwidth_field="on" /]', esc_attr__('Name', 'et_builder'), esc_attr__('Email Address', 'et_builder'), esc_attr__('Message', 'et_builder')))), 'all_modules_default_attrs' => ET_Builder_Element::get_all_modules_default_fields($post_type), 'saveModuleLibraryCategories' => et_fb_prepare_library_cats(), 'columnSettingFields' => array('advanced' => array('bg_img_%s' => array('label' => esc_html__('Column %s Background Image', 'et_builder'), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => esc_attr__('Upload an image', 'et_builder'), 'choose_text' => esc_attr__('Choose a Background Image', 'et_builder'), 'update_text' => esc_attr__('Set As Background', 'et_builder'), 'description' => esc_html__('If defined, this image will be used as the background for this module. To remove a background image, simply delete the URL from the settings field.', 'et_builder'), 'tab_slug' => 'advanced'), 'parallax_%s' => array('label' => esc_html__('Column %s Parallax Effect', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array('on' => esc_html__('Yes', 'et_builder'), 'off' => esc_html__('No', 'et_builder')), 'affects' => array('parallax_method_%s'), 'description' => esc_html__('Here you can choose whether or not use parallax effect for the featured image', 'et_builder'), 'tab_slug' => 'advanced'), 'parallax_method_%s' => array('label' => esc_html__('Column %s Parallax Method', 'et_builder'), 'type' => 'select', 'option_category' => 'configuration', 'options' => array('off' => esc_html__('CSS', 'et_builder'), 'on' => esc_html__('True Parallax', 'et_builder')), 'depends_show_if' => 'on', 'depends_to' => array('parallax_%s'), 'description' => esc_html__('Here you can choose which parallax method to use for the featured image', 'et_builder'), 'tab_slug' => 'advanced'), 'background_color_%s' => array('label' => esc_html__('Column %s Background Color', 'et_builder'), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced'), 'padding_%s' => array('label' => esc_html__('Column %s Custom Padding', 'et_builder'), 'type' => 'custom_padding', 'mobile_options' => true, 'option_category' => 'layout', 'description' => esc_html__('Adjust padding to specific values, or leave blank to use the default padding.', 'et_builder'), 'tab_slug' => 'advanced')), 'css' => array('module_id_%s' => array('label' => esc_html__('Column %s CSS ID', 'et_builder'), 'type' => 'text', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'option_class' => 'et_pb_custom_css_regular'), 'module_class_%s' => array('label' => esc_html__('Column %s CSS Class', 'et_builder'), 'type' => 'text', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'option_class' => 'et_pb_custom_css_regular'), 'custom_css_before_%s' => array('label' => esc_html__('Column %s before', 'et_builder'), 'no_space_before_selector' => true, 'selector' => ':before'), 'custom_css_main_%s' => array('label' => esc_html__('Column %s Main Element', 'et_builder')), 'custom_css_after_%s' => array('label' => esc_html__('Column %s After', 'et_builder'), 'no_space_before_selector' => true, 'selector' => ':after'))));
    // Internationalization.
    $helpers['i18n'] = array('modules' => array('audio' => array('meta' => _x('by <strong>%1$s</strong>', 'Audio Module meta information', 'et_builder')), 'contactForm' => array('thankYou' => esc_html__('Thanks for contacting us', 'et_builder'), 'submit' => esc_attr__('Submit', 'et_builder')), 'countdownTimer' => array('dayFull' => esc_html__('Day(s)', 'et_builder'), 'dayShort' => esc_html__('Day', 'et_builder'), 'hourFull' => esc_html__('Hour(s)', 'et_builder'), 'hourShort' => esc_html__('Hrs', 'et_builder'), 'minuteFull' => esc_html__('Minute(s)', 'et_builder'), 'minuteShort' => esc_html__('Min', 'et_builder'), 'secondFull' => esc_html__('Second(s)', 'et_builder'), 'secondShort' => esc_html__('Sec', 'et_builder')), 'signup' => array('emailAddress' => esc_attr__('Email Address', 'et_builder'), 'firstName' => esc_attr__('First Name', 'et_builder'), 'lastName' => esc_attr__('Last Name', 'et_builder'), 'name' => esc_attr__('Name', 'et_builder'), 'email' => esc_attr__('Email', 'et_builder')), 'filterablePortfolio' => array('all' => esc_html__('All', 'et_builder')), 'login' => array('loginAs' => sprintf(esc_html__('Login as %s', 'et_builder'), $current_user->display_name), 'login' => esc_html__('Login', 'et_builder'), 'logout' => esc_html__('Log out', 'et_builder'), 'forgotPassword' => esc_html__('Forgot your password?', 'et_builder'), 'username' => esc_html__('Username', 'et_builder'), 'password' => esc_html__('Password', 'et_builder')), 'search' => array('submitButtonText' => esc_html__('Search', 'et_builder'), 'searchfor' => esc_html__('Search for:', 'et_builder')), 'fullwidthPostSlider' => array('by' => esc_html('by ', 'et_builder'))), 'saveButtonText' => esc_attr__('Save', 'et_builder'), 'saveDraftButtonText' => esc_attr__('Save Draft', 'et_builder'), 'publishButtonText' => is_page() && !current_user_can('publish_pages') || !is_page() && !current_user_can('publish_posts') ? esc_attr__('Submit', 'et_builder') : esc_attr__('Publish', 'et_builder'), 'controls' => array('tinymce' => array('visual' => esc_html__('Visual', 'et_builder'), 'text' => esc_html__('Text', 'et_builder')), 'moduleItem' => array('addNew' => esc_html__('Add New Item', 'et_builder')), 'upload' => array('buttonText' => esc_html__('Upload', 'et_builder')), 'insertMedia' => array('buttonText' => esc_html__('Add Media', 'et_builder'), 'modalTitleText' => esc_html__('Insert Media', 'et_builder')), 'inputMargin' => array('top' => esc_html__('Top', 'et_builder'), 'right' => esc_html__('Right', 'et_builder'), 'bottom' => esc_html__('Bottom', 'et_builder'), 'left' => esc_html__('Left', 'et_builder')), 'colorpicker' => array('clear' => esc_html__('Clear', 'et_builder')), 'uploadGallery' => array('uploadButtonText' => esc_html__('Update Gallery', 'et_builder')), 'centerMap' => array('updateMapButtonText' => esc_html__('Find', 'et_builder'), 'geoCodeError' => esc_html__('Geocode was not successful for the following reason', 'et_builder'), 'geoCodeError_2' => esc_html__('Geocoder failed due to', 'et_builder'), 'noResults' => esc_html__('No results found', 'et_builder'), 'mapPinAddressInvalid' => esc_html__('Invalid Pin and address data. Please try again.', 'et_builder')), 'tabs' => array('general' => esc_html__('General', 'et_builder'), 'design' => esc_html__('Design', 'et_builder'), 'css' => esc_html__('CSS', 'et_builder')), 'additionalButton' => array('changeApiKey' => esc_html__('Change API Key', 'et_builder'), 'generateImageUrlFromVideo' => esc_html__('Generate From Video', 'et_builder'))), 'rightClickMenuItems' => array('undo' => esc_html__('Undo', 'et_builder'), 'redo' => esc_html__('Redo', 'et_builder'), 'lock' => esc_html__('Lock', 'et_builder'), 'unlock' => esc_html__('Unlock', 'et_builder'), 'copy' => esc_html__('Copy', 'et_builder'), 'paste' => esc_html__('Paste', 'et_builder'), 'copyStyle' => esc_html__('Copy Style', 'et_builder'), 'pasteStyle' => esc_html__('Paste Style', 'et_builder'), 'disable' => esc_html__('Disable', 'et_builder'), 'enable' => esc_html__('Enable', 'et_builder'), 'save' => esc_html__('Save to Library', 'et_builder'), 'moduleType' => array('module' => esc_html__('Module', 'et_builder'), 'row' => esc_html__('Row', 'et_builder'), 'section' => esc_html__('Section', 'et_builder')), 'disableGlobal' => esc_html__('Disable Global', 'et_builder')), 'tooltips' => array('insertModule' => esc_html__('Insert Module', 'et_builder'), 'insertColumn' => esc_html__('Insert Columns', 'et_builder'), 'insertSection' => esc_html__('Insert Section', 'et_builder'), 'insertRow' => esc_html__('Insert Row', 'et_builder'), 'newModule' => esc_html__('New Module', 'et_builder'), 'newRow' => esc_html__('New Row', 'et_builder'), 'newSection' => esc_html__('New Section', 'et_builder'), 'addFromLibrary' => esc_html__('Add From Library', 'et_builder'), 'addToLibrary' => esc_html__('Add to Library', 'et_builder'), 'loading' => esc_html__('loading...', 'et_builder'), 'regular' => esc_html__('Regular', 'et_builder'), 'fullwidth' => esc_html__('Fullwidth', 'et_builder'), 'specialty' => esc_html__('Specialty', 'et_builder'), 'changeRow' => esc_html__('Choose Layout', 'et_builder'), 'clearLayout' => esc_html__('Clear Layout', 'et_builder'), 'clearLayoutText' => esc_html__('All of your current page content will be lost. Do you wish to proceed?', 'et_builder'), 'yes' => esc_html__('Yes', 'et_builder'), 'loadLayout' => esc_html__('Load From Library', 'et_builder'), 'predefinedLayout' => esc_html__('Predefined Layouts', 'et_builder'), 'replaceLayout' => esc_html__('Replace existing content.', 'et_builder'), 'search' => esc_html__('Search', 'et_builder') . '...', 'portability' => esc_html__('Portability', 'et_builder'), 'export' => esc_html__('Export', 'et_builder'), 'import' => esc_html__('Import', 'et_builder'), 'exportText' => esc_html__('Exporting your Divi Builder Layout will create a JSON file that can be imported into a different website.', 'et_builder'), 'exportName' => esc_html__('Export File Name', 'et_builder'), 'exportButton' => esc_html__('Export Divi Builder Layout', 'et_builder'), 'importText' => esc_html__('Importing a previously-exported Divi Builder Layout file will overwrite all content currently on this page.', 'et_builder'), 'importField' => esc_html__('Select File To Import', 'et_builder'), 'importBackUp' => esc_html__('Download backup before importing', 'et_builder'), 'importButton' => esc_html__('Import Divi Builder Layout', 'et_builder'), 'noFile' => esc_html__('No File Selected', 'et_builder'), 'chooseFile' => esc_html__('Choose File', 'et_builder')), 'saveModuleLibraryAttrs' => array('general' => esc_html__('Include General Settings', 'et_builder'), 'advanced' => esc_html__('Include Advanced Design Settings', 'et_builder'), 'css' => esc_html__('Include Custom CSS', 'et_builder'), 'selectCategoriesText' => esc_html__('Select category(ies) for new template or type a new name ( optional )', 'et_builder'), 'templateName' => esc_html__('Template Name', 'et_builder'), 'selectiveSync' => esc_html__('Selective Sync', 'et_builder'), 'selectiveError' => esc_html__('Please select at least 1 tab to save', 'et_builder'), 'globalTitle' => esc_html__('Save as Global', 'et_builder'), 'globalText' => esc_html__('Make this a global item', 'et_builder'), 'createCatText' => esc_html__('Create New Category', 'et_builder'), 'addToCatText' => esc_html__('Add To Categories', 'et_builder'), 'descriptionText' => esc_html__('Here you can add the current item to your Divi Library for later use.', 'et_builder'), 'descriptionTextLayout' => esc_html__('Save your current page to the Divi Library for later use.', 'et_builder'), 'saveText' => esc_html__('Save to Library', 'et_builder'), 'allCategoriesText' => esc_html__('All Categories', 'et_builder')), 'modals' => array('tabItemTitles' => array('general' => esc_html__('General', 'et_builder'), 'design' => esc_html__('Design', 'et_builder'), 'css' => esc_html__('CSS', 'et_builder')), 'pageSettings' => array('title' => esc_html__('Page Settings', 'et_builder'))), 'history' => array('modal' => array('title' => esc_html__('Editing History', 'et_builder'), 'tabs' => array('states' => esc_html__('History States', 'et_builder'))), 'meta' => et_pb_history_localization()), 'help' => array('modal' => array('title' => esc_html__('Divi Builder Helper', 'et_builder'), 'tabs' => array('shortcut' => esc_html__('Shortcuts', 'et_builder'))), 'shortcuts' => array('page_title' => esc_html__('Page Shortcuts', 'et_builder'), 'page' => array('undo' => array('kbd' => array('super', 'z'), 'desc' => esc_html__('Undo', 'et_builder')), 'redo' => array('kbd' => array('super', 'y'), 'desc' => esc_html__('Redo', 'et_builder')), 'save' => array('kbd' => array('super', 's'), 'desc' => esc_html__('Save Page', 'et_builder')), 'save_as_draft' => array('kbd' => array('super', 'shift', 's'), 'desc' => esc_html__('Save Page As Draft', 'et_builder')), 'exit' => array('kbd' => array('super', 'e'), 'desc' => esc_html__('Exit Visual Builder', 'et_builder')), 'exit_to_backend_builder' => array('kbd' => array('super', 'shift', 'e'), 'desc' => esc_html__('Exit To Backend Builder', 'et_builder')), 'toggle_settings_bar' => array('kbd' => array('t'), 'desc' => esc_html__('Toggle Settings Bar', 'et_builder')), 'open_page_settings' => array('kbd' => array('o'), 'desc' => esc_html__('Open Page Settings', 'et_builder')), 'open_history' => array('kbd' => array('h'), 'desc' => esc_html__('Open History Window', 'et_builder')), 'open_portability' => array('kbd' => array('p'), 'desc' => esc_html__('Open Portability Window', 'et_builder')), 'zoom_in' => array('kbd' => array('super', '+'), 'desc' => esc_html__('Responsive Zoom In', 'et_builder')), 'zoom_out' => array('kbd' => array('super', '-'), 'desc' => esc_html__('Responsive Zoom Out', 'et_builder')), 'help' => array('kbd' => array('?'), 'desc' => esc_html__('List All Shortcuts', 'et_builder'))), 'inline_title' => esc_html__('Inline Editor Shortcuts', 'et_builder'), 'inline' => array('escape' => array('kbd' => array('esc'), 'desc' => esc_html__('Exit Inline Editor', 'et_builder'))), 'module_title' => esc_html__('Module Shortcuts', 'et_builder'), 'module' => array('module_copy' => array('kbd' => array('super', 'c'), 'desc' => esc_html__('Copy Module', 'et_builder')), 'module_cut' => array('kbd' => array('super', 'x'), 'desc' => esc_html__('Cut Module', 'et_builder')), 'module_paste' => array('kbd' => array('super', 'v'), 'desc' => esc_html__('Paste Module', 'et_builder')), 'module_copy_styles' => array('kbd' => array('super', 'alt', 'c'), 'desc' => esc_html__('Copy Module Styles', 'et_builder')), 'module_paste_styles' => array('kbd' => array('super', 'alt', 'v'), 'desc' => esc_html__('Paste Module Styles', 'et_builder')), 'module_lock' => array('kbd' => array('l'), 'desc' => esc_html__('Lock Module', 'et_builder')), 'module_disable' => array('kbd' => array('d'), 'desc' => esc_html__('Disable Module', 'et_builder')), 'drag_auto_copy' => array('kbd' => array('alt', 'module move'), 'desc' => esc_html__('Move and copy module into dropped location', 'et_builder')), 'column_change_structure' => array('kbd' => array('c', array('1', '2', '3', '4')), 'desc' => esc_html__('Change Column Structure', 'et_builder')), 'row_make_fullwidth' => array('kbd' => array('r', 'f'), 'desc' => esc_html__('Make Row Fullwidth', 'et_builder')), 'row_edit_gutter' => array('kbd' => array('g', array('1', '2', '3', '4')), 'desc' => esc_html__('Change Gutter Width', 'et_builder')), 'add_new_row' => array('kbd' => array('r', array('1', '2', '3', '4')), 'desc' => esc_html__('Add New Row', 'et_builder')), 'add_new_section' => array('kbd' => array('s', array('1', '2', '3')), 'desc' => esc_html__('Add New Section', 'et_builder')), 'resize_padding_auto_opposite' => array('kbd' => array('shift', 'Drag Padding'), 'desc' => esc_html__('Restrict padding to 10px increments', 'et_builder')), 'resize_padding_limited' => array('kbd' => array('alt', 'Drag Padding'), 'desc' => esc_html__('Padding limited to opposing value', 'et_builder')), 'resize_padding_10' => array('kbd' => array('shift', 'alt', 'Drag Padding'), 'desc' => esc_html__('Mirror padding on both sides', 'et_builder')), 'increase_padding_row' => array('kbd' => array('r', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Row Padding', 'et_builder')), 'decrease_padding_row' => array('kbd' => array('r', 'alt', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Row Padding', 'et_builder')), 'increase_padding_section' => array('kbd' => array('s', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Section Padding', 'et_builder')), 'decrease_padding_section' => array('kbd' => array('s', 'alt', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Section Padding', 'et_builder')), 'increase_padding_row_10' => array('kbd' => array('r', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Row Padding By 10px', 'et_builder')), 'decrease_padding_row_10' => array('kbd' => array('r', 'alt', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Row Padding By 10px', 'et_builder')), 'increase_padding_section_10' => array('kbd' => array('s', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Section Padding By 10px', 'et_builder')), 'decrease_padding_section_10' => array('kbd' => array('s', 'alt', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Section Padding By 10px', 'et_builder'))), 'modal_title' => esc_html__('Modal Shortcuts', 'et_builder'), 'modal' => array('escape' => array('kbd' => array('esc'), 'desc' => esc_html__('Close Modal', 'et_builder')), 'save_changes' => array('kbd' => array('enter'), 'desc' => esc_html__('Save Changes', 'et_builder')), 'undo' => array('kbd' => array('super', 'z'), 'desc' => esc_html__('Undo', 'et_builder')), 'redo' => array('kbd' => array('super', 'shift', 'z'), 'desc' => esc_html__('Redo', 'et_builder')), 'switch_tabs' => array('kbd' => array('shift', 'tab'), 'desc' => esc_html__('Switch Tabs', 'et_builder')), 'toggle_expand' => array('kbd' => array('super', 'enter'), 'desc' => esc_html__('Expand Modal Fullscreen', 'et_builder')), 'toggle_snap' => array('kbd' => array('super', array('left', 'right')), 'desc' => esc_html__('Snap Modal Left / Right', 'et_builder'))))), 'sortable' => array('has_no_ab_permission' => esc_html__('You do not have permission to edit the module, row or section in this split test.', 'et_builder'), 'cannot_move_goal_into_subject' => esc_html__('A split testing goal cannot be moved inside of a split testing subject. To perform this action you must first end your split test.', 'et_builder'), 'cannot_move_subject_into_goal' => esc_html__('A split testing subject cannot be moved inside of a split testing goal. To perform this action you must first end your split test.', 'et_builder'), 'cannot_move_row_goal_out_from_subject' => esc_html__('Once set, a goal that has been placed inside a split testing subject cannot be moved outside the split testing subject. You can end your split test and start a new one if you would like to make this change.', 'et_builder'), 'section_only_row_dragged_away' => esc_html__('The section should have at least one row.', 'et_builder'), 'global_module_alert' => esc_html__('You cannot add global modules into global sections or rows', 'et_builder'), 'cannot_move_module_goal_out_from_subject' => esc_html__('Once set, a goal that has been placed inside a split testing subject cannot be moved outside the split testing subject. You can end your split test and start a new one if you would like to make this change.', 'et_builder'), 'stop_dropping_3_col_row' => esc_html__('3 column row can\'t be used in this column.', 'et_builder')), 'tooltip' => array('pageSettingsBar' => array('responsive' => array('zoom' => esc_html__('Zoom Out', 'et_builder'), 'desktop' => esc_html__('Desktop View', 'et_builder'), 'tablet' => esc_html__('Tablet View', 'et_builder'), 'phone' => esc_html__('Phone View', 'et_builder')), 'main' => array('loadLibrary' => esc_html__('Load From Library', 'et_builder'), 'saveToLibrary' => esc_html__('Save To Library', 'et_builder'), 'clearLayout' => esc_html__('Clear Layout', 'et_builder'), 'pageSettingsModal' => esc_html__('Page Settings', 'et_builder'), 'history' => esc_html__('Editing History', 'et_builder'), 'portability' => esc_html__('Portability', 'et_builder'), 'open' => esc_html__('Expand Settings', 'et_builder'), 'close' => esc_html__('Collapse Settings', 'et_builder')), 'save' => array('saveDraft' => esc_html__('Save as Draft', 'et_builder'), 'save' => esc_html__('Save', 'et_builder'), 'publish' => esc_html__('Publish', 'et_builder'))), 'modal' => array('expandModal' => esc_html__('Expand Modal', 'et_builder'), 'contractModal' => esc_html__('Contract Modal', 'et_builder'), 'resize' => esc_html__('Resize Modal', 'et_builder'), 'snapModal' => esc_html__('Snap to Left', 'et_builder'), 'separateModal' => esc_html__('Separate Modal', 'et_builder'), 'redo' => esc_html__('Redo', 'et_builder'), 'undo' => esc_html__('Undo', 'et_builder'), 'cancel' => esc_html__('Discard All Changes', 'et_builder'), 'save' => esc_html__('Save Changes', 'et_builder')), 'inlineEditor' => array('back' => esc_html__('Go Back', 'et_builder'), 'increaseFontSize' => esc_html__('Decrease Font Size', 'et_builder'), 'decreaseFontSize' => esc_html__('Increase Font Size', 'et_builder'), 'bold' => esc_html__('Bold Text', 'et_builder'), 'italic' => esc_html__('Italic Text', 'et_builder'), 'underline' => esc_html__('Underline Text', 'et_builder'), 'link' => esc_html__('Insert Link', 'et_builder'), 'quote' => esc_html__('Insert Quote', 'et_builder'), 'alignment' => esc_html__('Text Alignment', 'et_builder'), 'centerText' => esc_html__('Center Text', 'et_builder'), 'rightText' => esc_html__('Right Text', 'et_builder'), 'leftText' => esc_html__('Left Text', 'et_builder'), 'justifyText' => esc_html__('Justify Text', 'et_builder'), 'list' => esc_html__('List Settings', 'et_builder'), 'indent' => esc_html__('Indent List', 'et_builder'), 'undent' => esc_html__('Undent List', 'et_builder'), 'orderedList' => esc_html__('Insert Ordered List', 'et_builder'), 'unOrderedList' => esc_html__('Insert Unordered List', 'et_builder'), 'text' => esc_html__('Text Settings', 'et_builder'), 'textColor' => esc_html__('Text Color', 'et_builder'), 'heading' => array('one' => esc_html__('Insert Heading One', 'et_builder'), 'two' => esc_html__('Insert Heading Two', 'et_builder'), 'three' => esc_html__('Insert Heading Three', 'et_builder'), 'four' => esc_html__('Insert Heading Four', 'et_builder'))), 'section' => array('tab' => array('move' => esc_html__('Move Section', 'et_builder'), 'settings' => esc_html__('Section Settings', 'et_builder'), 'duplicate' => esc_html__('Duplicate Section', 'et_builder'), 'addToLibrary' => esc_html__('Save Section To Library', 'et_builder'), 'delete' => esc_html__('Delete Section', 'et_builder')), 'addButton' => esc_html__('Add New Section', 'et_builder')), 'row' => array('tab' => array('move' => esc_html__('Move Row', 'et_builder'), 'settings' => esc_html__('Row Settings', 'et_builder'), 'duplicate' => esc_html__('Duplicate Row', 'et_builder'), 'addToLibrary' => esc_html__('Save Row To Library', 'et_builder'), 'delete' => esc_html__('Delete Row', 'et_builder'), 'update' => esc_html__('Change Column Structure', 'et_builder')), 'addButton' => esc_html__('Add New Row', 'et_builder')), 'module' => array('tab' => array('move' => esc_html__('Move Module', 'et_builder'), 'settings' => esc_html__('Module Settings', 'et_builder'), 'duplicate' => esc_html__('Duplicate Module', 'et_builder'), 'addToLibrary' => esc_html__('Save Module To Library', 'et_builder'), 'delete' => esc_html__('Delete Module', 'et_builder')), 'addButton' => esc_html__('Add New Module', 'et_builder'))), 'unsavedConfirmation' => esc_html__('Unsaved changes will be lost if you leave the Divi Builder at this time.', 'et_builder'), 'libraryLoadError' => esc_html__('Error loading Library items from server. Please refresh the page and try again.', 'et_builder'));
    // Pass helpers via localization.
    wp_localize_script('et-frontend-builder', 'ETBuilderBackend', $helpers);
}
Esempio n. 2
0
function et_pb_pagebuilder_meta_box()
{
    global $typenow, $post;
    do_action('et_pb_before_page_builder');
    echo '<div id="et_pb_hidden_editor">';
    wp_editor('', 'et_pb_content_new', array('media_buttons' => true, 'tinymce' => array('wp_autoresize_on' => true)));
    echo '</div>';
    printf('<div id="et_pb_main_container" class="post-type-%1$s%2$s"></div>', esc_attr($typenow), !et_pb_is_allowed('move_module') ? ' et-pb-disable-sort' : '');
    $rename_module_menu = sprintf('<%% if ( this.hasOption( "rename" ) ) { %%>
			<li><a class="et-pb-right-click-rename" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Rename', 'et_builder'));
    $copy_module_menu = sprintf('<%% if ( this.hasOption( "copy" ) ) { %%>
			<li><a class="et-pb-right-click-copy" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Copy', 'et_builder'));
    $paste_after_menu = sprintf('<%% if ( this.hasOption( "paste-after" ) ) { %%>
			<li><a class="et-pb-right-click-paste-after" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Paste After', 'et_builder'));
    $paste_menu_item = sprintf('<%% if ( this.hasOption( "paste-column" ) ) { %%>
			<li><a class="et-pb-right-click-paste-column" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Paste', 'et_builder'));
    $paste_app_menu_item = sprintf('<%% if ( this.hasOption( "paste-app" ) ) { %%>
			<li><a class="et-pb-right-click-paste-app" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Paste', 'et_builder'));
    $save_to_lib_menu = sprintf('<%% if ( this.hasOption( "save-to-library") ) { %%>
			<li><a class="et-pb-right-click-save-to-library" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Save to Library', 'et_builder'));
    $lock_unlock_menu = sprintf('<%% if ( this.hasOption( "lock" ) ) { %%>
			<li><a class="et-pb-right-click-lock" href="#"><span class="unlock">%1$s</span><span class="lock">%2$s</span></a></li>
		<%% } %%>', esc_html__('Unlock', 'et_builder'), esc_html__('Lock', 'et_builder'));
    $enable_disable_menu = sprintf('<%% if ( this.hasOption( "disable" ) ) { %%>
			<li><a class="et-pb-right-click-disable" href="#"><span class="enable">%1$s</span><span class="disable">%2$s</span></a>
				<span class="et_pb_disable_on_options"><span class="et_pb_disable_on_option et_pb_disable_on_phone"></span><span class="et_pb_disable_on_option et_pb_disable_on_tablet"></span><span class="et_pb_disable_on_option et_pb_disable_on_desktop"></span></span>
			</li>
		<%% } %%>', esc_html__('Enable', 'et_builder'), esc_html__('Disable', 'et_builder'));
    $start_ab_testing_menu = sprintf('<%% if ( this.hasOption( "start-ab-testing") ) { %%>
			<li><a class="et-pb-right-click-start-ab-testing" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Split Test', 'et_builder'));
    $end_ab_testing_menu = sprintf('<%% if ( this.hasOption( "end-ab-testing") ) { %%>
			<li><a class="et-pb-right-click-end-ab-testing" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('End Split Test', 'et_builder'));
    $disable_global_menu = sprintf('<%% if ( this.hasOption( "disable-global") ) { %%>
			<li><a class="et-pb-right-click-disable-global" href="#">%1$s</a></li>
		<%% } %%>', esc_html__('Disable Global', 'et_builder'));
    // Right click options Template
    printf('<script type="text/template" id="et-builder-right-click-controls-template">
		<ul class="options">
			<%% if ( "module" !== this.options.model.attributes.type || _.contains( %13$s, this.options.model.attributes.module_type ) ) { %%>
				%1$s

				%15$s

				%16$s

				%17$s

				%8$s

				<%% if ( this.hasOption( "undo" ) ) { %%>
				<li><a class="et-pb-right-click-undo" href="#">%9$s</a></li>
				<%% } %%>

				<%% if ( this.hasOption( "redo" ) ) { %%>
				<li><a class="et-pb-right-click-redo" href="#">%10$s</a></li>
				<%% } %%>

				%2$s

				%3$s

				<%% if ( this.hasOption( "collapse" ) ) { %%>
				<li><a class="et-pb-right-click-collapse" href="#"><span class="expand">%4$s</span><span class="collapse">%5$s</span></a></li>
				<%% } %%>

				%6$s

				%7$s

				%12$s

				%11$s

			<%% } %%>

			<%% if ( this.hasOption( "preview" ) ) { %%>
			<li><a class="et-pb-right-click-preview" href="#">%14$s</a></li>
			<%% } %%>
		</ul>
		</script>', et_pb_is_allowed('edit_module') && (et_pb_is_allowed('general_settings') || et_pb_is_allowed('advanced_settings') || et_pb_is_allowed('custom_css_settings')) ? $rename_module_menu : '', et_pb_is_allowed('disable_module') ? $enable_disable_menu : '', et_pb_is_allowed('lock_module') ? $lock_unlock_menu : '', esc_html__('Expand', 'et_builder'), esc_html__('Collapse', 'et_builder'), et_pb_is_allowed('add_module') ? $copy_module_menu : '', et_pb_is_allowed('add_module') ? $paste_after_menu : '', et_pb_is_allowed('divi_library') && et_pb_is_allowed('save_library') ? $save_to_lib_menu : '', esc_html__('Undo', 'et_builder'), esc_html__('Redo', 'et_builder'), et_pb_is_allowed('add_module') ? $paste_menu_item : '', et_pb_is_allowed('add_module') ? $paste_app_menu_item : '', et_pb_allowed_modules_list(), esc_html__('Preview', 'et_builder'), et_pb_is_allowed('ab_testing') ? $start_ab_testing_menu : '', et_pb_is_allowed('ab_testing') ? $end_ab_testing_menu : '', et_pb_is_allowed('edit_module') && et_pb_is_allowed('edit_global_library') ? $disable_global_menu : '');
    // "Rename Module Admin Label" Modal Window Template
    printf('<script type="text/template" id="et-builder-prompt-modal-rename_admin_label">
			<div class="et_pb_prompt_modal">
				<a href="#" class="et_pb_prompt_dont_proceed et-pb-modal-close">
					<span>%1$s</span>
				</a>
				<div class="et_pb_prompt_buttons">
					<br/>
					<input type="submit" class="et_pb_prompt_proceed" value="%2$s" />
				</div>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'), esc_attr__('Save', 'et_builder'));
    // "Rename Module Admin Label" Modal Content Template
    printf('<script type="text/template" id="et-builder-prompt-modal-rename_admin_label-text">
			<h3>%1$s</h3>
			<p>%2$s</p>

			<input type="text" value="" id="et_pb_new_admin_label" class="regular-text" />
		</script>', esc_html__('Rename', 'et_builder'), esc_html__('Enter a new name for this module', 'et_builder'));
    // Builder's Main Buttons
    $save_to_lib_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-save" title="%1$s">
			<span>%2$s</span>
		</a>', esc_attr__('Save to Library', 'et_builder'), esc_html__('Save to Library', 'et_builder'));
    $load_from_lib_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-load" title="%1$s">
			<span>%2$s</span>
		</a>', esc_attr__('Load From Library', 'et_builder'), esc_html__('Load From Library', 'et_builder'));
    $clear_layout_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-clear" title="%1$s">
			<span>%2$s</span>
		</a>', esc_attr__('Clear Layout', 'et_builder'), esc_html__('Clear Layout', 'et_builder'));
    // Builder's History Buttons
    $history_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-history" title="%1$s">
			<span class="icon"></span><span class="label">%2$s</span>
		</a>', esc_attr__('See History', 'et_builder'), esc_html__('See History', 'et_builder'));
    $redo_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-redo" title="%1$s">
			<span class="icon"></span><span class="label">%2$s</span>
		</a>', esc_attr__('Redo', 'et_builder'), esc_html__('Redo', 'et_builder'));
    $undo_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-undo" title="%1$s">
			<span class="icon"></span><span class="label">%2$s</span>
		</a>', esc_attr__('Undo', 'et_builder'), esc_html__('Undo', 'et_builder'));
    // App View Stats Button
    $view_ab_stats_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-view-ab-stats" title="%1$s">
			<span class="icon"></span><span class="label">%2$s</span>
		</a>', esc_attr__('View Stats', 'et_builder'), esc_html__('View Stats', 'et_builder'));
    // App Settings Button
    $settings_button = sprintf('<a href="#" class="et-pb-layout-buttons et-pb-layout-buttons-settings" title="%1$s">
			<span class="icon"></span><span class="label">%2$s</span>
		</a>', esc_attr__('Settings', 'et_builder'), esc_html__('Settings', 'et_builder'));
    // App Template
    printf('<script type="text/template" id="et-builder-app-template">
			<div id="et_pb_layout_controls">
				%1$s
				%2$s
				%3$s
				%4$s
				%5$s
				%6$s
				%7$s
				%8$s
			</div>
			<div id="et-pb-histories-visualizer-overlay"></div>
			<ol id="et-pb-histories-visualizer"></ol>
		</script>', et_pb_is_allowed('divi_library') && et_pb_is_allowed('save_library') ? $save_to_lib_button : '', et_pb_is_allowed('divi_library') && et_pb_is_allowed('load_layout') && et_pb_is_allowed('add_library') && et_pb_is_allowed('add_module') ? $load_from_lib_button : '', et_pb_is_allowed('add_module') ? $clear_layout_button : '', $history_button, $redo_button, $undo_button, $view_ab_stats_button, $settings_button);
    // App Settings Buttons Template
    $builder_button_ab_testing_conditional = '( typeof et_pb_ab_goal === "undefined" || et_pb_ab_goal === "off" || typeof et_pb_ab_subject !== "undefined" )';
    $is_ab_active = isset($post->ID) && 'on' === get_post_meta($post->ID, '_et_pb_use_ab_testing', true);
    $view_stats_active_class = $is_ab_active ? 'active' : '';
    $view_stats_button = sprintf('<a href="#" class="et-pb-app-view-ab-stats-button %1$s" title="%2$s">
			<span class="icon">
				<object type="image/svg+xml" data="%3$s/images/stats.svg"></object>
			</span>
			<span class="label">%2$s</span>
		</a>', esc_attr($view_stats_active_class), esc_attr__('View Split Testing Stats', 'et_builder'), esc_url(ET_BUILDER_URI));
    $portability_class = 'et-pb-app-portability-button';
    if ($is_ab_active) {
        $portability_class .= ' et-core-disabled';
    }
    printf('<script type="text/template" id="et-builder-app-settings-button-template">
			<a href="#" class="et-pb-app-settings-button" title="%1$s">
				<span class="icon">
					<object type="image/svg+xml" data="%5$s/images/menu.svg"></object>
				</span>
				<span class="label">%2$s</span>
			</a>
			%3$s
			%4$s
		</script>', esc_attr__('Settings', 'et_builder'), esc_html__('Settings', 'et_builder'), et_core_portability_link('et_builder', array('class' => $portability_class)), et_pb_is_allowed('ab_testing') ? $view_stats_button : '', esc_url(ET_BUILDER_URI));
    $section_settings_button = sprintf('<%% if ( ( typeof et_pb_template_type === \'undefined\' || \'section\' === et_pb_template_type || \'\' === et_pb_template_type )%3$s ) { %%>
			<a href="#" class="et-pb-settings et-pb-settings-section" title="%1$s"><span>%2$s</span></a>
		<%% } %%>', esc_attr__('Settings', 'et_builder'), esc_html__('Settings', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? ' && typeof et_pb_global_module === "undefined"' : '');
    $section_clone_button = sprintf('%3$s
			<a href="#" class="et-pb-clone et-pb-clone-section" title="%1$s"><span>%2$s</span></a>
		%4$s', esc_attr__('Clone Section', 'et_builder'), esc_html__('Clone Section', 'et_builder'), '<% if ( ' . $builder_button_ab_testing_conditional . ' ) { %>', '<% } %>');
    $section_remove_button = sprintf('%3$s
			<a href="#" class="et-pb-remove et-pb-remove-section" title="%1$s"><span>%2$s</span></a>
		%4$s', esc_attr__('Delete Section', 'et_builder'), esc_html__('Delete Section', 'et_builder'), '<% if ( ' . $builder_button_ab_testing_conditional . ' ) { %>', '<% } %>');
    $section_unlock_button = sprintf('<a href="#" class="et-pb-unlock" title="%1$s"><span>%2$s</span></a>', esc_attr__('Unlock Section', 'et_builder'), esc_html__('Unlock Section', 'et_builder'));
    // Section Template
    $settings_controls = sprintf('<div class="et-pb-controls">
			%1$s

			<%% if ( typeof et_pb_template_type === \'undefined\' || ( \'section\' !== et_pb_template_type && \'row\' !== et_pb_template_type && \'module\' !== et_pb_template_type ) ) { %%>
				%2$s
				%3$s
			<%% } %%>

			<a href="#" class="et-pb-expand" title="%4$s"><span>%5$s</span></a>
			%6$s
		</div>', et_pb_is_allowed('edit_module') && (et_pb_is_allowed('general_settings') || et_pb_is_allowed('advanced_settings') || et_pb_is_allowed('custom_css_settings')) ? $section_settings_button : '', et_pb_is_allowed('add_module') ? $section_clone_button : '', et_pb_is_allowed('add_module') ? $section_remove_button : '', esc_attr__('Expand Section', 'et_builder'), esc_html__('Expand Section', 'et_builder'), et_pb_is_allowed('lock_module') ? $section_unlock_button : '');
    $add_from_lib_section = sprintf('<span class="et-pb-section-add-saved">%1$s</span>', esc_html__('Add From Library', 'et_builder'));
    $add_standard_section_button = sprintf('<span class="et-pb-section-add-main">%1$s</span>', esc_html__('Standard Section', 'et_builder'));
    $add_standard_section_button = apply_filters('et_builder_add_main_section_button', $add_standard_section_button);
    $add_fullwidth_section_button = sprintf('<span class="et-pb-section-add-fullwidth">%1$s</span>', esc_html__('Fullwidth Section', 'et_builder'));
    $add_fullwidth_section_button = apply_filters('et_builder_add_fullwidth_section_button', $add_fullwidth_section_button);
    $add_specialty_section_button = sprintf('<span class="et-pb-section-add-specialty">%1$s</span>', esc_html__('Specialty Section', 'et_builder'));
    $add_specialty_section_button = apply_filters('et_builder_add_specialty_section_button', $add_specialty_section_button);
    $settings_add_controls = sprintf('<%% if ( typeof et_pb_template_type === \'undefined\' || ( \'section\' !== et_pb_template_type && \'row\' !== et_pb_template_type && \'module\' !== et_pb_template_type ) ) { %%>
			<a href="#" class="et-pb-section-add">
				%1$s
				%2$s
				%3$s
				%4$s
			</a>
		<%% } %%>', $add_standard_section_button, $add_fullwidth_section_button, $add_specialty_section_button, et_pb_is_allowed('divi_library') && et_pb_is_allowed('add_library') ? $add_from_lib_section : '');
    printf('<script type="text/template" id="et-builder-section-template">
			<div class="et-pb-right-click-trigger-overlay"></div>
			%1$s
			<div class="et-pb-section-content et-pb-data-cid%3$s%4$s" data-cid="<%%= cid %%>" data-skip="<%%= typeof( et_pb_skip_module ) === \'undefined\' ? \'false\' : \'true\' %%>">
			</div>
			%2$s
			<div class="et-pb-locked-overlay et-pb-locked-overlay-section"></div>
			<span class="et-pb-section-title"><%%= admin_label.replace( /%%22/g, "&quot;" ) %%></span>
		</script>', apply_filters('et_builder_section_settings_controls', $settings_controls), et_pb_is_allowed('add_module') ? apply_filters('et_builder_section_add_controls', $settings_add_controls) : '', !et_pb_is_allowed('move_module') ? ' et-pb-disable-sort' : '', !et_pb_is_allowed('edit_global_library') ? sprintf('<%%= typeof et_pb_global_module !== \'undefined\' ? \' et-pb-disable-sort\' : \'\' %%>') : '');
    $row_settings_button = sprintf('<%% if ( ( typeof et_pb_template_type === \'undefined\' || et_pb_template_type !== \'module\' )%3$s ) { %%>
			<a href="#" class="et-pb-settings et-pb-settings-row" title="%1$s"><span>%2$s</span></a>
		<%% } %%>', esc_attr__('Settings', 'et_builder'), esc_html__('Settings', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? ' && ( typeof et_pb_global_module === "undefined" || "" === et_pb_global_module ) && ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent )' : '');
    $row_clone_button = sprintf('%3$s
			<a href="#" class="et-pb-clone et-pb-clone-row" title="%1$s"><span>%2$s</span></a>
		%4$s', esc_attr__('Clone Row', 'et_builder'), esc_html__('Clone Row', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? '<% if ( ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent ) && ' . $builder_button_ab_testing_conditional . ' ) { %>' : '<% if ( ' . $builder_button_ab_testing_conditional . ' ) { %>', '<% } %>');
    $row_remove_button = sprintf('%3$s
			<a href="#" class="et-pb-remove et-pb-remove-row" title="%1$s"><span>%2$s</span></a>
		%4$s', esc_attr__('Delete Row', 'et_builder'), esc_html__('Delete Row', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? '<% if ( ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent  ) && ' . $builder_button_ab_testing_conditional . ') { %>' : '<% if ( ' . $builder_button_ab_testing_conditional . ' ) { %>', '<% } %>');
    $row_change_structure_button = sprintf('%3$s
			<a href="#" class="et-pb-change-structure" title="%1$s"><span>%2$s</span></a>
		%4$s', esc_attr__('Change Structure', 'et_builder'), esc_html__('Change Structure', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? '<% if ( ( typeof et_pb_global_module === "undefined" || "" === et_pb_global_module ) && ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent ) ) { %>' : '', !et_pb_is_allowed('edit_global_library') ? '<% } %>' : '');
    $row_unlock_button = sprintf('<a href="#" class="et-pb-unlock" title="%1$s"><span>%2$s</span></a>', esc_attr__('Unlock Row', 'et_builder'), esc_html__('Unlock Row', 'et_builder'));
    // Row Template
    $settings = sprintf('<div class="et-pb-controls">
			%1$s
		<%% if ( typeof et_pb_template_type === \'undefined\' || \'section\' === et_pb_template_type ) { %%>
			%2$s
		<%% }

		if ( typeof et_pb_template_type === \'undefined\' || et_pb_template_type !== \'module\' ) { %%>
			%4$s
		<%% }

		if ( typeof et_pb_template_type === \'undefined\' || \'section\' === et_pb_template_type ) { %%>
			%3$s
		<%% } %%>

		<a href="#" class="et-pb-expand" title="%5$s"><span>%6$s</span></a>
		%7$s
		</div>', et_pb_is_allowed('edit_module') && (et_pb_is_allowed('general_settings') || et_pb_is_allowed('advanced_settings') || et_pb_is_allowed('custom_css_settings')) ? $row_settings_button : '', et_pb_is_allowed('add_module') ? $row_clone_button : '', et_pb_is_allowed('add_module') ? $row_remove_button : '', et_pb_is_allowed('edit_module') && (et_pb_is_allowed('general_settings') || et_pb_is_allowed('advanced_settings') || et_pb_is_allowed('custom_css_settings')) ? $row_change_structure_button : '', esc_attr__('Expand Row', 'et_builder'), esc_html__('Expand Row', 'et_builder'), et_pb_is_allowed('lock_module') ? $row_unlock_button : '');
    $row_class = sprintf('class="et-pb-row-content et-pb-data-cid%1$s%2$s <%%= typeof et_pb_template_type !== \'undefined\' && \'module\' === et_pb_template_type ? \' et_pb_hide_insert\' : \'\' %%>"', !et_pb_is_allowed('move_module') ? ' et-pb-disable-sort' : '', !et_pb_is_allowed('edit_global_library') ? sprintf('<%%= typeof et_pb_global_parent !== \'undefined\' || typeof et_pb_global_module !== \'undefined\' ? \' et-pb-disable-sort\' : \'\' %%>') : '');
    $data_skip = 'data-skip="<%= typeof( et_pb_skip_module ) === \'undefined\' ? \'false\' : \'true\' %>"';
    $add_row_button = sprintf('<%% if ( ( typeof et_pb_template_type === \'undefined\' || \'section\' === et_pb_template_type )%2$s ) { %%>
			<a href="#" class="et-pb-row-add">
				<span>%1$s</span>
			</a>
		<%% } %%>', esc_html__('Add Row', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? ' && typeof et_pb_global_parent === "undefined"' : '');
    $insert_column_button = sprintf('<a href="#" class="et-pb-insert-column">
			<span>%1$s</span>
		</a>', esc_html__('Insert Column(s)', 'et_builder'));
    printf('<script type="text/template" id="et-builder-row-template">
			<div class="et-pb-right-click-trigger-overlay"></div>
			%1$s
			<div data-cid="<%%= cid %%>" %2$s %3$s>
				<div class="et-pb-row-container"></div>
				%4$s
			</div>
			%5$s
			<div class="et-pb-locked-overlay et-pb-locked-overlay-row"></div>
			<span class="et-pb-row-title"><%%= admin_label.replace( /%%22/g, "&quot;" ) %%></span>
		</script>', apply_filters('et_builder_row_settings_controls', $settings), $row_class, $data_skip, et_pb_is_allowed('add_module') ? $insert_column_button : '', et_pb_is_allowed('add_module') ? $add_row_button : '');
    // Module Block Template
    $clone_button = sprintf('<%% if ( ( typeof et_pb_template_type === \'undefined\' || et_pb_template_type !== \'module\' )%3$s && _.contains(%4$s, module_type) && ' . $builder_button_ab_testing_conditional . ' ) { %%>
			<a href="#" class="et-pb-clone et-pb-clone-module" title="%1$s">
				<span>%2$s</span>
			</a>
		<%% } %%>', esc_attr__('Clone Module', 'et_builder'), esc_html__('Clone Module', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? ' &&  ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent )' : '', et_pb_allowed_modules_list());
    $remove_button = sprintf('<%% if ( ( typeof et_pb_template_type === \'undefined\' || et_pb_template_type !== \'module\' )%3$s && _.contains(%4$s, module_type) && ' . $builder_button_ab_testing_conditional . ' ) { %%>
			<a href="#" class="et-pb-remove et-pb-remove-module" title="%1$s">
				<span>%2$s</span>
			</a>
		<%% } %%>', esc_attr__('Remove Module', 'et_builder'), esc_html__('Remove Module', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? ' &&  ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent )' : '', et_pb_allowed_modules_list());
    $unlock_button = sprintf('<%% if ( typeof et_pb_template_type === \'undefined\' || et_pb_template_type !== \'module\' ) { %%>
			<a href="#" class="et-pb-unlock" title="%1$s">
				<span>%2$s</span>
			</a>
		<%% } %%>', esc_html__('Unlock Module', 'et_builder'), esc_attr__('Unlock Module', 'et_builder'));
    $settings_button = sprintf('<%% if (%3$s _.contains( %4$s, module_type ) ) { %%>
			<a href="#" class="et-pb-settings" title="%1$s">
				<span>%2$s</span>
			</a>
		<%% } %%>', esc_attr__('Module Settings', 'et_builder'), esc_html__('Module Settings', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? ' ( typeof et_pb_global_parent === "undefined" || "" === et_pb_global_parent ) && ( typeof et_pb_global_module === "undefined" || "" === et_pb_global_module ) &&' : '', et_pb_allowed_modules_list());
    printf('<script type="text/template" id="et-builder-block-module-template">
			%1$s
			%2$s
			%3$s
			%4$s
			<span class="et-pb-module-title"><%%= admin_label.replace( /%%22/g, "&quot;" ) %%></span>
		</script>', et_pb_is_allowed('edit_module') && (et_pb_is_allowed('general_settings') || et_pb_is_allowed('advanced_settings') || et_pb_is_allowed('custom_css_settings')) ? $settings_button : '', et_pb_is_allowed('add_module') ? $clone_button : '', et_pb_is_allowed('add_module') ? $remove_button : '', et_pb_is_allowed('lock_module') ? $unlock_button : '');
    // Modal Template
    $save_exit_button = sprintf('<a href="#" class="et-pb-modal-save button button-primary">
			<span>%1$s</span>
		</a>', esc_html__('Save & Exit', 'et_builder'));
    $save_template_button = sprintf('<%% if ( typeof et_pb_template_type === \'undefined\' || \'\' === et_pb_template_type ) { %%>
			<a href="#" class="et-pb-modal-save-template button">
				<span>%1$s</span>
			</a>
		<%% } %%>', esc_html__('Save & Add To Library', 'et_builder'));
    $preview_template_button = sprintf('<a href="#" class="et-pb-modal-preview-template button">
			<span class="icon"></span>
			<span class="label">%1$s</span>
		</a>', esc_html__('Preview', 'et_builder'));
    $can_edit_or_has_modal_view_tab = et_pb_is_allowed('edit_module') && (et_pb_is_allowed('general_settings') || et_pb_is_allowed('advanced_settings') || et_pb_is_allowed('custom_css_settings'));
    printf('<script type="text/template" id="et-builder-modal-template">
			<div class="et-pb-modal-container%6$s">

				<a href="#" class="et-pb-modal-close">
					<span>%1$s</span>
				</a>

			<%% if ( ! ( typeof open_view !== \'undefined\' && open_view === \'column_specialty_settings\' ) && typeof type !== \'undefined\' && ( type === \'module\' || type === \'section\' || type === \'row_inner\' || ( type === \'row\' && typeof open_view === \'undefined\' ) ) ) { %%>
				<div class="et-pb-modal-bottom-container%4$s">
					%2$s
					%5$s
					%3$s
				</div>
			<%% } %%>

			</div>
		</script>', esc_html__('Cancel', 'et_builder'), et_pb_is_allowed('divi_library') && et_pb_is_allowed('save_library') ? $save_template_button : '', $can_edit_or_has_modal_view_tab ? $save_exit_button : '', !et_pb_is_allowed('divi_library') || !et_pb_is_allowed('save_library') ? ' et_pb_single_button' : '', $preview_template_button, $can_edit_or_has_modal_view_tab ? '' : ' et_pb_no_editing');
    // Column Settings Template
    $columns_number = '<% if ( view.model.attributes.specialty_columns === 3 ) { %>
			3
		<% } else { %>
			2
		<% } %>';
    $data_specialty_columns = sprintf('<%% if ( typeof view !== \'undefined\' && typeof view.model.attributes.specialty_columns !== \'undefined\' ) { %%>
			data-specialty_columns="%1$s"
		<%% } %%>', $columns_number);
    $saved_row_tab = sprintf('<li class="et-pb-saved-module" data-open_tab="et-pb-saved-modules-tab">
			<a href="#">%1$s</a>
		</li>', esc_html__('Add From Library', 'et_builder'));
    $saved_row_container = '<% if ( ( typeof change_structure === \'undefined\' || \'true\' !== change_structure ) && ( typeof et_pb_specialty === \'undefined\' || et_pb_specialty !== \'on\' ) ) { %>
								<div class="et-pb-main-settings et-pb-main-settings-full et-pb-saved-modules-tab"></div>
							<% } %>';
    printf('<script type="text/template" id="et-builder-column-settings-template">

			<h3 class="et-pb-settings-heading" data-current_row="<%%= cid %%>">%1$s</h3>

		<%% if ( ( typeof change_structure === \'undefined\' || \'true\' !== change_structure ) && ( typeof et_pb_specialty === \'undefined\' || et_pb_specialty !== \'on\' ) ) { %%>
			<ul class="et-pb-options-tabs-links et-pb-saved-modules-switcher" %2$s>
				<li class="et-pb-saved-module et-pb-options-tabs-links-active" data-open_tab="et-pb-new-modules-tab" data-content_loaded="true">
					<a href="#">%3$s</a>
				</li>
				%4$s
			</ul>
		<%% } %%>

			<div class="et-pb-main-settings et-pb-main-settings-full et-pb-new-modules-tab active-container">
				<ul class="et-pb-column-layouts">
					%5$s
				</ul>
			</div>

			%6$s

		</script>', esc_html__('Insert Columns', 'et_builder'), $data_specialty_columns, esc_html__('New Row', 'et_builder'), et_pb_is_allowed('divi_library') && et_pb_is_allowed('add_library') ? $saved_row_tab : '', et_builder_get_columns_layout(), et_pb_is_allowed('divi_library') && et_pb_is_allowed('add_library') ? $saved_row_container : '');
    // "Add Module" Template
    $fullwidth_class = '<% if ( typeof module.fullwidth_only !== \'undefined\' && module.fullwidth_only === \'on\' ) { %> et_pb_fullwidth_only_module<% } %>';
    $saved_modules_tab = sprintf('<li class="et-pb-saved-module" data-open_tab="et-pb-saved-modules-tab">
			<a href="#">%1$s</a>
		</li>', esc_html__('Add From Library', 'et_builder'));
    $saved_modules_container = '<div class="et-pb-main-settings et-pb-main-settings-full et-pb-saved-modules-tab"></div>';
    printf('<script type="text/template" id="et-builder-modules-template">
			<h3 class="et-pb-settings-heading">%1$s</h3>

			<ul class="et-pb-options-tabs-links et-pb-saved-modules-switcher">
				<li class="et-pb-new-module et-pb-options-tabs-links-active" data-open_tab="et-pb-all-modules-tab">
					<a href="#">%2$s</a>
				</li>

				%3$s
			</ul>

			<div class="et-pb-main-settings et-pb-main-settings-full et-pb-all-modules-tab active-container">
				<ul class="et-pb-all-modules">
				<%% _.each(modules, function(module) { %%>
					<%% if ( "et_pb_row" !== module.label && "et_pb_section" !== module.label && "et_pb_column" !== module.label && "et_pb_row_inner" !== module.label && _.contains(%6$s, module.label ) ) { %%>
						<li class="<%%= module.label %%>%4$s">
							<span class="et_module_title"><%%= module.title %%></span>
						</li>
					<%% } %%>
				<%% }); %%>
				</ul>
			</div>

			%5$s
		</script>', esc_html__('Insert Module', 'et_builder'), esc_html__('New Module', 'et_builder'), et_pb_is_allowed('divi_library') && et_pb_is_allowed('add_library') ? $saved_modules_tab : '', $fullwidth_class, et_pb_is_allowed('divi_library') && et_pb_is_allowed('add_library') ? $saved_modules_container : '', et_pb_allowed_modules_list());
    // Load Layout Template
    printf('<script type="text/template" id="et-builder-load_layout-template">
			<h3 class="et-pb-settings-heading">%1$s</h3>

		<%% if ( typeof display_switcher !== \'undefined\' && display_switcher === \'on\' ) { %%>
			<ul class="et-pb-options-tabs-links et-pb-saved-modules-switcher">
				<li class="et-pb-new-module et-pb-options-tabs-links-active" data-open_tab="et-pb-all-modules-tab">
					<a href="#">%2$s</a>
				</li>
				<li class="et-pb-saved-module" data-open_tab="et-pb-saved-modules-tab">
					<a href="#">%3$s</a>
				</li>
			</ul>
		<%% } %%>

		<%% if ( typeof display_switcher !== \'undefined\' && display_switcher === \'on\' ) { %%>
			<div class="et-pb-main-settings et-pb-main-settings-full et-pb-all-modules-tab active-container"></div>
			<div class="et-pb-main-settings et-pb-main-settings-full et-pb-saved-modules-tab" style="display: none;"></div>
		<%% } else { %%>
			<div class="et-pb-main-settings et-pb-main-settings-full et-pb-saved-modules-tab active-container"></div>
		<%% } %%>
		</script>', esc_html__('Load Layout', 'et_builder'), esc_html__('Predefined Layouts', 'et_builder'), esc_html__('Add From Library', 'et_builder'));
    $insert_module_button = sprintf('%2$s
		<a href="#" class="et-pb-insert-module<%%= typeof et_pb_template_type === \'undefined\' || \'module\' !== et_pb_template_type ? \'\' : \' et_pb_hidden_button\' %%>">
			<span>%1$s</span>
		</a>
		%3$s', esc_html__('Insert Module(s)', 'et_builder'), !et_pb_is_allowed('edit_global_library') ? '<% if ( typeof et_pb_global_parent === "undefined" ) { %>' : '', !et_pb_is_allowed('edit_global_library') ? '<% } %>' : '');
    // Column Template
    printf('<script type="text/template" id="et-builder-column-template">
			%1$s
		</script>', et_pb_is_allowed('add_module') ? $insert_module_button : '');
    // Advanced Settings Buttons Module
    printf('<script type="text/template" id="et-builder-advanced-setting">
			<a href="#" class="et-pb-advanced-setting-remove">
				<span>%1$s</span>
			</a>

			<a href="#" class="et-pb-advanced-setting-options">
				<span>%2$s</span>
			</a>

			<a href="#" class="et-pb-clone et-pb-advanced-setting-clone">
				<span>%3$s</span>
			</a>
		</script>', esc_html__('Delete', 'et_builder'), esc_html__('Settings', 'et_builder'), esc_html__('Clone Module', 'et_builder'));
    // Advanced Settings Modal Buttons Template
    printf('<script type="text/template" id="et-builder-advanced-setting-edit">
			<div class="et-pb-modal-container">
				<a href="#" class="et-pb-modal-close">
					<span>%1$s</span>
				</a>

				<div class="et-pb-modal-bottom-container">
					<a href="#" class="et-pb-modal-save">
						<span>%2$s</span>
					</a>
				</div>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'), esc_html__('Save', 'et_builder'));
    // "Deactivate Builder" Modal Message Template
    printf('<script type="text/template" id="et-builder-prompt-modal-deactivate_builder-text">
			<h3>%1$s</h3>
			<p>%2$s</p>
			<p>%3$s</p>
		</script>', esc_html__('Disable Builder', 'et_builder'), esc_html__('All content created in the Divi Builder will be lost. Previous content will be restored.', 'et_builder'), esc_html__('Do you wish to proceed?', 'et_builder'));
    // "Clear Layout" Modal Window Template
    printf('<script type="text/template" id="et-builder-prompt-modal-clear_layout-text">
			<h3>%1$s</h3>
			<p>%2$s</p>
			<p>%3$s</p>
		</script>', esc_html__('Clear Layout', 'et_builder'), esc_html__('All of your current page content will be lost.', 'et_builder'), esc_html__('Do you wish to proceed?', 'et_builder'));
    // "Reset Advanced Settings" Modal Template
    printf('<script type="text/template" id="et-builder-prompt-modal-reset_advanced_settings-text">
			<p>%1$s</p>
			<p>%2$s</p>
		</script>', esc_html__('All advanced module settings in will be lost.', 'et_builder'), esc_html__('Do you wish to proceed?', 'et_builder'));
    // "Save Layout" Modal Window Template
    printf('<script type="text/template" id="et-builder-prompt-modal-save_layout">
			<div class="et_pb_prompt_modal">
				<a href="#" class="et_pb_prompt_dont_proceed et-pb-modal-close">
					<span>%1$s</span>
				</a>
				<div class="et_pb_prompt_buttons">
					<br/>
					<input type="submit" class="et_pb_prompt_proceed" value="%2$s" />
				</div>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'), esc_html__('Save', 'et_builder'));
    // "Save Layout" Modal Content Template
    printf('<script type="text/template" id="et-builder-prompt-modal-save_layout-text">
			<h3>%1$s</h3>
			<p>%2$s</p>

			<label>%3$s</label>
			<input type="text" value="" id="et_pb_new_layout_name" class="regular-text" />
		</script>', esc_html__('Save To Library', 'et_builder'), esc_html__('Save your current page to the Divi Library for later use.', 'et_builder'), esc_html__('Layout Name:', 'et_builder'));
    // "Save Template" Modal Window Layout
    printf('<script type="text/template" id="et-builder-prompt-modal-save_template">
			<div class="et_pb_prompt_modal et_pb_prompt_modal_save_library">
				<div class="et_pb_prompt_buttons">
					<br/>
					<input type="submit" class="et_pb_prompt_proceed" value="%1$s" />
				</div>
			</div>
		</script>', esc_attr__('Save And Add To Library', 'et_builder'));
    // "Save Template" Content Layout
    $layout_categories = get_terms('layout_category', array('hide_empty' => false));
    $categories_output = sprintf('<div class="et-pb-option"><label>%1$s</label>', esc_html__('Add To Categories:', 'et_builder'));
    if (is_array($layout_categories) && !empty($layout_categories)) {
        $categories_output .= '<div class="et-pb-option-container layout_cats_container">';
        foreach ($layout_categories as $category) {
            $categories_output .= sprintf('<label>%1$s<input type="checkbox" value="%2$s"/></label>', esc_html($category->name), esc_attr($category->term_id));
        }
        $categories_output .= '</div></div>';
    }
    $categories_output .= sprintf('
		<div class="et-pb-option">
			<label>%1$s:</label>
			<div class="et-pb-option-container">
				<input type="text" value="" id="et_pb_new_cat_name" class="regular-text" />
			</div>
		</div>', esc_html__('Create New Category', 'et_builder'));
    $general_checkbox = sprintf('<label>
			%1$s <input type="checkbox" value="general" id="et_pb_template_general" checked />
		</label>', esc_html__('Include General settings', 'et_builder'));
    $advanced_checkbox = sprintf('<label>
			%1$s <input type="checkbox" value="advanced" id="et_pb_template_advanced" checked />
		</label>', esc_html__('Include Advanced Design settings', 'et_builder'));
    $css_checkbox = sprintf('<label>
			%1$s <input type="checkbox" value="css" id="et_pb_template_css" checked />
		</label>', esc_html__('Include Custom CSS', 'et_builder'));
    printf('<script type="text/template" id="et-builder-prompt-modal-save_template-text">
			<div class="et-pb-main-settings">
				<p>%1$s</p>

				<div class="et-pb-option">
					<label>%2$s:</label>

					<div class="et-pb-option-container">
						<input type="text" value="" id="et_pb_new_template_name" class="regular-text" />
					</div>
				</div>

			<%% if ( \'module\' === module_type ) { %%>
				<div class="et-pb-option">
					<label>%3$s:</label>

					<div class="et-pb-option-container et_pb_select_module_tabs">
						%4$s

						%5$s

						%6$s
						<p class="et_pb_error_message_save_template" style="display: none;">
							%7$s
						</p>
					</div>
				</div>
			<%% } %%>

			<%% if ( \'global\' !== is_global && \'global\' !== is_global_child ) { %%>
				<div class="et-pb-option">
					<label>%8$s</label>

					<div class="et-pb-option-container">
						<label>
							%9$s <input type="checkbox" value="" id="et_pb_template_global" />
						</label>
					</div>
				</div>
			<%% } %%>

				%10$s
			</div>
		</script>', esc_html__('Here you can save the current item and add it to your Divi Library for later use as well.', 'et_builder'), esc_html__('Template Name', 'et_builder'), esc_html__('Selective Sync', 'et_builder'), et_pb_is_allowed('general_settings') ? $general_checkbox : '', et_pb_is_allowed('advanced_settings') ? $advanced_checkbox : '', et_pb_is_allowed('custom_css_settings') ? $css_checkbox : '', esc_html__('Please select at least 1 tab to save', 'et_builder'), esc_html__('Save as Global:', 'et_builder'), esc_html__('Make this a global item', 'et_builder'), $categories_output);
    // Prompt Modal Window Template
    printf('<script type="text/template" id="et-builder-prompt-modal">
			<div class="et_pb_prompt_modal">
				<a href="#" class="et_pb_prompt_dont_proceed et-pb-modal-close">
					<span>%1$s<span>
				</a>

				<div class="et_pb_prompt_buttons">
					<a href="#" class="et_pb_prompt_proceed">%2$s</a>
				</div>
			</div>
		</script>', esc_html__('No', 'et_builder'), esc_html__('Yes', 'et_builder'));
    // "Open Settings" Modal Window Template
    printf('<script type="text/template" id="et-builder-prompt-modal-open_settings">
			<div class="et_pb_prompt_modal">
				<a href="#" class="et_pb_prompt_dont_proceed et-pb-modal-close">
					<span>%1$s</span>
				</a>
				<div class="et_pb_prompt_buttons">
					<br/>
					<input type="submit" class="et_pb_prompt_proceed" value="%2$s" />
				</div>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'), esc_html__('Save', 'et_builder'));
    // "Open Settings" Modal Content Template
    printf('<script type="text/template" id="et-builder-prompt-modal-open_settings-text">
			<h3>%1$s</h3>
			<div class="et_pb_prompt_fields">
			%2$s
			</div><!-- .et_pb_prompt_fields -->
		</script>', esc_html__('Divi Builder Settings', 'et_builder'), et_pb_get_builder_settings_fields(et_pb_get_builder_settings_configurations()));
    /**
     * "Turn off Split Testing" Modal Window Template
     */
    printf('<script type="text/template" id="et-builder-prompt-modal-turn_off_ab_testing">
			<div class="et_pb_prompt_modal">
				<a href="#" class="et_pb_prompt_dont_proceed et-pb-modal-close">
					<span>%1$s</span>
				</a>
				<div class="et_pb_prompt_buttons">
					<br/>
					<input type="submit" class="et_pb_prompt_proceed" value="%2$s" />
				</div>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'), esc_html__('Yes', 'et_builder'));
    // "Turn off Split Testing" Modal Content Template
    printf('<script type="text/template" id="et-builder-prompt-modal-turn_off_ab_testing-text">
			<h3>%1$s</h3>
			<p>%2$s</p>
			<p>%3$s</p>
		</script>', esc_html__('End Split Test?', 'et_builder'), esc_html__('Upon ending your split test, you will be asked to select which subject variation you would like to keep. Remaining subjects will be removed.', 'et_builder'), esc_html__('Note: this process cannot be undone.', 'et_builder'));
    /**
     * Split Testing Alert :: Modal Window Template
     */
    printf('<script type="text/template" id="et-builder-prompt-modal-ab_testing_alert">
			<div class="et_pb_prompt_modal">
				<div class="et_pb_prompt_buttons">
					<br/>
					<input type="submit" class="et_pb_prompt_proceed" value="%1$s" />
				</div>
			</div>
		</script>', esc_html__('Ok', 'et_builder'));
    // Split Testing Alert :: Modal Content Template
    printf('<script type="text/template" id="et-builder-prompt-modal-ab_testing_alert-text">
			<%% if ( ! _.isUndefined( et_pb_ab_js_options[id] ) ) { %%>
				<h3><%%= et_pb_ab_js_options[id].title %%></h3>
				<p><%%= et_pb_ab_js_options[id].desc %%></p>
			<%% } else { %%>
				<h3>%1$s</h3>
				<p>%2$s</p>
			<%% } %%>
		</script>', esc_html__('An Error Occurred', 'et_builder'), esc_html__('For some reason, you cannot perform this task.', 'et_builder'));
    /**
     * Split Testing Alert Yes/No :: Modal Window Template
     */
    printf('<script type="text/template" id="et-builder-prompt-modal-ab_testing_alert_yes_no">
			<div class="et_pb_prompt_modal">
				<div class="et_pb_prompt_buttons">
					<br/>
					<button class="et_pb_prompt_proceed_alternative et_pb_prompt_cancel">%1$s</button>
					<input type="submit" class="et_pb_prompt_proceed has_alternative has_cancel_alternative" value="%2$s" />
				</div>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'), esc_html__('Proceed', 'et_builder'));
    // Split Testing Alert Yes/No :: Modal Content Template
    printf('<script type="text/template" id="et-builder-prompt-modal-ab_testing_alert_yes_no-text">
			<%% if ( ! _.isUndefined( et_pb_ab_js_options[id] ) ) { %%>
				<h3><%%= et_pb_ab_js_options[id].title %%></h3>
				<p><%%= et_pb_ab_js_options[id].desc %%></p>
			<%% } else { %%>
				<h3>%1$s</h3>
				<p>%2$s</p>
			<%% } %%>
		</script>', esc_html__('An Error Occurred', 'et_builder'), esc_html__('For some reason, you cannot perform this task.', 'et_builder'));
    /**
     * Splir Testing :: Set global item winner status
     */
    printf('<script type="text/template" id="et-builder-prompt-modal-set_global_subject_winner">
			<div class="et_pb_prompt_modal">
				<div class="et_pb_prompt_buttons">
					<br/>
					<button class="et_pb_prompt_proceed_alternative">%1$s</button>
					<input type="submit" class="et_pb_prompt_proceed has_alternative" value="%2$s" />
				</div>
			</div>
		</script>', esc_html__('Save as Global Item', 'et_builder'), esc_html__('Save', 'et_builder'));
    // Split Testing :: Set global item winner status template
    printf('<script type="text/template" id="et-builder-prompt-modal-set_global_subject_winner-text">
			<h3>%1$s</h3>
			<p>%2$s</p>
			<ol>
				<li>%3$s</li>
				<li>%4$s</li>
			</ol>
		</script>', esc_html__('Set Winner Status', 'et_builder'), esc_html__('You were using global item as split testing winner. Consequently, you have to choose between:', 'et_builder'), esc_html__('Save winner as global item (selected subject will be synced and your global item will be updated in the Divi Library)', 'et_builder'), esc_html__('Save winner as non-global item (selected subject will no longer be a global item and your changes will not modify the global item)', 'et_builder'));
    /**
     * Split Testing :: View Stats Template
     */
    printf('<script type="text/template" id="et-builder-prompt-modal-view_ab_stats">
			<div class="et_pb_prompt_modal et_pb_ab_view_stats">
				<a href="#" class="et_pb_prompt_dont_proceed et-pb-modal-close">
					<span>%1$s</span>
				</a>
			</div>
		</script>', esc_html__('Cancel', 'et_builder'));
    $view_stats_tabs = "";
    foreach (et_pb_ab_get_analysis_types() as $analysis) {
        $view_stats_tabs .= sprintf('<div class="view-stats-tab tab-%1$s" data-analysis="%1$s">
				<ul class="et-pb-ab-view-stats-time-filter">
					<li><a href="#" data-duration="day">%2$s</a></li>
					<li><a href="#" data-duration="week">%3$s</a></li>
					<li><a href="#" data-duration="month">%4$s</a></li>
					<li><a href="#" data-duration="all">%5$s</a></li>
				</ul><!-- .et-pb-ab-view-stats-time-filter -->

				<ul class="et-pb-ab-view-stats-subjects-filter">
				</ul><!-- .et-pb-ab-view-stats-subjects-filter -->

				<div class="view-stats-main-stats">
					<canvas id="ab-testing-stats-%1$s" class="ab-testing-stats" width="913" height="330"></canvas>
				</div>

				<h2 class="sub-heading">%6$s</h2>
				<div class="view-stats-table-wrapper">
					<table id="view-stats-table-%1$s" class="view-stats-table">
						<thead></thead>
						<tbody></tbody>
						<tfoot></tfoot>
					</table>
				</div><!-- .view-stats-table-wrapper -->
				<div class="view-stats-pie-wrapper">
					<canvas id="ab-testing-stats-pie-%1$s" class="ab-testing-stats-pie" width="200" height="200"></canvas>
					<ul class="ab-testing-stats-pie-legends">
					</ul><!-- .ab-testing-stats-pie-legends -->
				</div><!-- .view-stats-pie-wrapper -->
				<div class="no-stats">
					<span class="icon">
						<object type="image/svg+xml" data="%7$s/images/stats-no-data.svg"></object>
					</span>
					<h2>%8$s</h2>
					<p>%9$s</p>
				</div><!-- .no-stats -->
			</div>', esc_attr($analysis), esc_html__('Last 24 Hours', 'et_builder'), esc_html__('Last 7 Days', 'et_builder'), esc_html__('Last Month', 'et_builder'), esc_html__('All Time', 'et_builder'), esc_html__('Summary &amp; Data', 'et_builder'), esc_url(ET_BUILDER_URI), esc_html__('Statistics are still being collected for this time frame', 'et_builder'), esc_html__('Stats will be displayed upon sufficient data collection', 'et_builder'));
    }
    // Split Testing :: View Stats content
    printf('<script type="text/template" id="et-builder-prompt-modal-view_ab_stats-text">
			<h3>%1$s</h3>
			<ul class="et-pb-options-tabs-links">
				<li class="et_pb_options_tab_ab_stat_conversion et-pb-options-tabs-links-active" data-analysis="conversions">
					<a href="#">%6$s</a>
				</li>
				<li class="et_pb_options_tab_ab_stat_clicks" data-analysis="clicks">
					<a href="#">%2$s</a>
				</li>
				<li class="et_pb_options_tab_ab_stat_reads" data-analysis="reads">
					<a href="#">%3$s</a>
				</li>
				<li class="et_pb_options_tab_ab_stat_bounces" data-analysis="bounces">
					<a href="#">%4$s</a>
				</li>
				<li class="et_pb_options_tab_ab_stat_engagements" data-analysis="engagements">
					<a href="#">%5$s</a>
				</li>
				<li class="et_pb_options_tab_ab_stat_shortcode_conversions" data-analysis="shortcode_conversions">
					<a href="#">%13$s</a>
				</li>
				<li class="et_pb_ab_refresh_button">
					<a href="#" class="et-pb-ab-refresh-stats" title="%11$s">
						<span class="icon"></span><span class="label">%12$s</span>
					</a>
				</li>
			</ul><!-- .et-pb-options-tabs-links -->
			<div class="et-pb-ab-view-stats-content has-data">
				%7$s
			</div>
			<div class="et-pb-ab-view-stats-content no-data">
				<span class="icon">
					<object type="image/svg+xml" data="%8$s/images/stats-no-data.svg"></object>
				</span>
				<h2>%9$s</h2>
				<p>%10$s</p>
			</div>
			<div class="et_pb_prompt_buttons">
				<input type="submit" class="et_pb_prompt_proceed" value="%14$s">
			</div>
		</script>', esc_html__('Split Testing Statistics', 'et_builder'), esc_html__('Clicks', 'et_builder'), esc_html__('Reads', 'et_builder'), esc_html__('Bounces', 'et_builder'), esc_html__('Goal Engagement', 'et_builder'), esc_html__('Conversions', 'et_builder'), $view_stats_tabs, esc_url(ET_BUILDER_URI), esc_html__('Statistics are being collected', 'et_builder'), esc_html__('Stats will be displayed upon sufficient data collection', 'et_builder'), esc_attr__('Refresh Stats', 'et_builder'), esc_html__('Refresh Stats', 'et_builder'), esc_html__('Shortcode Conversions', 'et_builder'), esc_attr__('End Split Test &amp; Pick Winner', 'et_builder'));
    // "Add Specialty Section" Button Template
    printf('<script type="text/template" id="et-builder-add-specialty-section-button">
			<a href="#" class="et-pb-section-add-specialty et-pb-add-specialty-template" data-is_template="true">%1$s</a>
		</script>', esc_html__('Add Specialty Section', 'et_builder'));
    // Saved Entry Template
    echo '<script type="text/template" id="et-builder-saved-entry">
			<a class="et_pb_saved_entry_item"><%= title %></a>
		</script>';
    // Font Icons Template
    printf('<script type="text/template" id="et-builder-google-fonts-options-items">
			%1$s
		</script>', et_builder_get_font_options_items());
    // Font Icons Template
    printf('<script type="text/template" id="et-builder-font-icon-list-items">
			%1$s
		</script>', et_pb_get_font_icon_list_items());
    // Histories Visualizer Item Template
    printf('<script type="text/template" id="et-builder-histories-visualizer-item-template">
			<li id="et-pb-history-<%%= this.options.get( "timestamp" ) %%>" class="<%%= this.options.get( "current_active_history" ) ? "active" : "undo"  %%>" data-timestamp="<%%= this.options.get( "timestamp" )  %%>">
				<span class="datetime"><%%= this.options.get( "datetime" )  %%></span>
				<span class="verb"> <%%= this.getVerb()  %%></span>
				<span class="noun"> <%%= this.getNoun()  %%></span>
				<%% if ( typeof this.getAddition === "function" && "" !== this.getAddition() ) { %%>
					<span class="addition"> <%%= this.getAddition() %%></span>
				<%% } %%>
			</li>
		</script>');
    // Font Down Icons Template
    printf('<script type="text/template" id="et-builder-font-down-icon-list-items">
			%1$s
		</script>', et_pb_get_font_down_icon_list_items());
    printf('<script type="text/template" id="et-builder-preview-icons-template">
			<ul class="et-pb-preview-screensize-switcher">
				<li><a href="#" class="et-pb-preview-mobile" data-width="375"><span class="label">%1$s</span></a></li>
				<li><a href="#" class="et-pb-preview-tablet" data-width="768"><span class="label">%2$s</span></a></li>
				<li><a href="#" class="et-pb-preview-desktop active"><span class="label">%3$s</span></a></li>
			</ul>
		</script>', esc_html__('Mobile', 'et_builder'), esc_html__('Tablet', 'et_builder'), esc_html__('Desktop', 'et_builder'));
    printf('<script type="text/template" id="et-builder-options-tabs-links-template">
			<ul class="et-pb-options-tabs-links">
				<%% _.each(this.et_builder_template_options.tabs.options, function(tab, index) { %%>
					<li class="et_pb_options_tab_<%%= tab.slug %%><%%= \'1\' === index ? \' et-pb-options-tabs-links-active\' : \'\' %%>">
						<a href="#"><%%= tab.label %%></a>
					</li>
				<%% }); %%>
			</ul>
		</script>');
    printf('<script type="text/template" id="et-builder-mobile-options-tabs-template">
			<div class="et_pb_mobile_settings_tabs">
				<a href="#" class="et_pb_mobile_settings_tab et_pb_mobile_settings_active_tab" data-settings_tab="desktop">
					%1$s
				</a>
				<a href="#" class="et_pb_mobile_settings_tab" data-settings_tab="tablet">
					%2$s
				</a>
				<a href="#" class="et_pb_mobile_settings_tab" data-settings_tab="phone">
					%3$s
				</a>
			</div>
		</script>', esc_html__('Desktop', 'et_builder'), esc_html__('Tablet', 'et_builder'), esc_html__('Smartphone', 'et_builder'));
    printf('<script type="text/template" id="et-builder-padding-inputs-template">
			<label>
				<%%= this.et_builder_template_options.padding.options.label %%>
				<input type="text" class="et_custom_margin et_custom_margin_<%%= this.et_builder_template_options.padding.options.side %%><%%= this.et_builder_template_options.padding.options.class %%><%%= \'need_mobile\' === this.et_builder_template_options.padding.options.need_mobile ? \' et_pb_setting_mobile et_pb_setting_mobile_desktop et_pb_setting_mobile_active\' : \'\' %%>"<%%= \'need_mobile\' === this.et_builder_template_options.padding.options.need_mobile ? \' data-device="desktop"\' : \'\' %%> />
				<%% if ( \'need_mobile\' === this.et_builder_template_options.padding.options.need_mobile ) { %%>
					<input type="text" class="et_custom_margin et_pb_setting_mobile et_pb_setting_mobile_tablet et_custom_margin_<%%= this.et_builder_template_options.padding.options.side %%><%%= this.et_builder_template_options.padding.options.class %%>" data-device="tablet" />
					<input type="text" class="et_custom_margin et_pb_setting_mobile et_pb_setting_mobile_phone et_custom_margin_<%%= this.et_builder_template_options.padding.options.side %%><%%= this.et_builder_template_options.padding.options.class %%>" data-device="phone" />
				<%% } %%>
			</label>
		</script>');
    printf('<script type="text/template" id="et-builder-yes-no-button-template">
			<div class="et_pb_yes_no_button et_pb_off_state">
				<span class="et_pb_value_text et_pb_on_value"><%%= this.et_builder_template_options.yes_no_button.options.on %%></span>
				<span class="et_pb_button_slider"></span>
				<span class="et_pb_value_text et_pb_off_value"><%%= this.et_builder_template_options.yes_no_button.options.off %%></span>
			</div>
		</script>');
    printf('<script type="text/template" id="et-builder-font-buttons-option-template">
			<%% _.each(this.et_builder_template_options.font_buttons.options, function(font_button) { %%>
				<div class="et_builder_<%%= font_button %%>_font et_builder_font_style mce-widget mce-btn">
					<button type="button">
						<i class="mce-ico mce-i-<%%= font_button %%>"></i>
					</button>
				</div>
			<%% }); %%>
		</script>');
    printf('<script type="text/template" id="et-builder-failure-notice-template">
			%1$s
		</script>', et_builder_get_failure_notification_modal());
    printf('<script type="text/template" id="et-builder-cache-notice-template">
			%1$s
		</script>', et_builder_get_cache_notification_modal());
    do_action('et_pb_after_page_builder');
}