palette)) { $palette = implode('|', $this->palette); } else { // Default to true. $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; } // Support passing show_opacity as string or boolean. Default to true. $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; // Begin the output. ?>
label); ?> description)) { ?> description); ?>
link()); ?> /> default ) ) { $this->json['default'] = $this->default; } else { $this->json['default'] = $this->setting->default; } $this->json['value'] = $this->value(); $this->json['choices'] = $this->choices; $this->json['link'] = $this->get_link(); $this->json['id'] = $this->id; $this->json['inputAttrs'] = ''; foreach ( $this->input_attrs as $attr => $value ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
<# for ( key in data.choices ) { #> checked="checked" <# } #>> <# } #>
attr = $attr; $this->label = $args['label']; parent::__construct( $manager, $id, $args ); } /** * Renders the control wrapper and calls $this->render_content() for the internals. * * @see WP_Customize_Control::render() */ protected function render() { $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id ); $class = 'customize-control has-switchers customize-control-' . $this->type; ?>
  • render_content(); ?>
  • value() ) && ! empty( $this->value() ) ) { $values = json_encode( $this->value() ); } else { $values = $this->value(); } ?> link(); ?> class="ikreatethemes-responsive-buttonset-collection-value" value=""/> array( 'icon' => 'dashicons-desktop', ), 'tablet' => array( 'icon' => 'dashicons-tablet', ), 'mobile' => array( 'icon' => 'dashicons-smartphone ', ), ); $attr = $this->attr; if ( is_array( $this->value() ) && ! empty( $this->value() ) ) { $values = $this->value(); } else { $values = json_decode( $this->value(), true ); } ?>
  • " . esc_html( $this->label ) . ''; ?>

    1 ) { ?>
      $device_details ) { if ( $i == 1 ) { $active = ' active'; } else { $active = ''; } ?>
    description ) { ?> description ); ?>
    $device_details ) { if ( $i == 1 ) { $active = ' active'; } else { $active = ''; } echo '
      '; $value = isset( $values[ $device_id ] ) ? $values[ $device_id ] : ''; echo '
    • '; foreach ( $this->choices as $val => $label ) { ?> value=""> '; echo '
    '; $i ++; } ?>
  • icon_array = $args['icon_array']; } parent::__construct($manager, $id, $args); } public function render_content() { ?> label)) : ?>

    label); ?>

    description) { ?> description); ?> label); ?> description) { ?> description); ?> choices)) { return; } ?>
    label); ?> description) { ?> description); ?> value()) ? explode(',', $this->value()) : $this->value(); ?> link(); ?> value="" />
    link(); ?> value()); ?>>
    label); ?> description)) { ?> description); ?>
    options = $args['options']; $this->class = isset($args['class']) ? $args['class'] : ''; parent::__construct($manager, $id, $args); } public function render_content() { $options = $this->options; ?>
    label); ?> description)) { ?> description); ?>
    $image) { $class = ( $this->value() == $key ) ? 'selector-selected' : ''; echo '
    '; echo ''; echo '
    '; } ?>
    link(); ?> />

    json['default'] = $this->setting->default; if (isset($this->default)) { $this->json['default'] = $this->default; } $this->json['value'] = maybe_unserialize($this->value()); $this->json['choices'] = $this->choices; $this->json['link'] = $this->get_link(); $this->json['id'] = $this->id; $this->json['inputAttrs'] = ''; foreach ($this->input_attrs as $attr => $value) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr($value) . '" '; } $this->json['inputAttrs'] = maybe_serialize($this->input_attrs()); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?>
    {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
    on_off_label = $args['switch_label']; $this->class = isset($args['class']) ? $args['class'] : ''; parent::__construct($manager, $id, $args); } public function render_content() { $switch_class = ($this->value() == 'enable') ? 'switch-on ' : ''; $switch_class .= $this->class; $on_off_label = $this->on_off_label; ?>
    link(); ?> type="hidden" value="value()); ?>"/> label); ?> description) { ?> description ); ?> buttons as $button) { $active = isset($button['active']) ? $button['active'] : false; if ($active && $first) { $first = false; } elseif ($active && !$first) { $active = false; } $class = ""; if(isset($button['class'])){ $class = $button['class']; } $formatted_buttons[] = array( 'name' => $button['name'], 'fields' => $button['fields'], 'class' => $class, 'active' => $active, ); $all_fields = array_merge($all_fields, $button['fields']); } $this->json['buttons'] = $formatted_buttons; $this->json['fields'] = $all_fields; } public function content_template() { ?>
    <# if ( data.buttons ) { #>
    <# for (tab in data.buttons) { #> {{ data.buttons[tab].name }} <# } #>
    <# } #>
    hide = get_theme_mod($args['hiding_control'], 'enable'); } add_action('customize_controls_init', array($this, 'enqueue')); } /** * Add custom parameters to pass to the JS via JSON. * * @access public */ public function json() { $json = parent::json(); $json['hide'] = $this->hide; $json['hiding_control'] = $this->hiding_control; return $json; } /** * Enqueue function. * * @access public * @return void */ public function enqueue() { wp_enqueue_script('ikreatethemes-toggle-section', get_template_directory_uri() . '/inc/customizer/js/toggle-section.js', array('jquery'), IKTHEMES_VERSION, true); } /** * Outputs the Underscore.js template. * * @access public * @return void */ protected function render_template() { ?>
  • <# if(data.hiding_control){ #> <# } #>

  • render_content() for the internals. * * @see WP_Customize_Control::render() */ protected function render() { $id = 'customize-control-' . str_replace(array('[', ']'), array('-', ''), $this->id); $class = 'customize-control has-switchers customize-control-' . $this->type; ?>
  • render_content(); ?>
  • json['id'] = $this->id; $this->json['inputAttrs'] = ''; foreach ($this->input_attrs as $attr => $value) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr($value) . '" '; } $this->json['desktop'] = array(); $this->json['tablet'] = array(); $this->json['mobile'] = array(); foreach ($this->settings as $setting_key => $setting) { $this->json[$setting_key] = array( 'id' => $setting->id, 'default' => $setting->default, 'link' => $this->get_link($setting_key), 'value' => $this->value($setting_key), ); } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> <# if ( data.label ) { #>
    {{{ data.label }}}
    <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #> <# if ( data.desktop ) { #>
    <# } #> <# if ( data.tablet ) { #>
    <# } #> <# if ( data.mobile ) { #>
    <# } #> label); ?>
    link(); ?> />
    description) { ?> description); ?> fields = $fields; $this->attr = $attr; $this->label = $args['label']; parent::__construct( $manager, $id, $args ); } /** * Renders the control wrapper and calls $this->render_content() for the internals. * * @see WP_Customize_Control::render() */ protected function render() { $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id ); $class = 'customize-control has-switchers customize-control-' . $this->type; ?>
  • render_content(); ?>
  • value() ) && ! empty( $this->value() ) ) { $values = json_encode( $this->value() ); } else { $values = $this->value(); } ?> link(); ?> class="cssbox-collection-value" value=""/> array( 'icon' => 'dashicons-laptop', ), 'tablet' => array( 'icon' => 'dashicons-tablet', ), 'mobile' => array( 'icon' => 'dashicons-smartphone ', ), ); $default_fields = array( 'top' => true, 'right' => true, 'bottom' => true, 'left' => true, ); $box_fields_attr = ! empty( $this->fields ) ? $this->fields : $default_fields; $attr = $this->attr; if ( is_array( $this->value() ) && ! empty( $this->value() ) ) { $values = $this->value(); } else { $values = json_decode( $this->value(), true ); } $min = isset( $attr['min'] ) ? $attr['min'] : 0; $max = isset( $attr['max'] ) ? $attr['max'] : 1000; $step = isset( $attr['step'] ) ? $attr['step'] : 1; $link = isset( $attr['link'] ) ? $attr['link'] : 1; $devices = isset( $attr['devices'] ) ? $attr['devices'] : $devices; $link_text = isset( $attr['link_text'] ) ? $attr['link_text'] : esc_html__( 'Link', 'business-roy' ); ?>
  • " . esc_html( $this->label ) . ''; ?>

    description ) { ?> description ); ?>
    1 ) { ?>
    $device_details ) { if ( $i == 1 ) { $active = ' active'; } else { $active = ''; } echo '
      '; foreach ( $box_fields_attr as $field_id => $box_single_field ) { $value = isset( $values[ $device_id ][ $field_id ] ) ? $values[ $device_id ][ $field_id ] : ''; $default = isset( $box_single_field[ $device_id ][ $field_id ] ) ? $box_single_field[ $device_id ][ $field_id ] : ''; if ( ! $value ) { if ( isset( $box_single_field['default'] ) ) { $value = $box_single_field['default']; } } echo '
    • '; ?> '; } if ( $link ) { $cssbox_link = isset( $values[ $device_id ]['cssbox_link'] ) ? $values[ $device_id ]['cssbox_link'] : ''; ?>
    • '; $i ++; } ?>
  • ikreate_themes_button_labels(); $this->button_labels = apply_filters('customizer_background_button_labels', $button_labels, $id); // Set field labels $field_labels = $this->ikreate_themes_field_labels(); $this->field_labels = apply_filters('customizer_background_field_labels', $field_labels, $id); // Set background choices $background_choices = $this->ikreate_themes_background_choices(); $this->background_choices = apply_filters('customizer_background_choices', $background_choices, $id); } /** * Add custom parameters to pass to the JS via JSON. * * @since 1.0.0 * @access public * @return void */ public function to_json() { parent::to_json(); $background_choices = $this->background_choices; $field_labels = $this->field_labels; // Loop through each of the settings and set up the data for it. foreach ($this->settings as $setting_key => $setting_id) { $this->json[$setting_key] = array( 'link' => $this->get_link($setting_key), 'value' => $this->value($setting_key), 'label' => isset($field_labels[$setting_key]) ? $field_labels[$setting_key] : '' ); if ('image_url' === $setting_key) { if ($this->value($setting_key)) { // Get the attachment model for the existing file. $attachment_id = attachment_url_to_postid($this->value($setting_key)); if ($attachment_id) { $this->json['attachment'] = wp_prepare_attachment_for_js($attachment_id); } } } elseif ('repeat' === $setting_key) { $this->json[$setting_key]['choices'] = $background_choices['repeat']; } elseif ('size' === $setting_key) { $this->json[$setting_key]['choices'] = $background_choices['size']; } elseif ('position' === $setting_key) { $this->json[$setting_key]['choices'] = $background_choices['position']; } elseif ('attach' === $setting_key) { $this->json[$setting_key]['choices'] = $background_choices['attach']; } } } /** * Render a JS template for the content of the media control. * * @since 1.0.0 */ public function content_template() { parent::content_template(); ?>
    <# if ( data.attachment && data.repeat && data.repeat.choices ) { #>
  • <# if ( data.repeat.label ) { #> {{ data.repeat.label }} <# } #>
  • <# } #> <# if ( data.attachment && data.size && data.size.choices ) { #>
  • <# if ( data.size.label ) { #> {{ data.size.label }} <# } #>
  • <# } #> <# if ( data.attachment && data.position && data.position.choices ) { #>
  • <# if ( data.position.label ) { #> {{ data.position.label }} <# } #>
  • <# } #> <# if ( data.attachment && data.attach && data.attach.choices ) { #>
  • <# if ( data.attach.label ) { #> {{ data.attach.label }} <# } #>
  • <# } #>
    esc_html__('Select Image', 'business-roy'), 'change' => esc_html__('Change Image', 'business-roy'), 'remove' => esc_html__('Remove', 'business-roy'), 'default' => esc_html__('Default', 'business-roy'), 'placeholder' => esc_html__('No image selected', 'business-roy'), 'frame_title' => esc_html__('Select Image', 'business-roy'), 'frame_button' => esc_html__('Choose Image', 'business-roy'), ); return $button_labels; } /** * Returns field labels. * * @since 1.0.0 */ public static function ikreate_themes_field_labels() { $field_labels = array( 'repeat' => esc_html__('Repeat', 'business-roy'), 'size' => esc_html__('Size', 'business-roy'), 'position' => esc_html__('Position', 'business-roy'), 'attach' => esc_html__('Attachment', 'business-roy') ); return $field_labels; } /** * Returns the background choices. * * @since 1.0.0 * @return array */ public static function ikreate_themes_background_choices() { $choices = array( 'repeat' => array( 'no-repeat' => esc_html__('No Repeat', 'business-roy'), 'repeat' => esc_html__('Tile', 'business-roy'), 'repeat-x' => esc_html__('Tile Horizontally', 'business-roy'), 'repeat-y' => esc_html__('Tile Vertically', 'business-roy') ), 'size' => array( 'auto' => esc_html__('Default', 'business-roy'), 'cover' => esc_html__('Cover', 'business-roy'), 'contain' => esc_html__('Contain', 'business-roy') ), 'position' => array( 'left top' => esc_html__('Left Top', 'business-roy'), 'left center' => esc_html__('Left Center', 'business-roy'), 'left bottom' => esc_html__('Left Bottom', 'business-roy'), 'right top' => esc_html__('Right Top', 'business-roy'), 'right center' => esc_html__('Right Center', 'business-roy'), 'right bottom' => esc_html__('Right Bottom', 'business-roy'), 'center top' => esc_html__('Center Top', 'business-roy'), 'center center' => esc_html__('Center Center', 'business-roy'), 'center bottom' => esc_html__('Center Bottom', 'business-roy') ), 'attach' => array( 'fixed' => esc_html__('Fixed', 'business-roy'), 'scroll' => esc_html__('Scroll', 'business-roy') ) ); return $choices; } } /** * Group Control */ class Ikreate_Themes_Custom_Control_Group extends WP_Customize_Control { /** * The control type. * * @access public * @var string */ public $type = 'group'; public $label = ''; /** * The fields that each container row will contain. * * @access public * @var array */ public $fields = array(); /** * Repeater drag and drop controler * * @since 1.0.0 */ public function __construct( $manager, $id, $args = array(), $fields = array() ) { $this->fields = $fields; $this->label = $args['label']; parent::__construct( $manager, $id, $args ); } /** * enqueue css and scrpts * * @since 1.2.8 */ public function enqueue() { wp_enqueue_script('ikreatethemes-group-control', get_template_directory_uri().'/inc/customizer/js/group.js', array( 'jquery', 'customize-controls' ), IKTHEMES_VERSION, true); } /** * Renders the control wrapper and calls $this->render_content() for the internals. * * @see WP_Customize_Control::render() */ protected function render() { $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id ); $class = 'customize-control has-switchers customize-control-' . $this->type; ?>
  • render_content(); ?>
  • value() ) && ! empty( $this->value() ) ) { $values = json_encode( $this->value() ); } else { $values = $this->value(); } ?> link(); ?> class="ikreatethemes-group-collection" value=""/> fields; if ( is_array( $this->value() ) && ! empty( $this->value() ) ) { $values = $this->value(); } else { $values = json_decode( $this->value(), true ); } ?>
  • " . esc_html( $this->label ) . ''; ?>

    description ) { ?> description ); ?>
  • array( 'icon' => 'dashicons-laptop', ), 'tablet' => array( 'icon' => 'dashicons-tablet', ), 'mobile' => array( 'icon' => 'dashicons-smartphone ', ), ); $default_fields = array( 'top' => true, 'right' => true, 'bottom' => true, 'left' => true, ); $box_fields_attr = ! empty( $box_fields ) ? $box_fields : $default_fields; $min = isset( $attr['min'] ) ? $attr['min'] : 0; $max = isset( $attr['max'] ) ? $attr['max'] : 1000; $step = isset( $attr['step'] ) ? $attr['step'] : 1; $link = isset( $attr['link'] ) ? $attr['link'] : 1; $link_toggle = isset( $attr['link_toggle'] ) ? $attr['link_toggle'] : true; $devices = isset( $attr['devices'] ) ? $attr['devices'] : $devices; $link_text = isset( $attr['link_text'] ) ? $attr['link_text'] : esc_html__( 'Link', 'business-roy' ); if ( count( $devices ) > 1 ) { ?>
    $device_details ) { if ( $i == 1 ) { $active = ' active'; } else { $active = ''; } echo '
    esc_url(get_template_directory_uri()) . '/assets/images/icons/', ); wp_localize_script('ikreatethemes-repeater-control', 'ikreatethemes_script', $translation_array); } /** * Repeater drag and drop controller * * @since 1.0.0 */ public function __construct($manager, $id, $args = array(), $fields = array()) { $this->fields = $fields; $this->box_label = $args['box_label']; $this->add_label = $args['add_label']; if( isset($args['limit'])){ $this->limit = $args['limit']; } if( isset($args['sortable'])){ $this->sortable = $args['sortable']; } $this->cats = get_categories(array('hide_empty' => false)); parent::__construct($manager, $id, $args); } public function render_content() { $values = json_decode($this->value()); $array_lenght = 0; if(is_array( $values ) ){ $array_lenght = count($values); } ?> label); ?> description) { ?> description); ?> link()); ?> class="ikreatethemes-repeater-collector" value="value()); ?>" /> limit ): ?>
    limit); ?>
    fields; $values = json_decode($this->value()); if (is_array($values)) { foreach ($values as $value) { ?>
  • box_label); ?>

    $field) { $class = isset($field['class']) ? $field['class'] : ''; ?>
    $key) ? $value->$key : ''; $default = isset($field['default']) ? $field['default'] : ''; switch ($field['type']) { case 'wrapper-start': echo '
    '; echo ''. esc_html($label). ''; break; case 'wrapper-end': echo '
    '; break; case 'url': echo ''; break; case 'text': echo ''; break; case 'number': echo ''; break; case 'textarea': echo ''; break; case 'upload': $image = $image_class = ""; if ($new_value) { $image = ''; $image_class = ' hidden'; } echo '
    '; echo '
    '; echo '
    '; esc_html_e('No image selected', 'business-roy'); echo '
    '; echo '
    '; echo $image; echo '
    '; echo '
    '; echo ''; echo ''; echo ''; echo '
    '; echo '
    '; echo '
    '; break; case 'category': echo ''; break; case 'select': $options = $field['options']; echo ''; break; case 'checkbox': echo ''; break; case 'colorpicker': echo ''; break; case 'selector': $options = $field['options']; echo '
    '; foreach ($options as $option => $val) { $class = ( $new_value == $option ) ? 'selector-selected' : ''; echo ''; } echo '
    '; echo ''; break; case 'radio': $options = $field['options']; echo '
    '; foreach ($options as $option => $val) { echo ''; } echo '
    '; echo ''; break; case 'switch': $switch = $field['switch']; $switch_class = ($new_value == 'enable' || $new_value == 'on') ? 'switch-on' : ''; echo '
    '; echo '
    '; echo '
    '; echo '
    ' . esc_html($switch["enable"]) . '
    '; echo '
    '; echo '
    '; echo '
    ' . esc_html($switch["disable"]) . '
    '; echo '
    '; echo '
    '; echo '
    '; echo ''; break; case 'range': $options = $field['options']; $new_value = $new_value ? $new_value : $options['val']; echo '
    '; echo '
    '; echo ''; echo '' . esc_html($options['unit']) . ''; echo '
    '; break; case 'icon': echo '
    '; echo '
    '; echo ''; echo ''; echo '
    '; echo '
    '; echo ''; if (apply_filters('ikreatethemes_show_font_awesome', true)) { echo '
      '; $ikreatethemes_font_awesome_icon_array = ikreatethemes_font_awesome_icon_array(); foreach ($ikreatethemes_font_awesome_icon_array as $ikreatethemes_font_awesome_icon) { $icon_class = $new_value == $ikreatethemes_font_awesome_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; } if (apply_filters('ikreatethemes_show_ico_font', true)) { echo '
      '; $ikreatethemes_icofont_icon_array = ikreatethemes_icofont_icon_array(); foreach ($ikreatethemes_icofont_icon_array as $ikreatethemes_icofont_icon) { $icon_class = $new_value == $ikreatethemes_icofont_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; } echo '
    '; echo ''; echo '
    '; break; case 'social-icon': echo '
    '; echo '
    '; echo ''; echo ''; echo '
    '; echo '
    '; echo '
      '; $font_awesome_icon_array = ikreatethemes_font_awesome_social_icon_array(); foreach ($font_awesome_icon_array as $font_awesome_icon) { $icon_class = $new_value == $font_awesome_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; echo '
    '; echo ''; echo '
    '; break; case 'multicategory': $new_value_array = !is_array($new_value) ? explode(',', $new_value) : $new_value; echo '
      '; echo '
    • '; foreach ($this->cats as $cat) { $checked = in_array($cat->term_id, $new_value_array) ? 'checked="checked"' : ''; echo '
    • '; echo ''; echo '
    • '; } echo '
    '; echo ''; break; case 'gallery':?> '; } } ?>
    '; break; default: break; } ?>
  • description) { ?> description); ?> choices; if ($choices) { echo ''; } } } class Ikreate_Themes_Upgrade_Section extends WP_Customize_Section { /** * The type of customize section being rendered. * * @since 1.0.0 * @access public * @var string */ public $type = 'iktheme-upgrade-section'; public $class = ''; /** * Custom button text to output. * * @since 1.0.0 * @access public * @var string */ public $upgrade_text = ''; /** * Custom pro button URL. * * @since 1.0.0 * @access public * @var string */ public $upgrade_url = ''; public $options = array(); /** * Add custom parameters to pass to the JS via JSON. * * @since 1.0.0 * @access public * @return void */ public function json() { $json = parent::json(); $json['upgrade_text'] = $this->upgrade_text; $json['upgrade_url'] = $this->upgrade_url; $json['options'] = $this->options; $json['class'] = $this->class; return $json; } /** * Outputs the Underscore.js template. * * @since 1.0.0 * @access public * @return void */ protected function render_template() { ?>
  • <# if ( _.isEmpty(data.options) ) { #>

    <# if ( data.title ) { #> {{{ data.title }}} <# } #> <# if ( data.upgrade_text && data.upgrade_url ) { #> {{ data.upgrade_text }} <# } #>

    <# }else{ #> <# _.each( data.options, function(key, value) { #> {{{ key }}}
    <# }) #> <# if ( data.upgrade_text && data.upgrade_url ) { #> {{ data.upgrade_text }} <# } #> <# } #>
  • pro_text; $json['pro_url'] = esc_url( $this->pro_url ); return $json; } /** * Outputs the Underscore.js template. * * @since 1.0.0 * @access public * @return void */ protected function render_template() { ?>
  • {{ data.title }} <# if ( data.pro_text && data.pro_url ) { #> {{ data.pro_text }} <# } #>