File manager - Edit - /home/nandedex/public_html/s.nandedexpress.com/better-facebook-chat.zip
Back
PK o��[�U�nM M better-facebook-chat.phpnu �[��� <?php /* Plugin Name: Better Facebook Chat Plugin URI: http://betterstudio.com Description: Integrate Facebook Messenger experience directly into your website. Version: 1.1.1 Author: BetterStudio Author URI: http://betterstudio.com License: GPL2 */ /** * Better_Facebook_Chat class wrapper * * @return Better_Facebook_Chat */ function Better_Facebook_Chat() { return Better_Facebook_Chat::self(); } // Fire up the plugin Better_Facebook_Chat(); /** * Smart Lists Pack Functionality */ class Better_Facebook_Chat { /** * Contains BP version number that used for assets for preventing cache mechanism * * @var string */ public static $version = '1.1.1'; /** * Contains BR option panel id * * @var string */ public static $panel_id = 'better_facebook_chat'; /** * Inner array of instances * * @var array */ protected static $instances = array(); /** * Initialize! */ function __construct() { // make sure following code only one time run static $initialized; if ( $initialized ) { return; } else { $initialized = true; } // Includes functions include $this->dir_path( 'includes/functions.php' ); // Register panel include $this->dir_path( 'includes/options/panel.php' ); // Register included BF to loader add_filter( 'better-framework/loader', array( $this, 'better_framework_loader' ) ); // Enable needed sections add_filter( 'better-framework/sections', array( $this, 'setup_bf_features' ), 50 ); // Initialize after bf init add_action( 'better-framework/after_setup', array( $this, 'bf_init' ) ); // Includes BF loader if not included before include self::dir_path( 'includes/libs/better-framework/init.php' ); add_filter( 'better-framework/oculus/logger/turn-off', array( $this, 'oculus_logger' ), 22, 3 ); add_action( 'wp_footer', array( $this, 'print_template' ) ); } /** * Used for accessing plugin directory URL * * @param string $address * * @return string */ public static function dir_url( $address = '' ) { static $url; if ( is_null( $url ) ) { $url = trailingslashit( plugin_dir_url( __FILE__ ) ); } return $url . ltrim( $address, '/' ); } /** * Used for accessing plugin directory path * * @param string $address * * @return string */ public static function dir_path( $address = '' ) { static $path; if ( is_null( $path ) ) { $path = trailingslashit( plugin_dir_path( __FILE__ ) ); } return $path . ltrim( $address, '/' ); } /** * Returns current version * * @return string */ public static function get_version() { return self::$version; } /** * Used for retrieving options simply and safely for next versions * * @param string $option_key * * @return mixed|null */ public static function get_option( $option_key ) { return bf_get_option( $option_key, self::$panel_id ); } /** * Is chat active or not? * * @return bool */ public function is_active() { return self::get_option( 'chat_enabled' ) && self::get_option( 'facebook_page' ); } /** * Build the required object instance * * @param string $object * @param bool $fresh * @param bool $just_include * * @return self|null */ public static function factory( $object = 'self', $fresh = false, $just_include = false ) { if ( isset( self::$instances[ $object ] ) && ! $fresh ) { return self::$instances[ $object ]; } switch ( $object ) { /** * Main BS_Financial_Pack_Pro Class */ case 'self': $class = 'Better_Facebook_Chat'; break; default: return null; } // Just prepare/includes files if ( $just_include ) { return null; } // don't cache fresh objects if ( $fresh ) { return new $class; } self::$instances[ $object ] = new $class; return self::$instances[ $object ]; } /** * Used for accessing alive instance class * * @since 1.0 * * @return Better_Facebook_Chat */ public static function self() { return self::factory(); } /** * Adds included BetterFramework to loader * * @param $frameworks * * @return array */ function better_framework_loader( $frameworks ) { $frameworks[] = array( 'version' => '3.10.14', 'path' => self::dir_path( 'includes/libs/better-framework/' ), 'uri' => self::dir_url( 'includes/libs/better-framework/' ), ); return $frameworks; } /** * Setups features of BetterFramework * * @param $features * * @return array */ function setup_bf_features( $features ) { $features['admin_panel'] = true; return $features; } /** * Init the plugin */ function bf_init() { if ( ! $this->is_active() ) { return; } // Enqueue assets add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); } /** * Callback: Used for registering scripts * * @hooked enqueue_scripts */ function enqueue_scripts() { $locale = get_locale(); wp_enqueue_script( 'facebook-sdk', "https://connect.facebook.net/$locale/sdk/xfbml.customerchat.js" ); if ( function_exists( 'wp_add_inline_script' ) ) { wp_add_inline_script( 'facebook-sdk', $this->init_sdk_js() ); } bf_enqueue_style( 'better-facebook-chat', bf_append_suffix( self::dir_url( 'css/style' ), '.css' ), array(), bf_append_suffix( self::dir_path( 'css/style' ), '.css' ), self::$version ); } /** * Enable Oculus error logging system for plugin * * @hooked better-framework/oculus/logger/filter * * @access private * * @param boolean $bool previous value * @param string $product_dir * @param string $type_dir * * @return bool true if error belongs to plugin, previous value otherwise. */ function oculus_logger( $bool, $product_dir, $type_dir ) { if ( $type_dir === 'plugins' && $product_dir === 'better-facebook-chat' ) { return false; } return $bool; } /** * Print facebook chat html markup */ public function print_template() { if ( ! $this->is_active() ) { return; } if ( ! function_exists( 'wp_add_inline_script' ) ) { printf( '<script>%s</script>', $this->init_sdk_js() ); } $attrs = ''; $options = array( 'theme_color', 'logged_out_greeting', 'logged_in_greeting', 'position', ); foreach ( $options as $option_key ) { $option_value = $this->get_option( $option_key ); $attrs .= sprintf( ' %s="%s"', $option_key, esc_attr( $option_value ) ); } ?> <div class="fb-customerchat"<?php echo $attrs ?> page_id="<?php echo bsfc_get_page_id( $this->get_option( 'facebook_page' ) ) ?>"></div> <?php } /** * Get init facebook std js as raw string * * @return string */ public function init_sdk_js() { return <<<JS window.fbAsyncInit = function () { FB.init({ autoLogAppEvents: true, xfbml: true, version: 'v2.12' }); FB.CustomerChat.show(true); }; JS; } } PK o��[�z�� � gulpfile.jsnu �[��� var gulp = require('gulp'), cleanCSS = require('gulp-minify-css'), rename = require('gulp-rename'), uglify = require('gulp-uglify'); gulp.task('styles', function () { return gulp.src(['./css/*.css', '!./css/*.min.css']) .pipe(cleanCSS({ keepSpecialComments: 1, level: 2 })) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest(function (file) { return file.base; })); }); gulp.task('scripts', function () { return gulp.src(['./js/*.js', '!./js/*.min.js']) .pipe(uglify()) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest(function (file) { return file.base; })); }); gulp.task('watch', function () { gulp.watch(['./css/*.css', '!./css/*.min.css'], ['styles']); gulp.watch(['./js/*.js', '!./js/*.min.js'], ['scripts']); }); gulp.task('default', ['styles', 'scripts']); PK o��[ BU� css/style.min.cssnu �[��� .fb-customerchat[position=right-top]+.fb_dialog.fb_dialog{bottom:auto!important;top:18pt!important}.fb-customerchat[position=right-top] iframe{bottom:auto!important;top:72pt!important}.fb-customerchat[position=left-top]+.fb_dialog.fb_dialog{bottom:auto!important;top:18pt!important;left:18pt;right:auto}.fb-customerchat[position=left-top] iframe{bottom:auto!important;top:72pt!important;left:18pt;right:auto}.fb-customerchat[position=left-bottom] iframe,.fb-customerchat[position=left-bottom]+.fb_dialog.fb_dialog{left:18pt;right:auto}PK o��[���0 0 css/style.cssnu �[��� /** * Right and Top position */ .fb-customerchat[position="right-top"] + .fb_dialog.fb_dialog { bottom: auto !important; top: 18pt !important; } .fb-customerchat[position="right-top"] iframe { bottom: auto !important; top: 72pt !important; } /** * Left and Top position */ .fb-customerchat[position="left-top"] + .fb_dialog.fb_dialog { bottom: auto !important; top: 18pt !important; left: 18pt; right: auto; } .fb-customerchat[position="left-top"] iframe { bottom: auto !important; top: 72pt !important; left: 18pt; right: auto; } /** * Left and Bottom position */ .fb-customerchat[position="left-bottom"] + .fb_dialog.fb_dialog { left: 18pt; right: auto; } .fb-customerchat[position="left-bottom"] iframe { left: 18pt; right: auto; } PK o��[��3t� � includes/functions.phpnu �[��� <?php /** * Fetch facebook numeric ID * * @param string $username facebook page slug/username * * @return string none empty on success */ function bsfc_fetch_page_id( $username ) { $remote = wp_remote_get( 'https://www.facebook.com/' . $username ); if ( ! $remote || is_wp_error( $remote ) ) { return ''; } if ( wp_remote_retrieve_response_code( $remote ) !== 200 ) { return ''; } preg_match( '/\"entity_id\"\s*:\s*\"(\d+)\"/', wp_remote_retrieve_body( $remote ), $matches ); if ( $matches ) { return $matches[1]; } return ''; } /** * Get facebook numeric ID for page name * * @param string $page_name facebook page URL or username * * @return string none empty on success */ function bsfc_get_page_id( $page_name ) { $fb_url_pattern = '/^https?:\/\/(?:www|m)\.facebook.com\/(?:profile\.php\?id=)?([a-zA-Z0-9\.]+)$/'; preg_match( $fb_url_pattern, $page_name, $matches ); if ( $matches ) { $username = $matches[1]; } else { $username = $page_name; } $cache = get_option( 'bsfc_page_id', array() ); if ( ! empty( $cache[ $username ] ) ) { return $cache[ $username ]; } $page_id = bsfc_fetch_page_id( $username ); update_option( 'bsfc_page_id', array( $username => $page_id ) ); return $page_id; }PK o��['�q� includes/index.phpnu �[��� <?php // Silence is betterPK o��[@�} } U includes/libs/better-framework/page-builder/compatibility/kc/kc.nocache_templates.phpnu �[��� <?php /** * * King Composer * (c) KingComposer.com * */ if(!defined('KC_FILE')) { header('HTTP/1.0 403 Forbidden'); exit; } global $kc; ?> <div id="kc-right-click-helper"><i class="sl-close"></i></div> <div style="display:none;" id="kc-storage-prepare"> <div id="kc-css-box-test"></div> </div> <img width="50" src="<?php echo KC_URL; ?>/assets/images/drag.png" id="kc-ui-handle-image" /> <img width="50" src="<?php echo KC_URL; ?>/assets/images/drag-copy.png" id="kc-ui-handle-image-copy" /> <div id="kc-undo-deleted-element"> <a href="javascript:void(0)" class="do-action"> <i class="sl-action-undo"></i> <?php _e('Restore deleted items', 'kingcomposer'); ?> <span class="amount">0</span> </a> <div id="drop-to-delete"><span></span></div> <i class="sl-close"></i> </div> <script type="text/html" id="tmpl-kc-top-nav-template"> <?php do_action('kc-top-nav'); ?> </script> <script type="text/html" id="tmpl-kc-wp-widgets-template"> <div id="kc-wp-list-widgets"><?php if( !function_exists( 'submit_button' ) ){ function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) { echo kc_get_submit_button( $text, $type, $name, $wrap, $other_attributes ); } } ob_start(); global $wp_registered_widget_controls; $controls = $wp_registered_widget_controls; $wp_registered_widget_controls = array(); wp_list_widgets(); $wp_registered_widget_controls = $controls; $content = str_replace( array( '<script', '</script>' ), array( '<script', '</script>' ), ob_get_contents() ); ob_end_clean(); echo $content; ?></div> </script> <?php do_action('kc_tmpl_nocache'); ?> PK o��[`x8� � Z includes/libs/better-framework/page-builder/compatibility/kc/class-bf-kc-compatibility.phpnu �[��� <?php if ( ! class_exists( 'BF_KC_Compatibility' ) ) { /** * @since 4.0.0 */ class BF_KC_Compatibility { /** * @var self */ protected static $instance; /** * @var array */ public static $deferred_fields_maps = array(); /** * @var array */ public static $dynamic_fields_maps = array(); /** * Get singleton instance of class */ public static function instance() { if ( ! self::$instance instanceof self ) { self::$instance = new self(); self::$instance->init(); } return self::$instance; } /** * Initialize the library * * @since 4.0.0 */ public function init() { global $kc_pro; // TODO: load widget lists via ajax // add_action( 'admin_footer', array( $this, 'optimized_kc_admin_footer' ) ); // remove_action( 'admin_footer', 'kc_admin_footer' ); if ( bf_is_doing_ajax() ) { add_action( 'wp_ajax_bf_kc_tmpl_storage', array( $this, 'kc_tmpl_storage' ) ); } if ( $kc_pro && isset( $kc_pro->action ) && 'live-editor' === $kc_pro->action ) { add_action( 'kc_after_admin_footer', array( $this, 'append_security_token' ), 0 ); } add_action( 'wp_ajax_bf_load_kc_fields', array( $this, 'ajax_load_fields' ) ); add_action( 'edit_form_after_editor', array( $this, 'append_security_token' ) ); add_filter( 'kc_maps', array( $this, 'filter_kc_maps_var' ) ); } /** * @see kc_ajax::tmpl_storage */ public function kc_tmpl_storage() { check_ajax_referer( 'kc-nonce', 'security' ); global $kc; /** * $kc->param_types_cache don't have getter method >.< i have to take it force */ $reflectionClass = new ReflectionClass( $kc ); $param_types_cache = $reflectionClass->getProperty( 'param_types_cache' ); $param_types_cache->setAccessible( true ); $param_types = $param_types_cache->getValue( $kc ); if ( ! empty( $param_types ) ) { foreach ( $param_types as $name => $func ) { if ( function_exists( $func ) ) { echo '<script type="text/html" id="tmpl-kc-field-type-' . esc_attr( $name ) . '-template">'; ob_start(); $func(); $field = ob_get_clean(); $this->wrap_show_on_atts( $field ); echo "</script>\n"; } } } require_once KC_PATH . '/includes/kc.templates.php'; do_action( 'kc_tmpl_storage' ); echo '<!----END_KC_TMPL---->'; exit; } public function wrap_show_on_atts( $input ) { include BF_PATH . 'page-builder/generators/kc/templates/default-js.php'; } /** * Optimized version of the kc_admin_footer() callback * * @hooked admin_footer */ public function optimized_kc_admin_footer() { if ( ! function_exists( 'kc_admin_enable' ) ) { return; } if ( is_admin() && ! kc_admin_enable() ) { return; } do_action( 'kc_before_admin_footer' ); require_once KC_PATH . '/includes/kc.js_languages.php'; require_once BF_PATH . 'page-builder/compatibility/kc/kc.nocache_templates.php'; do_action( 'kc_after_admin_footer' ); } /** * @hooked wp_ajax_bf_load_kc_fields */ public function ajax_load_fields() { if ( empty( $_REQUEST['shortcode'] ) || empty( $_REQUEST['token'] ) ) { return; } check_ajax_referer( 'ajax-load-kc-fields', 'token' ); $shortcode = $_REQUEST['shortcode']; if ( ! $shortcode_instance = BF_Shortcodes_Manager::factory( $shortcode, array(), true ) ) { wp_send_json_error( new WP_Error( 'invalid_shortcode' ) ); } $deferred_fields = $this->filter_deferred_fields( $shortcode_instance->page_builder_fields( 'KC' ) ); $shortcode_atts = isset( $_REQUEST['shortcode_atts'] ) && is_array( $_REQUEST['shortcode_atts'] ) ? $_REQUEST['shortcode_atts'] : array(); foreach ( $deferred_fields as $field ) { if ( 'js' === $field['_render_engine'] ) { $global_fields[] = array( // 'html' => $this->get_field( $field_type ), 'html' => $this->get_field( $field, array( 'input_name' => '{{data.name}}', 'value' => '{{data.value}}', ) ), 'id' => $field['name'] ); } elseif ( 'php' === $field['_render_engine'] ) { $name = $field['name']; // $dedicated_fields[] = array( 'html' => $this->get_field( $field, array( 'input_name' => $name, 'value' => isset( $shortcode_atts[ $name ] ) ? $shortcode_atts[ $name ] : '', ) ), 'id' => $field['type'], 'name' => $name, ); } } wp_send_json_success( compact( 'dedicated_fields', 'global_fields' ) ); } /** * @hooked edit_form_after_editor */ public function append_security_token() { wp_nonce_field( 'ajax-load-kc-fields', 'bf_kc_ajax_field', false ); } /** * Mark map as deferred to load field HTML markup via ajax. * * @param string $map_id * @param array $fields_type */ public static function mark_fields_as_deferred( $map_id, $fields_type ) { self::$deferred_fields_maps[ $map_id ][] = array_unique( $fields_type ); } /** * @param string $map_id */ public static function always_fetch_map_fields( $map_id ) { if ( ! in_array( $map_id, self::$dynamic_fields_maps ) ) { self::$dynamic_fields_maps[] = $map_id; } } /** * @param array $kc_maps * * @hooked kc_maps * * @return array */ public function filter_kc_maps_var( $kc_maps ) { foreach ( self::$dynamic_fields_maps as $map_id ) { $kc_maps[ $map_id ]['always_fetch_fields'] = true; } foreach ( self::$deferred_fields_maps as $map_id => $fields_type ) { if ( isset( $kc_maps[ $map_id ] ) && empty( $kc_maps[ $map_id ]['always_fetch_fields'] ) ) { $kc_maps[ $map_id ]['deferred_fields'] = $fields_type; } } return $kc_maps; } /** * List deferred fields type. * * @param array $fields * * @return array */ public function filter_deferred_fields( $fields ) { /** * @var BF_KC_Wrapper $kc_wrapper */ $kc_wrapper = Better_Framework::factory( 'page-builder' )->wrapper_class( 'KC' ); $kc_wrapper = new $kc_wrapper(); $deferred_fields = array(); $dynamic_deferred_fields = $kc_wrapper->dynamic_deferred_fields(); $static_deferred_fields = $kc_wrapper->static_deferred_fields(); foreach ( $fields as $tab_fields ) { foreach ( $tab_fields as $field ) { if ( in_array( $field['type'], $dynamic_deferred_fields ) ) { $deferred_fields[ $field['name'] ] = $field; $deferred_fields[ $field['name'] ]['_render_engine'] = 'php'; } elseif ( in_array( $field['type'], $static_deferred_fields ) ) { $deferred_fields[ $field['name'] ] = $field; $deferred_fields[ $field['name'] ]['_render_engine'] = 'js'; } } } return $deferred_fields; } /** * @param string $field * @param array $options * * @return string */ public function get_field( $field, $options = array() ) { $field = array_merge( $field, $options ); if ( ! class_exists( 'BF_KC_Fields_Generator' ) ) { require BF_PATH . 'page-builder/generators/kc/class-bf-kc-fields-generator.php'; } if ( isset( $field['name'] ) && ! isset( $field['id'] ) ) { $field['id'] = $field['name']; } $generator = new BF_KC_Fields_Generator( $field, $field['input_name'] ); return $generator->get_field(); } /** * @param array $field * * @return string */ public function get_field_placeholder( $field ) { return sprintf( '<div class="bf-deferred-kc-field" data-field-name="%s"></div>', esc_attr( $field['name'] ) ); } } BF_KC_Compatibility::instance(); } PK o��[���E( ( F includes/libs/better-framework/page-builder/compatibility/kc/index.phpnu �[��� <?php // let's show them we are better PK o��[���E( ( C includes/libs/better-framework/page-builder/compatibility/index.phpnu �[��� <?php // let's show them we are better PK o��[���E( ( F includes/libs/better-framework/page-builder/compatibility/vc/index.phpnu �[��� <?php // let's show them we are better PK o��[�s��� � P includes/libs/better-framework/page-builder/compatibility/vc/vc_column_inner.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ global $_vc_column_inner_template_file, $_bf_vc_column_inner_atts; $_bf_vc_column_inner_atts = $atts; if ( $_vc_column_inner_template_file ) { include $_vc_column_inner_template_file; } PK o��[��P� � J includes/libs/better-framework/page-builder/compatibility/vc/vc_column.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ global $_vc_column_template_file, $_bf_vc_column_inner_atts, $_bf_vc_column_atts; //todo: include $variable can cause security concerns $_bf_vc_column_atts = $atts; $_bf_vc_column_inner_atts = array(); if ( $_vc_column_template_file ) { include $_vc_column_template_file; } // Clear atts again to make sure it works in pages with 2 different vc contents $_bf_vc_column_atts = $_bf_vc_column_inner_atts = array(); PK o��[�%�֨ � Z includes/libs/better-framework/page-builder/generators/kc/kc-field-generator-functions.phpnu �[��� <?php if ( ! function_exists( 'bf_kc_field_generator' ) ) { function bf_kc_field_generator( $type, $settings = array() ) { if ( ! class_exists( 'BF_KC_Fields_Generator' ) ) { require BF_PATH . 'page-builder/generators/kc/class-bf-kc-fields-generator.php'; } $options = wp_parse_args( array( 'input_name' => '{{data.name}}', 'value' => '{{data.value}}', 'type' => $type, 'bypass_wrapper' => true, ), $settings ); $generator = new BF_KC_Fields_Generator( $options, $options['input_name'] ); $input = $generator->get_field(); include BF_PATH . 'page-builder/generators/kc/templates/default-js.php'; } } if ( ! function_exists( 'bf_kc_field_switch' ) ) { function bf_kc_field_switch() { bf_kc_field_generator( 'switch' ); } } // //if ( ! function_exists( 'bf_kc_field_color' ) ) { // // function bf_kc_field_color() { // // bf_kc_field_generator( 'color' ); // } //} PK o��[��)f� � L includes/libs/better-framework/page-builder/generators/kc/fields/heading.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ ?> <div class="bf-section-container bf-clearfix"> <div class="bf-section-heading bf-clearfix" data-id="{{data.name}}" id="{{data.name}}"> <div class="bf-section-heading-title bf-clearfix"> <h3>{{data.label}}</h3> </div> </div> </div>PK o��[�I�i@ @ P includes/libs/better-framework/page-builder/generators/kc/fields/ajax_select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/ajax_select.php';PK o��[�h� � K includes/libs/better-framework/page-builder/generators/kc/fields/switch.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ ?> <div class="bf-switch bf-clearfix"> <# var onLabel = data.options['on-label'] || '<?php _e( 'On', 'better-studio' ) ?>', offLabel = data.options['off-label'] || '<?php _e( 'Off', 'better-studio' ) ?>', inputClasses = data.options['input-class']; #> <label class="cb-enable <# if(data.value && data.value !== '0') { #> selected<# } #>"><span>{{{onLabel}}}</span></label> <label class="cb-disable <# if(!data.value || data.value === '0') { #> selected<# } #>"><span>{{{offLabel}}}</span></label> <input type="hidden" name="{{data.name}}" value="<# if(data.value && data.value !== '0') {#>1<#}else {#>0<#}#>" class="kc-param checkbox {{inputClasses}}"> </div>PK o��[��˜� � K includes/libs/better-framework/page-builder/generators/kc/fields/select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ if ( isset( $options['_options'] ) ) { $options['options'] = $options['_options']; } include BF_PATH . 'core/field-generator/fields/select.php';PK o��[�W?aA A K includes/libs/better-framework/page-builder/generators/kc/fields/editor.phpnu �[��� <?php include BF_PATH . 'core/field-generator/fields/editor.php';PK o��[ . . P includes/libs/better-framework/page-builder/generators/kc/fields/term_select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/term_select.php'; PK o��[�\��� � P includes/libs/better-framework/page-builder/generators/kc/fields/icon_select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ // Default selected $current = array( 'key' => '', 'title' => __( 'Chose an Icon', 'better-studio' ), 'width' => '', 'height' => '', 'type' => '', ); if ( isset( $options['value'] ) ) { if ( is_array( $options['value'] ) ) { if ( in_array( $options['value']['type'], array( 'custom-icon', 'custom' ) ) ) { $current['key'] = isset( $options['value']['icon'] ) ? $options['value']['icon'] : ''; $current['title'] = bf_get_icon_tag( isset( $options['value'] ) ? $options['value'] : '' ) . ' ' . __( 'Custom icon', 'better-studio' ); $current['width'] = isset( $options['value']['width'] ) ? $options['value']['width'] : ''; $current['height'] = isset( $options['value']['height'] ) ? $options['value']['height'] : ''; $current['type'] = 'custom-icon'; } else { Better_Framework::factory( 'icon-factory' ); $fontawesome = BF_Icons_Factory::getInstance( 'fontawesome' ); if ( isset( $fontawesome->icons[ $options['value']['icon'] ] ) ) { $current['key'] = $options['value']['icon']; $current['title'] = bf_get_icon_tag( $options['value'] ) . $fontawesome->icons[ $options['value']['icon'] ]['label']; $current['width'] = $options['value']['width']; $current['height'] = $options['value']['height']; $current['type'] = 'fontawesome'; } } } elseif ( ! empty( $options['value'] ) ) { Better_Framework::factory( 'icon-factory' ); $fontawesome = BF_Icons_Factory::getInstance( 'fontawesome' ); $icon_label = ''; if ( substr( $options['value'], 0, 3 ) == 'fa-' ) { $icon_label = bf_get_icon_tag( $options['value'] ) . ' ' . $fontawesome->icons[ $options['value'] ]['label']; $current['type'] = 'fontawesome'; } else { $icon_label = bf_get_icon_tag( $options['value'] ); $current['type'] = 'custom-icon'; } $current['key'] = $options['value']; $current['title'] = $icon_label; $current['width'] = ''; $current['height'] = ''; } } $icon_handler = 'bf-icon-modal-handler-' . mt_rand(); ?> <div class="bf-icon-modal-handler" id="<?php echo esc_attr( $icon_handler ); ?>"> <div class="select-options"> <span class="selected-option"><?php echo wp_kses( $current['title'], bf_trans_allowed_html() ); ?></span> </div> <input type="hidden" class="kc-param wpb-textinput title textfield icon-input" data-label="" name="<?php echo esc_attr( $options['input_name'] ); ?>" value="<?php echo esc_attr( $current['key'] ); ?>"/> </div><!-- modal handler container --> <?php bf_enqueue_modal( 'icon' ); PK o��[�L��= = K includes/libs/better-framework/page-builder/generators/kc/fields/slider.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/slider.php';PK o��[���S S I includes/libs/better-framework/page-builder/generators/kc/fields/info.phpnu �[��� <div class="info-value"> <?php echo $options['std']; // escaped before ?> </div>PK o��[�AD K includes/libs/better-framework/page-builder/generators/kc/fields/custom.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $classes = array(); $classes[] = 'bf-section-container'; if ( ! empty( $options['container_class'] ) ) { $classes[] = $options['container_class']; } printf( '<div class="%s">', implode( ' ', $classes ) ); include BF_PATH . 'core/field-generator/fields/custom.php'; echo '</div>'; PK o��[?-�/ / Q includes/libs/better-framework/page-builder/generators/kc/fields/select_popup.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/select_popup.php';PK o��[Vb�2� � U includes/libs/better-framework/page-builder/generators/kc/fields/background_image.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ // stripcslashes for when json is splashed! if ( ! empty( $options['value'] ) ) { $value = $options['value']; } else { $value = array( 'img' => '', 'type' => 'cover' ); } $media_title = empty( $options['media_title'] ) ? __( 'Upload', 'better-studio' ) : $options['media_title']; $button_text = empty( $options['button_text'] ) ? __( 'Upload', 'better-studio' ) : $options['button_text']; // Upload Button $upload_button = Better_Framework::html() ->add( 'a' ) ->class( 'bf-button bf-background-image-upload-btn button' ) ->data( 'mediatitle', $media_title ) ->data( 'buttontext', $button_text ); if ( isset( $options['upload_label'] ) ) { $upload_button->text( $options['upload_label'] ); } else { $upload_button->text( __( 'Upload', 'better-studio' ) ); } // Remove Button $remove_button = Better_Framework::html() ->add( 'a' ) ->class( 'bf-button bf-background-image-remove-btn button' ); if ( isset( $options['remove_label'] ) ) { $remove_button->text( $options['remove_label'] ); } else { $remove_button->text( __( 'Remove', 'better-studio' ) ); } if ( $value['img'] == "" ) { $remove_button->css( 'display', 'none' ); } // Select $select = Better_Framework::html() ->add( 'select' ) ->attr( 'id', $options['id'] . '-select' ) ->class( 'bf-background-image-uploader-select' ) ->name( $options['input_name'] . '[type]' ); $select->text( '<option value="repeat" ' . ( $value['type'] == 'repeat' ? 'selected="selected"' : '' ) . '>' . __( 'Repeat Horizontal and Vertical - Pattern', 'better-studio' ) . '</option>' ); $select->text( '<option value="cover" ' . ( $value['type'] == 'cover' ? 'selected="selected"' : '' ) . '>' . __( 'Fully Cover Background - Photo', 'better-studio' ) . '</option>' ); $select->text( '<option value="repeat-y" ' . ( $value['type'] == 'repeat-y' ? 'selected="selected"' : '' ) . '>' . __( 'Repeat Horizontal', 'better-studio' ) . '</option>' ); $select->text( '<option value="repeat-x" ' . ( $value['type'] == 'repeat-x' ? 'selected="selected"' : '' ) . '>' . __( 'Repeat Vertical', 'better-studio' ) . '</option>' ); $select->text( '<option value="no-repeat" ' . ( $value['type'] == 'no-repeat' ? 'selected="selected"' : '' ) . '>' . __( 'No Repeat', 'better-studio' ) . '</option>' ); if ( $value['img'] == "" ) { $select->css( 'display', 'none' ); } // Main Input $input = Better_Framework::html() ->add( 'input' ) ->type( 'hidden' ) ->class( 'bf-background-image-input' ) ->name( $options['input_name'] . '[img]' ) ->val( $value['img'] ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } echo $upload_button->display(); // escaped before echo $remove_button->display(); // escaped before echo '<br>'; echo $select->display(); // escaped before echo $input->display(); // escaped before if ( $value['img'] != "" ) { echo '<div class="bf-background-image-preview">'; } else { echo '<div class="bf-background-image-preview" style="display: none">'; } echo '<img src="' . esc_url( $value['img'] ) . '" />'; echo '</div>'; PK o��[���E( ( J includes/libs/better-framework/page-builder/generators/kc/fields/index.phpnu �[��� <?php // let's show them we are better PK o��[�:p� � J includes/libs/better-framework/page-builder/generators/kc/fields/color.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ ?> <div class="bs-color-picker-wrapper"> <input type="text" name="{{data.name}}" value="{{data.value}}" class="bs-color-picker-value color-picker kc-param" data-alpha="true"> </div> PK o��[�vb� � I includes/libs/better-framework/page-builder/generators/kc/fields/text.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $wrapper = Better_Framework::html()->add( 'div' )->class( 'bf-clearfix' ); $input = Better_Framework::html()->add( 'input' )->type( 'text' )->name( $options['input_name'] ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } if ( ! empty( $options['value'] ) ) { $input->value( $options['value'] )->css( 'border-color', $options['value'] ); } $wrapper->add( $input ); echo $wrapper->display(); // escaped before PK o��[�d�B B P includes/libs/better-framework/page-builder/generators/kc/fields/media_image.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/media_image.php';PK o��[6\�B B P includes/libs/better-framework/page-builder/generators/kc/fields/image_radio.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/image_radio.php';PK o��[��U�� � T includes/libs/better-framework/page-builder/generators/kc/fields/sorter_checkbox.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ // set options from deferred callback if ( isset( $options['deferred-options'] ) ) { if ( is_string( $options['deferred-options'] ) && is_callable( $options['deferred-options'] ) ) { $options['options'] = call_user_func( $options['deferred-options'] ); } elseif ( is_array( $options['deferred-options'] ) && ! empty( $options['deferred-options']['callback'] ) && is_callable( $options['deferred-options']['callback'] ) ) { if ( isset( $options['deferred-options']['args'] ) ) { $options['options'] = call_user_func_array( $options['deferred-options']['callback'], $options['deferred-options']['args'] ); } else { $options['options'] = call_user_func( $options['deferred-options']['callback'] ); } } } if ( empty( $options['options'] ) ) { return; } if ( isset( $options['value'] ) && ! empty( $options['value'] ) ) { if ( is_string( $options['value'] ) ) { $value = array_flip( explode( ',', $options['value'] ) ); $options['value'] = array_fill_keys( array_keys( $value ), true ); } } else { $options['value'] = array(); } $value = $options['value']; $check_all = ( ! isset( $options['check_all'] ) || $options['check_all'] ) && ! bf_count( $value ) ? true : false; $groups_ids = array(); $selected_items = array(); // Options That Saved Before foreach ( $value as $item_id => $item ) { if ( ! $item ) { continue; } $selected_items[ $item_id ] = $item; } $input = Better_Framework::html()->add( 'input' )->type( 'hidden' )->name( $options['input_name'] )->attr( 'value', implode( ',', array_keys( $selected_items ) ) ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } echo $input->display(); // escaped before ?> <div class="bf-sorter-groups-container"> <ul id="bf-sorter-group-<?php echo esc_attr( $options['id'] ); ?>" class="bf-sorter-list bf-vc-sorter-list bf-vc-sorter-checkbox-list bf-sorter-<?php echo esc_attr( $options['id'] ); ?>"> <?php // Options That Saved Before foreach ( $selected_items as $item_id => $item ) { ?> <li id="bf-sorter-group-item-<?php echo esc_attr( $options['id'] ); ?>-<?php echo esc_attr( $item_id ); ?>" class="<?php echo isset( $options['options'][ $item_id ]['css-class'] ) ? esc_attr( $options['options'][ $item_id ]['css-class'] ) : ''; ?> item-<?php echo esc_attr( $item_id ); ?> checked-item" style="<?php echo isset( $options['options'][ $item_id ]['css'] ) ? esc_attr( $options['options'][ $item_id ]['css'] ) : ''; ?>"> <label> <input name="<?php echo esc_attr( $item_id ); ?>" value="<?php echo esc_attr( $item_id ); ?>" type="checkbox" checked="checked"/> <?php echo $options['options'][ $item_id ]['label']; ?> </label> </li> <?php unset( $options['options'][ $item_id ] ); } // Options That Not Saved but are Active foreach ( $options['options'] as $item_id => $item ) { // Skip Disabled Items if ( isset( $item['css-class'] ) && strpos( $item['css-class'], 'active-item' ) === false ) { continue; } ?> <li id="bf-sorter-group-item-<?php echo esc_attr( $options['id'] ); ?>-<?php echo esc_attr( $item_id ); ?>" class="<?php echo isset( $item['css-class'] ) ? esc_attr( $item['css-class'] ) : ''; ?> item-<?php echo esc_attr( $item_id ); ?> <?php echo $check_all ? ' checked-item' : ''; ?>" <?php echo $check_all ? ' checked="checked" ' : ''; ?> style="<?php echo isset( $item['css'] ) ? esc_attr( $item['css'] ) : ''; ?>"> <label> <input name="<?php echo esc_attr( $item_id ); ?>" value="<?php echo esc_attr( $item_id ); ?>" type="checkbox" <?php echo $check_all ? ' checked="checked" ' : ''; ?>/> <?php echo is_array( $item ) ? $item['label'] : $item; // escaped before ?> </label> </li> <?php unset( $options['options'][ $item_id ] ); } // Disable Items foreach ( $options['options'] as $item_id => $item ) { ?> <li id="bf-sorter-group-item-<?php echo esc_attr( $options['id'] ); ?>-<?php echo esc_attr( $item_id ); ?>" class="<?php echo isset( $item['css-class'] ) ? esc_attr( $item['css-class'] ) : ''; ?> item-<?php echo esc_attr( $item_id ); ?>" style="<?php echo isset( $item['css'] ) ? esc_attr( $item['css'] ) : ''; ?>"> <label> <input name="<?php echo esc_attr( $item_id ); ?>" value="<?php echo esc_attr( $item_id ); ?>" type="checkbox" disabled/> <?php echo is_array( $item ) ? $item['label'] : $item; // escaped before ?> </label> </li> <?php } ?> </ul> <?php echo $this->get_filed_input_desc( $options ); // escaped before ?> </div> PK o��[ ,~ Z includes/libs/better-framework/page-builder/generators/kc/class-bf-kc-fields-generator.phpnu �[��� <?php /** * Class BF_KC_Front_End_Generator * * @since 4.0.0 */ class BF_KC_Fields_Generator extends BF_Admin_Fields { /** * Holds Items Array * * @since 1.0 * @access public * @var array|null */ public $item; /** * Panel ID * * @since 1.0 * @access public * @var string */ public $id; /** * Constructor * * @param array $item Contain details of one field * @param $id */ public function __construct( $item = array(), $id = array() ) { $generator_options = array( 'fields_dir' => BF_PATH . 'page-builder/generators/kc/fields/', 'templates_dir' => BF_PATH . 'page-builder/generators/kc/templates/' ); parent::__construct( $generator_options ); $item['input_class'] = 'kc-param'; $this->item = $item; $this->id = $id; } /** * Display HTML output of panel array * * Display full html of panel array which is defined in object parameter * * @since 1.0 * @access public * @return string */ public function get_field() { $output = ''; $field = $this->item; if ( ! isset( $field['value'] ) && isset( $field['std'] ) ) { $field['value'] = $field['std']; } $output .= $this->section( call_user_func( array( $this, $field['type'] ), $field ), $field ); return $output; } } PK o��[���E( ( C includes/libs/better-framework/page-builder/generators/kc/index.phpnu �[��� <?php // let's show them we are better PK o��["��U� � O includes/libs/better-framework/page-builder/generators/kc/templates/default.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ if ( ! isset( $options['id'] ) && isset( $options['name'] ) ) { $options['id'] = $options['name']; } if ( ! empty( $options['bypass_wrapper'] ) ) { echo $input; return; } ?> <div class="bf-section-container <?php echo isset( $options['section_class'] ) ? esc_attr( $options['section_class'] ) : ''; ?>" <?php echo bf_show_on_attributes( $options ) ?>> <?php echo $input; // escaped before ?> </div>PK o��[�O��� � O includes/libs/better-framework/page-builder/generators/kc/templates/heading.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $style = ! empty( $options['layout'] ) ? $options['layout'] : 'style-1'; if ( ! isset( $options['id'] ) ) { $options['id'] = ''; } if ( ! isset( $options['title'] ) ) { $options['title'] = $options['label']; } ?> <div class="bf-section-container bf-clearfix"> <div class="bf-section-heading bf-clearfix <?php echo $style; ?>" data-id="<?php echo esc_attr( $options['id'] ); ?>" id="<?php echo esc_attr( $options['id'] ); ?>"> <div class="bf-section-heading-title bf-clearfix"> <h4><?php echo esc_html( $options['title'] ); ?></h4> </div> <?php if ( ! empty( $options['desc'] ) ) { ?> <div class="bf-section-heading-desc bf-clearfix"><?php echo wp_kses( $options['desc'], bf_trans_allowed_html() ); ?></div> <?php } ?> </div> </div>PK o��[K6 F F R includes/libs/better-framework/page-builder/generators/kc/templates/default-js.phpnu �[��� <# var sectionClass = data.options['section_class'] || '', settings = data.options['show_on'] ? JSON.stringify(data.options['show_on']) : ''; #> <div class="bf-section-container {{sectionClass}}" data-param-name="{{data.name}}" data-param-settings="{{settings}}"> <?php echo $input; // escaped before ?> </div>PK o��[���E( ( M includes/libs/better-framework/page-builder/generators/kc/templates/index.phpnu �[��� <?php // let's show them we are better PK o��[���E( ( @ includes/libs/better-framework/page-builder/generators/index.phpnu �[��� <?php // let's show them we are better PK o��[��x`: : L includes/libs/better-framework/page-builder/generators/vc/fields/heading.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ ?> <div class="bf-section-container bf-clearfix"> <div class="bf-section-heading bf-clearfix" data-id="<?php echo esc_attr( $options['id'] ); ?>" id="<?php echo esc_attr( $options['id'] ); ?>"> <div class="bf-section-heading-title bf-clearfix"> <h3><?php echo esc_html( $options['name'] ); ?></h3> </div> </div> </div>PK o��[�I�i@ @ P includes/libs/better-framework/page-builder/generators/vc/fields/ajax_select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/ajax_select.php';PK o��[BSw�1 1 Q includes/libs/better-framework/page-builder/generators/vc/fields/vc-switchery.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $checkbox = Better_Framework()->html()->add( 'input' )->type( 'input' )->name( $options['input_name'] )->val( '' )->class( 'checkbox' ); // On Label $on_label = __( 'On', 'better-studio' ); if ( isset( $options['on-label'] ) ) { $on_label = $options['on-label']; } // On Label $off_label = __( 'Off', 'better-studio' ); if ( isset( $options['off-label'] ) ) { $off_label = $options['off-label']; } if ( $options['value'] ) { $on_checked = 'selected'; $off_checked = ''; $checkbox->val( 1 ); } else { $on_checked = ''; $off_checked = 'selected'; $checkbox->val( 0 ); } if ( isset( $options['input_class'] ) ) { $checkbox->class( $options['input_class'] ); } ?> <div class="bf-switch bf-clearfix"> <label class="cb-enable <?php echo esc_attr( $on_checked ); ?>"><span><?php echo esc_html( $on_label ); ?></span></label> <label class="cb-disable <?php echo esc_attr( $off_checked ); ?>"><span><?php echo esc_html( $off_label ); ?></span></label> <?php echo $checkbox->display(); // escaped before ?> </div>PK o��[ȑ~�= = K includes/libs/better-framework/page-builder/generators/vc/fields/select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/select.php';PK o��[ . . P includes/libs/better-framework/page-builder/generators/vc/fields/term_select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/term_select.php'; PK p��["G�� � S includes/libs/better-framework/page-builder/generators/vc/fields/vc-image_radio.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $value = ! empty( $options['value'] ) ? $options['value'] : ''; $wrapper = Better_Framework::html()->add( 'div' )->class( 'bf-clearfix' ); $input = Better_Framework::html()->add( 'input' )->type( 'hidden' )->name( $options['input_name'] ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } if ( ! empty( $options['value'] ) ) { $input->value( $options['value'] )->css( 'border-color', $options['value'] ); } $wrapper->add( $input ); echo $wrapper->display(); // escaped before foreach ( $options['options'] as $key => $item ) { $is_checked = ! empty( $value ) && ( $key == $value ); $image = Better_Framework::html()->add( 'img' )->src( $item['img'] )->alt( $item['label'] )->title( $item['label'] ); $label = Better_Framework::html()->add( 'label' ); $label->text( $image ); if ( isset( $item['label'] ) ) { $p = Better_Framework::html()->add( 'p' )->text( $item['label'] )->class( 'item-label' ); $label->text( $p ); } $object = Better_Framework::html()->add( 'div' )->class( 'vc-bf-image-radio-option' )->data( 'id', $key ); if ( $is_checked ) { $object->class( 'checked' ); } $object->text( $label->display() ); echo $object->display(); // escaped before }PK p��[�5a� � P includes/libs/better-framework/page-builder/generators/vc/fields/icon_select.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ // Default selected $current = array( 'key' => '', 'title' => __( 'Chose an Icon', 'better-studio' ), 'width' => '', 'height' => '', 'type' => '', ); if ( isset( $options['value'] ) ) { if ( is_array( $options['value'] ) ) { if ( in_array( $options['value']['type'], array( 'custom-icon', 'custom' ) ) ) { $current['key'] = isset( $options['value']['icon'] ) ? $options['value']['icon'] : ''; $current['title'] = bf_get_icon_tag( isset( $options['value'] ) ? $options['value'] : '' ) . ' ' . __( 'Custom icon', 'better-studio' ); $current['width'] = isset( $options['value']['width'] ) ? $options['value']['width'] : ''; $current['height'] = isset( $options['value']['height'] ) ? $options['value']['height'] : ''; $current['type'] = 'custom-icon'; } else { Better_Framework::factory( 'icon-factory' ); $fontawesome = BF_Icons_Factory::getInstance( 'fontawesome' ); if ( isset( $fontawesome->icons[ $options['value']['icon'] ] ) ) { $current['key'] = $options['value']['icon']; $current['title'] = bf_get_icon_tag( $options['value'] ) . $fontawesome->icons[ $options['value']['icon'] ]['label']; $current['width'] = $options['value']['width']; $current['height'] = $options['value']['height']; $current['type'] = 'fontawesome'; } } } elseif ( ! empty( $options['value'] ) ) { Better_Framework::factory( 'icon-factory' ); $fontawesome = BF_Icons_Factory::getInstance( 'fontawesome' ); $icon_label = ''; if ( substr( $options['value'], 0, 3 ) == 'fa-' ) { $icon_label = bf_get_icon_tag( $options['value'] ) . ' ' . $fontawesome->icons[ $options['value'] ]['label']; $current['type'] = 'fontawesome'; } else { $icon_label = bf_get_icon_tag( $options['value'] ); $current['type'] = 'custom-icon'; } $current['key'] = $options['value']; $current['title'] = $icon_label; $current['width'] = ''; $current['height'] = ''; } } $icon_handler = 'bf-icon-modal-handler-' . mt_rand(); ?> <div class="bf-icon-modal-handler" id="<?php echo esc_attr( $icon_handler ); ?>"> <div class="select-options"> <span class="selected-option"><?php echo wp_kses( $current['title'], bf_trans_allowed_html() ); ?></span> </div> <input type="hidden" class="wpb_vc_param_value wpb-textinput title textfield icon-input" data-label="" name="<?php echo esc_attr( $options['input_name'] ); ?>" value="<?php echo esc_attr( $current['key'] ); ?>"/> </div><!-- modal handler container --> <?php bf_enqueue_modal( 'icon' ); PK p��[�L��= = K includes/libs/better-framework/page-builder/generators/vc/fields/slider.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/slider.php';PK p��[�AD K includes/libs/better-framework/page-builder/generators/vc/fields/custom.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $classes = array(); $classes[] = 'bf-section-container'; if ( ! empty( $options['container_class'] ) ) { $classes[] = $options['container_class']; } printf( '<div class="%s">', implode( ' ', $classes ) ); include BF_PATH . 'core/field-generator/fields/custom.php'; echo '</div>'; PK p��[?-�/ / Q includes/libs/better-framework/page-builder/generators/vc/fields/select_popup.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/select_popup.php';PK p��[Vb�2� � U includes/libs/better-framework/page-builder/generators/vc/fields/background_image.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ // stripcslashes for when json is splashed! if ( ! empty( $options['value'] ) ) { $value = $options['value']; } else { $value = array( 'img' => '', 'type' => 'cover' ); } $media_title = empty( $options['media_title'] ) ? __( 'Upload', 'better-studio' ) : $options['media_title']; $button_text = empty( $options['button_text'] ) ? __( 'Upload', 'better-studio' ) : $options['button_text']; // Upload Button $upload_button = Better_Framework::html() ->add( 'a' ) ->class( 'bf-button bf-background-image-upload-btn button' ) ->data( 'mediatitle', $media_title ) ->data( 'buttontext', $button_text ); if ( isset( $options['upload_label'] ) ) { $upload_button->text( $options['upload_label'] ); } else { $upload_button->text( __( 'Upload', 'better-studio' ) ); } // Remove Button $remove_button = Better_Framework::html() ->add( 'a' ) ->class( 'bf-button bf-background-image-remove-btn button' ); if ( isset( $options['remove_label'] ) ) { $remove_button->text( $options['remove_label'] ); } else { $remove_button->text( __( 'Remove', 'better-studio' ) ); } if ( $value['img'] == "" ) { $remove_button->css( 'display', 'none' ); } // Select $select = Better_Framework::html() ->add( 'select' ) ->attr( 'id', $options['id'] . '-select' ) ->class( 'bf-background-image-uploader-select' ) ->name( $options['input_name'] . '[type]' ); $select->text( '<option value="repeat" ' . ( $value['type'] == 'repeat' ? 'selected="selected"' : '' ) . '>' . __( 'Repeat Horizontal and Vertical - Pattern', 'better-studio' ) . '</option>' ); $select->text( '<option value="cover" ' . ( $value['type'] == 'cover' ? 'selected="selected"' : '' ) . '>' . __( 'Fully Cover Background - Photo', 'better-studio' ) . '</option>' ); $select->text( '<option value="repeat-y" ' . ( $value['type'] == 'repeat-y' ? 'selected="selected"' : '' ) . '>' . __( 'Repeat Horizontal', 'better-studio' ) . '</option>' ); $select->text( '<option value="repeat-x" ' . ( $value['type'] == 'repeat-x' ? 'selected="selected"' : '' ) . '>' . __( 'Repeat Vertical', 'better-studio' ) . '</option>' ); $select->text( '<option value="no-repeat" ' . ( $value['type'] == 'no-repeat' ? 'selected="selected"' : '' ) . '>' . __( 'No Repeat', 'better-studio' ) . '</option>' ); if ( $value['img'] == "" ) { $select->css( 'display', 'none' ); } // Main Input $input = Better_Framework::html() ->add( 'input' ) ->type( 'hidden' ) ->class( 'bf-background-image-input' ) ->name( $options['input_name'] . '[img]' ) ->val( $value['img'] ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } echo $upload_button->display(); // escaped before echo $remove_button->display(); // escaped before echo '<br>'; echo $select->display(); // escaped before echo $input->display(); // escaped before if ( $value['img'] != "" ) { echo '<div class="bf-background-image-preview">'; } else { echo '<div class="bf-background-image-preview" style="display: none">'; } echo '<img src="' . esc_url( $value['img'] ) . '" />'; echo '</div>'; PK p��[��U�� � W includes/libs/better-framework/page-builder/generators/vc/fields/vc-sorter_checkbox.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ // set options from deferred callback if ( isset( $options['deferred-options'] ) ) { if ( is_string( $options['deferred-options'] ) && is_callable( $options['deferred-options'] ) ) { $options['options'] = call_user_func( $options['deferred-options'] ); } elseif ( is_array( $options['deferred-options'] ) && ! empty( $options['deferred-options']['callback'] ) && is_callable( $options['deferred-options']['callback'] ) ) { if ( isset( $options['deferred-options']['args'] ) ) { $options['options'] = call_user_func_array( $options['deferred-options']['callback'], $options['deferred-options']['args'] ); } else { $options['options'] = call_user_func( $options['deferred-options']['callback'] ); } } } if ( empty( $options['options'] ) ) { return; } if ( isset( $options['value'] ) && ! empty( $options['value'] ) ) { if ( is_string( $options['value'] ) ) { $value = array_flip( explode( ',', $options['value'] ) ); $options['value'] = array_fill_keys( array_keys( $value ), true ); } } else { $options['value'] = array(); } $value = $options['value']; $check_all = ( ! isset( $options['check_all'] ) || $options['check_all'] ) && ! bf_count( $value ) ? true : false; $groups_ids = array(); $selected_items = array(); // Options That Saved Before foreach ( $value as $item_id => $item ) { if ( ! $item ) { continue; } $selected_items[ $item_id ] = $item; } $input = Better_Framework::html()->add( 'input' )->type( 'hidden' )->name( $options['input_name'] )->attr( 'value', implode( ',', array_keys( $selected_items ) ) ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } echo $input->display(); // escaped before ?> <div class="bf-sorter-groups-container"> <ul id="bf-sorter-group-<?php echo esc_attr( $options['id'] ); ?>" class="bf-sorter-list bf-vc-sorter-list bf-vc-sorter-checkbox-list bf-sorter-<?php echo esc_attr( $options['id'] ); ?>"> <?php // Options That Saved Before foreach ( $selected_items as $item_id => $item ) { ?> <li id="bf-sorter-group-item-<?php echo esc_attr( $options['id'] ); ?>-<?php echo esc_attr( $item_id ); ?>" class="<?php echo isset( $options['options'][ $item_id ]['css-class'] ) ? esc_attr( $options['options'][ $item_id ]['css-class'] ) : ''; ?> item-<?php echo esc_attr( $item_id ); ?> checked-item" style="<?php echo isset( $options['options'][ $item_id ]['css'] ) ? esc_attr( $options['options'][ $item_id ]['css'] ) : ''; ?>"> <label> <input name="<?php echo esc_attr( $item_id ); ?>" value="<?php echo esc_attr( $item_id ); ?>" type="checkbox" checked="checked"/> <?php echo $options['options'][ $item_id ]['label']; ?> </label> </li> <?php unset( $options['options'][ $item_id ] ); } // Options That Not Saved but are Active foreach ( $options['options'] as $item_id => $item ) { // Skip Disabled Items if ( isset( $item['css-class'] ) && strpos( $item['css-class'], 'active-item' ) === false ) { continue; } ?> <li id="bf-sorter-group-item-<?php echo esc_attr( $options['id'] ); ?>-<?php echo esc_attr( $item_id ); ?>" class="<?php echo isset( $item['css-class'] ) ? esc_attr( $item['css-class'] ) : ''; ?> item-<?php echo esc_attr( $item_id ); ?> <?php echo $check_all ? ' checked-item' : ''; ?>" <?php echo $check_all ? ' checked="checked" ' : ''; ?> style="<?php echo isset( $item['css'] ) ? esc_attr( $item['css'] ) : ''; ?>"> <label> <input name="<?php echo esc_attr( $item_id ); ?>" value="<?php echo esc_attr( $item_id ); ?>" type="checkbox" <?php echo $check_all ? ' checked="checked" ' : ''; ?>/> <?php echo is_array( $item ) ? $item['label'] : $item; // escaped before ?> </label> </li> <?php unset( $options['options'][ $item_id ] ); } // Disable Items foreach ( $options['options'] as $item_id => $item ) { ?> <li id="bf-sorter-group-item-<?php echo esc_attr( $options['id'] ); ?>-<?php echo esc_attr( $item_id ); ?>" class="<?php echo isset( $item['css-class'] ) ? esc_attr( $item['css-class'] ) : ''; ?> item-<?php echo esc_attr( $item_id ); ?>" style="<?php echo isset( $item['css'] ) ? esc_attr( $item['css'] ) : ''; ?>"> <label> <input name="<?php echo esc_attr( $item_id ); ?>" value="<?php echo esc_attr( $item_id ); ?>" type="checkbox" disabled/> <?php echo is_array( $item ) ? $item['label'] : $item; // escaped before ?> </label> </li> <?php } ?> </ul> <?php echo $this->get_filed_input_desc( $options ); // escaped before ?> </div> PK p��[;3il< < J includes/libs/better-framework/page-builder/generators/vc/fields/color.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/color.php';PK p��[�vb� � I includes/libs/better-framework/page-builder/generators/vc/fields/text.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $wrapper = Better_Framework::html()->add( 'div' )->class( 'bf-clearfix' ); $input = Better_Framework::html()->add( 'input' )->type( 'text' )->name( $options['input_name'] ); if ( isset( $options['input_class'] ) ) { $input->class( $options['input_class'] ); } if ( ! empty( $options['value'] ) ) { $input->value( $options['value'] )->css( 'border-color', $options['value'] ); } $wrapper->add( $input ); echo $wrapper->display(); // escaped before PK p��[_\k_9 9 L includes/libs/better-framework/page-builder/generators/vc/fields/vc-info.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/info.php';PK p��[�d�B B S includes/libs/better-framework/page-builder/generators/vc/fields/vc-media_image.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ include BF_PATH . 'core/field-generator/fields/media_image.php';PK p��[�S S ] includes/libs/better-framework/page-builder/generators/vc/class-bf-vc-front-end-generator.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ class BF_VC_Front_End_Generator extends BF_Admin_Fields { /** * Holds Items Array * * @since 1.0 * @access public * @var array|null */ public $item; /** * Panel ID * * @since 1.0 * @access public * @var string */ public $id; /** * Panel Values * * @since 1.0 * @access public * @var array */ public $values; /** * Constructor Function * * @param array $item Contain details of one field * @param $id * * @since 1.0 * @access public * @return \BF_VC_Front_End_Generator */ public function __construct( array &$item, &$id ) { // Parent Constructor $generator_options = array( 'fields_dir' => BF_PATH . 'page-builder/generators/vc/fields/', 'templates_dir' => BF_PATH . 'page-builder/generators/vc/templates/' ); $this->supported_fields[] = 'vc-image_radio'; $this->supported_fields[] = 'vc-media_image'; $this->supported_fields[] = 'vc-switchery'; $this->supported_fields[] = 'vc-sorter_checkbox'; $this->supported_fields[] = 'vc-info'; parent::__construct( $generator_options ); $this->item = $item; $this->id = $id; } /** * Display HTML output of panel array * * Display full html of panel array which is defined in object parameter * * @since 1.0 * @access public * @return string */ public function get_field() { $output = ''; $field = $this->item; if ( ! isset( $field['value'] ) && isset( $field['std'] ) ) { $field['value'] = $field['std']; } $output .= $this->section( call_user_func( array( $this, $field['type'] ), $field ), $field ); return $output; } }PK p��[���E( ( C includes/libs/better-framework/page-builder/generators/vc/index.phpnu �[��� <?php // let's show them we are better PK p��[��:�� � \ includes/libs/better-framework/page-builder/generators/vc/class-bf-vc-shortcode-extender.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ if ( ! class_exists( "WPBakeryShortCode" ) ) { class WPBakeryShortCode { } } /** * Wrapper for WPBakeryShortCode Class for handling editor */ class BF_VC_Shortcode_Extender extends WPBakeryShortCode { }PK p��[�E�� � O includes/libs/better-framework/page-builder/generators/vc/templates/default.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ ?> <div class="bf-section-container vc-input bf-clearfix <?php echo isset( $options['section_class'] ) ? esc_attr( $options['section_class'] ) : ''; ?>"> <?php echo $input; // escaped before ?> </div>PK p��[=�<Nk k O includes/libs/better-framework/page-builder/generators/vc/templates/heading.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $style = ! empty( $options['layout'] ) ? $options['layout'] : 'style-1'; ?> <div class="bf-section-container vc-input bf-clearfix"> <div class="bf-section-heading bf-clearfix <?php echo $style; ?>" data-id="<?php echo esc_attr( $options['id'] ); ?>" id="<?php echo esc_attr( $options['id'] ); ?>"> <div class="bf-section-heading-title bf-clearfix"> <h4><?php echo esc_html( $options['title'] ); ?></h4> </div> <?php if ( ! empty( $options['desc'] ) ) { ?> <div class="bf-section-heading-desc bf-clearfix"><?php echo wp_kses( $options['desc'], bf_trans_allowed_html() ); ?></div> <?php } ?> </div> </div>PK p��[x�� � O includes/libs/better-framework/page-builder/generators/vc/templates/vc-info.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ $classes = $this->get_classes( $options ); $iri = isset( $options['repeater_item'] ) && $options['repeater_item'] == true; // Is this section for a repeater item $section_classes = $classes['section'] . ' bf-widget-field-section'; $heading_classes = $classes['heading'] . ' bf-heading'; $controls_classes = $classes['controls'] . ' bf-control not-prepared'; $explain_classes = $classes['explain'] . ' bf-desc'; if ( $iri ) { $section_classes .= ' ' . $classes['repeater-section']; $heading_classes .= ' ' . $classes['repeater-heading']; $controls_classes .= ' ' . $classes['repeater-controls']; $explain_classes .= ' ' . $classes['repeater-explain']; } else { $section_classes .= ' ' . $classes['nonrepeater-section']; $heading_classes .= ' ' . $classes['nonrepeater-heading']; $controls_classes .= ' ' . $classes['nonrepeater-controls']; $explain_classes .= ' ' . $classes['nonrepeater-explain']; } $section_classes .= ' ' . $classes['section-class-by-filed-type']; $heading_classes .= ' ' . $classes['heading-class-by-filed-type']; $controls_classes .= ' ' . $classes['controls-class-by-filed-type']; $explain_classes .= ' ' . $classes['explain-class-by-filed-type']; if ( ! isset( $options['info-type'] ) ) { $options['info-type'] = 'info'; } if ( ! isset( $options['state'] ) ) { $options['state'] = 'open'; } ?> <div class="bf-section-container bf-clearfix"> <div class="bf-section-info <?php echo esc_attr( $options['info-type'] ); ?> <?php echo esc_attr( $options['state'] ); ?> bf-clearfix"> <div class="bf-section-info-title bf-clearfix"> <h3><?php switch ( $options['info-type'] ) { case 'help': echo '<i class="fa fa-support"></i> '; break; case 'info': echo '<i class="fa fa-info"></i> '; break; case 'warning': echo '<i class="fa fa-warning"></i> '; break; case 'danger': echo '<i class="fa fa-exclamation"></i> '; break; default: echo '<i class="fa fa-info"></i> '; break; } echo esc_html( $options['name'] ); ?></h3> </div> <div class="<?php echo esc_attr( $controls_classes ); ?> bf-clearfix"> <?php echo $input; // escaped before ?> </div> </div> </div>PK p��[���E( ( 5 includes/libs/better-framework/page-builder/index.phpnu �[��� <?php // let's show them we are better PK p��[Zy� O includes/libs/better-framework/page-builder/misc/class-bf-widget-artificial.phpnu �[��� <?php class BF_Widget_Artificial extends BF_Widget { /** * @var string */ protected $shortcode_id; /** * @var BF_Shortcode */ protected $shortcode_instance; public function __construct( $shortcode_id ) { $this->set_shortcode_id( $shortcode_id ); if ( ! $this->shortcode_instance ) { return; } $settings = $this->shortcode_instance->page_builder_settings(); parent::__construct( $shortcode_id, $settings['name'], isset( $settings['description'] ) ? $settings['description'] : '' ); } /** * Loads fields */ public function load_fields() { $this->fields = array_values( $this->shortcode_instance->get_fields() ); } /** * @param string $shortcode_id */ public function set_shortcode_id( $shortcode_id ) { $this->shortcode_id = $shortcode_id; $this->shortcode_instance = BF_Shortcodes_Manager::factory( $this->shortcode_id, array(), true ); } /** * @return string */ public function get_shortcode_id() { return $this->shortcode_id; } } PK p��[=�'� � M includes/libs/better-framework/page-builder/class-bf-page-builder-wrapper.phpnu �[��� <?php /** * Class BF_Page_Builders_Wrapper * * @since 4.0.0 */ abstract class BF_Page_Builder_Wrapper { /** * Register supported fields. * * @since 4.0.0 * @return bool true on success. */ abstract public function register_fields(); /** * Unique id of the page builder. * * @since 4.0.0 * @return string */ abstract public function unique_id(); /** * Register shortcode map. * * @param array $settings * @param mixed $fields transformed fields * * @since 4.0.0 * @return bool true on success */ abstract public function register_map( array $settings, $fields ); /** * List of supported fields type. * * @since 4.0.0 * @return array */ abstract public function supported_fields(); /** * Call register_map method when this hook has been fired. * * Empty return value will fire the method immediately. * * @since 4.0.0 * @return string */ public static function register_map_hook() { return ''; } /** * Call register_fields method when this hook has been fired. * * Empty return value will fire the method immediately. * * @since 4.0.0 * @return string */ public static function register_fields_hook() { return ''; } } PK p��[���7 �7 L includes/libs/better-framework/page-builder/wrappers/class-bf-vc-wrapper.phpnu �[��� <?php /*** * BetterFramework is BetterStudio framework for themes and plugins. * * ______ _ _ ______ _ * | ___ \ | | | | | ___| | | * | |_/ / ___| |_| |_ ___ _ __ | |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ * | ___ \/ _ \ __| __/ _ \ '__| | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / * | |_/ / __/ |_| || __/ | | | | | | (_| | | | | | | __/\ V V / (_) | | | < * \____/ \___|\__|\__\___|_| \_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ * * Copyright © 2017 Better Studio * * * Our portfolio is here: https://betterstudio.com/ * * \--> BetterStudio, 2018 <--/ */ /** * Initialize custom functionality to VC */ class BF_VC_Wrapper extends BF_Page_Builder_Wrapper { /** * Register shortcode map. * * @param array $settings * @param array $fields transformed fields * * @since 4.0.0 * @return bool true on success */ public function register_map( array $settings, $fields ) { if ( empty( $settings['name'] ) ) { return false; } if ( isset( $settings['id'] ) ) { $settings['base'] = $settings['id']; unset( $settings['id'] ); } $settings['params'] = $fields; vc_map( $settings ); } function register_fields() { if ( ! class_exists( 'BF_VC_Shortcode_Extender' ) ) { require_once BF_PATH . 'page-builder/generators/vc/class-bf-vc-shortcode-extender.php'; } if ( ! class_exists( 'BF_Admin_Fields' ) ) { include BF_PATH . 'core/field-generator/class-bf-admin-fields.php'; } if ( ! class_exists( 'BF_VC_Front_End_Generator' ) ) { require_once BF_PATH . 'page-builder/generators/vc/class-bf-vc-front-end-generator.php'; } // Make it theme check plugin friendly ;) $shortcode_param_add_func = 'vc_add' . '_' . 'shortcode' . '_' . 'param'; if ( ! function_exists( $shortcode_param_add_func ) ) { return; } call_user_func( $shortcode_param_add_func, 'bf_select', array( $this, 'select_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_color', array( $this, 'color_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_background_image', array( $this, 'background_image_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_media_image', array( $this, 'media_image_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_image_radio', array( $this, 'image_radio' ) ); call_user_func( $shortcode_param_add_func, 'bf_info', array( $this, 'info' ) ); call_user_func( $shortcode_param_add_func, 'bf_slider', array( $this, 'slider_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_sorter_checkbox', array( $this, 'sorter_checkbox_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_switch', array( $this, 'switchery' ) ); call_user_func( $shortcode_param_add_func, 'bf_switchery', array( $this, 'switchery' ) ); // old. deprecated, fallback call_user_func( $shortcode_param_add_func, 'bf_ajax_select', array( $this, 'ajax_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_icon_select', array( $this, 'icon_select_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_heading', array( $this, 'heading_param' ) ); call_user_func( $shortcode_param_add_func, 'bf_term_select', array( $this, 'term_select' ) ); call_user_func( $shortcode_param_add_func, 'bf_custom', array( $this, 'custom_html' ) ); call_user_func( $shortcode_param_add_func, 'bf_select_popup', array( $this, 'select_popup' ) ); return true; } /** * List of supported fields type. * * @since 4.0.0 * @return array */ public function supported_fields() { return array( 'info', 'switch', 'slider', 'color', 'select', 'custom', 'heading', 'switchery', 'ajax_select', 'icon_select', 'term_select', 'image_radio', 'media_image', 'select_popup', 'sorter_checkbox', 'background_image', ); } /** * Convert VC Field option to an BF Field Option * * @param $settings * @param $value * * @return array */ private function convert_field_option( $settings, $value ) { $options = array( 'name' => $settings['heading'], 'id' => $settings['param_name'], 'input_name' => $settings['param_name'], 'value' => $value, 'input_class' => "wpb_vc_param_value wpb-" . $settings['type'] . " " . $settings['param_name'] . ' ' . $settings['type'] . "_field", ); if ( isset( $settings['description'] ) ) { $options['desc'] = $settings['description']; } if ( isset( $settings['input-desc'] ) ) { $options['input-desc'] = $settings['input-desc']; } if ( isset( $settings['deferred-options'] ) ) { $options['deferred-options'] = $settings['deferred-options']; } if ( isset( $settings['options'] ) ) { $options['options'] = $settings['options']; } if ( isset( $settings['section_class'] ) ) { $options['section_class'] = $settings['section_class']; } return $options; } /** * Adds BF Image Radio Field to Visual Composer * * @param $settings * @param $value * * @return string */ function image_radio( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'vc-image_radio'; $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Info Field to Visual Composer * * @param $settings * @param $value * * @return string */ function info( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'vc-info'; $options['value'] = $settings['std']; if ( isset( $settings['state'] ) ) { $options['state'] = $settings['state']; } if ( isset( $settings['info-type'] ) ) { $options['info-type'] = $settings['info-type']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Image Radio Field to Visual Composer * * @param $settings * @param $value * * @return string */ function switchery( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'vc-switchery'; if ( isset( $settings['on-label'] ) ) { $options['on-label'] = $settings['on-label']; } if ( isset( $settings['off-label'] ) ) { $options['off-label'] = $settings['off-label']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Color field to Visual Composer * * @param $settings * @param $value * * @return string */ function color_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'color'; $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Select field to Visual Composer * * @param $settings * @param $value * * @return string */ function select_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'select'; if ( isset( $settings['multiple'] ) ) { $options['multiple'] = $settings['multiple']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Select field to Visual Composer * * @param $settings * @param $value * * @return string */ function term_select( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'term_select'; $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds custom field to Visual Composer * * @param $settings * @param $value * * @return string */ function custom_html( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'custom'; if ( isset( $settings['input_callback'] ) ) { $options['input_callback'] = $settings['input_callback']; } if ( isset( $settings['container_class'] ) ) { $options['container_class'] = $settings['container_class']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds select popup field to Visual Composer * * @param $settings * @param $value * * @return string */ function select_popup( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); if ( $extra = wp_array_slice_assoc( $settings, bf_field_extra_options( 'select_popup' ) ) ) { $options = array_merge( $options, $extra ); } $options['type'] = 'select_popup'; if ( isset( $settings['input_callback'] ) ) { $options['input_callback'] = $settings['input_callback']; } if ( isset( $settings['container_class'] ) ) { $options['container_class'] = $settings['container_class']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Ajax field to Visual Composer * * @param $settings * @param $value * * @return string */ function ajax_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'ajax_select'; $options['callback'] = $settings['callback']; $options['get_name'] = $settings['get_name']; if ( isset( $settings['placeholder'] ) ) { $options['placeholder'] = $settings['placeholder']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Adds BF Background Image field to Visual Composer * * @param $settings * @param $value * * @return string */ function background_image_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'background_image'; if ( isset( $settings['media_title'] ) ) { $options['media_title'] = $settings['media_title']; } if ( isset( $settings['button_text'] ) ) { $options['button_text'] = $settings['button_text']; } if ( isset( $settings['upload_label'] ) ) { $options['upload_label'] = $settings['upload_label']; } if ( isset( $settings['remove_label'] ) ) { $options['remove_label'] = $settings['remove_label']; } $generator = new BF_VC_Front_End_Generator( $options, $value ); return $generator->get_field(); } /** * Adds BF Background Image field to Visual Composer * * @param $settings * @param $value * * @return string */ function media_image_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'vc-media_image'; if ( isset( $settings['upload_label'] ) ) { $options['upload_label'] = $settings['upload_label']; } if ( isset( $settings['remove_label'] ) ) { $options['remove_label'] = $settings['remove_label']; } if ( isset( $settings['media_title'] ) ) { $options['media_title'] = $settings['media_title']; } if ( isset( $settings['media_button'] ) ) { $options['media_button'] = $settings['media_button']; } if ( isset( $settings['data-type'] ) ) { $options['data-type'] = $settings['data-type']; } if ( isset( $settings['show_input'] ) ) { $options['show_input'] = $settings['show_input']; } if ( isset( $settings['hide_preview'] ) ) { $options['hide_preview'] = $settings['hide_preview']; } $generator = new BF_VC_Front_End_Generator( $options, $value ); return $generator->get_field(); } /** * Adds BF slider field to Visual Composer * * @param $settings * @param $value * * @return string */ function slider_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'slider'; if ( isset( $settings['dimension'] ) ) { $options['dimension'] = $settings['dimension']; } if ( isset( $settings['min'] ) ) { $options['min'] = $settings['min']; } if ( isset( $settings['max'] ) ) { $options['max'] = $settings['max']; } if ( isset( $settings['step'] ) ) { $options['step'] = $settings['step']; } $generator = new BF_VC_Front_End_Generator( $options, $value ); return $generator->get_field(); } /** * Adds BF slider field to Visual Composer * * @param $settings * @param $value * * @return string */ function sorter_checkbox_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'vc-sorter_checkbox'; if ( ! is_bool( $value ) && ! empty( $value ) ) { $options['value'] = $value; } elseif ( isset( $settings['value'] ) ) { $options['value'] = $settings['value']; } $generator = new BF_VC_Front_End_Generator( $options, $value ); return $generator->get_field(); } /** * Adds BF Background Image field to Visual Composer * * @param $settings * @param $value * * @return string */ function icon_select_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'icon_select'; $generator = new BF_VC_Front_End_Generator( $options, $value ); return $generator->get_field(); } /** * Adds BF Heading field to Visual Composer * * @param $settings * @param $value * * @return string */ function heading_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'heading'; if ( isset( $settings['heading'] ) ) { $options['title'] = $settings['heading']; } elseif ( isset( $options['title'] ) ) { $options['title'] = $settings['title']; $options['heading'] = $settings['title']; } $generator = new BF_VC_Front_End_Generator( $options, $value ); return $generator->get_field(); } /** * Unique id of the page builder. * * @since 4.0.0 * @return string */ public function unique_id() { return 'VC'; } } PK p��[�Z}[w w S includes/libs/better-framework/page-builder/wrappers/class-bf-elementor-wrapper.phpnu �[��� <?php class BF_Elementor_Wrapper extends BF_Page_Builder_Wrapper { /** * @var array */ protected $elementor_built_in_fields = array( 'text', 'heading', 'hr', 'textarea', 'wp_editor', 'code', 'switch', 'select', 'radio', 'color', 'media_image', 'slider', ); /** * @var array */ protected $wrapper_fields_list = array( // 'date', // 'checkbox', // 'ajax_select', // 'ajax_action', // 'sorter', // 'sorter_checkbox', // 'media', // 'background_image', // 'image_upload', // 'image_checkbox', // 'image_radio', // 'image_select', // 'icon_select', // 'typography', // 'border', // 'export', // 'import', // 'custom', // 'group_close', // 'editor', // 'term_select', // 'image_preview', // 'select_popup', 'info', ); /** * Register supported fields. * * @return bool true on success. */ public function register_fields() { if ( ! class_exists( 'BF_Elementor_Control_Wrapper' ) ) { require BF_PATH . 'page-builder/wrappers/class-bf-elementor-control-wrapper.php'; } foreach ( $this->wrapper_fields_list as $field_type ) { $control = new BF_Elementor_Control_Wrapper(); $control->set_bf_field_type( $field_type ); \Elementor\Plugin::$instance->controls_manager->register_control( $field_type, $control ); } return true; } /** * Register shortcode map. * * @param array $settings * @param array $fields transformed fields * * @return bool true on success */ public function register_map( array $settings, $fields ) { if ( $settings['id'] !== 'bs-about' ) { return; } if ( ! class_exists( 'BF_Elementor_Widget_Wrapper' ) ) { require BF_PATH . 'page-builder/wrappers/class-bf-elementor-widget-wrapper.php'; } try { $widget = new BF_Elementor_Widget_Wrapper(); $widget->set_bf_shortcode_settings( $settings ); return \Elementor\Plugin::instance()->widgets_manager->register_widget_type( $widget ); } catch( Exception $e ) { return false; } } /** * List of supported fields type. * * @return array */ public function supported_fields() { return array_merge( $this->elementor_built_in_fields, $this->wrapper_fields_list ); } /** * Call register_map method when this hook has been fired. * * Empty return value will fire the method immediately. * * @since 4.0.0 * @return string */ public static function register_map_hook() { return 'elementor/widgets/widgets_registered'; } /** * Call register_map method when this hook has been fired. * * Empty return value will fire the method immediately. * * @since 4.0.0 * @return string */ public static function register_fields_hook() { return 'elementor/controls/controls_registered'; } /** * Unique id of the page builder. * * @since 4.0.0 * @return string */ public function unique_id() { return 'Elementor'; } } PK p��[ !�� � ] includes/libs/better-framework/page-builder/wrappers/class-bf-page-builder-widget-wrapper.phpnu �[��� <?php class BF_Page_Builder_Widget_Wrapper { public $widget_based_page_builders = array( 'Elementor', 'SiteOrigin', ); public function __construct() { add_action( 'widgets_init', array( $this, 'init_widgets' ), 30 ); if ( ! class_exists( 'BF_Widget_Artificial' ) ) { require BF_PATH . 'page-builder/misc/class-bf-widget-artificial.php'; } } /** * Init shortcodes as widget for known page builders. */ public function init_widgets() { if ( ! $this->can_init_widgets() ) { return; } foreach ( BF_Shortcodes_Manager::shortcodes_list() as $key => $shortcode ) { if ( isset( $shortcode['widget_class'] ) || ! empty( $shortcode['skip_page_builder'] ) ) { continue; } $this->register_widget( $key ); } } /** * @param string $shortcode_id * * @return BF_Widget_Artificial */ public function widget_class( $shortcode_id ) { return new BF_Widget_Artificial( $shortcode_id ); } /** * @param string $shortcode_id */ public function register_widget( $shortcode_id ) { global $wp_widget_factory; // we can't use register_widget( $widget ) because siteorigin page builder won't work when $widget is an object $wp_widget_factory->widgets["bf-page-builder-widget-$shortcode_id"] = $this->widget_class( $shortcode_id ); } /** * @return bool */ public function can_init_widgets() { if ( $this->is_wp_widgets_page() ) { return false; } $page_builder = Better_Framework::factory( 'page-builder' )->active_page_builders(); return in_array( $page_builder, $this->widget_based_page_builders ); } public function is_wp_widgets_page() { global $pagenow; return 'widgets.php' === $pagenow; } } PK p��[�Z��T T [ includes/libs/better-framework/page-builder/wrappers/class-bf-elementor-control-wrapper.phpnu �[��� <?php class BF_Elementor_Control_Wrapper extends \Elementor\Base_Data_Control { /** * @var string */ public $bf_field_type; /** * Get emoji one area control type. * * Retrieve the control type, in this case `emojionearea`. * * @since 1.0.0 * @access public * * @return string Control type. */ public function get_type() { return $this->bf_field_type; } /** * Enqueue emoji one area control scripts and styles. * * Used to register and enqueue custom scripts and styles used by the emoji one * area control. * * @since 1.0.0 * @access public */ public function enqueue() { } /** * Get emoji one area control default settings. * * Retrieve the default settings of the emoji one area control. Used to return * the default settings while initializing the emoji one area control. * * @since 1.0.0 * @access protected * * @return array Control default settings. */ protected function get_default_settings() { return array(); } /** * Render emoji one area control output in the editor. * * Used to generate the control HTML in the editor using Underscore JS * template. The variables for the class are available using `data` JS * object. * * @since 1.0.0 * @access public */ public function content_template() { $control_uid = $this->get_control_uid(); ?> <div class="elementor-control-field"> <label for="<?php echo esc_attr( $control_uid ); ?>" class="elementor-control-title"> {{{ data.label }}} </label> <div class="elementor-control-input-wrapper"> <?php $this->render_field(); ?> </div> </div> <# if ( data.description ) { #> <div class="elementor-control-field-description">{{{ data.description }}}</div> <# } #> <?php } /** * @param string $field_type */ public function set_bf_field_type( $field_type ) { $this->bf_field_type = $field_type; } /** * @return string */ public function get_bf_field_type() { return $this->bf_field_type; } /** * */ protected function render_field() { $fields_dir = BF_PATH . 'core/field-generator/fields/'; $field_file = sprintf( '%s.php', $this->bf_field_type ); $options = array( 'value' => '', 'input_name' => '___INPUT_NAME_PLACEHOLDER___', ); ob_start(); include $fields_dir . $field_file; $field_markup = ob_get_clean(); echo $this->embed_unique_id( $field_markup ); } /** * @param string $html * * @return html */ public function embed_unique_id( $html ) { $pattern = '/( \< \s* [a-z]+ [^\>]* name\s*=\s* ([\'\"])? ___INPUT_NAME_PLACEHOLDER___ (?(2) \\2) [^\>]* \>)/isx'; return preg_replace_callback( $pattern, array( $this, 'embed_unique_id_in_field' ), $html ); } public function embed_unique_id_in_field( $matches ) { $field = $matches[1]; $modified_field = preg_replace( '/ id\s*=\s* ([^\s\>]+)/isx', 'id="' . $this->get_control_uid() . '"', $field ); if ( $modified_field !== $field ) { return $modified_field; } return preg_replace( '/(.+)\>/', '$1 id="' . $this->get_control_uid() . '">', $field ); } } PK p��[����� � Z includes/libs/better-framework/page-builder/wrappers/class-bf-elementor-widget-wrapper.phpnu �[��� <?php class BF_Elementor_Widget_Wrapper extends \Elementor\Widget_Base { public $widget_id; public function __construct( array $data = [], array $args = null ) { if ( isset( $data['widgetType'] ) ) { $this->widget_id = $data['widgetType']; } parent::__construct( $data, $args ); } /** * @var array */ protected $bf_shortcode_settings = array(); /** * Get widget name. * * @access public * * @return string Widget name. */ public function get_name() { return isset( $this->bf_shortcode_settings['id'] ) ? $this->bf_shortcode_settings['id'] : ''; } /** * Get widget title. * * @access public * * @return string Widget title. */ public function get_title() { return isset( $this->bf_shortcode_settings['name'] ) ? $this->bf_shortcode_settings['name'] : ''; } /** * Get widget icon. * * @access public * * @return string Widget icon. */ public function get_icon() { return isset( $this->bf_shortcode_settings['icon'] ) ? $this->bf_shortcode_settings['icon'] : ''; } /** * Get widget categories. * * @access public * * @return array Widget categories. */ public function get_categories() { if ( isset( $this->bf_shortcode_settings['category'] ) ) { return array( $this->bf_shortcode_settings['category'] ); } return array( 'general' ); } /** * Register oEmbed widget controls. * * @access protected */ protected function _register_controls() { if ( ! class_exists( 'BF_Fields_Adapter' ) ) { require BF_PATH . '/page-builder/class-bf-fields-adapter.php'; } if ( ! class_exists( 'BF_To_Elementor_Fields_Adapter' ) ) { require BF_PATH . 'page-builder/adapters/elementor/class-bf-to-elementor-fields-adapter.php'; } BF_Shortcodes_Manager::factory(); $adapter = new BF_To_Elementor_Fields_Adapter(); $adapter->set_elementor_widget( $this ); $adapter->load_fields( $this->shortcode_fields() ); $adapter->transform(); } /** * Render oEmbed widget output on the frontend. * * @access protected */ protected function render() { $content = ''; echo BF_Shortcodes_Manager::handle_shortcodes( $this->attributes(), $content, $this->widget_id ); } /** * @return array */ protected function attributes() { $attrs = $this->get_settings(); foreach ( $this->attributes_changes() as $id => $index ) { if ( ! isset( $attrs[ $id ] ) ) { continue; } $attrs[ $id ] = isset( $attrs[ $id ][ $index ] ) ? $attrs[ $id ][ $index ] : ''; } return $attrs; } /** * @return array */ protected function attributes_changes() { if ( ! $changes = get_option( 'bf-elementor-fields-comp' ) ) { return array(); } return isset( $changes[ $this->widget_id ] ) ? $changes[ $this->widget_id ] : array(); } /** * @param array $settings */ public function set_bf_shortcode_settings( $settings ) { $this->bf_shortcode_settings = $settings; if ( ! empty( $settings['id'] ) ) { $this->widget_id = $settings['id']; } } /** * @return array */ public function get_bf_shortcode_settings() { return $this->bf_shortcode_settings; } public function shortcode_fields() { $fields = array(); if ( $shortcode = BF_Shortcodes_Manager::factory( $this->widget_id ) ) { $fields = $shortcode->get_fields(); $this->fields_compatibility( $fields ); } return $fields; } public function fields_compatibility( &$fields ) { $status = get_option( 'bf-elementor-fields-comp', array() ); foreach ( $fields as $field ) { if ( isset( $field['type'] ) && 'media_image' === $field['type'] ) { $status[ $this->widget_id ][ $field['id'] ] = isset( $field['data-type'] ) ? $field['data-type'] : 'url'; } } update_option( 'bf-elementor-fields-comp', $status ); } } PK p��[b\� L includes/libs/better-framework/page-builder/wrappers/class-bf-kc-wrapper.phpnu �[��� <?php class BF_KC_Wrapper extends BF_Page_Builder_Wrapper { /** * @var array * * @since 4.0.0 */ public $static_fields = array(); /** * Register * * @return bool true on success. */ public function register_fields() { global $kc; if ( ! $kc || ! is_callable( array( $kc, 'add_param_type' ) ) ) { return false; } // Register fields except deferred ones, they will load via ajax // @see BF_KC_Compatibility::ajax_load_fields() $this->static_fields = array_diff( $this->supported_fields(), $this->dynamic_deferred_fields(), $this->static_deferred_fields() ); /** * We can't use $kc->add_param_type because the second parameter doesn't accept object * That's silly but we have to handle this part in hard way! * * @see KingComposer::convert_paramTypes */ // add_action( 'kc_after_admin_footer', array( $this, 'print_static_fields_template' ) ); require BF_PATH . 'page-builder/generators/kc/kc-field-generator-functions.php'; foreach ( $this->static_fields as $field ) { if ( function_exists( 'bf_kc_field_' . $field ) ) { $kc->add_param_type( $field, 'bf_kc_field_' . $field ); } } return true; } /** * @since 4.0.0 */ /*public function print_static_fields_template() { if ( empty( $this->static_fields ) ) { return; } if ( ! class_exists( 'BF_KC_Fields_Generator' ) ) { require BF_PATH . 'page-builder/generators/kc/class-bf-kc-fields-generator.php'; } $generator = new BF_KC_Fields_Generator(); foreach ( $this->static_fields as $field ) { echo '<script type="text/html" id="tmpl-kc-field-type-' . esc_attr( $field ) . '-template">'; $options = array( 'id' => '{{data.name}}', 'value' => '{{data.value}}', 'type' => $field, ); call_user_func( array( $generator, $field ), $options ); echo "</script>\n"; } }*/ /** * Adds BF Select field to Visual Composer * * @param $settings * @param $value * * @return string */ function select_param( $settings, $value ) { $options = $this->convert_field_option( $settings, $value ); $options['type'] = 'select'; if ( isset( $settings['multiple'] ) ) { $options['multiple'] = $settings['multiple']; } $generator = new BF_VC_Front_End_Generator( $options, $settings['param_name'] ); return $generator->get_field(); } /** * Register shortcode map. * * @param array $settings * @param array $fields transformed fields * * @return bool true on success */ public function register_map( array $settings, $fields ) { if ( empty( $settings['name'] ) || empty( $settings['id'] ) ) { return false; } if ( empty( $fields ) ) { return false; } $always_fetch_fields = false; $deferred_types = $this->dynamic_deferred_fields(); foreach ( $fields as $tab_fields ) { foreach ( $tab_fields as $field ) { if ( in_array( $field['type'], $deferred_types ) ) { BF_KC_Compatibility::always_fetch_map_fields( $settings['id'] ); $always_fetch_fields = true; break 2; } } } if ( ! $always_fetch_fields ) { $deferred_types = $this->static_deferred_fields(); $deferred_fields = array(); foreach ( $fields as $tab_fields ) { foreach ( $tab_fields as $field ) { if ( in_array( $field['type'], $deferred_types ) ) { $deferred_fields[] = $field['type']; } } } if ( ! empty( $deferred_fields ) ) { BF_KC_Compatibility::mark_fields_as_deferred( $settings['id'], $deferred_fields ); } } $settings['params'] = $fields; if ( isset( $settings['desc'] ) ) { $settings['description'] = $settings['desc']; unset( $settings['desc'] ); } return $this->kc_map( $settings['id'], $settings ); } /** * List of all supported fields type. * * @return array */ public function supported_fields() { return array( 'text', 'color', 'switch', 'heading', 'icon_select', 'select', 'select_popup', 'term_select', 'ajax_select', 'custom', 'group', 'group_close', 'info', 'heading', 'image_radio', 'media_image', 'sorter_checkbox', // 'background_image', ); } /** * todo: add comment * * @return array */ public function static_deferred_fields() { return array(); } /** * todo: add comment * List of fields types that should be fetch via ajax * * @return array */ public function dynamic_deferred_fields() { return array( 'icon_select', 'select', 'select_popup', 'term_select', 'ajax_select', 'heading', 'custom', 'group', 'group_close', 'info', 'image_radio', 'media_image', 'sorter_checkbox', // 'background_image', ); } /** * @param string $id * @param array $atts * * @global KingComposer $kc * * @since 4.0.0 * @return bool true on success or false on error. */ public function kc_map( $id, $atts ) { global $kc; if ( $kc && is_callable( array( $kc, 'add_map' ) ) ) { if ( empty( $atts['category'] ) ) { $atts['category'] = 'all'; } if ( empty( $atts['icon'] ) ) { $atts['icon'] = "$id-icon"; } $kc->add_map( array( $id => $atts ) ); return true; } return false; } /** * Unique id of the page builder. * * @since 4.0.0 * @return string */ public function unique_id() { return 'KC'; } }PK p��[���E( ( >