title' => __( 'Choose Style', 'better-studio' ), 'box_pre_title' => __( 'Active style', 'better-studio' ), 'box_button' => __( 'Change Style', 'better-studio' ), ), 'section_class' => 'bsfp-style-field', // 'vc_admin_label' => true, ), array( 'name' => __( 'Color Scheme', 'better-studio' ), 'id' => 'scheme', 'type' => 'select', 'options' => array( 'light' => __( 'Light (White Skin)', 'better-studio' ), 'dark' => __( 'Dark (Black Skin)', 'better-studio' ), ), // 'vc_admin_label' => false, ), array( 'type' => 'tab', 'name' => __( 'Stock Market & Currency', 'better-studio' ), 'id' => 'stocks', ), array( 'name' => __( 'Stock Market Type', 'better-studio' ), 'id' => 'stocks', 'type' => 'select', 'options' => array( 'top-x-stocks' => __( 'Top X Popular Stock Markets', 'better-studio' ), 'selected' => __( 'Manually Selected Stock Markets', 'better-studio' ), ), // 'vc_admin_label' => false, ), array( 'name' => __( 'Stock Markets Count', 'better-studio' ), 'id' => 'stocks-count', 'type' => 'text', 'show_on' => array( array( 'stocks=top-x-stocks', ) ), // 'vc_admin_label' => false, ), array( 'name' => __( 'Select Stock Market', 'better-studio' ), 'id' => 'stocks-selected', 'type' => 'ajax_select', 'get_name' => 'bsfp_stock_market_select_callback_name', 'callback' => 'bsfp_stock_market_select_callback', 'show_on' => array( array( 'stocks=selected', ) ), // 'vc_admin_label' => false, ), array( 'name' => __( 'Currency', 'better-studio' ), 'id' => 'currency', 'type' => 'select', 'deferred-options' => array( 'callback' => 'bsfp_get_currencies_list_option', ), // 'vc_admin_label' => true, ), ); /** * Retrieve heading fields from outside (our themes are defining them) */ { $heading_fields = apply_filters( 'better-framework/shortcodes/heading-fields', array(), $this->id ); if ( $heading_fields ) { $fields = array_merge( $heading_fields, $fields ); } } /** * Retrieve design fields from outside (our themes are defining them) */ { $design_fields = apply_filters( 'better-framework/shortcodes/design-fields', array(), $this->id ); if ( $design_fields ) { $fields = array_merge( $fields, $design_fields ); } } return $fields; } /** * Registers Visual Composer Add-on */ function page_builder_settings() { return array( 'name' => __( 'Stock Markets Table', 'better-studio' ), "base" => $this->id, "weight" => 10, "wrapper_height" => 'full', "category" => __( 'Financial Pack', 'better-studio' ), ); } // page_builder_settings } /** * BS FP Stock Market Table Widget */ class BSFP_StockMarket_Table_Widget extends BF_Widget { /** * Register widget with WordPress. */ function __construct() { parent::__construct( 'bsfp-stockmarket-table', __( 'FP - Stock Market Table', 'better-studio' ), array( 'description' => __( 'Stock Market table', 'better-studio' ) ) ); } // __construct /** * Loads fields */ function load_fields() { // Back end form fields $this->fields = array( array( 'name' => __( 'Title', 'better-studio' ), 'id' => 'title', 'type' => 'text', ), // Style Options array( 'type' => 'group', 'name' => __( 'Style', 'better-studio' ), 'id' => 'style_tab', 'state' => 'close', ), array( 'name' => __( 'Style', 'better-studio' ), 'id' => 'style', 'type' => 'select_popup', 'deferred-options' => array( 'callback' => 'bsfp_stockmarket_table_styles_option', ), 'texts' => array( 'modal_title' => __( 'Choose Style', 'better-studio' ), 'box_pre_title' => __( 'Active style', 'better-studio' ), 'box_button' => __( 'Change Style', 'better-studio' ), ), 'section_class' => 'bsfp-style-field', ), array( 'name' => __( 'Color Scheme', 'better-studio' ), 'id' => 'scheme', 'type' => 'select', 'options' => array( 'light' => __( 'Light (White Skin)', 'better-studio' ), 'dark' => __( 'Dark (Black Skin)', 'better-studio' ), ), ), // array( 'type' => 'group', 'name' => __( 'Stock Markets & Currency', 'better-studio' ), 'id' => 'stocks', 'state' => 'close', ), array( 'name' => __( 'Stock Markets Type', 'better-studio' ), 'id' => 'stocks', 'type' => 'select', 'options' => array( 'top-x-stocks' => __( 'Top X Popular Stock Markets', 'better-studio' ), 'selected' => __( 'Manually Selected Stock Markets', 'better-studio' ), ), ), array( 'name' => __( 'Stock Markets Count', 'better-studio' ), 'id' => 'stocks-count', 'type' => 'text', 'show_on' => array( array( 'stocks=top-x-stocks', ) ), ), array( 'name' => __( 'Select Stock Market', 'better-studio' ), 'id' => 'stocks-selected', 'type' => 'ajax_select', 'get_name' => 'bsfp_stock_market_select_callback_name', 'callback' => 'bsfp_stock_market_select_callback', 'show_on' => array( array( 'stocks=selected', ) ), ), array( 'name' => __( 'Currency', 'better-studio' ), 'id' => 'currency', 'type' => 'select', 'deferred-options' => array( 'callback' => 'bsfp_get_currencies_list_option', ), ), ); } // load_fields } 'name' => __( 'Tab Content', 'publisher' ), 'id' => 'content', 'type' => 'textarea', 'shortcode_content' => true, ), 'id' => array( 'name' => __( 'Custom Tab ID (Optional)', 'publisher' ), 'id' => 'id', 'type' => 'text', ), ), ), ); } /** * TinyMCE view settings * * @return array */ function tinymce_settings() { return array( 'name' => __( 'Tabs', 'publisher' ), 'sub_shortcodes' => array( 'tab_settings' => 'tab' ), 'scripts' => array( array( 'type' => 'registered', 'handles' => array( 'theme-libs' ), ) ), ); } public function page_builder_settings() { $settings = parent::page_builder_settings(); return array_merge( $settings, array( 'name' => __( 'Tabs', 'publisher' ), 'id' => $this->id, 'category' => publisher_white_label_get_option( 'publisher' ), 'click_able' => true, ) ); } /** * @param array $settings * * @return array */ public function parse_attr_tabs( $settings ) { if ( ! $settings ) { return array(); } $tabs_list = array(); foreach ( $settings as $index => $tab ) { if ( isset( $tab['title'] ) && isset( $tab['content'] ) ) { $tabs_list[] = array( 'title' => sprintf( $tab['title'], $index ), 'content' => wpautop( do_shortcode( $tab['content'] ) ), 'id' => isset( $tab['content'] ) ? $tab['content'] : mt_rand(), ); } } return $tabs_list; } /** * @param string $content * * @return array */ public function parse_content_tabs( $content ) { global $publisher_sh_tabs_count, $publisher_sh_tabs; $publisher_sh_tabs_count = 0; $publisher_sh_tabs = array(); // parse nested shortcodes and collect data do_shortcode( $content ); return $publisher_sh_tabs; } }