Plugin Directory

Changeset 1490799


Ignore:
Timestamp:
09/06/2016 07:58:10 AM (9 years ago)
Author:
tranthethang
Message:

2.0.1

  • Update jquery plugin "Magnific Popup" to v1.1.0 - 2016-02-20
  • Add toggle button, to switch mode Editor and Page Builder.
  • Add Php Docs for all variables, fuctions, classes.
  • Optimize source code: Php, Css, Js.
  • Separate functions to multi classes.
  • Support "php-autoload" to include files.
  • Use Ajax for all action: load form, load list of widget, load customize fields,..
Location:
kopa-page-builder/trunk
Files:
62 added
3 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • kopa-page-builder/trunk/kopa-page-builder.php

    r1468356 r1490799  
    11<?php
    2 /*
    3 Plugin Name: Kopa Page Builder
    4 Description: The visual page builder
    5 Version: 1.4
    6 Author: Kopa Theme
    7 Author URI: http://kopatheme.com/
    8 License: GNU General Public License v3 or later
    9 License URI: http://www.gnu.org/licenses/gpl-3.0.html
    10 
    11 Kopa Page Builder plugin, Copyright 2014 Kopatheme.com
    12 Kopa Page Builder is distributed under the terms of the GNU GPL
    13 
    14 Requires at least: 4.1
    15 Tested up to: 4.5.2
    16 Text Domain: kopa-page-builder
    17 Domain Path: /languages/
    18 */
    19 
    20 define( 'KPB_IS_DEV', true );
    21 define( 'KPB_DIR', plugin_dir_url( __FILE__ ) );
    22 define( 'KPB_PATH', plugin_dir_path( __FILE__ ) );
    23 
    24 add_action( 'plugins_loaded', array( 'Kopa_Page_Builder', 'plugins_loaded' ) );
    25 add_action( 'after_setup_theme', array( 'Kopa_Page_Builder', 'after_setup_theme' ), 20 );   
    26 
    27 class Kopa_Page_Builder {
    28 
    29     function __construct() {
    30         add_action( 'add_meta_boxes', array( $this, 'register_meta_boxes' ) );             
    31         add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 20);
    32 
    33         #LIGHTBOX       
    34         add_action( 'admin_footer', array( $this, 'print_ajax_security' ) );
    35 
    36         #AJAX
    37         add_action( 'wp_ajax_kpb_get_widget_form', array( $this, 'get_widget_form' ) );
    38         add_action( 'wp_ajax_kpb_save_widget', array( $this, 'save_widget' ) );
    39         add_action( 'wp_ajax_kpb_save_grid', array( $this, 'save_grid' ) );     
    40         add_action( 'wp_ajax_kpb_delete_widget', array( $this, 'delete_widget' ) );     
    41         add_action( 'wp_ajax_kpb_save_customize', array( $this, 'save_customize' ) );       
    42         add_action( 'wp_ajax_kpb_save_layout_customize', array( $this, 'save_layout_customize' ) );                     
    43         add_action( 'wp_ajax_kpb_load_lightbox_html', array( $this, 'load_lightbox_html' ) );               
     2/**
     3 * Kopa Page Builder plugin helps you create static pages by manually adding, editing or moving the widgets to the expected sidebars. Unlike the other Page Builder plugins which available on WordPress.org now, this plugin requires a deep understanding of technical knowledge and WordPress to use for your website.
     4 *
     5 * @package Kopa_Page_Builder
     6 * @author kopatheme
     7 *
     8 * Plugin Name: Kopa Page Builder
     9 * Description: Kopa Page Builder plugin helps you create static pages by manually adding, editing or moving the widgets to the expected sidebars. Unlike the other Page Builder plugins which available on WordPress.org now, this plugin requires a deep understanding of technical knowledge and WordPress to use for your website.
     10 * Version: 2.0.1
     11 * Author: Kopa Theme
     12 * Author URI: http://kopatheme.com/
     13 * License: GNU General Public License v3 or later
     14 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
     15 *
     16 * Kopa Page Builder plugin, Copyright 2016 Kopatheme.com
     17 * Kopa Page Builder is distributed under the terms of the GNU GPL
     18 *
     19 * Requires at least: 4.1
     20 * Tested up to: 4.6
     21 * Text Domain: kopa-page-builder
     22 * Domain Path: /languages/
     23 */
     24
     25if ( ! class_exists( 'Kopa_Page_Builder' ) ) {
     26
     27    define( 'KPB_IS_DEV', false );
     28    define( 'KPB_DIR', plugin_dir_url( __FILE__ ) );
     29    define( 'KPB_PATH', plugin_dir_path( __FILE__ ) );
     30
     31    add_action( 'plugins_loaded', array( 'Kopa_Page_Builder', 'plugins_loaded' ) );
     32    add_action( 'after_setup_theme', array( 'Kopa_Page_Builder', 'get_instance' ), 20 );
     33
     34    include_once KPB_PATH . 'inc/class-kpb-autoloader.php';
     35
     36    /**
     37     * The main class for plugin Kopa Page Builder.
     38     */
     39    class Kopa_Page_Builder {
     40
     41        /**
     42         * The instance of class Kopa_Page_Builder.
     43         *
     44         * @var object $instance
     45         */
     46        protected static $instance = null;
     47
     48        /**
     49         * The function for singleton pattern.
     50         *
     51         * @return object
     52         */
     53        static function get_instance() {
     54            if ( null === self::$instance ) {
     55                self::$instance = new self;
     56            }
     57            return self::$instance;
     58        }
     59
     60        /**
     61         * The construct function of object Kopa_Page_Builder.
     62         */
     63        function __construct() {
     64            add_action( 'admin_menu', array( $this, 'admin_menu' ), 99 );
     65            add_action( 'add_meta_boxes', array( $this, 'register_meta_boxes' ) );
     66
     67            if ( is_admin() ) {
     68                KPB_Ajax::get_instance();
     69                KPB_Layout::get_instance();
     70                KPB_Row::get_instance();
     71                KPB_Col::get_instance();
     72                KPB_Widget::get_instance();
     73                KPB_Admin_Assets::get_instance();
     74                KPB_Editor::get_instance();
     75            }
     76
     77            KPB_Shortcode::get_instance();
     78        }
     79
     80        /**
     81         * Force remove metabox "postcustom".
     82         *
     83         * @return void
     84         */
     85        function admin_menu() {
     86            remove_meta_box( 'postcustom', 'page', 'normal' );
     87        }
     88
     89        /**
     90         * Register page-builder metabox.
     91         *
     92         * @return void
     93         */
     94        function register_meta_boxes() {
     95            add_meta_box( 'kpb-metabox', esc_html__( 'Page Builder', 'kopa-page-builder' ), array( $this, 'get_meta_boxes' ), 'page', 'advanced', 'high' );
     96        }
     97
     98        /**
     99         * Print page-builder metabox.
     100         *
     101         * @return void
     102         */
     103        function get_meta_boxes() {
     104            global $post;
     105
     106            wp_nonce_field( 'kpb-metabox', 'kpb-metabox_security' );
     107
     108            $obj_layout     = KPB_Layout::get_instance();
     109            $layouts        = $obj_layout->get_layouts();
     110            $current_layout = self::get_current_layout( $post->ID );
     111            $cbo_layouts    = $obj_layout->get_key_current_layout();
     112            ?>         
     113
     114      <section id="kpb-wrapper">
     115         
     116          <header id="kpb-wrapper-header" class="kpb-clearfix">
     117             
     118                        <select id="kpb-select-layout" name="<?php echo esc_attr( $cbo_layouts ); ?>" class="kpb-pull-left" onchange="KPB_Layouts.change(event, jQuery(this));" autocomplete="off">
     119                            <?php   foreach ( $layouts as $layout_slug => $layout ) : ?>
     120                                <option value="<?php echo esc_attr( $layout_slug ); ?>" <?php selected( $current_layout, $layout_slug, true ) ?>><?php echo esc_html( $layout['title'] ); ?></option>                       
     121                            <?php endforeach; ?>
     122                        </select>                                           
     123
     124                        <a id="kpb-button-save-layouts" href="#" onclick="KPB_Layout.save_layout( event, jQuery( this ) );" class="button button-primary button-large kpb-pull-right" data-status='1'><?php esc_html_e( 'Save', 'kopa-page-builder' ); ?></a>       
     125                        <a id="kpb-button-hide-preview" href="#" onclick="KPB_Tips.hide_screenshot( event, jQuery( this ) );" class="button button-secondary button-large kpb-pull-right" data-status='0' style="display: none;"><?php esc_html_e( 'Show visual layout', 'kopa-page-builder' ); ?></a>
     126                        <a id="kpb-button-customize-layout" href="#" onclick="KPB_Layout_Customize.open( event, jQuery( this ) );" class="button button-secondary button-large kpb-pull-right" style="display: none;"><?php esc_html_e( 'Customize', 'kopa-page-builder' ); ?></a>                 
     127                       
     128          </header>
     129                         
     130      </section>
     131            <?php
     132        }
     133
     134        /**
     135         * Register plugin text-domain.
     136         *
     137         * @return void
     138         */
     139        static function plugins_loaded() {
     140            load_plugin_textdomain( 'kopa-page-builder', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     141        }
     142
     143        /**
     144         * Get list of registed layouts.
     145         *
     146         * @return array
     147         */
     148        static function get_registed_layouts() {
     149            $obj_layout = KPB_Layout::get_instance();
     150            return $obj_layout->get_layouts();
     151        }
     152
     153        /**
     154         * Get layout information by layout slug.
     155         *
     156         * @param  string $layout_slug Slug or Name of a layout.
     157         * @return array
     158         */
     159        static function get_layout( $layout_slug = '' ) {
     160            $obj_layout = KPB_Layout::get_instance();
     161            return $obj_layout->get_layout( $layout_slug );
     162        }
     163
     164        /**
     165         * Get slug / name of current / activated layout.
     166         *
     167         * @param integer $post_id ID of a post.
     168         */
     169        static function get_current_layout( $post_id = 0 ) {
     170            $obj_layout = KPB_Layout::get_instance();
     171            return $obj_layout->get_current_layout( $post_id );
     172        }
     173
     174        /**
     175         * Get grid data for page.
     176         *
     177         * @param  integer $post_id ID of a post.
     178         * @param  string  $layout_slug Slug or Name of a layout.
     179         * @return array
     180         */
     181        static function get_layout_data( $post_id = 0, $layout_slug = '' ) {
     182            $obj_layout = KPB_Layout::get_instance();
     183            return $obj_layout->get_data( $post_id, $layout_slug );
     184        }
     185
     186        /**
     187         * Get customize data for a layout.
     188         *
     189         * @param  integer $post_id ID of a post.
     190         * @param  string  $layout_slug Slug or Name of a layout.
     191         * @return array
     192         */
     193        static function get_layout_customize_data( $post_id = 0, $layout_slug = '' ) {
     194            $obj_layout = KPB_Layout::get_instance();
     195            return $obj_layout->get_data_customize( $post_id, $layout_slug );
     196        }
     197
     198        /**
     199         * Get customize data for a row.
     200         *
     201         * @param  integer $post_id ID of a post.
     202         * @param  string  $layout_slug Slug or Name of a layout.
     203         * @param  string  $row_slug Slug or Name of a row.
     204         * @return array
     205         */
     206        static function get_row_customize_data( $post_id = 0, $layout_slug = '', $row_slug = '' ) {
     207            $obj_row = KPB_Row::get_instance();
     208            return $obj_row->get_data( $post_id, $layout_slug, $row_slug );
     209        }
     210
     211        /**
     212         * Get customize data for a column.
     213         *
     214         * @param  integer $post_id ID of a post.
     215         * @param  string  $layout_slug Slug or Name of a layout.
     216         * @param  string  $row_slug Slug or Name of a row.
     217         * @param  string  $col_slug Slug or Name of a column.
     218         * @return array
     219         */
     220        static function get_col_customize_data( $post_id = 0, $layout_slug = '', $row_slug = '', $col_slug = '' ) {
     221            $obj_col = KPB_Col::get_instance();
     222            return $obj_col->get_data( $post_id, $layout_slug, $row_slug, $col_slug );
     223        }
     224
     225        static function is_exist_widget( $post_id = 0, $widget_class_name = '' ) {
     226            $layout_slug = self::get_current_layout( $post_id );
     227            $obj_widget  = KPB_Widget::get_instance();
     228           
     229            return $obj_widget->is_exist( $post_id, $layout_slug, $widget_class_name );
     230        }
     231
     232        /**
     233         * Get customize data for a row.
     234         * Has been replaced by get_row_customize_data( $post_id, $layout_slug, $row_slug ).
     235         *
     236         * @deprecated since 2.0.0
     237         * @param  integer $post_id ID of a post.
     238         * @param  string  $layout_slug Slug or Name of a layout.
     239         * @param  string  $row_slug Slug or Name of a row.
     240         * @return array
     241         */
     242        static function get_current_wrapper_data( $post_id = 0, $layout_slug = '', $row_slug = '' ) {
     243            return self::get_row_customize_data( $post_id, $layout_slug, $row_slug );
     244        }
     245
     246        /**
     247         * Get grid data for page.
     248         * Has been replaced by get_layout_data( $post_id, $layout_slug, $row_slug ).
     249         *
     250         * @deprecated since 2.0.0
     251         * @param  integer $post_id ID of a post.
     252         * @param  string  $layout_slug Slug or Name of a layout.
     253         * @return array
     254         */
     255        static function get_current_layout_data( $post_id = 0, $layout_slug = '' ) {
     256            return self::get_layout_data( $post_id, $layout_slug );
     257        }
    44258       
    45         #SHORTCODE
    46         add_shortcode( 'kpb_home_url', array( $this, 'shortcode_home_url' ) ); 
    47 
    48         #CONFIG
    49         add_filter( 'kopa_theme_options_settings', array( $this, 'configuration' ), 20, 1);
    50259    }
    51260
    52     public static function after_setup_theme() {
    53         if (!class_exists( 'Kopa_Framework'))
    54             return;         
    55         else   
    56             new Kopa_Page_Builder();                           
    57     }
    58 
    59     public function configuration( $options){
    60         $options[] = array(
    61             'title'   => esc_html__( 'Page builder', 'kopa-page-builder' ),
    62             'type'    => 'title',       
    63             'id'      => 'page-builder'     
    64         ); 
    65         $options[] = array(
    66             'title'   => NULL,
    67             'type'    => 'checkbox',               
    68             'id'      => 'is-enable-page-builder-use-sticky-toolbar',
    69             'default' => 1,
    70             'label'   => esc_html__( 'Enable sticky toolbar ?', 'kopa-page-builder' ),
    71         );
    72 
    73         return $options;
    74     }
    75 
    76     public static function is_page() {
    77         global $pagenow, $post;
    78         $is_page = false;
    79 
    80         if( in_array( $pagenow, array( 'post.php', 'post-new.php')) ){             
    81             if( $post->post_type == 'page'){
    82                 $is_page = true;               
    83             }
    84         }   
    85 
    86         return $is_page;
    87     }
    88 
    89     public static function get_meta_key_current_layout() {
    90         return apply_filters( 'kopa_page_builder_get_meta_key_current_layout','kopa_page_builder_current_layout' );
    91     }
    92 
    93     public static function get_meta_key_layout_customize() {
    94         return apply_filters( 'kopa_page_builder_get_meta_key_layout_customize','kopa_page_builder_layout_customize' );
    95     }
    96 
    97     public static function get_meta_key_grid() {
    98         return apply_filters( 'kopa_page_builder_get_meta_key_grid','kopa_page_builder_data' );
    99     }
    100 
    101     public static function get_meta_key_wrapper() {
    102         return apply_filters( 'kopa_page_builder_get_meta_key_wrapper','kopa_page_builder_wrapper' );
    103     }
    104 
    105     public static function get_meta_key_widget_customize() {
    106         return apply_filters( 'kopa_page_builder_get_meta_key_widget_customize','kopa_page_builder_widget_customize' );
    107     }
    108 
    109     public static function get_registed_layouts() {
    110         return apply_filters( 'kopa_page_builder_get_layouts', array() );
    111     }
    112 
    113     public static function get_current_layout( $post_id){
    114         return get_post_meta( $post_id, self::get_meta_key_current_layout(), true);     
    115     }
    116 
    117     public static function get_current_layout_data( $post_id, $current_layout = null){
    118         $current_layout = $current_layout ? $current_layout : self::get_current_layout( $post_id);
    119         $meta_key = sprintf( '%s-%s', self::get_meta_key_grid(), $current_layout);     
    120 
    121         return get_post_meta( $post_id, $meta_key, true);
    122     }
    123 
    124     public static function get_current_wrapper_data( $post_id, $current_layout, $current_section){
    125         if(empty( $current_layout) || empty( $current_section))
    126             return false;
    127        
    128         $meta_key = sprintf( '%s-%s-%s', self::get_meta_key_wrapper(), $current_layout, $current_section); 
    129         return get_post_meta( $post_id, $meta_key, true);
    130     }
    131 
    132     public static function get_layout_customize_data( $post_id, $layout_slug){
    133         if(empty( $layout_slug))
    134             return false;
    135 
    136         $meta_key = sprintf( '%s-%s', self::get_meta_key_layout_customize(), $layout_slug);
    137         return get_post_meta( $post_id, $meta_key, true);   
    138     }
    139 
    140     public function get_control( $param_args){
    141         ?>
    142         <div class="kpb-control kpb-clearfix">
    143             <div class="kpb-row">
    144                 <?php
    145                 $is_hide_title     = ( isset( $param_args['is_hide_title'] ) && ( true === $param_args['is_hide_title'] ) ) ? true : false;
    146                 $right_col_classes = 'kpb-col-12';
    147 
    148                 if( ! $is_hide_title ):
    149                     $right_col_classes = 'kpb-col-9';
    150                 ?>
    151                     <div class="kpb-col-3">
    152                         <?php echo esc_attr( $param_args['title']);?>
    153                     </div>
    154                 <?php endif; ?>
    155 
    156                 <div class="<?php echo esc_attr( $right_col_classes ); ?>">
    157                     <?php
    158                     switch ( $param_args['type']) {
    159                         case 'alert':
    160                             $this->get_field_alert( $param_args);
    161                             break;
    162                         case 'color':
    163                             $this->get_field_color( $param_args);
    164                             break;
    165                         case 'image':
    166                             $this->get_field_image( $param_args);
    167                             break;
    168                         case 'select':
    169                             $this->get_field_select( $param_args);
    170                             break;     
    171                         case 'text':
    172                             $this->get_field_text( $param_args);
    173                             break;                                                                             
    174                         case 'number':
    175                             $this->get_field_number( $param_args);
    176                             break; 
    177                         case 'checkbox':
    178                             $this->get_field_checkbox( $param_args);   
    179                             break;
    180                         case 'radio':
    181                             $this->get_field_radio( $param_args);
    182                             break;
    183                         case 'radio_image':
    184                             $this->get_field_radio_image( $param_args);
    185                             break;
    186                         case 'textarea':
    187                             $this->get_field_textarea( $param_args);
    188                             break;
    189                         case 'icon':
    190                             $this->get_field_icon( $param_args);
    191                             break;
    192                     }
    193                     if(isset( $param_args['help']) && !empty( $param_args['help'])){
    194                         ?>
    195                         <div class="kpb-ui-help-text"><?php echo stripcslashes( $param_args['help']); ?></div>
    196                         <?php
    197                     }
    198                     ?>                 
    199                 </div>
    200             </div>
    201         </div>
    202         <?php
    203     }
    204 
    205     public static function plugins_loaded() {
    206         load_plugin_textdomain( 'kopa-page-builder', false, dirname(plugin_basename(__FILE__)) . '/languages/' );
    207     }
    208 
    209     public function admin_enqueue_scripts( $hook){
    210         if (self::is_page()) {
    211             $prefix = 'kopa_page_builder_';
    212             $affix = KPB_IS_DEV ? '' : '.min';         
    213             wp_enqueue_style( 'wp-color-picker' );         
    214             wp_enqueue_style( 'jquery-magnific-popup', plugins_url("css/magnific-popup{$affix}.css", __FILE__), NULL, NULL);           
    215             wp_enqueue_style( $prefix . 'style', plugins_url("css/style{$affix}.css", __FILE__), NULL, NULL);
    216 
    217             wp_enqueue_script( 'jquery-form' );
    218             wp_enqueue_script( 'json2' );           
    219             wp_enqueue_script( 'jquery-ui-sortable' );
    220             wp_enqueue_script( 'wp-color-picker' );
    221             wp_enqueue_script( 'jquery-magnific-popup', plugins_url("js/jquery.magnific-popup{$affix}.js", __FILE__), array( 'jquery' ), NULL, TRUE);           
    222             wp_enqueue_script( 'jquery-waypoints', plugins_url("js/waypoints{$affix}.js", __FILE__), array( 'jquery' ), NULL, TRUE);
    223             wp_enqueue_script( 'jquery-waypoints-sticky', plugins_url("js/waypoints-sticky{$affix}.js", __FILE__), array( 'jquery' ), NULL, TRUE);                     
    224             wp_enqueue_script( $prefix . 'script', plugins_url("js/script{$affix}.js", __FILE__), array( 'jquery' ), NULL, TRUE);
    225 
    226             wp_enqueue_script( 'kopa_media_uploader' );
    227 
    228             wp_localize_script( $prefix . 'script', 'KPB', array(   
    229                 'is_sticky_toolbar' => get_theme_mod( 'is-enable-page-builder-use-sticky-toolbar', 1),             
    230                 'ajax' => admin_url( 'admin-ajax.php' ),
    231                 'i18n' => array(     
    232                     'media_center'                       => esc_html__( 'Media center', 'kopa-page-builder' ),
    233                     'choose_image'                       => esc_html__( 'Choose image', 'kopa-page-builder' ),
    234                     'loading'                            => esc_html__( 'Loading...', 'kopa-page-builder' ),
    235                     'save'                               => esc_html__( 'Save', 'kopa-page-builder' ),
    236                     'saving'                             => esc_html__( 'Saving...', 'kopa-page-builder' ),
    237                     'hide_preview'                       => esc_html__( 'Hide visual layout', 'kopa-page-builder' ),
    238                     'show_preview'                       => esc_html__( 'Show visual layout', 'kopa-page-builder' ),
    239                     'are_you_sure_to_remove_this_widget' => esc_html__( 'Are you sure to remove this widget ?', 'kopa-page-builder' ),                     
    240                 )
    241             ));
    242         }
    243     }
    244 
    245     public function register_meta_boxes() {
    246         add_meta_box(
    247             'kopa_page_builder_meta_boxes',
    248             __( 'Page Builder', 'kopa-page-builder' ),
    249             array( $this, 'get_meta_boxes' ),
    250             'page'
    251         ); 
    252     }   
    253 
    254     public function get_meta_boxes() {
    255         global $post;
    256        
    257         wp_nonce_field( 'kopa_page_builder_meta_boxes', 'kopa_page_builder_meta_boxes_security' );
    258        
    259         $_layouts = apply_filters( 'kopa_page_builder_get_layouts', array());
    260         $_areas = apply_filters( 'kopa_page_builder_get_areas', array());
    261         $_section_fields = apply_filters( 'kopa_page_builder_get_section_fields', array());
    262 
    263 
    264         $current_layout = self::get_current_layout( $post->ID);     
    265         ?>
    266         <p id="kpb-metabox-loading-text"><img src="<?php echo KPB_DIR . '/images/loading.gif'; ?>" width="16px" height="16px">&nbsp;<?php esc_html_e( 'Loading..', 'kopa-page-builder' ); ?></p>
    267         <section id="kpb-wrapper" style="display: none;">
    268             <header id="kpb-wrapper-header" class="kpb-clearfix">                                               
    269                 <select id="kpb-select-layout" name="kpb-select-layout" class="kpb-pull-left" onchange="Kopa_Page_Builder.change_layout(event, jQuery(this));" autocomplete=off>                   
    270                     <?php
    271                     $_is_first_layout = true;                   
    272                     foreach ( $_layouts as $slug => $layout) {
    273                         $_selected = $current_layout ? (( $current_layout == $slug) ? 'selected="selected"' : '') : ( $_is_first_layout ? 'selected="selected"' : '' );
    274                         printf( '<option value="%s" %s>%s</option>', $slug, $_selected, $layout['title']);
    275                         $_is_first_layout = false;
    276                     }
    277                     ?>
    278                 </select>                                           
    279 
    280                 <a id="kpb-button-save-layouts" href="#" onclick="Kopa_Page_Builder.save_layout(event, jQuery(this));" class="button button-primary button-large kpb-pull-right" data-status='1'><?php esc_html_e( 'Save', 'kopa-page-builder' ); ?></a>       
    281 
    282                 <?php
    283                 $is_use_preview = (int) apply_filters( 'kpb_is_use_preview', 1 );
    284                 if( $is_use_preview ):
    285                 ?>
    286                     <a id="kpb-button-hide-preview" href="#" onclick="Kopa_Page_Builder.hide_preview(event, jQuery(this));" class="button button-link button-large kpb-pull-right" data-status='0'><?php esc_html_e( 'Show visual layout', 'kopa-page-builder' ); ?></a>
    287                 <?php endif; ?>                 
    288 
    289                 <a id="kpb-button-customize-layout" href="#" onclick="Kopa_Page_Builder.open_customize_layout(event, jQuery(this));" class="button button-link button-large kpb-pull-right"><?php esc_html_e( 'Customize', 'kopa-page-builder' ); ?></a>
    290             </header>
    291 
    292             <?php
    293             $_is_first_layout = true;
    294             $_layout_index = 0;
    295             foreach ( $_layouts as $layout_slug => $layout):                       
    296                 $current_layout_data = self::get_current_layout_data( $post->ID, $layout_slug);
    297                
    298                 $_classes = array( 'kpb-layout', 'kpb-row' );               
    299                 $_classes[] = $current_layout ? (( $current_layout == $layout_slug) ? 'kpb-active' : 'kpb-hidden') : ( $_is_first_layout ? 'kpb-active' : 'kpb-hidden' );               
    300             ?>
    301 
    302             <div id="<?php echo "kpb-layout-{$layout_slug}"; ?>" class="<?php echo implode( ' ', $_classes); ?>" data-layout="<?php echo $layout_slug; ?>">
    303                 <?php if(isset( $layout['section']) && !empty( $layout['section'])): ?>
    304                     <div class="kpb-col-left kpb-col-12">
    305                         <?php
    306                         if( $sections = isset( $layout['section']) && !empty( $layout['section']) ? $layout['section'] : false):                           
    307 
    308                             $_is_first_section = true;
    309                             foreach ( $sections as $section_slug => $section) :
    310                                 $_section_classes = ( $_is_first_section) ? 'kpb-section kpb-first' : 'kpb-section';                               
    311                             ?>
    312                                 <aside id="<?php echo "kpb-section-{$section_slug}-for-layout{$layout_slug}"; ?>" data-section="<?php echo $section_slug; ?>" class="<?php echo $_section_classes; ?>">
    313                                     <header class="kpb-section-header kpb-clearfix">
    314                                         <label class="kpb-pull-left"><?php echo esc_attr( $section['title']); ?></label>
    315                                        
    316                                         <?php if(!empty( $_section_fields)): ?>
    317                                             <a href="#"
    318                                             onclick="Kopa_Page_Builder.open_customize(event, jQuery(this), '<?php echo $layout_slug;?>', '<?php echo $section_slug; ?>' );"
    319                                             class="kpb-button-customize kpb-pull-right" ></a>       
    320                                         <?php endif; ?>
    321                                     </header>
    322                                     <div class="kpb-section-placeholder">
    323                                         <div class="kpb-row">                                       
    324                                             <?php
    325                                            
    326                                             if( $areas = isset( $section['area']) && !empty( $section['area']) ? $section['area'] : false):                         
    327                                                
    328                                                 $_section_grid = $section['grid'];
    329 
    330 
    331                                                 foreach ( $areas as $area_index => $area):
    332                                                     if(is_array( $area)):
    333                                                         ?>
    334                                                         <div class="<?php printf( 'kpb-col-%d', (int)$_section_grid[$area_index]); ?>">                                                     
    335                                                                 <?php
    336                                                                 $sub_grids = $area['grid'];
    337                                                                 $sub_areas = $area['area'];
    338 
    339                                                                 foreach( $sub_areas as $sub_area_index => $sub_area){
    340                                                                     $sub_area_class = (0 == $sub_area_index) ? 'kpb-row-sub-area-first' : '';
    341                                                                     ?>
    342                                                                     <div class="kpb-row kpb-clearfix kpb-row-sub-area <?php echo $sub_area_class;?>">
    343                                                                         <?php
    344                                                                         foreach( $sub_area as $child_area_area => $child_area):
    345                                                                             $_area_name    = $_areas[$child_area];
    346                                                                             $_area_classes =  array( 'kpb-area' );
    347                                                                             ?>
    348                                                                             <div class="<?php printf( 'kpb-col-%d', (int)$sub_grids[$sub_area_index][$child_area_area]); ?>">
    349                                                                                 <div id="<?php echo "kpb-area-{$child_area}-for-section{$section_slug}"; ?>" data-area="<?php echo $child_area; ?>" class="<?php echo implode( ' ', $_area_classes); ?>">
    350                                                                                     <header class="kpb-area-header kpb-clearfix">
    351                                                                                         <label><?php echo esc_attr( $_area_name); ?></label>
    352                                                                                         <br/>
    353                                                                                         <a href="#"
    354                                                                                         onclick="Kopa_Page_Builder.open_list_widgets(event, jQuery(this));"
    355                                                                                         class="kpb-button-add-widget"><?php esc_html_e( 'Add widget', 'kopa-page-builder' ); ?></a>     
    356                                                                                     </header>
    357 
    358                                                                                     <div class="kpb-area-placeholder">
    359                                                                                         <?php                                                                                                                       
    360                                                                                             if( isset( $current_layout_data[$section_slug][$child_area]) && 
    361                                                                                                 !empty( $current_layout_data[$section_slug][$child_area])):                                         
    362 
    363                                                                                                 $widgets = $current_layout_data[$section_slug][$child_area];
    364                                                                            
    365                                                                                                 foreach ( $widgets as $widget_id => $widget):   
    366                                                                                                     $widget_data = get_post_meta( $post->ID, $widget_id,true);
    367 
    368                                                                                                     $widget_title = isset( $widget_data['widget']['title']) && !empty( $widget_data['widget']['title']) ? $widget['name'] . ' : ' . $widget_data['widget']['title'] : $widget['name'];
    369                                                                                                                                                                        
    370                                                                                                     ?>
    371                                                                                                     <aside id="<?php echo esc_attr( $widget_id); ?>" class="kpb-widget" data-class="<?php echo esc_attr( $widget['class_name']); ?>" data-name="<?php echo esc_attr( $widget['name']); ?>">
    372                                                                                                         <div class="kpb-widget-inner kpb-clearfix">                                         
    373                                                                                                             <label class=""><?php echo esc_attr( $widget_title); ?></label>
    374                                                                                                             <br/>   
    375                                                                                                             <div class="kpb-widget-action kpb-clearfix">                                       
    376                                                                                                                 <a href="#" onclick="Kopa_Page_Builder.edit_widget(event, jQuery(this), '<?php echo esc_attr( $widget_id); ?>' );" class="kpb-button-edit kpb-pull-left"><?php esc_html_e( 'Edit', 'kopa-page-builder' ); ?></a>                                                                                   
    377                                                                                                                 <a href="#" onclick="Kopa_Page_Builder.delete_widget(event, jQuery(this), '<?php echo esc_attr( $widget_id); ?>' );" class="kpb-button-delete kpb-pull-left"><?php esc_html_e( 'Delete', 'kopa-page-builder' ); ?></a>                                                                                 
    378                                                                                                             </div>
    379                                                                                                         </div>                   
    380                                                                                                     </aside>
    381                                                                                                     <?php                                                                       
    382                                                                                                 endforeach;
    383                                                        
    384                                                                                             endif;                                     
    385                                                                                             ?>
    386                                                                                     </div>
    387 
    388                                                                                 </div>
    389                                                                             </div>
    390                                                                             <?php
    391                                                                         endforeach;
    392                                                                         ?>
    393                                                                     </div>                                                                                                                         
    394                                                                     <?php
    395                                                                 }
    396                                                                 ?>                                                     
    397                                                         </div>
    398                                                         <?php
    399                                                     else:
    400                                                         $_area_name = $_areas[$area];
    401                                                         $_area_classes =  array( 'kpb-area' );
    402                                                         ?>
    403                                                         <div class="<?php printf( 'kpb-col-%d', (int)$_section_grid[$area_index]); ?>">
    404                                                             <div id="<?php echo "kpb-area-{$area}-for-section{$section_slug}"; ?>" data-area="<?php echo $area; ?>" class="<?php echo implode( ' ', $_area_classes); ?>">
    405                                                                 <header class="kpb-area-header kpb-clearfix">
    406                                                                     <label><?php echo esc_attr( $_area_name); ?></label>
    407                                                                     <br/>
    408                                                                     <a href="#"
    409                                                                     onclick="Kopa_Page_Builder.open_list_widgets(event, jQuery(this));"
    410                                                                     class="kpb-button-add-widget"><?php esc_html_e( 'Add widget', 'kopa-page-builder' ); ?></a>     
    411                                                                 </header>
    412 
    413                                                                 <div class="kpb-area-placeholder">
    414                                                                     <?php                                                                                                                       
    415                                                                         if( isset( $current_layout_data[$section_slug][$area]) && 
    416                                                                             !empty( $current_layout_data[$section_slug][$area])):                                           
    417 
    418                                                                             $widgets = $current_layout_data[$section_slug][$area];
    419                                                        
    420                                                                             foreach ( $widgets as $widget_id => $widget):   
    421                                                                                 $widget_data = get_post_meta( $post->ID, $widget_id,true);
    422 
    423                                                                                 $widget_title = isset( $widget_data['widget']['title']) && !empty( $widget_data['widget']['title']) ? $widget['name'] . ' : ' . $widget_data['widget']['title'] : $widget['name'];
    424                                                                                                                                                    
    425                                                                                 ?>
    426                                                                                 <aside id="<?php echo esc_attr( $widget_id); ?>" class="kpb-widget" data-class="<?php echo esc_attr( $widget['class_name']); ?>" data-name="<?php echo esc_attr( $widget['name']); ?>">
    427                                                                                     <div class="kpb-widget-inner kpb-clearfix">                                         
    428                                                                                         <label class=""><?php echo esc_attr( $widget_title); ?></label>
    429                                                                                         <br/>   
    430                                                                                         <div class="kpb-widget-action kpb-clearfix">                                       
    431                                                                                             <a href="#" onclick="Kopa_Page_Builder.edit_widget(event, jQuery(this), '<?php echo esc_attr( $widget_id); ?>' );" class="kpb-button-edit kpb-pull-left"><?php esc_html_e( 'Edit', 'kopa-page-builder' ); ?></a>                                                                                   
    432                                                                                             <a href="#" onclick="Kopa_Page_Builder.delete_widget(event, jQuery(this), '<?php echo esc_attr( $widget_id); ?>' );" class="kpb-button-delete kpb-pull-left"><?php esc_html_e( 'Delete', 'kopa-page-builder' ); ?></a>                                                                                 
    433                                                                                         </div>
    434                                                                                     </div>                   
    435                                                                                 </aside>
    436                                                                                 <?php                                                                       
    437                                                                             endforeach;
    438                                    
    439                                                                         endif;                                     
    440                                                                         ?>
    441                                                                 </div>
    442 
    443                                                             </div>
    444                                                         </div>
    445                                                     <?php
    446                                                     endif;
    447                                                 endforeach;
    448                                             endif;
    449                                             ?>
    450                                         </div>
    451                                     </div>
    452                                 </aside>
    453                             <?php                   
    454                             $_is_first_section = false;     
    455                             endforeach;
    456                         endif;
    457                         ?>
    458                     </div>
    459                 <?php endif; ?>
    460 
    461                 <?php if(isset( $layout['preview']) && !empty( $layout['preview'])): ?>
    462                     <div class="kpb-col-right kpb-col-4" style="display: none;">
    463                         <span class="kpb-preview-images"><img src="<?php echo $layout['preview']; ?>"></span>                   
    464                     </div>
    465                 <?php endif; ?>
    466             </div>
    467 
    468             <?php
    469                 $_is_first_layout = false;
    470                 $_layout_index++;
    471             endforeach;         
    472             ?>
    473         </section>
    474         <?php
    475     }
    476 
    477     public function print_ajax_security() {
    478         wp_nonce_field("kpb_get_widget_form", "kpb_get_widget_form_security", FALSE);
    479         wp_nonce_field("kpb_delete_widget", "kpb_delete_widget_security", FALSE);
    480         wp_nonce_field("kpb_save_grid", "kpb_save_grid_security", FALSE);
    481         wp_nonce_field("kpb_load_lightbox_html", "kpb_load_lightbox_html_security", FALSE);         
    482     }
    483 
    484     public function get_widget_form() {
    485         check_ajax_referer( 'kpb_get_widget_form', 'security' );
    486 
    487         if ( $_POST['class_name']) {
    488             $class_name = $_POST['class_name'];
    489             $instance = array();
    490             $customize_data = array();
    491 
    492             if (isset( $_POST['widget_id'])) {
    493                 $widget_id      = $_POST['widget_id'];
    494                
    495                 $post_id        = (int) $_POST['post_id'];
    496                 $data           = get_post_meta( $post_id, $widget_id, true);
    497                
    498                 $instance       = $data['widget'];
    499                 $customize_data = isset( $data['customize']) ? $data['customize'] : array();
    500             }
    501 
    502             $widget = new $class_name;
    503             $widget->id_base = rand(0, 9999);
    504             $widget->number  = rand(0, 9999);           
    505 
    506             if(isset( $widget->kpb_is_private)){
    507                 $widget->kpb_is_private = false;
    508             }
    509            
    510 
    511             $customize_key = self::get_meta_key_widget_customize();
    512            
    513             $customize_fields = apply_filters( 'kopa_page_builder_get_customize_fields', array());                     
    514 
    515             if(!empty( $customize_fields)){
    516                 ?>
    517                 <section class="kpb-widget-customize kpb-wrapper-configuration">
    518                     <div class="kpb-wrapper-configuration-toggle">
    519                         <nav>
    520                             <ul class="kpb-clearfix">
    521                                 <li class="kpb-tab-title kpb-tab-title-first kpb-tab-title-active">
    522                                     <a href="<?php echo "#kpb-tab-widget-{$widget->id_base}"; ?>" onclick="Kopa_Page_Builder.change_customize_tab(event, jQuery(this));"><?php esc_html_e( 'Widget', 'kopa-page-builder' ); ?></a>
    523                                 </li>
    524 
    525                                 <?php                                   
    526                                 foreach ( $customize_fields  as $tab_slug => $tab):                                 
    527                                     $tab_id = $tab_slug . '-tab-' . $widget->id_base;
    528                                     ?>
    529                                     <li class="kpb-tab-title">
    530                                         <a href="<?php echo "#{$tab_id}"; ?>"  onclick="Kopa_Page_Builder.change_customize_tab(event, jQuery(this));"><?php echo esc_attr( $tab['title']); ?></a>
    531                                     </li>
    532                                     <?php   
    533                                 endforeach;
    534                                 ?>
    535                             </ul>
    536                         </nav>
    537                    
    538                         <div id="<?php echo "kpb-tab-widget-{$widget->id_base}"; ?>" class="kpb-tab-content">
    539                             <?php $widget->form( $instance); ?>
    540                         </div>
    541 
    542                         <?php   
    543                         foreach ( $customize_fields  as $tab_slug => $tab):     
    544                             $tab_id = $tab_slug . '-tab-' . $widget->id_base;
    545                             ?>
    546                             <div id="<?php echo $tab_id; ?>" class="kpb-tab-content" style="display:none;">
    547                                 <?php
    548                                 foreach ( $tab['params'] as $param_key => $param_args):
    549 
    550                                     $param_args['name'] = sprintf( '%s[%s][%s]', $customize_key, $tab_slug, $param_key);                                               
    551                                     $param_args['value'] = isset( $customize_data[$tab_slug][$param_key]) ? $customize_data[$tab_slug][$param_key] : (isset( $param_args['default']) ? $param_args['default'] : null);                                                     
    552                                    
    553                                     $this->get_control( $param_args);
    554 
    555                                 endforeach;
    556                                 ?>
    557                             </div>
    558                             <?php                           
    559                         endforeach;
    560                         ?> 
    561                 </section>           
    562                 <?php
    563             }else{
    564                 $widget->form( $instance);
    565             }
    566         }
    567 
    568         exit();
    569     }
    570 
    571     public function load_lightbox_html() {
    572         check_ajax_referer( 'kpb_load_lightbox_html', 'security' );
    573 
    574         if(isset( $_POST['post_id'])){
    575             $post_id = $_POST['post_id'];
    576 
    577             global $wp_widget_factory;             
    578             ?>
    579 
    580             <div id="kpb-loading-overlay">
    581                 <span><?php esc_html_e( 'Progressing..', 'kopa-page-builder' ); ?></span>
    582             </div>
    583 
    584             <div id="kpb-widgets-lightbox" style="display: none;">
    585                 <section id="kpb-widgets"> 
    586                     <header id="kpb-widgets-header" class="kpb-clearfix">
    587                         <label class="kpb-pull-left"><?php esc_html_e( 'Avaiable Widgets', 'kopa-page-builder' ); ?></label>
    588                         <a href="#" onclick="Kopa_Page_Builder.close_list_widgets(event);" class="button button-link button-delete kpb-pull-right"><?php esc_html_e( 'Close', 'kopa-page-builder' ); ?></a>
    589                     </header>   
    590                     <div class="kpb-widgets-inner">
    591                         <?php
    592                         $widgets = $wp_widget_factory->widgets;
    593                        
    594                         $widgets = apply_filters( 'kpb_get_widgets_list', $widgets);
    595 
    596                         $widgets_inprocess = array();
    597                         $blocks = array();
    598 
    599                         foreach ( $widgets as $class_name => $widget_info){
    600                             if (isset( $widget_info->kpb_group) && !empty( $widget_info->kpb_group)){
    601                                 $group_slug = $widget_info->kpb_group;
    602                             }else{
    603                                 if(strpos(strtolower( $widget_info->name), 'bbpress')){
    604                                     $group_slug = 'bbpress';
    605                                 }else if (strpos(strtolower( $widget_info->name), 'commerce')){
    606                                     $group_slug = 'product';
    607                                 }else{
    608                                     $group_slug = 'widgets';
    609                                 }                               
    610                             }
    611                              
    612                            
    613                             if(!isset( $blocks[$group_slug])){
    614                                 $blocks[$group_slug]['title'] = $this->str_beautify( $group_slug);                         
    615                             }
    616 
    617                             $blocks[$group_slug]['items'][$class_name] = $widget_info;
    618                         }
    619 
    620                         ksort( $blocks);
    621 
    622                         ?>
    623                         <div class="kpb-wrapper-configuration">
    624                             <div class="kpb-wrapper-configuration-toggle">
    625                                 <nav id="kpb-nav-list-blocks">
    626                                     <ul class="kpb-clearfix">
    627                                         <?php
    628                                         ob_start();
    629                                         $_is_first_tab = true;                                 
    630                                         foreach( $blocks as $block_slug => $block_info):
    631                                             $classes = $_is_first_tab ? 'kpb-tab-title kpb-tab-title-first kpb-tab-title-active' : 'kpb-tab-title';
    632                                             $tab_id = $this->str_uglify("kpb-list-{$block_slug}-blocks");
    633                                             ?>
    634                                             <li class="<?php echo $classes;?>">
    635                                                 <a href="<?php echo "#{$tab_id}"; ?>"><?php echo esc_attr( $block_info['title']); ?></a>
    636                                             </li>
    637                                             <?php   
    638                                             $_is_first_tab = false;
    639                                         endforeach;
    640                                         $nav = ob_get_clean();
    641                                         $nav = apply_filters( 'kopa_page_buider_get_block_nav_html', $nav, $blocks );
    642                                         echo wp_kses_post( $nav );
    643                                         ?>
    644                                     </ul>
    645                                 </nav>
    646 
    647                                 <?php
    648                                 $index_block = 0;
    649                                 $_is_first_tab = true;
    650 
    651                                 foreach( $blocks as $block_slug => $block_info):
    652                                     $blocks_classes = (0 == $index_block) ? 'kpb-tab-content kpb-list-blocks kpb-list-blocks-first kpb-clearfix' : 'kpb-tab-content kpb-list-blocks kpb-clearfix';
    653                                     $display = $_is_first_tab ? 'block' : 'none';                                       
    654                                     $tab_id = $this->str_uglify("kpb-list-{$block_slug}-blocks");                                       
    655                                     ?>
    656                                     <div id="<?php echo $tab_id; ?>" class="<?php echo $blocks_classes; ?>" style="display: <?php echo $display;?>">                                       
    657                                         <?php
    658                                             $index_global = 1;
    659                                             $index_single = 1;
    660 
    661                                             $widgets = $block_info['items'];
    662                                            
    663                                             ksort( $widgets);
    664 
    665                                             foreach ( $widgets as $class_name => $widget_info):
    666                                                 if (1 == $index_single || ( $index_single % 5 == 0)) {
    667                                                     if(1 == $index_global){
    668                                                         echo '<div class="kpb-row kpb-first">';
    669                                                     }else{
    670                                                         echo '<div class="kpb-row">';
    671                                                     }                       
    672                                                 }
    673                                                 ?>
    674                                                 <aside class="kpb-widget kpb-col-3">
    675                                                     <div class="kpb-widget-inner">
    676                                                         <header class="kpb-clearfix">
    677                                                             <label class="kpb-pull-left"><?php echo $widget_info->name; ?></label>
    678                                                             <a href="#" onclick="Kopa_Page_Builder.add_widget(event, jQuery(this), '<?php echo $class_name; ?>', '<?php echo $widget_info->name; ?>' );" class="kpb-button-use kpb-pull-right"><?php esc_html_e( 'Add', 'kopa-page-builder' ); ?></a>
    679                                                         </header>   
    680 
    681                                                         <div class="kpb-widget-description">                                                     
    682                                                             <span><?php echo $widget_info->widget_options['description']; ?></span>
    683                                                         </div>
    684                                                     </div>                   
    685                                                 </aside>
    686                                                 <?php
    687                                                 if (( $index_single % 4 == 0) || ( $index_global == count( $widgets))) {
    688                                                     echo '</div>';
    689                                                     $index_single = 1;
    690                                                 } else {
    691                                                     $index_single++;
    692                                                 }
    693 
    694                                                 $index_global++;
    695                                             endforeach;
    696                                         ?>
    697                                     </div>
    698                                     <?php
    699                                     $_is_first_tab = false;
    700                                     $index_block++;
    701                                 endforeach;
    702                                 ?>
    703                             </div>
    704                         </div>
    705                     </div>
    706                 </section>
    707             </div>
    708 
    709             <div id="kpb-widget-lightbox" style="display: none;">
    710                 <section id="kpb-widget">               
    711                     <form id="kpb-form-widget" name="kpb-form-widget"  method="POST" autocomplete="off" onsubmit="Kopa_Page_Builder.save_widget(event, jQuery(this));" action="<?php echo esc_url(wp_nonce_url(admin_url( 'admin-ajax.php?action=kpb_save_widget' ), 'kpb_save_widget', 'security' ) ); ?>">
    712                         <header id="kpb-widget-header" class="kpb-clearfix">
    713                             <label id="kpb-widget-title" class="kpb-pull-left"><?php esc_html_e( 'Widget Name', 'kopa-page-builder' ); ?></label>
    714                             <a href="#" onclick="Kopa_Page_Builder.close_widget(event);" class="button button-link button-delete kpb-pull-right"><?php esc_html_e( 'Close', 'kopa-page-builder' ); ?></a>
    715                         </header>
    716 
    717                         <div class="kpb-form-inner">
    718                             <center class="kpb-loading"><?php esc_html_e( 'Loading...', 'kopa-page-builder' ); ?></center>
    719                         </div>                 
    720 
    721                         <input type="hidden" name="kpb-widget-class-name" value="" autocomplete=off>
    722                         <input type="hidden" name="kpb-widget-name" value="" autocomplete=off>                 
    723                         <input type="hidden" name="kpb-widget-id" value="" autocomplete=off>             
    724                         <input type="hidden" name="kpb-widget-action" value="add" autocomplete=off>                                         
    725                         <input type="hidden" name="kpb-post-id" value="<?php echo (int)$post_id; ?>" autocomplete=off>
    726                    
    727                         <footer id="kpb-widget-footer" class="kpb-clearfix">
    728                             <button type="submit" class="button button-primary kpb-pull-right"><?php esc_html_e( 'Save', 'kopa-page-builder' ); ?></button>                 
    729                         </footer> 
    730 
    731                     </form>
    732 
    733                 </section>
    734             </div>
    735 
    736             <?php     
    737             $_layouts = apply_filters( 'kopa_page_builder_get_layouts', array());
    738             $_areas = apply_filters( 'kopa_page_builder_get_areas', array());
    739             $_section_fields = apply_filters( 'kopa_page_builder_get_section_fields', array());
    740             $meta_key = self::get_meta_key_wrapper();
    741            
    742             foreach ( $_layouts as $layout_slug => $layout) :
    743                 if( $sections = isset( $layout['section']) && !empty( $layout['section']) ? $layout['section'] : false):                           
    744                     foreach ( $sections as $section_slug => $section): 
    745                     $data = self::get_current_wrapper_data( $post_id, $layout_slug, $section_slug);
    746                     ?>
    747                     <div id="<?php echo "kpb-customize-lightbox-{$layout_slug}-{$section_slug}"; ?>" class="kpb-customize-lightbox" style="display: none;">             
    748                         <section class="kpb-customize">
    749                             <form name="<?php echo "kpb-form-customize-layout-{$layout_slug}-section-{$section_slug}" ?>"  method="POST" autocomplete="off" onsubmit="Kopa_Page_Builder.save_customize(event, jQuery(this), <?php echo (int) $post_id;?>);" action="<?php echo esc_url(wp_nonce_url(admin_url( 'admin-ajax.php?action=kpb_save_customize' ), 'kpb_save_customize', 'security' ) ); ?>">
    750                                 <input type="hidden" name="layout" value="<?php echo $layout_slug; ?>" autocomplete="off">
    751                                 <input type="hidden" name="section" value="<?php echo $section_slug; ?>" autocomplete="off">
    752 
    753                                 <header class="kpb-customize-header kpb-clearfix">
    754                                     <label class="kpb-section-title kpb-pull-left"><?php echo $section['title']; ?></label>
    755 
    756                                     <a href="#" onclick="Kopa_Page_Builder.close_customize(event);" class="button button-link button-delete kpb-pull-right"><?php esc_html_e( 'Close', 'kopa-page-builder' ); ?></a>
    757                                     <button type="submit" class="button button-primary kpb-pull-right"><?php esc_html_e( 'Save', 'kopa-page-builder' ); ?></button>                                                             
    758                                 </header>
    759 
    760                                 <div class="kpb-form-inner kpb-clearfix">
    761                                     <div id="<?php echo $section_slug; ?>" class="kpb-wrapper-configuration">                                   
    762                                         <div class="kpb-wrapper-configuration-toggle">
    763                                             <nav>
    764                                                 <ul class="kpb-clearfix">
    765                                                     <?php   
    766                                                     $_is_first_tab = true;                                 
    767                                                     foreach ( $_section_fields  as $fields_slug => $fields):
    768                                                         $classes = $_is_first_tab ? 'kpb-tab-title kpb-tab-title-first kpb-tab-title-active' : 'kpb-tab-title';
    769                                                         $tab_id = $section_slug . '-field-' . $fields_slug;
    770                                                         ?>
    771                                                         <li class="<?php echo $classes;?>">
    772                                                             <a href="<?php echo "#{$tab_id}"; ?>"><?php echo esc_attr( $fields['title']); ?></a>
    773                                                         </li>
    774                                                         <?php   
    775                                                         $_is_first_tab = false;
    776                                                     endforeach;
    777                                                     ?>
    778                                                 </ul>
    779                                             </nav>
    780 
    781                                             <?php   
    782                                             $_is_first_tab = true;                                 
    783                                             foreach ( $_section_fields  as $fields_slug => $fields):
    784                                                 $display = $_is_first_tab ? 'block' : 'none';                                       
    785                                                 $tab_id = $section_slug . '-field-' . $fields_slug;
    786                                                 ?>
    787                                                 <div id="<?php echo $tab_id; ?>" class="kpb-tab-content" style="display:<?php echo $display;?>;">
    788                                                     <?php
    789                                                     foreach ( $fields['params'] as $param_key => $param_args):
    790 
    791                                                         $param_args['name'] = sprintf( '%s-%s-%s[%s][%s]', $meta_key, $layout_slug, $section_slug, $fields_slug, $param_key);                                               
    792                                                         $param_args['value'] = isset( $data[$fields_slug][$param_key]) ? $data[$fields_slug][$param_key] : (isset( $param_args['default']) ? $param_args['default'] : null);                                                       
    793                                                        
    794                                                         $this->get_control( $param_args);
    795 
    796                                                     endforeach;
    797                                                     ?>
    798                                                 </div>
    799                                                 <?php
    800                                                 $_is_first_tab = false;
    801                                             endforeach;
    802                                             ?>     
    803                                         </div>
    804                                     </div>                                 
    805                                 </div>
    806                             </form>
    807                         </section>
    808                     </div>
    809                     <?php
    810                     endforeach;
    811                 endif;
    812 
    813                 if( isset( $layout['customize']) && !empty( $layout['customize'])){
    814                     $data = self::get_layout_customize_data( $post_id, $layout_slug);               
    815                     ?>
    816                     <div id="<?php echo "kpb-layout-customize-lightbox-{$layout_slug}"; ?>" class="kpb-customize-lightbox" style="display: none;">
    817                         <section class="kpb-customize">
    818                             <form name="<?php echo "kpb-form-customize-layout-{$layout_slug}" ?>"  method="POST" autocomplete="off" onsubmit="Kopa_Page_Builder.save_layout_customize(event, jQuery(this), <?php echo (int) $post_id;?>);" action="<?php echo esc_url(wp_nonce_url(admin_url( 'admin-ajax.php?action=kpb_save_layout_customize' ), 'kpb_save_layout_customize', 'security' ) ); ?>">
    819                                 <input type="hidden" name="layout" value="<?php echo $layout_slug; ?>" autocomplete="off">
    820 
    821                                 <header class="kpb-customize-header kpb-clearfix">
    822                                     <label class="kpb-section-title kpb-pull-left"><?php echo $layout['title']; ?></label>
    823                                     <a href="#" onclick="Kopa_Page_Builder.close_layout_customize(event);" class="button button-link button-delete kpb-pull-right"><?php esc_html_e( 'Close', 'kopa-page-builder' ); ?></a>
    824                                     <button type="submit" class="button button-primary kpb-pull-right"><?php esc_html_e( 'Save', 'kopa-page-builder' ); ?></button>                                                             
    825                                 </header>
    826 
    827                                 <div class="kpb-form-inner kpb-clearfix">
    828                                     <div class="kpb-wrapper-configuration">                                 
    829                                         <div class="kpb-wrapper-configuration-toggle">
    830                                             <nav>
    831                                                 <ul class="kpb-clearfix">
    832                                                     <?php   
    833                                                     $_is_first_tab = true;                                                                             
    834                                                     foreach ( $layout['customize']  as $tab_slug => $tab):
    835                                                         $classes = $_is_first_tab ? 'kpb-tab-title kpb-tab-title-first kpb-tab-title-active' : 'kpb-tab-title';
    836                                                         $tab_id = 'kpb-layout-customize-' . $layout_slug . '-tab-' . $tab_slug;
    837                                                         ?>
    838                                                         <li class="<?php echo $classes;?>">
    839                                                             <a href="<?php echo "#{$tab_id}"; ?>"><?php echo esc_attr( $tab['title']); ?></a>
    840                                                         </li>
    841                                                         <?php   
    842                                                         $_is_first_tab = false;
    843                                                     endforeach;
    844                                                     ?>
    845                                                 </ul>
    846                                             </nav>
    847 
    848                                             <?php   
    849                                             $_is_first_tab = true;                                 
    850                                             foreach ( $layout['customize']  as $tab_slug => $tab):
    851                                                 $display = $_is_first_tab ? 'block' : 'none';                                       
    852                                                 $tab_id = 'kpb-layout-customize-' . $layout_slug . '-tab-' . $tab_slug;
    853                                                 ?>
    854                                                 <div id="<?php echo $tab_id; ?>" class="kpb-tab-content" style="display:<?php echo $display;?>;">
    855                                                     <?php
    856                                                     foreach ( $tab['params'] as $param_key => $param_args):
    857 
    858                                                         $param_args['name'] = sprintf( '%s-%s[%s][%s]', self::get_meta_key_layout_customize(), $layout_slug, $tab_slug, $param_key);                                               
    859                                                         $param_args['value'] = isset( $data[$tab_slug][$param_key]) ? $data[$tab_slug][$param_key] : (isset( $param_args['default']) ? $param_args['default'] : null);                                                     
    860                                                        
    861                                                         $this->get_control( $param_args);
    862 
    863                                                     endforeach;
    864                                                     ?>
    865                                                 </div>
    866                                                 <?php
    867                                                 $_is_first_tab = false;
    868                                             endforeach;
    869                                             ?>     
    870                                         </div>
    871                                     </div>                                 
    872                                 </div>
    873                             </form>
    874                         </section>
    875                     </div>
    876                     <?php
    877                 }               
    878             endforeach;
    879         }
    880 
    881         exit();
    882     }
    883 
    884     public function save_widget() {
    885         check_ajax_referer( 'kpb_save_widget', 'security' );
    886 
    887         if (!empty( $_POST)) {
    888             $data = $_POST;
    889 
    890             $post_id = 0;
    891             $widget_id = '';
    892             $option['widget'] = array();
    893             $option['class_name'] = array();
    894 
    895             $customize_key = self::get_meta_key_widget_customize();
    896 
    897             foreach ( $data as $key => $value) {
    898                 if ( 'widget' == substr( $key, 0, 6)) {
    899                     $option['widget'] = reset( $value);
    900                 } else if ( 'kpb-widget-class-name' == $key) {
    901                     $option['class_name'] = $value;
    902                 } else if ( 'kpb-widget-id' == $key) {
    903                     $widget_id = $value;
    904                 } else if ( 'kpb-post-id' == $key) {
    905                     $post_id = (int) $value;
    906                 } else if ( 'kpb-widget-name' == $key){
    907                     $option['name'] = $value;
    908                 } else if( $customize_key == $key){
    909                     $option['customize'] = $value;
    910                 }
    911             }
    912 
    913             //VALIDATE DATA
    914             $obj = new $option['class_name'];
    915             $option['widget'] = $obj->update( $option['widget'], array());
    916 
    917             update_post_meta( $post_id, $widget_id, $option);
    918 
    919             $widget_title = (isset( $option['widget']['title']) && !empty( $option['widget']['title']))  ? $option['name'] . ' : ' . $option['widget']['title'] : $option['name'];
    920 
    921             ob_start();           
    922             if ( 'add' == $_POST['kpb-widget-action']):
    923                 ?>
    924                 <aside id="<?php echo esc_attr( $widget_id); ?>" class="kpb-widget" data-class="<?php echo esc_attr( $option['class_name']); ?>" data-name="<?php echo esc_attr( $option['name']); ?>">
    925                     <div class="kpb-widget-inner kpb-clearfix">                                         
    926                         <label class=""><?php echo $widget_title; ?></label>   
    927                         <div  class="kpb-widget-action kpb-clearfix">                                                                   
    928                             <a href="#" onclick="Kopa_Page_Builder.edit_widget(event, jQuery(this), '<?php echo esc_attr( $widget_id); ?>' );" class="kpb-button-edit kpb-pull-left"><?php esc_html_e( 'Edit', 'kopa-page-builder' ); ?></a>
    929                             <a href="#" onclick="Kopa_Page_Builder.delete_widget(event, jQuery(this), '<?php echo esc_attr( $widget_id); ?>' );" class="kpb-button-delete kpb-pull-left"><?php esc_html_e( 'Delete', 'kopa-page-builder' ); ?></a>
    930                         </div>                         
    931                     </div>                   
    932                 </aside>               
    933                 <?php
    934             else:
    935                 echo $widget_title;
    936             endif;
    937 
    938             $html = ob_get_clean();           
    939 
    940             echo $html;
    941         }
    942 
    943         do_action( 'kopa_page_builder_after_save_widget', $post_id, $widget_id, $option );
    944 
    945         exit();
    946     }
    947 
    948     public function delete_widget() {
    949         check_ajax_referer( 'kpb_delete_widget', 'security' );     
    950 
    951         if (isset( $_POST['widget_id']) && isset( $_POST['post_id'])) {
    952             $post_id   = (int) $_POST['post_id'];
    953             $widget_id = $_POST['widget_id'];
    954 
    955             delete_post_meta( $post_id, $widget_id);
    956 
    957             do_action( 'kopa_page_builder_after_delete_widget', $post_id, $widget_id );
    958         }
    959 
    960         exit();
    961     }
    962 
    963     public function save_grid() {
    964         check_ajax_referer( 'kpb_save_grid', 'security' );
    965        
    966         $post_id      = $_POST['post_id'];     
    967         $layout_id    = '';
    968         $layouts_data = '';
    969 
    970         if (!empty( $_POST['data'])) {
    971             $data = $_POST['data'];           
    972 
    973             $layouts = isset( $data['layouts']) && !empty( $data['layouts']) ? $data['layouts'] : false;
    974             if( $layouts){             
    975                 $current_layout = $data['current_layout'];
    976                 $layout_id      = $current_layout;
    977 
    978                 foreach ( $layouts as $layout_index => $layout) {               
    979                                        
    980                     $sections = isset( $layout['sections']) && !empty( $layout['sections']) ? $layout['sections'] : false;
    981 
    982                     if( $sections){
    983                         $_sections = array();
    984                         foreach ( $sections as $section_index => $section) {                                           
    985                             $areas = isset( $section['areas']) && !empty( $section['areas']) ? $section['areas'] : false;
    986 
    987                             if( $areas){
    988 
    989                                 $_areas = array();
    990 
    991                                 foreach ( $areas as $area_index => $area) {                             
    992                                     $widgets = isset( $area['widgets']) && !empty( $area['widgets']) ? $area['widgets'] : false;
    993                                     if( $widgets){                                 
    994                                         $_widgets = array();
    995                                         foreach ( $widgets as $widget_index => $widget) {                           
    996                                             $_widgets[$widget['id']] = array(                                               
    997                                                 'name'       => $widget['name'],
    998                                                 'class_name' => $widget['class_name']
    999                                             );
    1000                                         }
    1001                                         $_areas[$area['name']] = $_widgets;   
    1002                                     }                                                   
    1003                                 }
    1004                                 $_sections[$section['name']] = $_areas;
    1005                             }                       
    1006 
    1007                         }
    1008                        
    1009                         $_meta_key     = sprintf( '%s-%s', self::get_meta_key_grid(), $layout['name']);
    1010                         $layouts_data[$layout['name']] = $_sections;
    1011                         update_post_meta( $post_id, $_meta_key, $_sections);
    1012                     }               
    1013 
    1014                 }
    1015                 update_post_meta( $post_id, self::get_meta_key_current_layout(), $current_layout);             
    1016             }
    1017         } else {
    1018             delete_post_meta( $post_id, self::get_meta_key_grid());
    1019         }
    1020 
    1021         do_action( 'kopa_page_buider_after_save_grid', $post_id, $layout_id, $layouts_data );
    1022 
    1023         exit();     
    1024     }
    1025 
    1026     public function save_customize() {
    1027         check_ajax_referer( 'kpb_save_customize', 'security' );
    1028 
    1029         $post_id    = (int) $_POST['post_id'];
    1030         $layout     = $_POST['layout'];
    1031         $section    = $_POST['section'];       
    1032         $meta_key   = sprintf( '%s-%s-%s', self::get_meta_key_wrapper(), $layout, $section);   
    1033         $meta_value = array();     
    1034         $data       = $_POST[$meta_key];       
    1035 
    1036         $_section_fields = apply_filters( 'kopa_page_builder_get_section_fields', array());
    1037 
    1038         foreach ( $_section_fields as $tab_slug => $tab) {
    1039 
    1040             foreach ( $tab['params'] as $param_key => $param_args){
    1041                 $_value = isset( $data[$tab_slug][$param_key]) ? $data[$tab_slug][$param_key] : (isset( $param_args['default']) ? $param_args['default'] : null);               
    1042                 $meta_value[$tab_slug][$param_key] = $this->validate_data_meta_boxes( $param_args, $_value);
    1043             }
    1044 
    1045         }
    1046        
    1047         update_post_meta( $post_id, $meta_key, $meta_value);   
    1048 
    1049         do_action( 'kopa_page_builder_after_save_section_customize', $post_id, $layout, $meta_value, $section);
    1050 
    1051         exit();     
    1052     }   
    1053 
    1054     public function save_layout_customize() {
    1055         check_ajax_referer( 'kpb_save_layout_customize', 'security' );
    1056 
    1057         $post_id        = (int) $_POST['post_id'];
    1058         $layout_slug    = $_POST['layout'];
    1059         $meta_key       = sprintf( '%s-%s', self::get_meta_key_layout_customize(), $layout_slug);   
    1060         $meta_value     = array();
    1061         $data           = $_POST[$meta_key];
    1062         $layouts        = apply_filters( 'kopa_page_builder_get_layouts', array());
    1063         $current_layout = $layouts[$layout_slug];
    1064 
    1065         foreach ( $current_layout['customize'] as $tab_slug => $tab) {
    1066             foreach ( $tab['params'] as $param_key => $param_args){
    1067                 $_value = isset( $data[$tab_slug][$param_key]) ? $data[$tab_slug][$param_key] : (isset( $param_args['default']) ? $param_args['default'] : null);               
    1068                 $meta_value[$tab_slug][$param_key] = $this->validate_data_meta_boxes( $param_args, $_value);
    1069             }
    1070         }
    1071 
    1072         do_action( 'kopa_page_builder_before_save_layout_customize', $post_id, $layout_slug, $meta_value);
    1073 
    1074         update_post_meta( $post_id, $meta_key, $meta_value);   
    1075 
    1076         do_action( 'kopa_page_builder_after_save_layout_customize', $post_id, $layout_slug, $meta_value );
    1077 
    1078         exit();
    1079     }
    1080 
    1081     public function str_beautify( $string) {
    1082         return ucwords(str_replace( '_', ' ', $string));
    1083     }
    1084 
    1085     public function str_uglify( $string) {
    1086         $string = preg_replace("/[^a-zA-Z0-9\s]/", '', $string);
    1087         return strtolower(str_replace( ' ', '_', $string));
    1088     }
    1089 
    1090     public function get_field_alert( $params ){
    1091         $classes = array( 'kpb-ui-alert' );
    1092         if( isset( $params['class'] ) ){
    1093             $classes = array_merge( $classes, $params['class'] );
    1094         }
    1095 
    1096         $skin = isset( $params['skin'] ) ? trim( $params['skin'] ) : 'info';
    1097         array_push( $classes, sprintf( 'kpb-skin-%s', $skin ) );
    1098         ?>
    1099         <div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"><?php echo wp_kses_post( $params['message'] ); ?></div>
    1100         <?php
    1101     }
    1102 
    1103     public function get_field_text( $params){
    1104         ?>
    1105         <input name="<?php echo esc_attr( $params['name']); ?>" value="<?php echo esc_attr( $params['value']); ?>" type="text" class="kpb-ui-text" autocomplete="off">     
    1106         <?php
    1107     }
    1108 
    1109     public function get_field_number( $params){
    1110         ?>
    1111         <input name="<?php echo esc_attr( $params['name']); ?>" value="<?php echo esc_attr( $params['value']); ?>" type="text" class="kpb-ui-number" autocomplete="off">       
    1112         <?php if( $params['affix']): ?>
    1113             <i><?php echo $params['affix']; ?></i>
    1114         <?php endif;?>
    1115         <?php
    1116     }
    1117 
    1118     public function get_field_color( $params){
    1119         ?>
    1120         <input name="<?php echo esc_attr( $params['name']); ?>" value="<?php echo esc_attr( $params['value']); ?>" type="text" class="kpb-ui-color" data-default-color="<?php echo isset( $params['default']) ? $params['default'] : ''; ?>" autocomplete="off">
    1121         <?php
    1122     }
    1123 
    1124     public function get_field_checkbox( $params){
    1125         $params['value'] = isset( $params['value']) ? isset( $params['value']) : isset( $params['default']) ? $params['value'] : 'false';
    1126         ?>
    1127         <input name="<?php echo esc_attr( $params['name']); ?>"
    1128             <?php checked( $params['value'], 'true' ); ?>
    1129             value="true"
    1130             type="checkbox"
    1131             class="kpb-ui-checbox"         
    1132             autocomplete="off">
    1133         <?php
    1134     }
    1135 
    1136     public function get_field_radio( $params){
    1137         foreach( $params['options'] as $value => $title):
    1138             $checked = !empty( $params['value']) && ( $params['value'] == $value) ? 'checked="checked"' : '';
    1139             $id = wp_generate_password(4, false, false) . '-' . $value;
    1140             ?>
    1141             <label for="<?php echo esc_attr( $id);?>">
    1142                 <span><?php echo esc_attr( $title); ?></span>
    1143                 <input id="<?php echo esc_attr( $id); ?>" name="<?php echo esc_attr( $params['name']); ?>" value="<?php echo esc_attr( $value); ?>" type="radio" class="kpb-ui-radio" <?php echo $checked; ?> autocomplete="off">       
    1144             </label>           
    1145             <?php
    1146         endforeach;
    1147     }
    1148 
    1149     public function get_field_radio_image( $params){
    1150         foreach( $params['options'] as $value => $title):
    1151             $checked = !empty( $params['value']) && ( $params['value'] == $value) ? 'checked="checked"' : '';
    1152             $id = wp_generate_password(4, false, false) . '-' . $value;
    1153             ?>
    1154             <div class="radio-image-wrapper">
    1155                 <label for="<?php echo esc_attr( $id);?>">
    1156                     <span><?php echo $title; ?></span>
    1157                     <input id="<?php echo esc_attr( $id); ?>" name="<?php echo esc_attr( $params['name']); ?>" value="<?php echo esc_attr( $value); ?>" type="radio" class="kpb-ui-radio" <?php echo $checked; ?> autocomplete="off">
    1158                 </label>
    1159             </div>
    1160         <?php
    1161         endforeach;
    1162     }
    1163 
    1164     public function get_field_select( $params){
    1165         ?>
    1166         <select name="<?php echo esc_attr( $params['name']); ?>" class="kpb-ui-select" autocomplete=off>
    1167             <?php
    1168             foreach( $params['options'] as $value => $title):
    1169                 $selected = !empty( $params['value']) && ( $params['value'] == $value) ? 'selected="selected"' : '';
    1170                 ?>
    1171                 <option value="<?php echo $value ?>" <?php echo esc_attr( $selected); ?>><?php echo esc_attr( $title); ?></option>
    1172                 <?php
    1173             endforeach;
    1174             ?>
    1175         </select>
    1176         <?php
    1177     }
    1178 
    1179     public function get_field_image( $params){
    1180         $preview       =  KPB_DIR . 'images/placehold.png';
    1181         $image         = !empty( $params['value']) ? do_shortcode( $params['value']) : '';
    1182         $image_reset   = (isset( $params['default']) && !empty( $params['default'])) ? do_shortcode( $params['default']) : '';
    1183         $image_preview = $image ? $image : $preview;
    1184         ?>
    1185         <div class="kpb-ui-image-outer">
    1186             <div class="kpb-clearfix">
    1187                 <input name="<?php echo esc_attr( $params['name']); ?>" value="<?php echo esc_url( $image); ?>" type="text" class="kpb-ui-image kpb-pull-left" autocomplete="off">
    1188                 <a href="#" class="kpb-ui-image-button-upload button button-secondary kpb-pull-left"><?php esc_html_e( 'Upload', 'kopa-page-builder' ); ?></a>
    1189                 <a href="#" class="kpb-ui-image-button-reset button button-link button-delete kpb-pull-left" data-preview="<?php echo esc_url( $preview); ?>" data-reset="<?php echo esc_url( $image_reset); ?>"><?php esc_html_e( 'Reset', 'kopa-page-builder' ); ?></a>
    1190             </div>   
    1191             <br/>
    1192             <img src="<?php echo $image_preview;?>" class="kpb-ui-image-preview" data-preview="<?php echo esc_url( $preview); ?>">     
    1193         </div>
    1194         <?php
    1195     }
    1196 
    1197     public function get_field_textarea( $params){
    1198         $class = isset( $params['class']) && !empty( $params['class']) ? $params['class'] : '';
    1199         $rows = isset( $params['rows']) && !empty( $params['rows']) ? (int) $params['rows'] : 3;       
    1200         ?>
    1201         <textarea name="<?php echo esc_attr( $params['name']); ?>" class="kpb-ui-textarea <?php echo $class;?>" rows="<?php echo $rows; ?>" autocomplete="off"><?php echo htmlspecialchars_decode(stripslashes( $params['value'])); ?></textarea>
    1202         <?php
    1203     }
    1204 
    1205     public function get_field_icon( $params){
    1206         $params['options'] = array( '' => esc_html__( '-- select icon --', 'kopa-page-builder' ) );
    1207         $icons = $this->get_icons();
    1208         foreach ( $icons as $icon) {
    1209             $params['options'][$icon] = str_replace( 'fa fa-', '', $icon);
    1210         }
    1211 
    1212         $this->get_field_select( $params);
    1213     }
    1214 
    1215     public function validate_data_meta_boxes( $param_args, $value){
    1216         switch ( $param_args['type']) {
    1217             case 'color':
    1218                 $value = esc_attr( $value);
    1219                 break;
    1220             case 'image':
    1221                 if (!empty( $value)) {
    1222                     $value = str_replace(home_url(), '[kpb_home_url]', $value);
    1223                 }
    1224                 break;
    1225             case 'select':
    1226                 $value = esc_attr( $value);
    1227                 break;     
    1228             case 'text':
    1229                 $value = esc_attr( $value);
    1230                 break;                                                                             
    1231             case 'number':
    1232                 if(trim( $value) != ''){
    1233                     $value = floatval( $value);
    1234                 }               
    1235                 break;
    1236             case 'textarea':
    1237                 $value = htmlspecialchars_decode(stripslashes( $value));
    1238                 break;                                                         
    1239         }
    1240 
    1241         return $value;
    1242     }
    1243 
    1244     public function shortcode_home_url() {   
    1245         return get_site_url();
    1246     }
    1247 
    1248     public function get_icons() {
    1249         $icons = array(
    1250             'fa fa-rub',
    1251             'fa fa-ruble',
    1252             'fa fa-rouble',
    1253             'fa fa-pagelines',
    1254             'fa fa-stack-exchange',
    1255             'fa fa-arrow-circle-o-right',
    1256             'fa fa-arrow-circle-o-left',
    1257             'fa fa-caret-square-o-left',
    1258             'fa fa-toggle-left',
    1259             'fa fa-dot-circle-o',
    1260             'fa fa-wheelchair',
    1261             'fa fa-vimeo-square',
    1262             'fa fa-try',
    1263             'fa fa-turkish-lira',
    1264             'fa fa-plus-square-o',
    1265             'fa fa-adjust',
    1266             'fa fa-anchor',
    1267             'fa fa-archive',
    1268             'fa fa-arrows',
    1269             'fa fa-arrows-h',
    1270             'fa fa-arrows-v',
    1271             'fa fa-asterisk',
    1272             'fa fa-ban',
    1273             'fa fa-bar-chart-o',
    1274             'fa fa-barcode',
    1275             'fa fa-bars',
    1276             'fa fa-beer',
    1277             'fa fa-bell',
    1278             'fa fa-bell-o',
    1279             'fa fa-bolt',
    1280             'fa fa-book',
    1281             'fa fa-bookmark',
    1282             'fa fa-bookmark-o',
    1283             'fa fa-briefcase',
    1284             'fa fa-bug',
    1285             'fa fa-building-o',
    1286             'fa fa-bullhorn',
    1287             'fa fa-bullseye',
    1288             'fa fa-calendar',
    1289             'fa fa-calendar-o',
    1290             'fa fa-camera',
    1291             'fa fa-camera-retro',
    1292             'fa fa-caret-square-o-down',
    1293             'fa fa-caret-square-o-left',
    1294             'fa fa-caret-square-o-right',
    1295             'fa fa-caret-square-o-up',
    1296             'fa fa-certificate',
    1297             'fa fa-check',
    1298             'fa fa-check-circle',
    1299             'fa fa-check-circle-o',
    1300             'fa fa-check-square',
    1301             'fa fa-check-square-o',
    1302             'fa fa-circle',
    1303             'fa fa-circle-o',
    1304             'fa fa-clock-o',
    1305             'fa fa-cloud',
    1306             'fa fa-cloud-download',
    1307             'fa fa-cloud-upload',
    1308             'fa fa-code',
    1309             'fa fa-code-fork',
    1310             'fa fa-coffee',
    1311             'fa fa-cog',
    1312             'fa fa-cogs',
    1313             'fa fa-comment',
    1314             'fa fa-comment-o',
    1315             'fa fa-comments',
    1316             'fa fa-comments-o',
    1317             'fa fa-compass',
    1318             'fa fa-credit-card',
    1319             'fa fa-crop',
    1320             'fa fa-crosshairs',
    1321             'fa fa-cutlery',
    1322             'fa fa-dashboard',
    1323             'fa fa-desktop',
    1324             'fa fa-dot-circle-o',
    1325             'fa fa-download',
    1326             'fa fa-edit',
    1327             'fa fa-ellipsis-h',
    1328             'fa fa-ellipsis-v',
    1329             'fa fa-envelope',
    1330             'fa fa-envelope-o',
    1331             'fa fa-eraser',
    1332             'fa fa-exchange',
    1333             'fa fa-exclamation',
    1334             'fa fa-exclamation-circle',
    1335             'fa fa-exclamation-triangle',
    1336             'fa fa-external-link',
    1337             'fa fa-external-link-square',
    1338             'fa fa-eye',
    1339             'fa fa-eye-slash',
    1340             'fa fa-female',
    1341             'fa fa-fighter-jet',
    1342             'fa fa-film',
    1343             'fa fa-filter',
    1344             'fa fa-fire',
    1345             'fa fa-fire-extinguisher',
    1346             'fa fa-flag',
    1347             'fa fa-flag-checkered',
    1348             'fa fa-flag-o',
    1349             'fa fa-flash',
    1350             'fa fa-flask',
    1351             'fa fa-folder',
    1352             'fa fa-folder-o',
    1353             'fa fa-folder-open',
    1354             'fa fa-folder-open-o',
    1355             'fa fa-frown-o',
    1356             'fa fa-gamepad',
    1357             'fa fa-gavel',
    1358             'fa fa-gear',
    1359             'fa fa-gears',
    1360             'fa fa-gift',
    1361             'fa fa-glass',
    1362             'fa fa-globe',
    1363             'fa fa-group',
    1364             'fa fa-hdd-o',
    1365             'fa fa-headphones',
    1366             'fa fa-heart',
    1367             'fa fa-heart-o',
    1368             'fa fa-home',
    1369             'fa fa-inbox',
    1370             'fa fa-info',
    1371             'fa fa-info-circle',
    1372             'fa fa-key',
    1373             'fa fa-keyboard-o',
    1374             'fa fa-laptop',
    1375             'fa fa-leaf',
    1376             'fa fa-legal',
    1377             'fa fa-lemon-o',
    1378             'fa fa-level-down',
    1379             'fa fa-level-up',
    1380             'fa fa-lightbulb-o',
    1381             'fa fa-location-arrow',
    1382             'fa fa-lock',
    1383             'fa fa-magic',
    1384             'fa fa-magnet',
    1385             'fa fa-mail-forward',
    1386             'fa fa-mail-reply',
    1387             'fa fa-mail-reply-all',
    1388             'fa fa-male',
    1389             'fa fa-map-marker',
    1390             'fa fa-meh-o',
    1391             'fa fa-microphone',
    1392             'fa fa-microphone-slash',
    1393             'fa fa-minus',
    1394             'fa fa-minus-circle',
    1395             'fa fa-minus-square',
    1396             'fa fa-minus-square-o',
    1397             'fa fa-mobile',
    1398             'fa fa-mobile-phone',
    1399             'fa fa-money',
    1400             'fa fa-moon-o',
    1401             'fa fa-music',
    1402             'fa fa-pencil',
    1403             'fa fa-pencil-square',
    1404             'fa fa-pencil-square-o',
    1405             'fa fa-phone',
    1406             'fa fa-phone-square',
    1407             'fa fa-picture-o',
    1408             'fa fa-plane',
    1409             'fa fa-plus',
    1410             'fa fa-plus-circle',
    1411             'fa fa-plus-square',
    1412             'fa fa-plus-square-o',
    1413             'fa fa-power-off',
    1414             'fa fa-print',
    1415             'fa fa-puzzle-piece',
    1416             'fa fa-qrcode',
    1417             'fa fa-question',
    1418             'fa fa-question-circle',
    1419             'fa fa-quote-left',
    1420             'fa fa-quote-right',
    1421             'fa fa-random',
    1422             'fa fa-refresh',
    1423             'fa fa-reply',
    1424             'fa fa-reply-all',
    1425             'fa fa-retweet',
    1426             'fa fa-road',
    1427             'fa fa-rocket',
    1428             'fa fa-rss',
    1429             'fa fa-rss-square',
    1430             'fa fa-search',
    1431             'fa fa-search-minus',
    1432             'fa fa-search-plus',
    1433             'fa fa-share',
    1434             'fa fa-share-square',
    1435             'fa fa-share-square-o',
    1436             'fa fa-shield',
    1437             'fa fa-shopping-cart',
    1438             'fa fa-sign-in',
    1439             'fa fa-sign-out',
    1440             'fa fa-signal',
    1441             'fa fa-sitemap',
    1442             'fa fa-smile-o',
    1443             'fa fa-sort',
    1444             'fa fa-sort-alpha-asc',
    1445             'fa fa-sort-alpha-desc',
    1446             'fa fa-sort-amount-asc',
    1447             'fa fa-sort-amount-desc',
    1448             'fa fa-sort-asc',
    1449             'fa fa-sort-desc',
    1450             'fa fa-sort-down',
    1451             'fa fa-sort-numeric-asc',
    1452             'fa fa-sort-numeric-desc',
    1453             'fa fa-sort-up',
    1454             'fa fa-spinner',
    1455             'fa fa-square',
    1456             'fa fa-square-o',
    1457             'fa fa-star',
    1458             'fa fa-star-half',
    1459             'fa fa-star-half-empty',
    1460             'fa fa-star-half-full',
    1461             'fa fa-star-half-o',
    1462             'fa fa-star-o',
    1463             'fa fa-subscript',
    1464             'fa fa-suitcase',
    1465             'fa fa-sun-o',
    1466             'fa fa-superscript',
    1467             'fa fa-tablet',
    1468             'fa fa-tachometer',
    1469             'fa fa-tag',
    1470             'fa fa-tags',
    1471             'fa fa-tasks',
    1472             'fa fa-terminal',
    1473             'fa fa-thumb-tack',
    1474             'fa fa-thumbs-down',
    1475             'fa fa-thumbs-o-down',
    1476             'fa fa-thumbs-o-up',
    1477             'fa fa-thumbs-up',
    1478             'fa fa-ticket',
    1479             'fa fa-times',
    1480             'fa fa-times-circle',
    1481             'fa fa-times-circle-o',
    1482             'fa fa-tint',
    1483             'fa fa-toggle-down',
    1484             'fa fa-toggle-left',
    1485             'fa fa-toggle-right',
    1486             'fa fa-toggle-up',
    1487             'fa fa-trash-o',
    1488             'fa fa-trophy',
    1489             'fa fa-truck',
    1490             'fa fa-umbrella',
    1491             'fa fa-unlock',
    1492             'fa fa-unlock-alt',
    1493             'fa fa-unsorted',
    1494             'fa fa-upload',
    1495             'fa fa-user',
    1496             'fa fa-users',
    1497             'fa fa-video-camera',
    1498             'fa fa-volume-down',
    1499             'fa fa-volume-off',
    1500             'fa fa-volume-up',
    1501             'fa fa-warning',
    1502             'fa fa-wheelchair',
    1503             'fa fa-wrench',
    1504             'fa fa-check-square',
    1505             'fa fa-check-square-o',
    1506             'fa fa-circle',
    1507             'fa fa-circle-o',
    1508             'fa fa-dot-circle-o',
    1509             'fa fa-minus-square',
    1510             'fa fa-minus-square-o',
    1511             'fa fa-plus-square',
    1512             'fa fa-plus-square-o',
    1513             'fa fa-square',
    1514             'fa fa-square-o',
    1515             'fa fa-bitcoin',
    1516             'fa fa-btc',
    1517             'fa fa-cny',
    1518             'fa fa-dollar',
    1519             'fa fa-eur',
    1520             'fa fa-euro',
    1521             'fa fa-gbp',
    1522             'fa fa-inr',
    1523             'fa fa-jpy',
    1524             'fa fa-krw',
    1525             'fa fa-money',
    1526             'fa fa-rmb',
    1527             'fa fa-rouble',
    1528             'fa fa-rub',
    1529             'fa fa-ruble',
    1530             'fa fa-rupee',
    1531             'fa fa-try',
    1532             'fa fa-turkish-lira',
    1533             'fa fa-usd',
    1534             'fa fa-won',
    1535             'fa fa-yen',
    1536             'fa fa-align-center',
    1537             'fa fa-align-justify',
    1538             'fa fa-align-left',
    1539             'fa fa-align-right',
    1540             'fa fa-bold',
    1541             'fa fa-chain',
    1542             'fa fa-chain-broken',
    1543             'fa fa-clipboard',
    1544             'fa fa-columns',
    1545             'fa fa-copy',
    1546             'fa fa-cut',
    1547             'fa fa-dedent',
    1548             'fa fa-eraser',
    1549             'fa fa-file',
    1550             'fa fa-file-o',
    1551             'fa fa-file-text',
    1552             'fa fa-file-text-o',
    1553             'fa fa-files-o',
    1554             'fa fa-floppy-o',
    1555             'fa fa-font',
    1556             'fa fa-indent',
    1557             'fa fa-italic',
    1558             'fa fa-link',
    1559             'fa fa-list',
    1560             'fa fa-list-alt',
    1561             'fa fa-list-ol',
    1562             'fa fa-list-ul',
    1563             'fa fa-outdent',
    1564             'fa fa-paperclip',
    1565             'fa fa-paste',
    1566             'fa fa-repeat',
    1567             'fa fa-rotate-left',
    1568             'fa fa-rotate-right',
    1569             'fa fa-save',
    1570             'fa fa-scissors',
    1571             'fa fa-strikethrough',
    1572             'fa fa-table',
    1573             'fa fa-text-height',
    1574             'fa fa-text-width',
    1575             'fa fa-th',
    1576             'fa fa-th-large',
    1577             'fa fa-th-list',
    1578             'fa fa-underline',
    1579             'fa fa-undo',
    1580             'fa fa-unlink',
    1581             'fa fa-angle-double-down',
    1582             'fa fa-angle-double-left',
    1583             'fa fa-angle-double-right',
    1584             'fa fa-angle-double-up',
    1585             'fa fa-angle-down',
    1586             'fa fa-angle-left',
    1587             'fa fa-angle-right',
    1588             'fa fa-angle-up',
    1589             'fa fa-arrow-circle-down',
    1590             'fa fa-arrow-circle-left',
    1591             'fa fa-arrow-circle-o-down',
    1592             'fa fa-arrow-circle-o-left',
    1593             'fa fa-arrow-circle-o-right',
    1594             'fa fa-arrow-circle-o-up',
    1595             'fa fa-arrow-circle-right',
    1596             'fa fa-arrow-circle-up',
    1597             'fa fa-arrow-down',
    1598             'fa fa-arrow-left',
    1599             'fa fa-arrow-right',
    1600             'fa fa-arrow-up',
    1601             'fa fa-arrows',
    1602             'fa fa-arrows-alt',
    1603             'fa fa-arrows-h',
    1604             'fa fa-arrows-v',
    1605             'fa fa-caret-down',
    1606             'fa fa-caret-left',
    1607             'fa fa-caret-right',
    1608             'fa fa-caret-square-o-down',
    1609             'fa fa-caret-square-o-left',
    1610             'fa fa-caret-square-o-right',
    1611             'fa fa-caret-square-o-up',
    1612             'fa fa-caret-up',
    1613             'fa fa-chevron-circle-down',
    1614             'fa fa-chevron-circle-left',
    1615             'fa fa-chevron-circle-right',
    1616             'fa fa-chevron-circle-up',
    1617             'fa fa-chevron-down',
    1618             'fa fa-chevron-left',
    1619             'fa fa-chevron-right',
    1620             'fa fa-chevron-up',
    1621             'fa fa-hand-o-down',
    1622             'fa fa-hand-o-left',
    1623             'fa fa-hand-o-right',
    1624             'fa fa-hand-o-up',
    1625             'fa fa-long-arrow-down',
    1626             'fa fa-long-arrow-left',
    1627             'fa fa-long-arrow-right',
    1628             'fa fa-long-arrow-up',
    1629             'fa fa-toggle-down',
    1630             'fa fa-toggle-left',
    1631             'fa fa-toggle-right',
    1632             'fa fa-toggle-up',
    1633             'fa fa-arrows-alt',
    1634             'fa fa-backward',
    1635             'fa fa-compress',
    1636             'fa fa-eject',
    1637             'fa fa-expand',
    1638             'fa fa-fast-backward',
    1639             'fa fa-fast-forward',
    1640             'fa fa-forward',
    1641             'fa fa-pause',
    1642             'fa fa-play',
    1643             'fa fa-play-circle',
    1644             'fa fa-play-circle-o',
    1645             'fa fa-step-backward',
    1646             'fa fa-step-forward',
    1647             'fa fa-stop',
    1648             'fa fa-youtube-play',
    1649             'fa fa-adn',
    1650             'fa fa-android',
    1651             'fa fa-apple',
    1652             'fa fa-bitbucket',
    1653             'fa fa-bitbucket-square',
    1654             'fa fa-bitcoin',
    1655             'fa fa-btc',
    1656             'fa fa-css3',
    1657             'fa fa-dribbble',
    1658             'fa fa-dropbox',
    1659             'fa fa-facebook',
    1660             'fa fa-facebook-square',
    1661             'fa fa-flickr',
    1662             'fa fa-foursquare',
    1663             'fa fa-github',
    1664             'fa fa-github-alt',
    1665             'fa fa-github-square',
    1666             'fa fa-gittip',
    1667             'fa fa-google-plus',
    1668             'fa fa-google-plus-square',
    1669             'fa fa-html5',
    1670             'fa fa-instagram',
    1671             'fa fa-linkedin',
    1672             'fa fa-linkedin-square',
    1673             'fa fa-linux',
    1674             'fa fa-maxcdn',
    1675             'fa fa-pagelines',
    1676             'fa fa-pinterest',
    1677             'fa fa-pinterest-square',
    1678             'fa fa-renren',
    1679             'fa fa-skype',
    1680             'fa fa-stack-exchange',
    1681             'fa fa-stack-overflow',
    1682             'fa fa-trello',
    1683             'fa fa-tumblr',
    1684             'fa fa-tumblr-square',
    1685             'fa fa-twitter',
    1686             'fa fa-twitter-square',
    1687             'fa fa-vimeo-square',
    1688             'fa fa-vk',
    1689             'fa fa-weibo',
    1690             'fa fa-windows',
    1691             'fa fa-xing',
    1692             'fa fa-xing-square',
    1693             'fa fa-youtube',
    1694             'fa fa-youtube-play',
    1695             'fa fa-youtube-square',
    1696             'fa fa-ambulance',
    1697             'fa fa-h-square',
    1698             'fa fa-hospital-o',
    1699             'fa fa-medkit',
    1700             'fa fa-plus-square',
    1701             'fa fa-stethoscope',
    1702             'fa fa-user-md',
    1703             'fa fa-wheelchair'
    1704         );
    1705 
    1706         return apply_filters( 'kpb_get_icons', $icons);
    1707     }
    1708 
    1709261}
  • kopa-page-builder/trunk/languages/kopa-page-builder-en_US.pot

    r1209395 r1490799  
     1#, fuzzy
    12msgid ""
    23msgstr ""
    34"Project-Id-Version: Kopa Page Builder\n"
    45"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2015-05-17 23:17+0700\n"
     6"POT-Creation-Date: 2016-08-15 23:32+0700\n"
    67"PO-Revision-Date: 2015-05-17 23:17+0700\n"
    78"Last-Translator: thanh4890 <[email protected]>\n"
     
    1213"Content-Transfer-Encoding: 8bit\n"
    1314"Plural-Forms: nplurals=2; plural=n != 1;\n"
    14 "X-Generator: Poedit 1.7.6\n"
     15"X-Generator: Poedit 1.8.7\n"
    1516"X-Poedit-SourceCharset: UTF-8\n"
    1617"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
    17 "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
    18 "X-Poedit-Basepath: ../\n"
     18"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
     19"esc_attr__;esc_attr_e;esc_html__;esc_html_e\n"
     20"X-Poedit-Basepath: ..\n"
    1921"X-Textdomain-Support: yes\n"
    2022"X-Poedit-SearchPath-0: .\n"
    2123
    22 #: kopa-page-builder.php:61
    23 msgid "Page builder"
    24 msgstr ""
    25 
    26 #: kopa-page-builder.php:70
    27 msgid "Use sticky toolbar ?"
    28 msgstr ""
    29 
    30 #: kopa-page-builder.php:217
     24#: inc/class-kpb-admin-assets.php:66
    3125msgid "Media center"
    3226msgstr ""
    3327
    34 #: kopa-page-builder.php:218
     28#: inc/class-kpb-admin-assets.php:67
    3529msgid "Choose image"
    3630msgstr ""
    3731
    38 #: kopa-page-builder.php:219 kopa-page-builder.php:694
     32#: inc/class-kpb-admin-assets.php:68 inc/class-kpb-widget.php:368
    3933msgid "Loading..."
    4034msgstr ""
    4135
    42 #: kopa-page-builder.php:220 kopa-page-builder.php:265
    43 #: kopa-page-builder.php:704 kopa-page-builder.php:733
    44 #: kopa-page-builder.php:800
     36#: inc/class-kpb-admin-assets.php:69 inc/class-kpb-col.php:115
     37#: inc/class-kpb-layout.php:379 inc/class-kpb-row.php:66
     38#: inc/class-kpb-widget.php:379 kopa-page-builder.php:124
    4539msgid "Save"
    4640msgstr ""
    4741
    48 #: kopa-page-builder.php:221
     42#: inc/class-kpb-admin-assets.php:70
    4943msgid "Saving..."
    5044msgstr ""
    5145
    52 #: kopa-page-builder.php:222 kopa-page-builder.php:267
    53 msgid "Hide preview"
     46#: inc/class-kpb-admin-assets.php:71
     47msgid "Hide visual layout"
    5448msgstr ""
    5549
    56 #: kopa-page-builder.php:223
    57 msgid "Show preview"
     50#: inc/class-kpb-admin-assets.php:72 kopa-page-builder.php:125
     51msgid "Show visual layout"
    5852msgstr ""
    5953
    60 #: kopa-page-builder.php:224
     54#: inc/class-kpb-admin-assets.php:73
    6155msgid "Are you sure to remove this widget ?"
    6256msgstr ""
    6357
    64 #: kopa-page-builder.php:233
     58#: inc/class-kpb-ajax.php:38
     59msgid "Loading.."
     60msgstr ""
     61
     62#: inc/class-kpb-col.php:112
     63msgid "Edit Column"
     64msgstr ""
     65
     66#: inc/class-kpb-col.php:114 inc/class-kpb-layout.php:378
     67#: inc/class-kpb-row.php:65 inc/class-kpb-widget.php:91
     68#: inc/class-kpb-widget.php:207 inc/class-kpb-widget.php:362
     69msgid "Close"
     70msgstr ""
     71
     72#: inc/class-kpb-editor.php:27 kopa-page-builder.php:95
    6573msgid "Page Builder"
    6674msgstr ""
    6775
    68 #: kopa-page-builder.php:251
    69 msgid "Loading.."
     76#: inc/class-kpb-field.php:14
     77msgid "I'm abstract field. Override me, please!"
    7078msgstr ""
    7179
    72 #: kopa-page-builder.php:269
    73 msgid "Customize"
     80#: inc/class-kpb-layout.php:102
     81msgid "Edit this row"
    7482msgstr ""
    7583
    76 #: kopa-page-builder.php:335 kopa-page-builder.php:390
    77 msgid "Add widget"
     84#: inc/class-kpb-layout.php:145 inc/class-kpb-layout.php:148
     85#: inc/class-kpb-layout.php:210 inc/class-kpb-layout.php:213
     86msgid "Add new widget"
    7887msgstr ""
    7988
    80 #: kopa-page-builder.php:356 kopa-page-builder.php:411
    81 #: kopa-page-builder.php:904
     89#: inc/class-kpb-layout.php:146 inc/class-kpb-layout.php:211
     90msgid "Edit this column"
     91msgstr ""
     92
     93#: inc/class-kpb-layout.php:171 inc/class-kpb-layout.php:234
     94#: inc/class-kpb-widget.php:556
    8295msgid "Edit"
    8396msgstr ""
    8497
    85 #: kopa-page-builder.php:357 kopa-page-builder.php:412
    86 #: kopa-page-builder.php:905
     98#: inc/class-kpb-layout.php:172 inc/class-kpb-layout.php:235
     99#: inc/class-kpb-widget.php:557
    87100msgid "Delete"
    88101msgstr ""
    89102
    90 #: kopa-page-builder.php:502
     103#: inc/class-kpb-row.php:64
     104msgid "Edit Row"
     105msgstr ""
     106
     107#: inc/class-kpb-widget.php:90 inc/class-kpb-widget.php:206
     108msgid "Avaiable Widgets"
     109msgstr ""
     110
     111#: inc/class-kpb-widget.php:159 inc/class-kpb-widget.php:240
     112msgid "Add"
     113msgstr ""
     114
     115#: inc/class-kpb-widget.php:266
     116msgid "Type of Widget"
     117msgstr ""
     118
     119#: inc/class-kpb-widget.php:360
     120msgid "Widget Name"
     121msgstr ""
     122
     123#: inc/class-kpb-widget.php:440
    91124msgid "Widget"
    92125msgstr ""
    93126
    94 #: kopa-page-builder.php:561
    95 msgid "Progressing.."
     127#: inc/fields/class-kpb-field-icon.php:9
     128msgid "-- select icon --"
    96129msgstr ""
    97130
    98 #: kopa-page-builder.php:567
    99 msgid "Avaiable Widgets"
    100 msgstr ""
    101 
    102 #: kopa-page-builder.php:568 kopa-page-builder.php:690
    103 #: kopa-page-builder.php:732 kopa-page-builder.php:799
    104 msgid "Close"
    105 msgstr ""
    106 
    107 #: kopa-page-builder.php:654
    108 msgid "use"
    109 msgstr ""
    110 
    111 #: kopa-page-builder.php:689
    112 msgid "Widget Name"
    113 msgstr ""
    114 
    115 #: kopa-page-builder.php:1141
     131#: inc/fields/class-kpb-field-image.php:18
    116132msgid "Upload"
    117133msgstr ""
    118134
    119 #: kopa-page-builder.php:1142
     135#: inc/fields/class-kpb-field-image.php:19
    120136msgid "Reset"
    121137msgstr ""
    122138
    123 #: kopa-page-builder.php:1159
    124 msgid "-- select icon --"
     139#: kopa-page-builder.php:126
     140msgid "Customize"
    125141msgstr ""
  • kopa-page-builder/trunk/readme.txt

    r1484447 r1490799  
    11=== Kopa Page Builder ===
    2 Contributors: kopatheme,tranthethang
    3 Tags: page builder, grid, drag and drop, content composer layout builder, bootstrap, website builder, widgets, kopa, kopasoft, kopatheme
     2Contributors: kopatheme, tranthethang
     3Tags: page builder, grid, drag and drop, content composer, layout builder, bootstrap, website builder, widgets, kopa, kopasoft, kopatheme, trathethang
    44Requires at least: 4.1
    5 Tested up to: 4.5.2
    6 Stable tag: 1.4
     5Tested up to: 4.6
     6Stable tag: 2.0.1
    77
    88== Description ==
    99
    10 Kopa Page Builder plugin helps you create static pages by manually adding, editing or moving the widgets to the expected sidebars.
    11 Unlike the other Page Builder plugins which available on WordPress.org now, this plugin requires a deep understanding of technical knowledge and WordPress to use for your website.
     10Kopa Page Builder plugin helps you create static pages by manually adding, editing or moving the widgets to the expected sidebars. Unlike the other Page Builder plugins which available on WordPress.org now, this plugin requires a deep understanding of technical knowledge and WordPress to use for your website.
    1211
    1312== Installation ==
     
    2827== Changelog ==
    2928
     29= 2.0.1 =
     30* Update jquery plugin "Magnific Popup" to  v1.1.0 - 2016-02-20
     31* Add toggle button, to switch mode Editor and Page Builder.
     32* Add Php Docs for all variables, fuctions, classes.
     33* Optimize source code: Php, Css, Js.
     34* Separate functions to multi classes.
     35* Support "php-autoload" to include files.
     36* Use Ajax for all action: load form, load list of widget, load customize fields,..
     37
    3038= 1.4 =
    3139* English wording.
     
    3947* add: new some action hooks:
    4048    1. kopa_page_builder_after_save_widget
    41     1. kopa_page_buider_after_save_grid
     49    1. kopa_page_builder_after_save_grid
    4250    1. kopa_page_builder_after_save_section_customize
    4351    1. kopa_page_builder_after_save_layout_customize
Note: See TracChangeset for help on using the changeset viewer.