khaihihi
This commit is contained in:
110
wp-content/plugins/keydesign-addon/elements/alertbox_elem.php
Normal file
110
wp-content/plugins/keydesign-addon/elements/alertbox_elem.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_ALERT_BOX')) {
|
||||
|
||||
class KD_ELEM_ALERT_BOX extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_alertbox_init'));
|
||||
add_shortcode('tek_alertbox', array($this, 'kd_alertbox_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_alertbox_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Alert box", "keydesign"),
|
||||
"description" => esc_html__("Easily display warning, error, info and success messages.", "keydesign"),
|
||||
"base" => "tek_alertbox",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/alert-box.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box type","keydesign"),
|
||||
"param_name" => "ab_type",
|
||||
"value" => array(
|
||||
"Warning" => "ab_warning",
|
||||
"Error" => "ab_error",
|
||||
"Info" => "ab_info",
|
||||
"Success" => "ab_success",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select box type.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box message", "keydesign"),
|
||||
"param_name" => "ab_message",
|
||||
"value" => "",
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Enter box message here.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "ab_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_alertbox_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'ab_type' => '',
|
||||
'ab_message' => '',
|
||||
'ab_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$ab_icon = "";
|
||||
|
||||
switch($ab_type){
|
||||
case 'ab_warning':
|
||||
$ab_icon = "fa-bell-o";
|
||||
break;
|
||||
|
||||
case 'ab_error':
|
||||
$ab_icon = "fa-exclamation-triangle";
|
||||
break;
|
||||
|
||||
case 'ab_info':
|
||||
$ab_icon = "fa-question";
|
||||
break;
|
||||
|
||||
case 'ab_success':
|
||||
$ab_icon = "fa-check";
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
$output = '<div class="kd-alertbox '.$ab_type.' '.$ab_extra_class.'">
|
||||
<div class="ab-icon"><i class="'.$ab_icon.' iconita"></i></div>
|
||||
<div class="ab-message">'.$ab_message.'</div>
|
||||
<a href="#" class="ab-close"><i class="fa-times iconita"></i></a>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_ALERT_BOX')) {
|
||||
$KD_ELEM_ALERT_BOX = new KD_ELEM_ALERT_BOX;
|
||||
}
|
||||
|
||||
?>
|
||||
379
wp-content/plugins/keydesign-addon/elements/appgallery_elem.php
Normal file
379
wp-content/plugins/keydesign-addon/elements/appgallery_elem.php
Normal file
@@ -0,0 +1,379 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_appgallery extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_appgallery_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('tek_appgallery')) {
|
||||
class tek_appgallery extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_appgallery_init'));
|
||||
add_shortcode('tek_appgallery', array($this, 'kd_appgallery_container'));
|
||||
add_shortcode('tek_appgallery_single', array($this, 'kd_appgallery_single'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_appgallery_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("App gallery", "keydesign"),
|
||||
"description" => esc_html__("Mobile app screenshots carousel.", "keydesign"),
|
||||
"base" => "tek_appgallery",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_appgallery_single'),
|
||||
"icon" => plugins_url('assets/element_icons/app-gallery.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Section title", "keydesign"),
|
||||
"param_name" => "ag_title",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter section title here.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Section description", "keydesign"),
|
||||
"param_name" => "ag_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter section description here.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Mockup image source", "keydesign"),
|
||||
"param_name" => "ag_mockup_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Upload mockup", "keydesign"),
|
||||
"param_name" => "ag_mockup",
|
||||
"description" => esc_html__("Upload container mockup.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ag_mockup_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external link", "keydesign"),
|
||||
"param_name" => "ag_mockup_ext",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ag_mockup_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ag_mockup_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 325x660 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ag_mockup_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "ag_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "ag_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "ag_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "ag_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "ag_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "ag_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("App screenshot", "keydesign"),
|
||||
"base" => "tek_appgallery_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_appgallery'),
|
||||
"icon" => plugins_url('assets/element_icons/child-image.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "ag_screenshot_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "ag_screenshot",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Upload mobile app screenshot.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ag_screenshot_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external link", "keydesign"),
|
||||
"param_name" => "ag_screenshot_ext",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ag_screenshot_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ag_screenshot_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 280x500 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ag_screenshot_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_appgallery_container($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'ag_title' => '',
|
||||
'ag_description' => '',
|
||||
'ag_mockup_source' => '',
|
||||
'ag_mockup' => '',
|
||||
'ag_mockup_ext' => '',
|
||||
'ag_mockup_size' => '',
|
||||
'ag_autoplay' => '',
|
||||
'ag_autoplay_speed' => '',
|
||||
'ag_stoponhover' => '',
|
||||
'ag_extra_class' => ''
|
||||
), $atts));
|
||||
|
||||
$output = $wrapper_class = $mockup_image = $ag_no_desc = $kd_appgallery_id = '';
|
||||
|
||||
$mockup_image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $ag_mockup,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
if ('' == $ag_title && '' == $ag_description) {
|
||||
$ag_no_desc = 'ag-no-desc-section';
|
||||
}
|
||||
|
||||
$kd_appgallery_id = "kd-appgal-".uniqid();
|
||||
|
||||
$wrapper_class = implode(' ', array('app-gallery', 'ag-parent', $kd_appgallery_id, $ag_no_desc, $ag_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'">';
|
||||
if ($ag_title != '' || $ag_description != '') {
|
||||
$output .= '<div class="ag-section-desc">
|
||||
<h4>'.$ag_title.'</h4>
|
||||
<p>'.$ag_description.'</p>
|
||||
</div>';
|
||||
}
|
||||
if ($ag_mockup_source == 'external_link' && $ag_mockup_ext != '') {
|
||||
$dimensions = vc_extract_dimensions( $ag_mockup_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
$output .= '<div class="ag-mockup"><img src="'.$ag_mockup_ext.'" '.$hwstring.' /></div>';
|
||||
} elseif ($ag_mockup_source == 'media_library' && $ag_mockup != '') {
|
||||
$output .= '<div class="ag-mockup">'.$mockup_image['thumbnail'].'</div>';
|
||||
}
|
||||
$output .= '<div class="ag-slider-wrapper">
|
||||
<div class="ag-slider">'.do_shortcode($content).'</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".app-gallery.'.$kd_appgallery_id.' .ag-slider").length) {
|
||||
$(".app-gallery.'.$kd_appgallery_id.' .ag-slider").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
margin: 50,';
|
||||
if ($ag_no_desc) {
|
||||
$output .= 'responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
},
|
||||
768:{
|
||||
items:2,
|
||||
},
|
||||
1024:{
|
||||
items:3,
|
||||
}
|
||||
},';
|
||||
} else {
|
||||
$output .= 'items: 1,';
|
||||
}
|
||||
$output .= 'loop: true,
|
||||
dots: true,
|
||||
dotsEach: true,
|
||||
dotsSpeed: 500,
|
||||
nav: false,';
|
||||
|
||||
if($ag_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
}
|
||||
|
||||
if($ag_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$ag_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($ag_autoplay == "auto_on" && $ag_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
}
|
||||
|
||||
$output .= '
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function kd_appgallery_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'ag_screenshot_source' => '',
|
||||
'ag_screenshot' => '',
|
||||
'ag_screenshot_ext' => '',
|
||||
'ag_screenshot_size' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $ss_image = $default_src = $dimensions = $hwstring = '';
|
||||
|
||||
$ss_image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $ag_screenshot,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$output = '<div class="ag-slider-child">';
|
||||
if ($ag_screenshot_source == 'external_link') {
|
||||
$dimensions = vc_extract_dimensions( $ag_screenshot_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
$ag_screenshot_ext = $ag_screenshot_ext ? esc_attr( $ag_screenshot_ext ) : $default_src;
|
||||
|
||||
$output .= '<img src="'.$ag_screenshot_ext.'" '.$hwstring.' />';
|
||||
} else {
|
||||
if (!$ss_image) {
|
||||
$output .= '<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .= $ss_image['thumbnail'];
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('tek_appgallery')) {
|
||||
$tek_appgallery = new tek_appgallery;
|
||||
}
|
||||
|
||||
?>
|
||||
174
wp-content/plugins/keydesign-addon/elements/bookpreview_elem.php
Normal file
174
wp-content/plugins/keydesign-addon/elements/bookpreview_elem.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_BOOK_PREVIEW')) {
|
||||
|
||||
class KD_ELEM_BOOK_PREVIEW extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_bookpreview_init'));
|
||||
add_shortcode('tek_bookpreview', array($this, 'kd_bookpreview_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_bookpreview_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Book Preview", "keydesign"),
|
||||
"description" => esc_html__("Book chapter preview in a device mockup.", "keydesign"),
|
||||
"base" => "tek_bookpreview",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/book-preview.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable content scrolling", "keydesign"),
|
||||
"param_name" => "bp_scroll",
|
||||
"value" => array(
|
||||
"On" => "scroll-on",
|
||||
"Off" => "scroll-off",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("When active the content in the book mockup area will smoothly scroll down.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Mockup image source", "keydesign"),
|
||||
"param_name" => "bp_mockup_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload device mockup", "keydesign"),
|
||||
"param_name" => "bp_mockup",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload container mockup.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "bp_mockup_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Mockup image external source", "keydesign"),
|
||||
"param_name" => "bp_mockup_ext",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter mockup image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "bp_mockup_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Mockup Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 590x700 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "bp_mockup_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea_html",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Book text", "keydesign"),
|
||||
"param_name" => "content",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter a short presentation of the book. HTML tags are allowed.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "bp_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_bookpreview_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'bp_mockup_source' => '',
|
||||
'bp_mockup' => '',
|
||||
'bp_mockup_ext' => '',
|
||||
'ext_image_size' => '',
|
||||
'bp_scroll' => '',
|
||||
'bp_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$mockup_img = $output = $dimensions = $hwstring = '';
|
||||
|
||||
if ( !empty($bp_mockup) ) {
|
||||
$mockup_img = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $bp_mockup,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
}
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
$bp_mockup_ext = $bp_mockup_ext ? esc_attr( $bp_mockup_ext ) : $default_src;
|
||||
|
||||
if ( $bp_scroll != "scroll-off" ) {
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".bp-content").length) {
|
||||
setInterval(function(){
|
||||
var pos = $(".bp-content").scrollTop();
|
||||
$(".bp-content").scrollTop(pos + 1);
|
||||
}, 30)
|
||||
}
|
||||
});</script>';
|
||||
}
|
||||
|
||||
$output .= '<div class="bp-container ' . $bp_extra_class . '">';
|
||||
if ($bp_mockup_source == 'external_link' && $bp_mockup_ext != '') {
|
||||
$output .= '<img src="'.$bp_mockup_ext.'" '.$hwstring.' />';
|
||||
} elseif ($bp_mockup_source == 'media_library' && $mockup_img != '') {
|
||||
$output .= $mockup_img['thumbnail'];
|
||||
}
|
||||
$output .= '<div class="bp-content">'.do_shortcode($content).'</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_BOOK_PREVIEW')) {
|
||||
$KD_ELEM_BOOK_PREVIEW = new KD_ELEM_BOOK_PREVIEW;
|
||||
}
|
||||
|
||||
?>
|
||||
252
wp-content/plugins/keydesign-addon/elements/button_elem.php
Normal file
252
wp-content/plugins/keydesign-addon/elements/button_elem.php
Normal file
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
if (!class_exists('KD_ELEM_BUTTON')) {
|
||||
class KD_ELEM_BUTTON extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_button_init'));
|
||||
add_shortcode('tek_button', array($this, 'kd_button_shrt'));
|
||||
}
|
||||
// VC Elements render in admin
|
||||
|
||||
function kd_button_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Button", "keydesign"),
|
||||
"description" => esc_html__("Call to action button with extensive settings.", "keydesign"),
|
||||
"base" => "tek_button",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/button.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "button_text",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter button text.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button style", "keydesign"),
|
||||
"param_name" => "button_style",
|
||||
"value" => array(
|
||||
"Solid" => "tt_primary_button",
|
||||
"Outline" => "tt_secondary_button"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button style", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button color scheme", "keydesign"),
|
||||
"param_name" => "button_color_scheme",
|
||||
"value" => array(
|
||||
"Primary color" => "btn_primary_color",
|
||||
"Secondary color" => "btn_secondary_color"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button predefined color scheme.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button hover state", "keydesign"),
|
||||
"param_name" => "button_hover_state",
|
||||
"value" => array(
|
||||
"Default" => "",
|
||||
"Solid - Primary color" => "hover_solid_primary",
|
||||
"Solid - Secondary color" => "hover_solid_secondary",
|
||||
"Outline - Primary color" => "hover_outline_primary",
|
||||
"Outline - Secondary color" => "hover_outline_secondary",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button hover state style.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button icon settings", "keydesign"),
|
||||
"param_name" => "button_icon_bool",
|
||||
"value" => array(
|
||||
"No icon" => "no",
|
||||
"Display icon" => "yes",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose to display icon or not.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon database", "keydesign"),
|
||||
"param_name" => "icons",
|
||||
"dependency" => array(
|
||||
"element" => "button_icon_bool",
|
||||
"value" => array("yes")
|
||||
),
|
||||
"description" => esc_html__("Select your icon.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon position", "keydesign"),
|
||||
"param_name" => "button_icon_position",
|
||||
"value" => array(
|
||||
"Left" => "icon_left",
|
||||
"Right" => "icon_right",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "button_icon_bool",
|
||||
"value" => array("yes")
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon position.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "button_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set link address and target.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button width", "keydesign"),
|
||||
"param_name" => "button_width",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Button width in pixels", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button position", "keydesign"),
|
||||
"param_name" => "button_position",
|
||||
"value" => array(
|
||||
"Center" => "button-center",
|
||||
"Left" => "pull-left",
|
||||
"Right" => "pull-right",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose button position inside the content area.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "button_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Render the element on front-end
|
||||
public function kd_button_shrt($atts, $content = null) {
|
||||
|
||||
$output = $icons = $link_target = $link_title = $button_link = $animation_delay = $wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'button_icon_bool' => 'yes',
|
||||
'icons' => '',
|
||||
'button_icon_position' => '',
|
||||
'button_target' => '_self',
|
||||
'button_text' => '',
|
||||
'button_link' => '',
|
||||
'button_style' => '',
|
||||
'button_color_scheme' => '',
|
||||
'button_hover_state' => '',
|
||||
'button_position' => '',
|
||||
'button_width' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'button_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$href = vc_build_link($button_link);
|
||||
if ($href['target'] == "") { $href['target'] = "_self"; }
|
||||
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target']) && ($href['target'] != '')) ? ' target="'.$href['target'].'"' : 'target="_self"';
|
||||
$link_title = (isset($href['title'])) ? ' title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('tt_button', $button_style, $button_color_scheme, $button_hover_state, $button_position, $button_icon_position, $css_animation, $button_extra_class));
|
||||
|
||||
$output .= '<a '.(!empty($button_width) ? 'style="width: '.$button_width.';"' : '').' href="'.$href['url'].'" '.$link_target.' '.$link_title.' class="'.trim($wrapper_class).'" '.$animation_delay.'>';
|
||||
if ($button_icon_bool == 'yes' && $button_icon_position == 'icon_left') {
|
||||
$output .= '<span class="'.$icons.' iconita"></span>';
|
||||
}
|
||||
$output .= '<span class="prim_text">'.$button_text.'</span>';
|
||||
if ($button_icon_bool == 'yes' && $button_icon_position == 'icon_right') {
|
||||
$output .= '<span class="'.$icons.' iconita"></span>';
|
||||
}
|
||||
$output .= '</a>';
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_BUTTON')) {
|
||||
$KD_ELEM_BUTTON = new KD_ELEM_BUTTON;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,310 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_CALL_TO_ACTION')) {
|
||||
|
||||
class KD_ELEM_CALL_TO_ACTION extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_calltoaction_init'));
|
||||
add_shortcode('tek_calltoaction', array($this, 'kd_calltoaction_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_calltoaction_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Call to action", "keydesign"),
|
||||
"description" => esc_html__("Call to action section with button.", "keydesign"),
|
||||
"base" => "tek_calltoaction",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/calltoaction-box.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon","keydesign"),
|
||||
"param_name" => "cta_icon_type",
|
||||
"value" => array(
|
||||
"No" => "no_icon",
|
||||
"Icon Browser" => "icon_browser",
|
||||
"Custom Icon" => "custom_image",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon source.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "cta_icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "cta_icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "cta_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "cta_icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "cta_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload custom image", "keydesign"),
|
||||
"param_name" => "cta_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload your own custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "cta_icon_type",
|
||||
"value" => array("custom_image"),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Call to action title", "keydesign"),
|
||||
"param_name" => "cta_title",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter call to action title here.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Call to action subtitle", "keydesign"),
|
||||
"param_name" => "cta_subtitle",
|
||||
"value" => "",
|
||||
"description" => esc_html__("This text will be displayed under the title.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text color", "keydesign"),
|
||||
"param_name" => "cta_text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose text color.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box color", "keydesign"),
|
||||
"param_name" => "cta_box_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose box color.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button link", "keydesign"),
|
||||
"param_name" => "cta_button_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "cta_button_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the text displayed on the button.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button style", "keydesign"),
|
||||
"param_name" => "cta_button_style",
|
||||
"value" => array(
|
||||
"Solid color" => "tt_primary_button",
|
||||
"Outline" => "tt_secondary_button"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button style", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button color scheme", "keydesign"),
|
||||
"param_name" => "cta_button_color_scheme",
|
||||
"value" => array(
|
||||
"Primary color" => "btn_primary_color",
|
||||
"Secondary color" => "btn_secondary_color"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button predefined color scheme.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation_text",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation_button",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "cta_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_calltoaction_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'cta_icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'cta_icon_color' => '',
|
||||
'cta_icon_size' => '',
|
||||
'cta_image' => '',
|
||||
'cta_title' => '',
|
||||
'cta_subtitle' => '',
|
||||
'cta_text_color' => '',
|
||||
'cta_box_color' => '',
|
||||
'cta_button_link' => '',
|
||||
'cta_button_text' => '',
|
||||
'cta_button_style' => '',
|
||||
'cta_button_color_scheme' => '',
|
||||
'css_animation_text' => '',
|
||||
'css_animation_button' => '',
|
||||
'cta_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$content_icon = $icon_color_style = $icon_size_style = $cta_img_array = $href = $link_target = $link_title = $animation_delay_text = $animation_delay_button = '';
|
||||
|
||||
if( $cta_icon_type == 'icon_browser' ) {
|
||||
// Enqueue needed icon font.
|
||||
// vc_icon_element_fonts_enqueue( $icon_library );
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$cta_icon = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($cta_icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$cta_icon_color.';';
|
||||
}
|
||||
|
||||
if ($cta_icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$cta_icon_size.';';
|
||||
}
|
||||
|
||||
if( $cta_icon_type == 'icon_browser' && !empty($cta_icon) ) {
|
||||
$content_icon = '<i class="'.$cta_icon.' fa" style="'.$icon_size_style.' '.$icon_color_style.'"></i> ';
|
||||
}
|
||||
elseif($cta_icon_type == 'custom_image' && !empty($cta_image)){
|
||||
$cta_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $cta_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_icon = $cta_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
$href = vc_build_link($cta_button_link);
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target']) && ($href['target'] != '')) ? 'target="'.$href['target'].'"' : '';
|
||||
$link_title = (isset($href['title'])) ? 'title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
//Animation delay
|
||||
if ('' != $css_animation_text) {
|
||||
$animation_delay_text = 'data-animation-delay="200"';
|
||||
}
|
||||
if ('' != $css_animation_button) {
|
||||
$animation_delay_button = 'data-animation-delay="200"';
|
||||
}
|
||||
|
||||
$output = '<div class="kd-calltoaction '.$cta_icon_type.' '.$cta_extra_class.'" '.(!empty($cta_box_color) ? 'style="background-color: '.$cta_box_color.';"' : '').'>
|
||||
<div class="container">
|
||||
<div class="cta-text-container ' . $css_animation_text . '" ' . $animation_delay_text . '>';
|
||||
if ($cta_icon_type != "no_icon") {
|
||||
$output .= '<div class="cta-icon">'.$content_icon.'</div>';
|
||||
}
|
||||
$output .= '<div class="cta-text">
|
||||
<h3 '.(!empty($cta_text_color) ? 'style="color: '.$cta_text_color.';"' : '').'>'.$cta_title.'</h3>
|
||||
<p '.(!empty($cta_text_color) ? 'style="color: '.$cta_text_color.';"' : '').'>'.$cta_subtitle.'</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cta-btncontainer">
|
||||
<a href="'.$href['url'].'" '.$link_target.' '.$link_title.' class="tt_button '.$cta_button_style.' '.$cta_button_color_scheme.' ' . $css_animation_button . '" ' . $animation_delay_button . '>'.$cta_button_text.'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_CALL_TO_ACTION')) {
|
||||
$KD_ELEM_CALL_TO_ACTION = new KD_ELEM_CALL_TO_ACTION;
|
||||
}
|
||||
|
||||
?>
|
||||
442
wp-content/plugins/keydesign-addon/elements/clients_elem.php
Normal file
442
wp-content/plugins/keydesign-addon/elements/clients_elem.php
Normal file
@@ -0,0 +1,442 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_clients extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_clients_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_clients')) {
|
||||
class tek_clients extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_clients_init'));
|
||||
add_shortcode('tek_clients', array($this, 'kd_clients_container'));
|
||||
add_shortcode('tek_clients_single', array($this, 'kd_clients_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_clients_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Logo carousel", "keydesign"),
|
||||
"description" => esc_html__("Carousel with images.", "keydesign"),
|
||||
"base" => "tek_clients",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_clients_single'),
|
||||
"icon" => plugins_url('assets/element_icons/logo-carousel.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation","keydesign"),
|
||||
"param_name" => "client_nav",
|
||||
"value" => array(
|
||||
"Disable" => "nav-disable",
|
||||
"Enable" => "nav-enable",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Enable to display navigation arrows.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation arrows color", "keydesign"),
|
||||
"param_name" => "client_nav_color",
|
||||
"value" => array(
|
||||
"Black" => "black-navigation",
|
||||
"White" => "white-navigation",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "client_nav",
|
||||
"value" => array("nav-enable")
|
||||
),
|
||||
"description" => esc_html__("Select the navigation arrows color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Elements per row", "keydesign"),
|
||||
"param_name" => "client_elements",
|
||||
"value" => array(
|
||||
"1 items" => "1",
|
||||
"2 items" => "2",
|
||||
"3 items" => "3",
|
||||
"4 items" => "4",
|
||||
"5 items" => "5",
|
||||
"6 items" => "6",
|
||||
"7 items" => "7",
|
||||
"8 items" => "8",
|
||||
"9 items" => "9",
|
||||
"10 items" => "10",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Amount of items displayed at a time with the widest browser width.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable loop","keydesign"),
|
||||
"param_name" => "client_loop",
|
||||
"value" => array(
|
||||
"Off" => "loop_off",
|
||||
"On" => "loop_on",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Infinity loop. Duplicate last and first items to get loop illusion.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "client_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "client_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "client_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "client_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "client_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image hover animation", "keydesign"),
|
||||
"param_name" => "client_image_animation",
|
||||
"value" => array(
|
||||
esc_html__( 'None', 'keydesign' ) => 'no-effect',
|
||||
esc_html__( 'Opacity', 'keydesign' ) => 'opacity-effect',
|
||||
esc_html__( 'Gray scale', 'keydesign' ) => 'grayscale-effect',
|
||||
esc_html__( 'Float', 'keydesign' ) => 'lift-effect',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose image animation on mouse over.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "client_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
)
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => __("Child image", "keydesign"),
|
||||
"base" => "tek_clients_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_clients'),
|
||||
"icon" => plugins_url('assets/element_icons/child-image.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "client_image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "client_image",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select logo image from media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "client_image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "client_image_ext",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "client_image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 140x40 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "client_image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable link?", "keydesign"),
|
||||
"param_name" => "client_enable_link",
|
||||
"value" => array(
|
||||
"No" => "link_off",
|
||||
"Yes" => "link_on",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image link", "keydesign"),
|
||||
"param_name" => "client_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter URL if you want this image to have a link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "client_enable_link",
|
||||
"value" => array("link_on"),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"heading" => __( "Link target", "keydesign" ),
|
||||
"param_name" => "client_link_target",
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "client_enable_link",
|
||||
"value" => array("link_on"),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "client_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_clients_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'client_nav' => '',
|
||||
'client_nav_color' => '',
|
||||
'client_elements' => '',
|
||||
'client_loop' => '',
|
||||
'client_autoplay' => '',
|
||||
'client_autoplay_speed' => '',
|
||||
'client_stoponhover' => '',
|
||||
'client_image_animation' => '',
|
||||
'client_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = '';
|
||||
|
||||
$kd_clientunique_id = "kd-client-".uniqid();
|
||||
|
||||
$output = '<div class="slider clients '.$client_image_animation.' '.$kd_clientunique_id.' '.$client_nav_color.' '.$client_extra_class.'">'.do_shortcode($content).'</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".slider.clients.'.$kd_clientunique_id.'").length) {
|
||||
$(".slider.clients.'.$kd_clientunique_id.'").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",';
|
||||
if ($client_nav == 'nav-enable') {
|
||||
$output .= 'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
} else {
|
||||
$output .= 'dots: false,';
|
||||
}
|
||||
$output .= 'responsiveClass:true,
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
},
|
||||
400:{
|
||||
items:3,
|
||||
},
|
||||
960:{
|
||||
items:'.$client_elements.',
|
||||
}
|
||||
},';
|
||||
|
||||
if($client_loop == "loop_on") {
|
||||
$output .= 'loop: true,';
|
||||
}
|
||||
|
||||
if($client_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
}
|
||||
|
||||
if($client_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$client_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($client_autoplay == "auto_on" && $client_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
}
|
||||
|
||||
$output .='
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_clients_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'client_image_source' => '',
|
||||
'client_image' => '',
|
||||
'client_image_ext' => '',
|
||||
'ext_image_size' => '',
|
||||
'client_enable_link' => '',
|
||||
'client_link' => '',
|
||||
'client_link_target' => '',
|
||||
'css_animation' => '',
|
||||
'client_animation_delay' => '',
|
||||
), $atts));
|
||||
|
||||
$default_src = $dimensions = $hwstring = $animation_delay = '';
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $client_image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
$client_image_ext = $client_image_ext ? esc_attr( $client_image_ext ) : $default_src;
|
||||
|
||||
// Animation delay
|
||||
if ($client_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$client_animation_delay;
|
||||
}
|
||||
|
||||
$output = '<div class="clients-content '.$css_animation.'" '.$animation_delay.'>';
|
||||
if(isset($client_link) && $client_link !== '') {
|
||||
if ($client_image_source == 'external_link') {
|
||||
$output .='<a href="'.$client_link.'" target="'.$client_link_target.'"><img src="'.$client_image_ext.'" '.$hwstring.' /></a>';
|
||||
} else {
|
||||
$output .='<a href="'.$client_link.'" target="'.$client_link_target.'">'.$image["thumbnail"].'</a>';
|
||||
}
|
||||
} else {
|
||||
if ($client_image_source == 'external_link') {
|
||||
$output .= '<img src="'.$client_image_ext.'" '.$hwstring.' />';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_clients')) {
|
||||
$tek_clients = new tek_clients;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_color_swtich extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_color_swtich_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_color_swtich')) {
|
||||
class tek_color_swtich extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_color_swtich_init'));
|
||||
add_shortcode('tek_color_swtich', array($this, 'kd_color_swtich_container'));
|
||||
add_shortcode('tek_color_swtich_single', array($this, 'kd_color_swtich_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_color_swtich_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Color switcher", "keydesign"),
|
||||
"description" => esc_html__("Carousel color picker", "keydesign"),
|
||||
"base" => "tek_color_swtich",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_color_swtich_single'),
|
||||
"icon" => plugins_url('assets/element_icons/color-switcher.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "cs_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "cs_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "cs_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "cs_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "cs_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "cs_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "cs_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => __("Child Image", "keydesign"),
|
||||
"base" => "tek_color_swtich_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_color_swtich'),
|
||||
"icon" => plugins_url('assets/element_icons/child-image.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "color_switch_image",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select or upload image from media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 600x350 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Element Color", "keydesign"),
|
||||
"param_name" => "color_switch_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link type", "keydesign"),
|
||||
"param_name" => "color_switch_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( "No link", "keydesign" ) => "no-link",
|
||||
esc_html__( "Add a custom link", "keydesign" ) => "enable-link",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add/remove custom link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "color_switch_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "color_switch_custom_link",
|
||||
"value" => "enable-link",
|
||||
),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_color_swtich_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'cs_autoplay' => '',
|
||||
'cs_autoplay_speed' => '',
|
||||
'cs_stoponhover' => '',
|
||||
'css_animation' => '',
|
||||
'cs_animation_delay' => '',
|
||||
'cs_extra_class' => ''
|
||||
), $atts));
|
||||
|
||||
$output = $animation_delay = $wrapper_class = '';
|
||||
|
||||
$kd_colorsw_id = "kd-colorsw-".uniqid();
|
||||
|
||||
// Animation delay
|
||||
if ($cs_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$cs_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('slider', 'color-swtich', $kd_colorsw_id, $css_animation, $cs_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>'.do_shortcode($content).'</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".color-swtich.'.$kd_colorsw_id.'").length > 0) {
|
||||
$(".color-swtich.'.$kd_colorsw_id.'").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
dotsEach: true,
|
||||
dotsSpeed: 500,
|
||||
items: 1,
|
||||
rewind: true,';
|
||||
if($cs_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
}
|
||||
|
||||
if($cs_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$cs_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($cs_autoplay == "auto_on" && $cs_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
}
|
||||
|
||||
$output .= 'addClassActive: true,
|
||||
animateIn: "fadeIn",
|
||||
});
|
||||
var elem_count = 0;
|
||||
jQuery(".color-swtich.'.$kd_colorsw_id.' .color-swtich-content").each(function (index, value) {
|
||||
var elem_color = ( jQuery(this).attr("data-color") );
|
||||
jQuery(".color-swtich.'.$kd_colorsw_id.' .owl-dots .owl-dot span").eq(elem_count++).css( "background", elem_color );
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_color_swtich_single($atts, $content = null) {
|
||||
// Declare empty vars
|
||||
$output = $link_title = $link_target = $default_src = $dimensions = $hwstring = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'image_source' => '',
|
||||
'color_switch_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'color_switch_color' => '',
|
||||
'color_switch_custom_link' => '',
|
||||
'color_switch_link' => '',
|
||||
|
||||
), $atts));
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $color_switch_image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
$ext_image = $ext_image ? esc_attr( $ext_image ) : $default_src;
|
||||
|
||||
$href = vc_build_link($color_switch_link);
|
||||
if ($href['target'] == "") { $href['target'] = "_self"; }
|
||||
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target'])) ? ' target="'.$href['target'].'"' : 'target="_self"';
|
||||
$link_title = (isset($href['title'])) ? ' title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
$output .= '<div class="color-swtich-content" data-color="'.$color_switch_color.'">';
|
||||
if ( $color_switch_custom_link == "enable-link" ) {
|
||||
$output .= '<a href="'.$href['url'].'"'.$link_target.''.$link_title.'>';
|
||||
}
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$output .='<img src="'.$default_src.'" />';
|
||||
} else {
|
||||
$output .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
if (!$image) {
|
||||
$output .='<img src="'.$default_src.'" />';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
if ( $color_switch_custom_link == "enable-link" ) {
|
||||
$output .= '</a>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_color_swtich')) {
|
||||
$tek_color_swtich = new tek_color_swtich;
|
||||
}
|
||||
?>
|
||||
372
wp-content/plugins/keydesign-addon/elements/contentbox_elem.php
Normal file
372
wp-content/plugins/keydesign-addon/elements/contentbox_elem.php
Normal file
@@ -0,0 +1,372 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_CONTENT_BOX')) {
|
||||
|
||||
class KD_ELEM_CONTENT_BOX extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_contentbox_init'));
|
||||
add_shortcode('tek_contentbox', array($this, 'kd_contentbox_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_contentbox_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Content box", "keydesign"),
|
||||
"description" => esc_html__("Content box with icon or custom image.", "keydesign"),
|
||||
"base" => "tek_contentbox",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/content-box.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Box title", "keydesign"),
|
||||
"param_name" => "cb_title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter a box title text.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box subtitle", "keydesign"),
|
||||
"param_name" => "cb_subtitle",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter a box subtitle text.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box content text", "keydesign"),
|
||||
"param_name" => "cb_content_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box content text here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon","keydesign"),
|
||||
"param_name" => "icon_type",
|
||||
"value" => array(
|
||||
"Icon Browser" => "icon_browser",
|
||||
"Custom Image" => "custom_icon",
|
||||
"No icon" => "no_icon",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon/image source. If no icon is selected the box hover effect will be disabled.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Custom image source", "keydesign"),
|
||||
"param_name" => "cb_image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("custom_icon"),
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload image icon", "keydesign"),
|
||||
"param_name" => "icon_img",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "cb_image_source",
|
||||
"value" => array("media_library"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "cb_ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "cb_image_source",
|
||||
"value" => array("external_link"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box link type", "keydesign"),
|
||||
"param_name" => "cb_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( 'No link', 'keydesign' ) => '#',
|
||||
esc_html__( 'Full box link', 'keydesign' ) => 'box-link',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add or remove the custom link.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link URL", "keydesign"),
|
||||
"param_name" => "cb_box_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter URL (Note: parameters like \"mailto:\" are also accepted).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "cb_custom_link",
|
||||
"value" => array( "box-link" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'type' => 'dropdown',
|
||||
'heading' => __( 'Link target', 'keydesign' ),
|
||||
'param_name' => 'cb_link_target',
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "cb_custom_link",
|
||||
"value" => array( "box-link" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array ("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn"),
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "cb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_contentbox_shrt($atts, $content = null) {
|
||||
// Declare empty vars
|
||||
$output = $content_icon = $icon_color_style = $icon_size_style = $src = $link = $image = $animation_delay = $icons = $a_attrs = $subtitle_class = $no_icon_class_fix = $wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'icon_color' => '',
|
||||
'icon_size' => '',
|
||||
'cb_image_source' => '',
|
||||
'icon_img' => '',
|
||||
'cb_ext_image' => '',
|
||||
'cb_title' => '',
|
||||
'cb_subtitle' => '',
|
||||
'cb_content_text' => '',
|
||||
'cb_custom_link' => '',
|
||||
'cb_box_link' => '',
|
||||
'cb_link_target' => '',
|
||||
'cb_button_text' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'cb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
if( $icon_type == 'icon_browser' ) {
|
||||
// Enqueue needed icon font.
|
||||
// vc_icon_element_fonts_enqueue( $icon_library );
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$icons = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$icon_color.';';
|
||||
}
|
||||
|
||||
if ($icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$icon_size.';';
|
||||
}
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $icon_img,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
if ($cb_image_source == 'external_link' && !empty($cb_ext_image)) {
|
||||
$src = $cb_ext_image;
|
||||
list($width, $height) = getimagesize($src);
|
||||
} elseif ($cb_image_source == 'media_library' && !empty($icon_img)) {
|
||||
$link = wp_get_attachment_image_src( $icon_img, 'large' );
|
||||
$link = $link[0];
|
||||
$src = $link;
|
||||
}
|
||||
|
||||
if( $icon_type == 'icon_browser' && !empty($icons) ) {
|
||||
$content_icon = '<i class="'.$icons .' fa" style="'.$icon_size_style.' '.$icon_color_style.'"></i> ';
|
||||
}
|
||||
elseif($icon_type == 'custom_icon'){
|
||||
if ($cb_image_source == 'external_link' && $cb_ext_image != '') {
|
||||
$content_icon = '<div class="cb-customimg"><img src="'.$cb_ext_image.'" width="'.$width.'" height="'.$height.'" /></div>';
|
||||
} elseif ($cb_image_source == 'media_library' && !empty($icon_img)) {
|
||||
$content_icon = '<div class="cb-customimg">'.$image['thumbnail'].'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
if ($cb_subtitle) {
|
||||
$subtitle_class = 'with-subtitle';
|
||||
}
|
||||
|
||||
if ($cb_custom_link == "box-link") {
|
||||
$output .= '<a href="'.$cb_box_link.'" target="'.$cb_link_target.'">';
|
||||
}
|
||||
|
||||
if ($icon_type == "no_icon") {
|
||||
$no_icon_class_fix = 'cb-no-icon';
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('cb-container', $no_icon_class_fix, $css_animation, $cb_extra_class));
|
||||
|
||||
$output .= '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>';
|
||||
if ($icon_type != "no_icon") {
|
||||
$output .= '<div class="cb-img-area">'.$content_icon.'</div>';
|
||||
}
|
||||
$output .= '<div class="cb-text-area">
|
||||
<h4 class="cb-heading '.$subtitle_class.'">'.$cb_title.'</h4>';
|
||||
if ($cb_subtitle) {
|
||||
$output .= '<h5 class="cb-subtitle">'.$cb_subtitle.'</h5>';
|
||||
}
|
||||
$output .= '<p>'.$cb_content_text.'</p>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
if ($cb_custom_link == "box-link") {
|
||||
$output .= '</a>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_CONTENT_BOX')) {
|
||||
$KD_ELEM_CONTENT_BOX = new KD_ELEM_CONTENT_BOX;
|
||||
}
|
||||
|
||||
?>
|
||||
220
wp-content/plugins/keydesign-addon/elements/countdown_elem.php
Normal file
220
wp-content/plugins/keydesign-addon/elements/countdown_elem.php
Normal file
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_COUNTDOWN')) {
|
||||
class KD_ELEM_COUNTDOWN extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_countdown_init'));
|
||||
add_shortcode('tek_countdown', array($this, 'kd_countdown_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_countdown_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Countdown", "keydesign"),
|
||||
"description" => esc_html__("Countdown", "keydesign"),
|
||||
"base" => "tek_countdown",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/countdown.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Starting Year", "keydesign"),
|
||||
"param_name" => "starting_year",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter event starting year", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Starting Month", "keydesign"),
|
||||
"param_name" => "starting_month",
|
||||
"value" => array(
|
||||
"January" => "1",
|
||||
"February" => "2",
|
||||
"March" => "3",
|
||||
"April" => "4",
|
||||
"May" => "5",
|
||||
"June" => "6",
|
||||
"July" => "7",
|
||||
"August" => "8",
|
||||
"September" => "9",
|
||||
"October" => "10",
|
||||
"November" => "11",
|
||||
"December" => "12",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Enter event starting month.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Starting Day", "keydesign"),
|
||||
"param_name" => "starting_day",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter event starting day.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("DAYS Counter Text", "keydesign"),
|
||||
"param_name" => "cd_text_days",
|
||||
"value" => "DAYS",
|
||||
"description" => esc_html__("Use this field to translate DAYS text.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("HOURS Counter Text", "keydesign"),
|
||||
"param_name" => "cd_text_hours",
|
||||
"value" => "HOURS",
|
||||
"description" => esc_html__("Use this field to translate HOURS text.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("MINUTES Counter Text", "keydesign"),
|
||||
"param_name" => "cd_text_minutes",
|
||||
"value" => "MINUTES",
|
||||
"description" => esc_html__("Use this field to translate MINUTES text.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("SECONDS Counter Text", "keydesign"),
|
||||
"param_name" => "cd_text_seconds",
|
||||
"value" => "SECONDS",
|
||||
"description" => esc_html__("Use this field to translate SECONDS text.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text alignment", "keydesign"),
|
||||
"param_name" => "cd_text_alignment",
|
||||
"value" => array(
|
||||
"Center" => "",
|
||||
"Left" => "cd-align-left",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select text alignment.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text color", "keydesign"),
|
||||
"param_name" => "cd_text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select countdown text color color. If none selected, the default color ( white ) will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "cd_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "cd_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_countdown_shrt($atts, $content = null) {
|
||||
|
||||
// Declare empty vars
|
||||
$output = $animation_delay = $wrapper_class = '';
|
||||
|
||||
// Include required JS files
|
||||
wp_enqueue_script('kd_countdown_script');
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'starting_year' => '',
|
||||
'starting_month' => '',
|
||||
'starting_day' => '',
|
||||
'cd_text_days' => '',
|
||||
'cd_text_hours' => '',
|
||||
'cd_text_minutes' => '',
|
||||
'cd_text_seconds' => '',
|
||||
'cd_text_alignment' => '',
|
||||
'cd_text_color' => '',
|
||||
'css_animation' => '',
|
||||
'cd_animation_delay' => '',
|
||||
'cd_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
// Animation delay
|
||||
if ($cd_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$cd_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('countdown', 'kd-countdown', $cd_text_alignment, $css_animation, $cd_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" ' .(!empty($cd_text_color) ? 'style="color: '.$cd_text_color.';" ' : ' '). ' data-count-year="'.$starting_year.'" data-count-month="'.$starting_month.'" data-count-day="'.$starting_day.'" data-text-days="'.$cd_text_days.'" data-text-hours="'.$cd_text_hours.'" data-text-minutes="'.$cd_text_minutes.'" data-text-seconds="'.$cd_text_seconds.'" '.$animation_delay.'></div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_COUNTDOWN')) {
|
||||
$KD_ELEM_COUNTDOWN = new KD_ELEM_COUNTDOWN;
|
||||
}
|
||||
?>
|
||||
373
wp-content/plugins/keydesign-addon/elements/counter_elem.php
Normal file
373
wp-content/plugins/keydesign-addon/elements/counter_elem.php
Normal file
@@ -0,0 +1,373 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_COUNTER')) {
|
||||
|
||||
class KD_ELEM_COUNTER extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_counter_init'));
|
||||
add_shortcode('tek_counter', array($this, 'kd_counter_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_counter_init() {
|
||||
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Counter", "keydesign"),
|
||||
"description" => esc_html__("Animated counter.", "keydesign"),
|
||||
"base" => "tek_counter",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/counter.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon","keydesign"),
|
||||
"param_name" => "count_icon_type",
|
||||
"value" => array(
|
||||
"No" => "no_icon",
|
||||
"Icon Browser" => "icon_browser",
|
||||
"Custom Icon" => "custom_icon",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon source.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "count_icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "count_icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "count_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "count_icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "count_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload image icon", "keydesign"),
|
||||
"param_name" => "count_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload your own custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "count_icon_type",
|
||||
"value" => array("custom_icon"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon position","keydesign"),
|
||||
"param_name" => "count_icon_position",
|
||||
"value" => array(
|
||||
"Top" => "icon_top",
|
||||
"Left" => "icon_left",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "count_icon_type",
|
||||
"value" => array("icon_browser", "custom_icon"),
|
||||
),
|
||||
"description" => esc_html__("Select icon position relative to the content.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter Size", "keydesign"),
|
||||
"param_name" => "count_size",
|
||||
"value" => array(
|
||||
"Normal" => "normal-counter",
|
||||
"Large" => "large-counter",
|
||||
),
|
||||
"description" => esc_html__("Select counter size","keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter number", "keydesign"),
|
||||
"param_name" => "count_number",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Only numerical values allowed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter number color", "keydesign"),
|
||||
"param_name" => "count_number_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose counter number color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter units", "keydesign"),
|
||||
"param_name" => "count_units",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Ex: coffee drinks, projects, clients.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter units color", "keydesign"),
|
||||
"param_name" => "count_units_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose counter units color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter description", "keydesign"),
|
||||
"param_name" => "count_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("This additional text will be displayed below the counter.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Counter description color", "keydesign"),
|
||||
"param_name" => "count_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose counter description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text alignment", "keydesign"),
|
||||
"param_name" => "count_alignment",
|
||||
"value" => array(
|
||||
"Center" => "count_center",
|
||||
"Left" => "count_left",
|
||||
),
|
||||
"description" => esc_html__("Select element alignment in container.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "count_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_counter_shrt($atts, $content = null)
|
||||
{
|
||||
|
||||
// Include required JS files
|
||||
wp_enqueue_script('kd_countto');
|
||||
|
||||
// Declare empty vars
|
||||
$output = $content_icon = $counter_id = $kd_counter_img_array = $js = $icon_color_style = $icon_size_style = $icon_position_class = $animation_delay = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'count_icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'count_icon_color' => '',
|
||||
'count_icon_size' => '',
|
||||
'count_image' => '',
|
||||
'count_icon_position' => '',
|
||||
'count_size' => '',
|
||||
'count_number' => '',
|
||||
'count_number_color' => '',
|
||||
'count_units' => '',
|
||||
'count_units_color' => '',
|
||||
'count_description' => '',
|
||||
'count_description_color' => '',
|
||||
'count_alignment' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'count_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
if( $count_icon_type == 'icon_browser' ) {
|
||||
// Enqueue needed icon font.
|
||||
// vc_icon_element_fonts_enqueue( $icon_library );
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$count_icon = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($count_icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$count_icon_color.';';
|
||||
}
|
||||
|
||||
if ($count_icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$count_icon_size.';';
|
||||
}
|
||||
|
||||
// Icon position class
|
||||
if ( $count_icon_position == 'icon_top' ) {
|
||||
$icon_position_class = 'icon-top';
|
||||
} elseif ( $count_icon_position == 'icon_left' ) {
|
||||
$icon_position_class = 'icon-left';
|
||||
}
|
||||
|
||||
if( $count_icon_type == 'icon_browser' && !empty($count_icon) ) {
|
||||
$content_icon = '<div class="kd-counter-icon"><i class="'.$count_icon.' fa" style=" '.$icon_color_style.' '.$icon_size_style.'"></i></div>';
|
||||
} elseif($count_icon_type == 'custom_icon' && !empty($count_image)){
|
||||
$kd_counter_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $count_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_icon = '<div class="kd-counter-customimg">'.$kd_counter_img_array['thumbnail'].'</div>';
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
switch($count_size){
|
||||
|
||||
case 'large-counter':
|
||||
$output .= '<div class="kd_counter '.$icon_position_class.' '. $count_size . (!empty($count_extra_class) ? $count_extra_class : '').' '.$count_alignment.' '.$css_animation.'" '.$animation_delay.'>';
|
||||
if(!empty($content_icon)) {
|
||||
$output .= '<div class="kd_counter_icon">';
|
||||
$output .= $content_icon;
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '<div class="kd_counter_content">';
|
||||
$output .= '<h4 class="kd_counter_number">';
|
||||
$output .= '<span class="kd_number_string" '.(!empty($count_number_color) ? 'style="color: '.$count_number_color.';"' : '').' data-from="0" data-to="'.$count_number.'" data-refresh-interval="50">0</span>
|
||||
<span class="kd_counter_units" '.(!empty($count_units_color) ? 'style="color: '.$count_units_color.';"' : '').'>'.$count_units.'</span>';
|
||||
$output .= '</h4>';
|
||||
$output .= '<div class="kd_counter_text" '.(!empty($count_description_color) ? 'style="color: '.$count_description_color.';"' : '').'>'.$count_description.'</div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
break;
|
||||
|
||||
case 'normal-counter':
|
||||
$output .= '<div class="kd_counter '.$icon_position_class.' '.(!empty($count_extra_class) ? $count_extra_class : '').' '.$count_alignment.' '.$css_animation.'" '.$animation_delay.'>';
|
||||
$output .= '<div class="kd_counter_content">';
|
||||
if(!empty($content_icon)) {
|
||||
$output .= '<div class="kd_counter_icon">';
|
||||
$output .= $content_icon;
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '<h4 class="kd_counter_number">';
|
||||
$output .= '<span class="kd_number_string" '.(!empty($count_number_color) ? 'style="color: '.$count_number_color.';"' : '').' data-from="0" data-to="'.$count_number.'" data-refresh-interval="50">0</span>
|
||||
<span class="kd_counter_units" '.(!empty($count_units_color) ? 'style="color: '.$count_units_color.';"' : '').'>'.$count_units.'</span>';
|
||||
$output .= '</h4>';
|
||||
if (!empty($count_description)) {
|
||||
$output .= '<div class="kd_counter_text" '.(!empty($count_description_color) ? 'style="color: '.$count_description_color.';"' : '').'>'.$count_description.'</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_COUNTER')) {
|
||||
$KD_ELEM_COUNTER = new KD_ELEM_COUNTER;
|
||||
}
|
||||
|
||||
?>
|
||||
121
wp-content/plugins/keydesign-addon/elements/divider_elem.php
Normal file
121
wp-content/plugins/keydesign-addon/elements/divider_elem.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_DIVIDER')) {
|
||||
|
||||
class KD_ELEM_DIVIDER extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_divider_init'));
|
||||
add_shortcode('tek_divider', array($this, 'kd_divider_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_divider_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Section divider", "keydesign"),
|
||||
"description" => esc_html__("Different divider styles to separate your content.", "keydesign"),
|
||||
"base" => "tek_divider",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/divider.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Divider shape","keydesign"),
|
||||
"param_name" => "div_shape",
|
||||
"value" => array(
|
||||
"Dotted line" => "dotted_line",
|
||||
"Dashed line" => "dashed_line",
|
||||
"Solid line" => "solid_line",
|
||||
"Double line" => "double_line",
|
||||
"Double dotted line" => "double_dotted",
|
||||
"Double dashed line" => "double_dashed",
|
||||
"Shadow line" => "shadow_line"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select divider type.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Line width","keydesign"),
|
||||
"param_name" => "div_width",
|
||||
"value" => array(
|
||||
"Full width" => "divider_full_width",
|
||||
"One half" => "divider_one_half",
|
||||
"One fourth" => "divider_one_fourth"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select divider width.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Line thickness","keydesign"),
|
||||
"param_name" => "div_thickness",
|
||||
"value" => array(
|
||||
"Thin line" => "thin_solid",
|
||||
"Medium line" => "medium_solid",
|
||||
"Thick line" => "thick_solid"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "div_shape",
|
||||
"value" => array("solid_line"),
|
||||
),
|
||||
"description" => esc_html__("Select divider width.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Line Color", "keydesign"),
|
||||
"param_name" => "div_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "div_shape",
|
||||
"value" => array("dotted_line", "dashed_line", "solid_line", "double_line", "double_dotted", "double_dashed"),
|
||||
),
|
||||
"description" => esc_html__("Choose divider color.", "keydesign")
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_divider_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'div_shape' => '',
|
||||
'div_width' => '',
|
||||
'div_thickness' => '',
|
||||
'div_color' => '',
|
||||
), $atts));
|
||||
|
||||
$div_size = "";
|
||||
|
||||
if($div_shape == "solid_line") {
|
||||
$div_size = $div_thickness;
|
||||
}
|
||||
|
||||
$output = '<div class="kd-divider '.$div_shape.' '.$div_width.' '.$div_size.'">
|
||||
<div class="divider-line" style="border-color:'.$div_color.'"></div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_DIVIDER')) {
|
||||
$KD_ELEM_DIVIDER = new KD_ELEM_DIVIDER;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_EVENT_SESSION')) {
|
||||
|
||||
class KD_ELEM_EVENT_SESSION extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_eventsession_init'));
|
||||
add_shortcode('tek_eventsession', array($this, 'kd_eventsession_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_eventsession_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Event session", "keydesign"),
|
||||
"description" => esc_html__("Event schedule session.", "keydesign"),
|
||||
"base" => "tek_eventsession",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/schedule.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Session time", "keydesign"),
|
||||
"param_name" => "es_session_time",
|
||||
"admin_label" => true,
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add a session time.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Session title", "keydesign"),
|
||||
"param_name" => "es_session_title",
|
||||
"admin_label" => true,
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add a session title.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Session summary", "keydesign"),
|
||||
"param_name" => "es_session_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add a session summary.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Person name", "keydesign"),
|
||||
"param_name" => "es_speaker_name",
|
||||
"admin_label" => true,
|
||||
"value" => "",
|
||||
"description" => esc_html__("Name of the person in charge for this session.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Person job", "keydesign"),
|
||||
"param_name" => "es_speaker_position",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the person job title.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Person image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Person image", "keydesign"),
|
||||
"param_name" => "es_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload your image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Person external image", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link type", "keydesign"),
|
||||
"param_name" => "es_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( "No link", "keydesign" ) => "#",
|
||||
esc_html__( "Add a custom link", "keydesign" ) => "1",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add/remove custom link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link text", "keydesign"),
|
||||
"param_name" => "es_link_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter link text here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "es_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "es_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "es_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Expand element","keydesign"),
|
||||
"param_name" => "es_expanded",
|
||||
"value" => array(
|
||||
"No" => "es_collapsed",
|
||||
"Yes" => "es_expand",
|
||||
),
|
||||
"save_always" => true
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "es_background_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select box background color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "es_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "es_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_eventsession_shrt($atts, $content = null) {
|
||||
|
||||
// Include required JS and CSS files
|
||||
wp_enqueue_script('kd_jquery_appear');
|
||||
|
||||
// Declare empty vars
|
||||
$output = $speaker_image = $href = $link_target = $link_title = $es_unique_id = $expand_class = $content_image = $animation_delay = $wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'es_session_time' => '',
|
||||
'es_session_title' => '',
|
||||
'es_session_description' => '',
|
||||
'es_speaker_name' => '',
|
||||
'es_speaker_position' => '',
|
||||
'image_source' => '',
|
||||
'es_image' => '',
|
||||
'ext_image' => '',
|
||||
'es_custom_link' => '',
|
||||
'es_link_text' => '',
|
||||
'es_link' => '',
|
||||
'es_expanded' => '',
|
||||
'es_background_color' => '',
|
||||
'css_animation' => '',
|
||||
'es_animation_delay' => '',
|
||||
'es_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$es_unique_id = 'esaccid'.mt_rand(999, 9999999);
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$content_image .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$content_image .='<img src="'.$ext_image.'" />';
|
||||
}
|
||||
} else {
|
||||
$speaker_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $es_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_image = $speaker_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
$href = vc_build_link($es_link);
|
||||
if ($href['target'] == "") { $href['target'] = "_self"; }
|
||||
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target'])) ? ' target="'.$href['target'].'"' : 'target="_self"';
|
||||
$link_title = (isset($href['title'])) ? ' title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
$es_no_description ='';
|
||||
if($es_session_description == '') {
|
||||
$es_no_description = 'es_no_description';
|
||||
}
|
||||
|
||||
switch($es_expanded){
|
||||
case 'es_collapsed':
|
||||
$expand_class = "es-collapsed";
|
||||
break;
|
||||
case 'es_expand':
|
||||
$expand_class = "es-expanded";
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($es_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$es_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('es-accordion', $es_no_description, $css_animation, $es_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" id="'.$es_unique_id.'" '.(!empty($es_background_color) ? 'style="background-color: '.$es_background_color.';"' : '').' '.$animation_delay.'>
|
||||
<div class="es-heading '.$expand_class.'">';
|
||||
if ($es_session_time != '') {
|
||||
$output .= '<span class="es-time"><i class="fa fa-clock-o"></i>'.$es_session_time.'</span>';
|
||||
}
|
||||
$output .= '<h4>';
|
||||
if ($es_expanded == 'es_expand') {
|
||||
$output .= '<a data-toggle="collapse" data-parent="#'.$es_unique_id.'" href="#tabid'.strtolower(md5($es_unique_id)).'" aria-expanded="true">'.$es_session_title.' <i class="fa fa-angle-down"></i></a>';
|
||||
} elseif ($es_expanded == 'es_collapsed') {
|
||||
$output .= '<a class="collapsed" data-toggle="collapse" data-parent="#'.$es_unique_id.'" href="#tabid'.strtolower(md5($es_unique_id)).'">'.$es_session_title.' <i class="fa fa-angle-down"></i></a>';
|
||||
}
|
||||
$output .= '</h4>
|
||||
</div>';
|
||||
if ($es_expanded == 'es_expand') {
|
||||
$output .= '<div id="tabid'.strtolower(md5($es_unique_id)).'" class="panel-collapse collapse in" aria-expanded="true" role="tabpanel">';
|
||||
} elseif ($es_expanded == 'es_collapsed') {
|
||||
$output .= '<div id="tabid'.strtolower(md5($es_unique_id)).'" class="panel-collapse collapse" role="tabpanel">';
|
||||
}
|
||||
$output .= '<div class="es-speaker-container">
|
||||
<div class="es-speaker-img">'.$content_image.'</div>
|
||||
<div class="es-speaker-name">'.$es_speaker_name.'</div>
|
||||
<div class="es-speaker-position">'.$es_speaker_position.'</div>
|
||||
</div>
|
||||
<div class="es-session-desc"><div class="es-desc-wrapper">'.wpb_js_remove_wpautop($es_session_description, true).'</div>';
|
||||
if ($es_custom_link == "1") {
|
||||
$output .= '<div class="es-link"><a href="'.$href['url'].'"'.$link_target.''.$link_title.'>'.$es_link_text.'</a></div>';
|
||||
}
|
||||
$output .= '</div></div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_EVENT_SESSION')) {
|
||||
$KD_ELEM_EVENT_SESSION = new KD_ELEM_EVENT_SESSION;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_extended_tabs extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_extended_tabs_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('tek_extended_tabs')) {
|
||||
class tek_extended_tabs extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_extended_tabs_init'));
|
||||
add_shortcode('tek_extended_tabs', array($this, 'kd_extended_tabs_container'));
|
||||
add_shortcode('tek_extended_tabs_single', array( $this, 'kd_extended_tabs_single'));
|
||||
add_action('wp_enqueue_scripts', array($this, 'kd_load_element_scripts'));
|
||||
}
|
||||
|
||||
function kd_load_element_scripts() {
|
||||
wp_enqueue_script("kd_easytabs_script");
|
||||
}
|
||||
|
||||
/* VC Elements render in admin */
|
||||
function kd_extended_tabs_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(
|
||||
array(
|
||||
"name" => esc_html__("Extended tabs", "keydesign"),
|
||||
"description" => __("Vertical tabs with extended features.", "keydesign"),
|
||||
"base" => "tek_extended_tabs",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_extended_tabs_single'),
|
||||
"icon" => plugins_url('assets/element_icons/extended-tabs.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Tabs alignment","keydesign"),
|
||||
"param_name" => "extended_tabs_alignment",
|
||||
"value" => array(
|
||||
"Left image" => "tabs-image-left",
|
||||
"Right image" => "tabs-image-right",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select tabs image alignment.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image layout","keydesign"),
|
||||
"param_name" => "extended_tabs_img_layout",
|
||||
"value" => array(
|
||||
"Contained" => "tab-img-contained",
|
||||
"Full width" => "tab-img-fullwidth",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select tabs image alignment.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "et_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "extended_tabs_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Tab", "keydesign"),
|
||||
"base" => "tek_extended_tabs_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_extended_tabs'),
|
||||
"icon" => plugins_url('assets/element_icons/child-tabs.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"heading" => esc_html__("Tab title", "keydesign"),
|
||||
"param_name" => "tab_title",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Add the tab title here.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display tab icon","keydesign"),
|
||||
"param_name" => "tab_icon_type",
|
||||
"value" => array(
|
||||
"No icon" => "no_icon",
|
||||
"Icon browser" => "icon_browser",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon source.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Tab Icon", "keydesign" ),
|
||||
"param_name" => "tab_icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "tab_icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea_html",
|
||||
"heading" => esc_html__("Tab content", "keydesign"),
|
||||
"param_name" => "content",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add the tab description here. This field accepts HTML tags.", "keydesign"),
|
||||
),
|
||||
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "tab_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload your image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 750x500 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_extended_tabs_container($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'extended_tabs_alignment' => '',
|
||||
'extended_tabs_img_layout' => '',
|
||||
'css_animation' => '',
|
||||
'et_animation_delay' => '',
|
||||
'extended_tabs_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $animation_delay = $wrapper_class = '';
|
||||
|
||||
$kd_tabs_id = "kd-tabswrapper-".uniqid(rand(10000,99999));
|
||||
|
||||
// Animation delay
|
||||
if ($et_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$et_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('features-tabs', $kd_tabs_id, $extended_tabs_alignment, $extended_tabs_img_layout, $css_animation, $extended_tabs_extra_class));
|
||||
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>
|
||||
' . do_shortcode($content) . '
|
||||
<ul class="tab-controls"></ul>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
$(".features-tabs.'.$kd_tabs_id.'").each( function (){
|
||||
$( "li.tab-control-item" , this ).appendTo( $( ".tab-controls" , this ) );
|
||||
} );
|
||||
});</script>';
|
||||
|
||||
if ($content != '') {
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_extended_tabs_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'tab_title' => '',
|
||||
'tab_icon_type' => '',
|
||||
'tab_icon_iconsmind' => '',
|
||||
'image_source' => '',
|
||||
'tab_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $default_src = $dimensions = $hwstring = $kd_extendtabs_id = $content_icon = '';
|
||||
|
||||
if( $tab_icon_type == 'icon_browser' ) {
|
||||
// Enqueue needed icon font.
|
||||
// vc_icon_element_fonts_enqueue( $icon_library );
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
if (strlen($tab_icon_iconsmind) > 0) {
|
||||
$icons = $tab_icon_iconsmind;
|
||||
}
|
||||
|
||||
if ( $tab_icon_type == 'icon_browser' ) {
|
||||
$content_icon = '<i class="'.$icons .' fa"></i> ';
|
||||
}
|
||||
|
||||
$image = wpb_getImageBySize($params = array( 'post_id' => NULL, 'attach_id' => $tab_image, 'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
$ext_image = $ext_image ? esc_attr( $ext_image ) : $default_src;
|
||||
|
||||
$kd_extendtabs_id = "kd-extab-".uniqid(rand(10000,99999));
|
||||
|
||||
$output .= '<div id="'.$kd_extendtabs_id.'">
|
||||
<div class="tab-image-container">';
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .='<img class="ext-tab-img" src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
if (!$image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
$output .= '</div>
|
||||
<div class="tab-text-container">
|
||||
<h2>' . $tab_title . '</h2>';
|
||||
if ($content != '') {
|
||||
615
wp-content/plugins/keydesign-addon/elements/iconbox_elem.php
Normal file
615
wp-content/plugins/keydesign-addon/elements/iconbox_elem.php
Normal file
@@ -0,0 +1,615 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_ICON_BOX')) {
|
||||
|
||||
class KD_ELEM_ICON_BOX extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_iconbox_init'));
|
||||
add_shortcode('tek_iconbox', array($this, 'kd_iconbox_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_iconbox_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Icon box", "keydesign"),
|
||||
"description" => esc_html__("Simple text box with icon.", "keydesign"),
|
||||
"base" => "tek_iconbox",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/icon-box.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Box title", "keydesign"),
|
||||
"param_name" => "title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box title here.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title size","keydesign"),
|
||||
"param_name" => "title_size",
|
||||
"value" => array(
|
||||
"Large" => "large-title",
|
||||
"Small title" => "small-title",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select title size.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box content type","keydesign"),
|
||||
"param_name" => "box_content_type",
|
||||
"value" => array(
|
||||
"Simple text" => "simple_text",
|
||||
"HTML content" => "html_content",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select box content type.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box description - simple text", "keydesign"),
|
||||
"param_name" => "text_box",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box content text here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "box_content_type",
|
||||
"value" => array("simple_text")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea_html",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box description - HTML content", "keydesign"),
|
||||
"param_name" => "content",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box content text here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "box_content_type",
|
||||
"value" => array("html_content")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Content text color", "keydesign"),
|
||||
"param_name" => "text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose content text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon","keydesign"),
|
||||
"param_name" => "icon_type",
|
||||
"value" => array(
|
||||
"Icon browser" => "icon_browser",
|
||||
"Custom image" => "custom_icon",
|
||||
"No icon" => "no_icon",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon source.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Custom image source", "keydesign"),
|
||||
"param_name" => "ib_image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("custom_icon"),
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "icon_img",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ib_image_source",
|
||||
"value" => array("media_library"),
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ib_ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "ib_image_source",
|
||||
"value" => array("external_link"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size","keydesign"),
|
||||
"param_name" => "icon_img_size",
|
||||
"value" => array(
|
||||
"Small size" => "img_small_size",
|
||||
"Medium size" => "img_medium_size",
|
||||
"Big size" => "img_big_size",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("custom_icon"),
|
||||
),
|
||||
"description" => esc_html__("Select image size.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon/image position","keydesign"),
|
||||
"param_name" => "icon_position",
|
||||
"value" => array(
|
||||
"Top" => "icon_top",
|
||||
"Left" => "icon_left",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "icon_type",
|
||||
"value" => array("icon_browser", "custom_icon"),
|
||||
),
|
||||
"description" => esc_html__("Select icon/image position relative to the content.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Content alignment", "keydesign"),
|
||||
"param_name" => "content_alignment",
|
||||
"value" => array(
|
||||
"Align center" => "content_center",
|
||||
"Align left" => "content_left",
|
||||
"Align right" => "content_right"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose content alignment.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "custom_link",
|
||||
"value" => array(
|
||||
esc_html__( "No link", "keydesign" ) => "ib-no-link",
|
||||
esc_html__( "Text link", "keydesign" ) => "ib-text-link",
|
||||
esc_html__( "Box link", "keydesign" ) => "ib-box-link",
|
||||
esc_html__( "Icon/image link", "keydesign" ) => "ib-icon-link",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add/remove custom link", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link text", "keydesign"),
|
||||
"param_name" => "link_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter link text here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "custom_link",
|
||||
"value" => array( "ib-text-link" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link color", "keydesign"),
|
||||
"param_name" => "link_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose link color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "custom_link",
|
||||
"value" => array( "ib-text-link" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link URL", "keydesign"),
|
||||
"param_name" => "iconbox_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter URL (Note: parameters like \"mailto:\" are also accepted).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "custom_link",
|
||||
"value" => array( "ib-text-link", "ib-box-link", "ib-icon-link" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'type' => 'dropdown',
|
||||
'heading' => __( 'Link target', 'keydesign' ),
|
||||
'param_name' => 'iconbox_link_target',
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "custom_link",
|
||||
"value" => array( "ib-text-link", "ib-box-link", "ib-icon-link" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background type", "keydesign"),
|
||||
"param_name" => "background_type",
|
||||
"value" => array(
|
||||
esc_html__( 'None', 'keydesign' ) => 'none',
|
||||
esc_html__( 'Select color', 'keydesign' ) => 'custom_bg_color',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select box background type.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Background color", "keydesign"),
|
||||
"param_name" => "background_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "background_type",
|
||||
"value" => array( "custom_bg_color" ),
|
||||
),
|
||||
"description" => esc_html__("Choose box background color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Hover effect", "keydesign"),
|
||||
"param_name" => "hover_effect",
|
||||
"value" => array(
|
||||
"No effect" => "ib-no-effect",
|
||||
"Effect 1" => "ib-hover-1",
|
||||
"Effect 2" => "ib-hover-2"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select box hover effect.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "ib_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "ib_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
public function kd_iconbox_shrt($atts, $content = null) {
|
||||
|
||||
// Declare empty vars
|
||||
$output = $content_icon = $icons = $icon_position_class = $content_alignment_class = $link_title = $link_target = $icon_color_style = $icon_size_style =
|
||||
$normal_bg = $theme_primary_color = $bg_extra_class = $animation_delay = $wrapper_class = $link = $width = $height = $image = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'icon_type' => '',
|
||||
'title' => '',
|
||||
'title_size' => '',
|
||||
'title_color' => '',
|
||||
'box_content_type' => '',
|
||||
'text_box' => '',
|
||||
'text_color' => '',
|
||||
'icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'icon_color' => '',
|
||||
'icon_size' => '',
|
||||
'ib_image_source' => '',
|
||||
'ib_ext_image' => '',
|
||||
'icon_img' => '',
|
||||
'icon_img_size' => '',
|
||||
'icon_position' => '',
|
||||
'content_alignment' => '',
|
||||
'custom_link' => '',
|
||||
'link_text'=> '',
|
||||
'link_color' => '',
|
||||
'iconbox_link' => '',
|
||||
'iconbox_link_target' => '',
|
||||
'background_type'=> '',
|
||||
'background_color' => '',
|
||||
'hover_effect' => '',
|
||||
'css_animation' => '',
|
||||
'ib_animation_delay' => '',
|
||||
'ib_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
|
||||
if( $icon_type == 'icon_browser' ) {
|
||||
// Enqueue needed icon font.
|
||||
// vc_icon_element_fonts_enqueue( $icon_library );
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$icons = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$icon_color.';';
|
||||
}
|
||||
|
||||
if ($icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$icon_size.';';
|
||||
}
|
||||
|
||||
$a_attrs['href'] = $iconbox_link;
|
||||
$a_attrs['target'] = $iconbox_link_target;
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $icon_img,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
if ($ib_image_source == 'external_link' && !empty($ib_ext_image)) {
|
||||
$src = $ib_ext_image;
|
||||
list($width, $height) = getimagesize($src);
|
||||
} elseif ($ib_image_source == 'media_library' && !empty($icon_img)) {
|
||||
$link = wp_get_attachment_image_src( $icon_img, 'large' );
|
||||
$link = $link[0];
|
||||
$src = $link;
|
||||
}
|
||||
|
||||
if ( $icon_type == 'icon_browser' ) {
|
||||
$content_icon = '<i class="'.$icons .' fa" style="'.$icon_size_style.' '.$icon_color_style.'"></i> ';
|
||||
} elseif ( $icon_type == 'custom_icon') {
|
||||
if ($ib_image_source == 'external_link' && $ib_ext_image != '') {
|
||||
$content_icon = '<div class="tt-iconbox-customimg '.$icon_img_size.'"><img src="'.$ib_ext_image.'" width="'.$width.'" height="'.$height.'" /></div>';
|
||||
} elseif ($ib_image_source == 'media_library' && !empty($icon_img)) {
|
||||
$content_icon = '<div class="tt-iconbox-customimg '.$icon_img_size.'">'.$image['thumbnail'].'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Content alignment in box
|
||||
if( $content_alignment == 'content_center' ) {
|
||||
$content_alignment_class = 'cont-center';
|
||||
}
|
||||
elseif ( $content_alignment == 'content_left' ) {
|
||||
$content_alignment_class = 'cont-left';
|
||||
}
|
||||
elseif ( $content_alignment == 'content_right' ) {
|
||||
$content_alignment_class = 'cont-right';
|
||||
}
|
||||
|
||||
|
||||
// Icon position class
|
||||
if ( $icon_position == 'icon_top' ) {
|
||||
$icon_position_class = 'icon-top';
|
||||
} elseif ( $icon_position == 'icon_left' ) {
|
||||
$icon_position_class = 'icon-left';
|
||||
}
|
||||
|
||||
//Background type
|
||||
switch($background_type){
|
||||
case 'none':
|
||||
$normal_bg = 'none';
|
||||
break;
|
||||
|
||||
case 'custom_bg_color':
|
||||
if ($background_color != '') {
|
||||
$normal_bg = $background_color;
|
||||
} else {
|
||||
$normal_bg = 'transparent';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($ib_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$ib_animation_delay;
|
||||
}
|
||||
|
||||
// Check if background color matches theme primary colorpicker
|
||||
$redux_ThemeTek = get_option( 'redux_ThemeTek' );
|
||||
$theme_primary_color = $redux_ThemeTek['tek-main-color'];
|
||||
if ($theme_primary_color == $background_color) {
|
||||
$bg_extra_class = "iconbox-main-color";
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('key-icon-box', 'icon-default', $icon_position_class, $content_alignment_class, $hover_effect, $css_animation, $ib_extra_class));
|
||||
|
||||
$output .= '<div class="'.trim($wrapper_class).'" '.(!empty($background_type) ? 'style="background-color: '.$normal_bg.';"' : '').' '.$animation_delay.'>';
|
||||
if ($custom_link == "ib-box-link") {
|
||||
$output .= '<a ' . vc_stringify_attributes( $a_attrs ) . '>';
|
||||
}
|
||||
|
||||
if ($hover_effect != "ib-no-effect") {
|
||||
$output .= '<div class="ib-wrapper">';
|
||||
}
|
||||
|
||||
if ($icon_type != "no_icon") {
|
||||
if ($custom_link == "ib-icon-link") {
|
||||
$output .= '<a ' . vc_stringify_attributes( $a_attrs ) . '>' . $content_icon . '</a>';
|
||||
} else {
|
||||
$output .= $content_icon;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty($title) && ($title_size == "small-title") ) {
|
||||
$output .= '<h6 class="service-heading" '.(!empty($title_color) ? 'style="color: '.$title_color.';"' : '').'>'.$title.'</h6>';
|
||||
} elseif ( !empty($title) ) {
|
||||
$output .= '<h5 class="service-heading" '.(!empty($title_color) ? 'style="color: '.$title_color.';"' : '').'>'.$title.'</h5>';
|
||||
}
|
||||
|
||||
if ($box_content_type == "html_content") {
|
||||
if($content != '') {
|
||||
$output .= '<p '.(!empty($text_color) ? 'style="color: '.$text_color.';"' : '').'>'.do_shortcode($content).'</p>';
|
||||
}
|
||||
} else {
|
||||
if ( !empty($text_box) ) {
|
||||
$output .= '<p '.(!empty($text_color) ? 'style="color: '.$text_color.';"' : '').'>'.$text_box.'</p>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($custom_link == "ib-text-link") {
|
||||
$output .= '<p class="ib-link '.$bg_extra_class.'"><a ' . vc_stringify_attributes( $a_attrs ) . ' '.(!empty($link_color) ? 'style="color: '.$link_color.';"' : '').'>'.$link_text.'</a></p>';
|
||||
}
|
||||
if ($hover_effect != "ib-no-effect") {
|
||||
$output .= '</div>';
|
||||
}
|
||||
if ($custom_link == "ib-box-link") {
|
||||
$output .= '</a>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_ICON_BOX')) {
|
||||
$KD_ELEM_ICON_BOX = new KD_ELEM_ICON_BOX;
|
||||
}
|
||||
|
||||
?>
|
||||
1
wp-content/plugins/keydesign-addon/elements/index.php
Normal file
1
wp-content/plugins/keydesign-addon/elements/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_LOGIN_FORM')) {
|
||||
|
||||
class KD_ELEM_LOGIN_FORM extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_loginform_init'));
|
||||
add_shortcode('tek_loginform', array($this, 'kd_loginform_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_loginform_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Login form", "keydesign"),
|
||||
"description" => esc_html__("Simple login form for use anywhere within WordPress.", "keydesign"),
|
||||
"base" => "tek_loginform",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/login-form.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"show_settings_on_create" => true,
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Redirect", "keydesign"),
|
||||
"param_name" => "redirect",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Redirect to another page after successful login.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Remember me","keydesign"),
|
||||
"param_name" => "remember",
|
||||
"value" => array(
|
||||
"Enable" => "enable-remember",
|
||||
"Disable" => "disable-remember",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Enable to display \"Remember\" me checkbox.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_loginform_shrt($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'redirect' => '',
|
||||
'remember' => '',
|
||||
), $atts));
|
||||
|
||||
$args = $login_form = '';
|
||||
|
||||
$args = array();
|
||||
$args['echo'] = "0";
|
||||
|
||||
if(isset($redirect) && $redirect != '') {
|
||||
$args['redirect'] = esc_url($redirect);
|
||||
}
|
||||
|
||||
if(isset($remember) && $remember != 'disable-remember') {
|
||||
$args['remember'] = "1";
|
||||
} else {
|
||||
$args['remember'] = "0";
|
||||
}
|
||||
|
||||
if(is_user_logged_in()) {
|
||||
$login_form .= wp_loginout(esc_url($_SERVER['REQUEST_URI']), false);
|
||||
} else {
|
||||
$login_form .= wp_login_form($args);
|
||||
}
|
||||
|
||||
return $login_form;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_LOGIN_FORM')) {
|
||||
$KD_ELEM_LOGIN_FORM = new KD_ELEM_LOGIN_FORM;
|
||||
}
|
||||
|
||||
?>
|
||||
446
wp-content/plugins/keydesign-addon/elements/map.php
Normal file
446
wp-content/plugins/keydesign-addon/elements/map.php
Normal file
@@ -0,0 +1,446 @@
|
||||
<?php
|
||||
if (!class_exists('KD_ELEM_MAP')) {
|
||||
class KD_ELEM_MAP extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_map_init'));
|
||||
add_shortcode('tek_map', array($this, 'kd_map_shrt'));
|
||||
}
|
||||
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_map_init() {
|
||||
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Google map", "keydesign"),
|
||||
"description" => esc_html__("Custom Google Map", "keydesign"),
|
||||
"base" => "tek_map",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/google-map.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "kd_param_notice",
|
||||
"text" => "<span style='display: block;'>Google maps requires a valid API key in order to work. You can add it in Dashboard > Ekko > Theme Options > Global Options. You can generate a new API key from <a href='https://developers.google.com/maps/faq#new-key' target='_blank' title='Google Maps API'>here</a>.</span>",
|
||||
"param_name" => "notification",
|
||||
"edit_field_class" => "vc_column vc_col-sm-12",
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Map name", "keydesign"),
|
||||
"param_name" => "map_name",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Insert a unique map name.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Location latitude", "keydesign"),
|
||||
"param_name" => "map_latitude",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter location latitude.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Location longitude", "keydesign"),
|
||||
"param_name" => "map_longitude",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter location longitude.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Map zoom", "keydesign"),
|
||||
"param_name" => "map_zoom",
|
||||
"value" => array(
|
||||
"10 - City" => "10",
|
||||
"11" => "11",
|
||||
"12" => "12",
|
||||
"13" => "13",
|
||||
"14" => "14",
|
||||
"15 - Streets" => "15",
|
||||
"16" => "16",
|
||||
"17" => "17",
|
||||
"18" => "18",
|
||||
"19" => "19",
|
||||
"20 - Buildings" => "20",
|
||||
),
|
||||
"description" => esc_html__("Enter map zoom (default 14).", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Map style", "keydesign"),
|
||||
"param_name" => "map_style",
|
||||
"value" => array(
|
||||
esc_html__( 'Grayscale', 'keydesign' ) => 'gmap_style_grayscale',
|
||||
esc_html__( 'Google preset colors', 'keydesign' ) => 'gmap_style_normal',
|
||||
),
|
||||
"description" => esc_html__("Choose map style.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Marker icon source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Map marker image", "keydesign"),
|
||||
"param_name" => "map_icon",
|
||||
"description" => esc_html__("Upload map marker icon. Recommended image size: 50x50 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Marker image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link. Recommended image size: 50x50 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Map height", "keydesign"),
|
||||
"param_name" => "map_height",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter map height in pixels. Default is 400px.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Map info panel settings", "keydesign"),
|
||||
"param_name" => "map_business_panel_settings",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"value" => array(
|
||||
esc_html__( "Hide business info panel", "keydesign" ) => "hidden_info_panel",
|
||||
esc_html__( "Left aligned", "keydesign" ) => "left_info_panel",
|
||||
esc_html__( "Right aligned", "keydesign" ) => "right_info_panel",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Panel title", "keydesign"),
|
||||
"param_name" => "map_business_name",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"description" => esc_html__("Enter panel title.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "map_business_panel_settings",
|
||||
"value" => array("left_info_panel", "right_info_panel")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Address", "keydesign"),
|
||||
"param_name" => "map_business_address",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"description" => esc_html__("Enter business address.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "map_business_panel_settings",
|
||||
"value" => array("left_info_panel", "right_info_panel")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Email", "keydesign"),
|
||||
"param_name" => "map_business_email",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"description" => esc_html__("Enter business email.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "map_business_panel_settings",
|
||||
"value" => array("left_info_panel", "right_info_panel")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Phone", "keydesign"),
|
||||
"param_name" => "map_business_phone",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"description" => esc_html__("Enter business phone.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "map_business_panel_settings",
|
||||
"value" => array("left_info_panel", "right_info_panel")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Opening hours title", "keydesign"),
|
||||
"param_name" => "map_business_opening_hours",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"description" => esc_html__("Enter opening hours title text.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "map_business_panel_settings",
|
||||
"value" => array("left_info_panel", "right_info_panel")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "param_group",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Opening hours schedule", "keydesign"),
|
||||
"value" => urlencode( json_encode ( array(
|
||||
array(
|
||||
"map_schedule_day" => "",
|
||||
"map_schedule_day_info" => "",
|
||||
)
|
||||
) ) ),
|
||||
"param_name" => "map_business_schedule",
|
||||
"group" => esc_html__("Business info", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "map_business_panel_settings",
|
||||
"value" => array("left_info_panel", "right_info_panel")
|
||||
),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"heading" => __("Day name","keydesign"),
|
||||
"param_name" => "map_schedule_day_name",
|
||||
"description" => "",
|
||||
"admin_label" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"heading" => __("Day opening/closing hours","keydesign"),
|
||||
"param_name" => "map_schedule_day_hours",
|
||||
"value" => "",
|
||||
"description" => "",
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Render the element on front-end
|
||||
public function kd_map_shrt($atts, $content = null) {
|
||||
|
||||
|
||||
$api = 'https://maps.googleapis.com/maps/api/js';
|
||||
$redux_ThemeTek = get_option( 'redux_ThemeTek' );
|
||||
$map_key = $redux_ThemeTek['tek-google-api'];
|
||||
if($map_key != false) {
|
||||
$arr_params = array(
|
||||
'key' => $map_key
|
||||
);
|
||||
$api = esc_url( add_query_arg( $arr_params, $api ));
|
||||
}
|
||||
|
||||
if (isset($redux_ThemeTek['tek-google-api']) && $redux_ThemeTek['tek-google-api'] != '' ) {
|
||||
wp_enqueue_script("googleapis",$api,null,null,false);
|
||||
}
|
||||
|
||||
// Declare empty vars
|
||||
$output = $gmap_style_var = $business_data = $content_image = $map_img_array = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'map_name' => '',
|
||||
'map_latitude' => '',
|
||||
'map_longitude' => '',
|
||||
'map_zoom' => '',
|
||||
'map_style' => '',
|
||||
'image_source' => '',
|
||||
'map_icon' => '',
|
||||
'ext_image' => '',
|
||||
'map_height' => '',
|
||||
'map_business_panel_settings' => '',
|
||||
'map_business_name' => '',
|
||||
'map_business_address' => '',
|
||||
'map_business_email' => '',
|
||||
'map_business_phone' => '',
|
||||
'map_business_opening_hours' => '',
|
||||
'map_business_schedule' => '',
|
||||
), $atts));
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
$content_image .= $ext_image;
|
||||
} else {
|
||||
$map_img_array = wp_get_attachment_image_src($map_icon, "large");
|
||||
$content_image = $map_img_array[0];
|
||||
}
|
||||
|
||||
switch($map_style){
|
||||
case 'gmap_style_grayscale':
|
||||
$gmap_style_var = 'var featureOpts = [
|
||||
{
|
||||
stylers: [
|
||||
{ "visibility": "on" },
|
||||
{ "weight": 1 },
|
||||
{ "saturation": -100 },
|
||||
{ "lightness": 2.2 },
|
||||
{ "gamma": 2.2 }
|
||||
]
|
||||
}, {
|
||||
featureType: "poi",
|
||||
stylers: [
|
||||
{ "visibility": "off" }
|
||||
]
|
||||
}
|
||||
];';
|
||||
break;
|
||||
|
||||
case 'gmap_style_normal':
|
||||
$gmap_style_var = 'var featureOpts = [
|
||||
{
|
||||
stylers: [
|
||||
{ "visibility": "on" },
|
||||
{ "weight": 1.1 },
|
||||
{ "saturation": 1 },
|
||||
{ "lightness": 1 },
|
||||
{ "gamma": 1 }
|
||||
]
|
||||
}
|
||||
];';
|
||||
break;
|
||||
}
|
||||
|
||||
$id = "kd".uniqid();
|
||||
|
||||
if (isset($redux_ThemeTek['tek-google-api']) && $redux_ThemeTek['tek-google-api'] != '' ) {
|
||||
$output .= '<script>
|
||||
|
||||
function initKdMap_'.$id.'() {
|
||||
var map_'.$id.';
|
||||
var gmap_location_'.$id.' = new google.maps.LatLng('.$map_latitude.', '.$map_longitude.');
|
||||
var GMAP_MODULE_'.$id.' = "customMap";
|
||||
'.$gmap_style_var.'
|
||||
var mapOptions = {
|
||||
zoom: '.$map_zoom.',
|
||||
center: gmap_location_'.$id.',
|
||||
scrollwheel: false,
|
||||
mapTypeControlOptions: {
|
||||
mapTypeIds: [google.maps.MapTypeId.ROADMAP, GMAP_MODULE_'.$id.']
|
||||
},
|
||||
mapTypeId: GMAP_MODULE_'.$id.'
|
||||
};
|
||||
map_'.$id.' = new google.maps.Map(document.getElementById("'.$id.'"), mapOptions);
|
||||
marker_'.$id.' = new google.maps.Marker({
|
||||
map: map_'.$id.',
|
||||
draggable: false,
|
||||
animation: google.maps.Animation.DROP,
|
||||
position: gmap_location_'.$id.',
|
||||
icon: "'.$content_image.'"
|
||||
});
|
||||
google.maps.event.addListener(marker_'.$id.', "click", function() {
|
||||
if (marker_'.$id.'.getAnimation() != null) {
|
||||
marker_'.$id.'.setAnimation(null);
|
||||
} else {
|
||||
marker_'.$id.'.setAnimation(google.maps.Animation.BOUNCE);
|
||||
}
|
||||
});
|
||||
var styledMapOptions = {
|
||||
name: "'.$map_name.'"
|
||||
};
|
||||
var customMapType_'.$id.' = new google.maps.StyledMapType(featureOpts, styledMapOptions);
|
||||
map_'.$id.'.mapTypes.set(GMAP_MODULE_'.$id.', customMapType_'.$id.');
|
||||
}
|
||||
jQuery(window).load(function() {
|
||||
initKdMap_'.$id.'();
|
||||
});
|
||||
</script>';
|
||||
} else {
|
||||
$output .= '<div class="kd-alertbox kd-contact-alertbox ab_info kd_map_alert">
|
||||
<div class="ab-icon"><i class="fa-question iconita"></i></div>
|
||||
<div class="ab-message"><p></p>
|
||||
<p>Google maps requires a valid API key in order to work.<br> You can add it in Dashboard > Ekko > Theme Options > Global Options. Generate a new API key from https://developers.google.com/maps</p></div>
|
||||
<a href="#" class="ab-close"><i class="fa-times iconita"></i></a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$output .= '<div class="contact-map-container '.$map_business_panel_settings.'" '.(!empty($map_height) ? 'style="height: '.$map_height.';"' : '').'>';
|
||||
if ($map_business_panel_settings != "hidden_info_panel") {
|
||||
$output .= '<div class="business-info-wrapper">
|
||||
<span class="fa fa-times toggle-map-info"></span>
|
||||
<div class="business-info-header">';
|
||||
if ($map_business_name != '') {
|
||||
$output .= '<h4>'.$map_business_name.'</h4>';
|
||||
}
|
||||
$output .= '<address>';
|
||||
if ($map_business_address != '') {
|
||||
$output .= '<span class="business-address-row"><i class="fa iconsmind-Map-Marker2"></i><span class="address-overflow">'.$map_business_address.'</span></span>';
|
||||
}
|
||||
if ($map_business_phone != '') {
|
||||
$output .= '<span class="business-phone-row"><i class="fa iconsmind-Telephone"></i>'.$map_business_phone.'</span>';
|
||||
}
|
||||
if ($map_business_email != '') {
|
||||
$output .= '<span class="business-email-row"><i class="fa iconsmind-Mail"></i><a href="mailto:'.$map_business_email.'">'.$map_business_email.'</a></span>';
|
||||
}
|
||||
$output .= '</address>
|
||||
</div>
|
||||
<div class="business-info-schedule">
|
||||
<h4>'.$map_business_opening_hours.'</h4>';
|
||||
$map_business_schedule = json_decode( urldecode( $map_business_schedule ), true );
|
||||
|
||||
if( isset( $map_business_schedule ) ) {
|
||||
foreach ( $map_business_schedule as $business_data ){
|
||||
$output .= '<div class="business-info-day">';
|
||||
if ( isset( $business_data["map_schedule_day_name"] ) ){
|
||||
$output .= '<span class="business-info-day-name">'.$business_data["map_schedule_day_name"].'</span>';
|
||||
}
|
||||
if ( isset( $business_data["map_schedule_day_hours"] ) ){
|
||||
$output .= '<span class="business-info-day-hours">'.$business_data["map_schedule_day_hours"].'</span>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '</div>
|
||||
</div>';
|
||||
}
|
||||
$output .= '<div id="'.$id.'" class="kd_map" '.(!empty($map_height) ? 'style="height: '.$map_height.';"' : '').'></div>
|
||||
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_MAP')) {
|
||||
$KD_ELEM_MAP = new KD_ELEM_MAP;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,267 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_masonrygallery_elem extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_masonrygallery_elem_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_masonrygallery_elem')) {
|
||||
class tek_masonrygallery_elem extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array( $this, 'kd_featured_init' ));
|
||||
add_shortcode('tek_masonrygallery_elem', array( $this, 'kd_masonrygallery_container' ));
|
||||
add_shortcode('tek_masonrygallery_elem_single', array( $this, 'kd_masonrygallery_single' ));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_featured_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Masonry gallery", "keydesign"),
|
||||
"description" => esc_html__("Display a gallery with masonry effect.", "keydesign"),
|
||||
"base" => "tek_masonrygallery_elem",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => false,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_masonrygallery_elem_single'),
|
||||
"icon" => plugins_url('assets/element_icons/masonry-gallery.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "mg_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "mg_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Gallery single image", "keydesign"),
|
||||
"base" => "tek_masonrygallery_elem_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_masonrygallery_elem'),
|
||||
"icon" => plugins_url('assets/element_icons/child-image.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "mg_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload a image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library"),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "mg_thumb_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size (Example: \"thumbnail\", \"medium\", \"large\", \"full\" or other sizes defined by theme). Alternatively enter size in pixels (Example: 800x800 (Width x Height)).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image masonry style","keydesign"),
|
||||
"param_name" => "mg_size",
|
||||
"value" => array(
|
||||
"Regular" => "mg-small",
|
||||
"Double size" => "mg-big",
|
||||
),
|
||||
"save_always" => true
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_masonrygallery_container($atts, $content = null) {
|
||||
|
||||
// Include required JS and CSS files
|
||||
wp_enqueue_script( 'masonry' );
|
||||
|
||||
// Declare empty vars
|
||||
$output = $animation_delay = $wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'css_animation' => '',
|
||||
'mg_animation_delay' => '',
|
||||
'mg_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
// Animation delay
|
||||
if ($mg_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$mg_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('mg-gallery', 'mg-container', 'row', $css_animation, $mg_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" '.$animation_delay.'><div class="mg-sizer"></div>' . do_shortcode($content) . '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_masonrygallery_single($atts, $content = null) {
|
||||
|
||||
// Declare empty vars
|
||||
$output = $image = $mg_single_size = $default_src = $size_fix = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'image_source' => '',
|
||||
'mg_image' => '',
|
||||
'ext_image' => '',
|
||||
'mg_thumb_size' => '',
|
||||
'mg_size' => '',
|
||||
), $atts));
|
||||
|
||||
if ( ! $mg_thumb_size ) {
|
||||
$mg_thumb_size = 'full';
|
||||
}
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $mg_image,
|
||||
'thumb_size' => $mg_thumb_size,
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$ext_image = $ext_image ? esc_attr( $ext_image ) : $default_src;
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
$src = $ext_image;
|
||||
} elseif ($image_source == 'media_library' && !$image) {
|
||||
$src = $default_src;
|
||||
} else {
|
||||
$link = wp_get_attachment_image_src( $mg_image, 'large' );
|
||||
$link = $link[0];
|
||||
$src = $link;
|
||||
}
|
||||
|
||||
if ($image_source == 'external_link' && !$ext_image ) {
|
||||
$width = '900';
|
||||
$height = '800';
|
||||
} elseif ($image_source == 'media_library' && !$image) {
|
||||
$width = '900';
|
||||
$height = '800';
|
||||
} elseif ($image_source == 'external_link' && $ext_image != '') {
|
||||
list($width, $height) = getimagesize($src);
|
||||
} elseif ($image_source == 'media_library' && $image != '') {
|
||||
$size_fix = wp_get_attachment_image_src( $mg_image, 'large' );
|
||||
$width = $size_fix[1];
|
||||
$height = $size_fix[2];
|
||||
}
|
||||
|
||||
if( $mg_size == 'mg-small' ) {
|
||||
$mg_single_size = 'small-masonry-img';
|
||||
}
|
||||
elseif ( $mg_size == 'mg-big' ) {
|
||||
$mg_single_size = 'big-masonry-img';
|
||||
}
|
||||
|
||||
$output = '<div class="mg-single-img '.$mg_single_size.'"><a data-size="' . $width. 'x' .$height .'" href='. $src . '>';
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$output .='<img src="'.$default_src.'" class="mg-img vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .='<img class="mg-img" src="'.$ext_image.'" width="'.$width.'" height="'.$height.'" />';
|
||||
}
|
||||
} else {
|
||||
if (!$image) {
|
||||
$output .='<img src="'.$default_src.'" class="mg-img vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
$output .= '</a></div>';
|
||||
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_masonrygallery_elem')) {
|
||||
$tek_masonrygallery_elem = new tek_masonrygallery_elem;
|
||||
}
|
||||
?>
|
||||
344
wp-content/plugins/keydesign-addon/elements/photobox_elem.php
Normal file
344
wp-content/plugins/keydesign-addon/elements/photobox_elem.php
Normal file
@@ -0,0 +1,344 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_PHOTO_BOX')) {
|
||||
|
||||
class KD_ELEM_PHOTO_BOX extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_photobox_init'));
|
||||
add_shortcode('tek_photobox', array($this, 'kd_photobox_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_photobox_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Photo box", "keydesign"),
|
||||
"description" => esc_html__("Simple photo box with link.", "keydesign"),
|
||||
"base" => "tek_photobox",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/photo-box.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Box title", "keydesign"),
|
||||
"param_name" => "phb_title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box title here.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "phb_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box description", "keydesign"),
|
||||
"param_name" => "phb_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box content text here.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description color", "keydesign"),
|
||||
"param_name" => "phb_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box text align", "keydesign"),
|
||||
"param_name" => "phb_text_align",
|
||||
"value" => array(
|
||||
esc_html__( 'Left aligned', 'keydesign' ) => 'text-left',
|
||||
esc_html__( 'Center aligned', 'keydesign' ) => 'text-center',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Text alignment in box.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "phb_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload your image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 400x250 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box link type", "keydesign"),
|
||||
"param_name" => "phb_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( 'No link', 'keydesign' ) => '#',
|
||||
esc_html__( 'Button link', 'keydesign' ) => 'box-button-link',
|
||||
esc_html__( 'Full box link', 'keydesign' ) => 'box-link',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add or remove the custom link.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "phb_box_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link", "box-link" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "phb_button_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the text displayed on the button.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button style", "keydesign"),
|
||||
"param_name" => "phb_button_style",
|
||||
"value" => array(
|
||||
"Solid color" => "tt_primary_button",
|
||||
"Outline" => "tt_secondary_button",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link" ),
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button style.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button color scheme", "keydesign"),
|
||||
"param_name" => "phb_button_color_scheme",
|
||||
"value" => array(
|
||||
"Primary color" => "btn_primary_color",
|
||||
"Secondary color" => "btn_secondary_color",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link" ),
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button predefined color scheme.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "phb_background_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose box background color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "phb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_photobox_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'phb_title' => '',
|
||||
'phb_title_color' => '',
|
||||
'phb_description' => '',
|
||||
'phb_description_color' => '',
|
||||
'phb_text_align' => '',
|
||||
'image_source' => '',
|
||||
'phb_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'phb_custom_link' => '',
|
||||
'phb_box_link' => '',
|
||||
'phb_button_text' => '',
|
||||
'phb_button_style' => '',
|
||||
'phb_button_color_scheme' => '',
|
||||
'phb_background_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'phb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$content_image = $phb_img_array = $href = $link_target = $link_title = $no_image_class = $animation_delay = $default_src = $dimensions = $hwstring = '';
|
||||
|
||||
if(empty($phb_image)) {
|
||||
$no_image_class = "no-image";
|
||||
}
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$content_image .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$content_image .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
$phb_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $phb_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_image = $phb_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
$href = vc_build_link($phb_box_link);
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target']) && ($href['target'] != '')) ? 'target="'.$href['target'].'"' : '';
|
||||
$link_title = (isset($href['title'])) ? 'title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output = '<div class="kd-photobox '.$css_animation.' '.$phb_extra_class.'" '.$animation_delay.'>';
|
||||
if ($phb_custom_link == "box-link") {
|
||||
$output .= '<a href="'.$href['url'].'" '.$link_target.' '.$link_title.'>';
|
||||
}
|
||||
$output .= '<div class="photobox-img">'.$content_image.'</div>';
|
||||
$output .= '<div class="phb-content '.$phb_text_align.' '.$no_image_class.'" '.(!empty($phb_background_color) ? 'style="background-color: '.$phb_background_color.';"' : '').'>
|
||||
<h5 '.(!empty($phb_title_color) ? 'style="color: '.$phb_title_color.';"' : '').'>'.$phb_title.'</h5>
|
||||
<p '.(!empty($phb_description_color) ? 'style="color: '.$phb_description_color.';"' : '').'>'.$phb_description.'</p>';
|
||||
if ($phb_custom_link == "box-button-link") {
|
||||
$output .= '<div class="phb-btncontainer">
|
||||
<a href="'.$href['url'].'" '.$link_target.' '.$link_title.' class="tt_button '.$phb_button_style.' '.$phb_button_color_scheme.'">'.$phb_button_text.'</a>
|
||||
</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
if ($phb_custom_link == "box-link") {
|
||||
$output .= '</a>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_PHOTO_BOX')) {
|
||||
$KD_ELEM_PHOTO_BOX = new KD_ELEM_PHOTO_BOX;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,561 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_photocarousel extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_photocarousel_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_photocarousel')) {
|
||||
class tek_photocarousel extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_photocarousel_init'));
|
||||
add_shortcode('tek_photocarousel', array($this, 'kd_photocarousel_container'));
|
||||
add_shortcode('tek_photocarousel_single', array($this, 'kd_photocarousel_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_photocarousel_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Photo box carousel", "keydesign"),
|
||||
"description" => esc_html__("List photo boxes in a carousel.", "keydesign"),
|
||||
"base" => "tek_photocarousel",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_photocarousel_single', 'tek_photobox'),
|
||||
"icon" => plugins_url('assets/element_icons/photobox-carousel.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Elements per row", "keydesign"),
|
||||
"param_name" => "pbc_elements",
|
||||
"value" => array(
|
||||
"1 item" => "1",
|
||||
"2 items" => "2",
|
||||
"3 items" => "3",
|
||||
"4 items" => "4",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Amount of items displayed at a time with the widest browser width.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation style","keydesign"),
|
||||
"param_name" => "pbc_nav_style",
|
||||
"value" => array(
|
||||
"Arrows" => "nav-arrows",
|
||||
"Dots" => "nav-dots",
|
||||
"Arrows and Dots" => "nav-arrows-dots",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select navigation style.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation color", "keydesign"),
|
||||
"param_name" => "pbc_navigation_color",
|
||||
"value" => array(
|
||||
"Black" => "black-navigation",
|
||||
"White" => "white-navigation",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose the navigation arrows and dots color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable loop","keydesign"),
|
||||
"param_name" => "pbc_loop",
|
||||
"value" => array(
|
||||
"Off" => "loop_off",
|
||||
"On" => "loop_on",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Infinity loop. Duplicate last and first items to get loop illusion.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "pbc_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "pbc_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "pbc_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "pbc_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "pbc_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "pb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Photo Box", "keydesign"),
|
||||
"base" => "tek_photocarousel_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_photocarousel'),
|
||||
"icon" => plugins_url('assets/element_icons/photo-box.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Box title", "keydesign"),
|
||||
"param_name" => "phb_title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box title here.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "phb_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box description", "keydesign"),
|
||||
"param_name" => "phb_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter box content text here.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description color", "keydesign"),
|
||||
"param_name" => "phb_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box text align", "keydesign"),
|
||||
"param_name" => "phb_text_align",
|
||||
"value" => array(
|
||||
esc_html__( 'Left aligned', 'keydesign' ) => 'text-left',
|
||||
esc_html__( 'Center aligned', 'keydesign' ) => 'text-center',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Text alignment in box.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "phb_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload your image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 400x250 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box link type", "keydesign"),
|
||||
"param_name" => "phb_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( 'No link', 'keydesign' ) => '#',
|
||||
esc_html__( 'Button link', 'keydesign' ) => 'box-button-link',
|
||||
esc_html__( 'Full box link', 'keydesign' ) => 'full-box-link',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add or remove the custom link.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "phb_box_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link", "full-box-link" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "phb_button_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the text displayed on the button.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button style", "keydesign"),
|
||||
"param_name" => "phb_button_style",
|
||||
"value" => array(
|
||||
"Solid color" => "tt_primary_button",
|
||||
"Outline" => "tt_secondary_button"
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link" ),
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button style", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button color scheme", "keydesign"),
|
||||
"param_name" => "phb_button_color_scheme",
|
||||
"value" => array(
|
||||
"Primary color" => "btn_primary_color",
|
||||
"Secondary color" => "btn_secondary_color"
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "phb_custom_link",
|
||||
"value" => array( "box-button-link" ),
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select button predefined color scheme.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "phb_background_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose box background color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "phb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_photocarousel_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'pbc_elements' => '',
|
||||
'pbc_nav_style' => '',
|
||||
'pbc_navigation_color' => '',
|
||||
'pbc_loop' => '',
|
||||
'pbc_autoplay' => '',
|
||||
'pbc_autoplay_speed' => '',
|
||||
'pbc_stoponhover' => '',
|
||||
'pb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $wrapper_class = '';
|
||||
|
||||
$kd_pbcunique_id = "kd-pbc-".uniqid();
|
||||
|
||||
$wrapper_class = implode(' ', array('photobox-carousel', 'pbc-parent', $pbc_navigation_color, $kd_pbcunique_id, $pbc_nav_style, $pb_extra_class));
|
||||
|
||||
$output .= '
|
||||
<div class="'.trim($wrapper_class).'">
|
||||
<div class="pbc-content">'.do_shortcode($content).'</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".photobox-carousel.'.$kd_pbcunique_id.' .pbc-content").length) {
|
||||
$(".photobox-carousel.'.$kd_pbcunique_id.' .pbc-content").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
},
|
||||
768:{
|
||||
items:2,
|
||||
},
|
||||
1199:{
|
||||
items:'.$pbc_elements.',
|
||||
},
|
||||
1366:{
|
||||
items:'.$pbc_elements.',';
|
||||
if($pbc_nav_style == "nav-arrows") {
|
||||
$output .= "\n".'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
} elseif ($pbc_nav_style == "nav-dots") {
|
||||
$output .= "\n".'dots: true,
|
||||
dotsEach: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,';
|
||||
} elseif ($pbc_nav_style == "nav-arrows-dots") {
|
||||
$output .= "\n".'dots: true,
|
||||
dotsEach: true,
|
||||
dotsSpeed: 500,
|
||||
nav: true,
|
||||
navSpeed: 500,';
|
||||
}
|
||||
$output .= '}
|
||||
},
|
||||
rewind: true,';
|
||||
|
||||
if($pbc_loop == "loop_on") {
|
||||
$output .= "\n".'loop: true,';
|
||||
}
|
||||
|
||||
if($pbc_autoplay == "auto_on") {
|
||||
$output .= "\n".'autoplay: true,';
|
||||
} else {
|
||||
$output .= "\n".'autoplay: false,';
|
||||
}
|
||||
|
||||
if($pbc_autoplay_speed !== "") {
|
||||
$output .= "\n".'autoplayTimeout: '.$pbc_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($pbc_autoplay == "auto_on" && $pbc_stoponhover == "hover_on") {
|
||||
$output .= "\n".'autoplayHoverPause: true,';
|
||||
} else {
|
||||
$output .= "\n".'autoplayHoverPause: false,';
|
||||
}
|
||||
|
||||
$output .='addClassActive: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_photocarousel_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'phb_title' => '',
|
||||
'phb_title_color' => '',
|
||||
'phb_description' => '',
|
||||
'phb_description_color' => '',
|
||||
'phb_text_align' => '',
|
||||
'image_source' => '',
|
||||
'phb_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'phb_custom_link' => '',
|
||||
'phb_box_link' => '',
|
||||
'phb_button_text' => '',
|
||||
'phb_button_style' => '',
|
||||
'phb_button_color_scheme' => '',
|
||||
'phb_background_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'phb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$content_image = $phb_img_array = $href = $link_target = $link_title = $no_image_class = $animation_delay = $default_src = $dimensions = $hwstring = '';
|
||||
|
||||
if(empty($phb_image)) {
|
||||
$no_image_class = "no-image";
|
||||
}
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$content_image .='<img class="photocarousel-img" src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$content_image .='<img class="photocarousel-img" src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
$phb_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $phb_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_image = $phb_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
$href = vc_build_link($phb_box_link);
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target']) && ($href['target'] != '')) ? 'target="'.$href['target'].'"' : '';
|
||||
$link_title = (isset($href['title'])) ? 'title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output = '<div class="kd-photobox '.$css_animation.' '.$phb_extra_class.'" '.$animation_delay.'>';
|
||||
if ($phb_custom_link == "full-box-link") {
|
||||
$output .= '<a class="full-pbox-link" href="'.$href['url'].'" '.$link_target.' '.$link_title.'>';
|
||||
}
|
||||
$output .= '<div class="photobox-img">'.$content_image.'</div>';
|
||||
$output .= '<div class="phb-content '.$phb_text_align.' '.$no_image_class.'" '.(!empty($phb_background_color) ? 'style="background-color: '.$phb_background_color.';"' : '').'>
|
||||
<h5 '.(!empty($phb_title_color) ? 'style="color: '.$phb_title_color.';"' : '').'>'.$phb_title.'</h5>
|
||||
<p '.(!empty($phb_description_color) ? 'style="color: '.$phb_description_color.';"' : '').'>'.$phb_description.'</p>';
|
||||
if ($phb_custom_link == "box-button-link") {
|
||||
$output .= '<div class="phb-btncontainer">
|
||||
<a href="'.$href['url'].'" '.$link_target.' '.$link_title.' class="tt_button '.$phb_button_style.' '.$phb_button_color_scheme.'">'.$phb_button_text.'</a>
|
||||
</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
if ($phb_custom_link == "full-box-link") {
|
||||
$output .= '</a>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_photocarousel')) {
|
||||
$tek_photocarousel = new tek_photocarousel;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,422 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_photogallery extends WPBakeryShortCodesContainer { }
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_photogallery_single extends WPBakeryShortCode { }
|
||||
}
|
||||
|
||||
if (!class_exists('tek_photogallery')) {
|
||||
class tek_photogallery extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_photogallery_init'));
|
||||
add_shortcode('tek_photogallery', array($this, 'kd_photogallery_container'));
|
||||
add_shortcode('tek_photogallery_single', array($this, 'kd_photogallery_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_photogallery_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Photo gallery", "keydesign"),
|
||||
"description" => esc_html__("Responsive image gallery.", "keydesign"),
|
||||
"base" => "tek_photogallery",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_photogallery_single'),
|
||||
"icon" => plugins_url('assets/element_icons/photo-gallery.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation style","keydesign"),
|
||||
"param_name" => "pg_nav_style",
|
||||
"value" => array(
|
||||
"Arrows" => "nav-arrows",
|
||||
"Dots" => "nav-dots",
|
||||
"Arrows and dots" => "nav-arrows-dots",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select navigation style.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "pg_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "pg_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "pg_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Select autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "pg_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "pg_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable loop","keydesign"),
|
||||
"param_name" => "pg_enable_loop",
|
||||
"value" => array(
|
||||
"Off" => "loop_off",
|
||||
"On" => "loop_on",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Infinity loop. Duplicate last and first items to get loop illusion.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Transparent inactive items","keydesign"),
|
||||
"param_name" => "pg_transparent_opt",
|
||||
"value" => array(
|
||||
"Enable" => "enable-transparent-items",
|
||||
"Disable" => "disable-transparent-items",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Set a transparency layer to inactive carousel items.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
'type' => 'css_editor',
|
||||
'heading' => esc_html__( 'Css', 'keydesign' ),
|
||||
'param_name' => 'css',
|
||||
'group' => esc_html__( 'Design options', 'keydesign' ),
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => __("Child image", "keydesign"),
|
||||
"base" => "tek_photogallery_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_photogallery'),
|
||||
"icon" => plugins_url('assets/element_icons/child-image.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "pg_image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "pg_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload a image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pg_image_source",
|
||||
"value" => array("media_library"),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "pg_ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pg_image_source",
|
||||
"value" => array("external_link"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "pg_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 650x450 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pg_image_source",
|
||||
"value" => array("external_link"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("On click action", "keydesign"),
|
||||
"param_name" => "pg_click_action",
|
||||
"value" => array(
|
||||
"None" => "click_action_none",
|
||||
"Open PhotoSwipe" => "open_photoswipe",
|
||||
"Open custom link" => "custom_link",
|
||||
),
|
||||
"description" => esc_html__("Select action for click action.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image link", "keydesign"),
|
||||
"param_name" => "pg_image_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter URL if you want this image to have a link (Note: parameters like \"mailto:\" are also accepted).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pg_click_action",
|
||||
"value" => array("custom_link"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'type' => 'dropdown',
|
||||
'heading' => __( 'Link Target', 'keydesign' ),
|
||||
'param_name' => 'pg_link_target',
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
'dependency' => array(
|
||||
'element' => 'pg_click_action',
|
||||
'value' => array('custom_link'),
|
||||
),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_photogallery_container($atts, $content = null) {
|
||||
|
||||
// Declare empty vars
|
||||
$output = $photo_gallery_id = $pg_wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'pg_nav_style' => '',
|
||||
'pg_autoplay' => '',
|
||||
'pg_autoplay_speed' => '',
|
||||
'pg_stoponhover' => '',
|
||||
'pg_enable_loop' => '',
|
||||
'pg_transparent_opt' => '',
|
||||
'extra_class' => '',
|
||||
'css' => '',
|
||||
), $atts));
|
||||
|
||||
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ) );
|
||||
|
||||
$photo_gallery_id = "kd-photo-gallery-".uniqid();
|
||||
|
||||
$pg_wrapper_class = implode(' ', array('photo-gallery-wrapper', $pg_transparent_opt, $photo_gallery_id, $pg_nav_style, $extra_class, $css_class));
|
||||
|
||||
$output .= '<div class="'.trim($pg_wrapper_class).'">
|
||||
<div class="gallery-items">' . do_shortcode($content) . '</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".'.$photo_gallery_id.' .gallery-items").length) {
|
||||
$(".'.$photo_gallery_id.' .gallery-items").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
items: 1,
|
||||
rewind: true,
|
||||
responsive:{
|
||||
0:{
|
||||
dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
},
|
||||
1366:{';
|
||||
if($pg_nav_style == "nav-arrows") {
|
||||
$output .= "\n".'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
} elseif ($pg_nav_style == "nav-dots") {
|
||||
$output .= "\n".'dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
dotsEach: true,';
|
||||
} elseif ($pg_nav_style == "nav-arrows-dots") {
|
||||
$output .= "\n".'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: true,
|
||||
dotsSpeed: 500,
|
||||
dotsEach: true,';
|
||||
}
|
||||
$output .= '}
|
||||
},';
|
||||
|
||||
if($pg_enable_loop == "loop_on") {
|
||||
$output .= "\n".'loop: true,';
|
||||
}
|
||||
|
||||
if($pg_autoplay == "auto_on") {
|
||||
$output .= "\n".'autoplay: true,';
|
||||
} else {
|
||||
$output .= "\n".'autoplay: false,';
|
||||
}
|
||||
|
||||
if($pg_autoplay_speed !== "") {
|
||||
$output .= "\n".'autoplayTimeout: '.$pg_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($pg_autoplay == "auto_on" && $pg_stoponhover == "hover_on") {
|
||||
$output .= "\n".'autoplayHoverPause: true,';
|
||||
} else {
|
||||
$output .= "\n".'autoplayHoverPause: false,';
|
||||
}
|
||||
|
||||
$output .='
|
||||
addClassActive: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_photogallery_single($atts, $content = null) {
|
||||
|
||||
// Declare empty vars
|
||||
$output = $default_src = $image = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'pg_image_source' => '',
|
||||
'pg_image' => '',
|
||||
'pg_ext_image' => '',
|
||||
'pg_image_size' => '',
|
||||
'pg_click_action' => '',
|
||||
'pg_image_link' => '',
|
||||
'pg_link_target' => '',
|
||||
), $atts));
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $pg_image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
if ($pg_image_source == 'external_link') {
|
||||
$src = $pg_ext_image;
|
||||
} elseif ($pg_image_source == 'media_library' && !$image) {
|
||||
$src = $default_src;
|
||||
} else {
|
||||
$link = wp_get_attachment_image_src( $pg_image, 'large' );
|
||||
$link = $link[0];
|
||||
$src = $link;
|
||||
}
|
||||
|
||||
if ($pg_image_source == 'external_link' && !$pg_ext_image ) {
|
||||
$width = '800';
|
||||
$height = '600';
|
||||
} elseif ($pg_image_source == 'media_library' && !$image) {
|
||||
$width = '800';
|
||||
$height = '600';
|
||||
} elseif ($pg_image_source == 'external_link' && $pg_ext_image != '') {
|
||||
list($width, $height) = getimagesize($src);
|
||||
} else {
|
||||
list($width, $height) = getimagesize($link);
|
||||
}
|
||||
|
||||
$a_attrs['href'] = $pg_image_link;
|
||||
$a_attrs['target'] = $pg_link_target;
|
||||
|
||||
if ($pg_image_source == 'external_link') {
|
||||
if ($pg_ext_image != '') {
|
||||
if ($pg_click_action == 'open_photoswipe') {
|
||||
$output .= '<a data-size="' . $width. 'x' .$height .'" href='. $src . '><img class="pg-img" src="'.$pg_ext_image.'" width="'.$width.'" height="'.$height.'" /></a>';
|
||||
} elseif ($pg_click_action == 'custom_link') {
|
||||
$output .= '<a ' . vc_stringify_attributes( $a_attrs ) . '><img class="pg-img" src="'.$pg_ext_image.'" width="'.$width.'" height="'.$height.'" /></a>';
|
||||
} else {
|
||||
$output .='<img class="pg-img" src="'.$pg_ext_image.'" width="'.$width.'" height="'.$height.'" />';
|
||||
}
|
||||
} else {
|
||||
$output .='<img class="pg-img" src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
}
|
||||
} else {
|
||||
if ($image != '') {
|
||||
if ($pg_click_action == 'open_photoswipe') {
|
||||
$output .= '<a data-size="' . $width. 'x' .$height .'" href='. $src . '>' . $image['thumbnail'] . '</a>';
|
||||
} elseif ($pg_click_action == 'custom_link') {
|
||||
$output .= '<a ' . vc_stringify_attributes( $a_attrs ) . '>' . $image['thumbnail'] . '</a>';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
} else {
|
||||
$output .='<img class="pg-img" src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_photogallery')) {
|
||||
$tek_photogallery = new tek_photogallery;
|
||||
}
|
||||
?>
|
||||
378
wp-content/plugins/keydesign-addon/elements/piechart_elem.php
Normal file
378
wp-content/plugins/keydesign-addon/elements/piechart_elem.php
Normal file
@@ -0,0 +1,378 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_PIE_CHART')) {
|
||||
|
||||
class KD_ELEM_PIE_CHART extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_piechart_init'));
|
||||
add_shortcode('tek_piechart', array($this, 'kd_piechart_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_piechart_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Pie chart", "keydesign"),
|
||||
"description" => esc_html__("Animated pie chart.", "keydesign"),
|
||||
"base" => "tek_piechart",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/pie-chart.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title", "keydesign"),
|
||||
"param_name" => "pc_title",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter pie chart title here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "pc_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description", "keydesign"),
|
||||
"param_name" => "pc_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter pie chart description here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description color", "keydesign"),
|
||||
"param_name" => "pc_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Bar thickness","keydesign"),
|
||||
"param_name" => "pc_thickness",
|
||||
"value" => array(
|
||||
"Thin line" => "thin_solid",
|
||||
"Medium line" => "medium_solid",
|
||||
"Thick line" => "thick_solid"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select pie chart bar width.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Percent", "keydesign"),
|
||||
"param_name" => "pc_value",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Pie chart percent value %. Only 1-100 values accepted.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Filling bar color", "keydesign"),
|
||||
"param_name" => "pc_main_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose filling bar color. If none selected, the default theme color will be used.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Track color", "keydesign"),
|
||||
"param_name" => "pc_track_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose track color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Pie content","keydesign"),
|
||||
"param_name" => "pc_center_content",
|
||||
"value" => array(
|
||||
"No content" => "no_content",
|
||||
"Percent value" => "percent_value",
|
||||
"Icon" => "center_icon",
|
||||
"Image" => "center_image",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select pie chart center content.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pc_center_content",
|
||||
"value" => "center_icon",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "pc_icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pc_center_content",
|
||||
"value" => "center_icon",
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "pc_icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pc_center_content",
|
||||
"value" => "center_icon",
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload image icon", "keydesign"),
|
||||
"param_name" => "pc_icon_img",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload your own custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pc_center_content",
|
||||
"value" => array("center_image"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link type", "keydesign"),
|
||||
"param_name" => "pc_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( 'No link', 'keydesign' ) => '#',
|
||||
esc_html__( 'Add custom link', 'keydesign' ) => '1',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add or remove the custom link.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "pc_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pc_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link text", "keydesign"),
|
||||
"param_name" => "pc_link_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter link text here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pc_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "no_animation",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay:", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "pc_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_piechart_shrt($atts, $content = null)
|
||||
{
|
||||
// Include required JS files
|
||||
wp_enqueue_script('kd_jquery_appear');
|
||||
wp_enqueue_script('kd_easing_script');
|
||||
wp_enqueue_script('kd_easypiechart_script');
|
||||
|
||||
// Declare empty vars
|
||||
$output = $content_icon = $icon_color_style = $icon_size_style = $pc_icons = $kd_piechart_img_array = $pc_unique_id = $animation_delay = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'pc_title' => '',
|
||||
'pc_title_color' => '',
|
||||
'pc_description' => '',
|
||||
'pc_description_color' => '',
|
||||
'pc_thickness' => '',
|
||||
'pc_value' => '',
|
||||
'pc_main_color' => '',
|
||||
'pc_track_color' => '',
|
||||
'pc_center_content' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'pc_icon_color' => '',
|
||||
'pc_icon_size' => '',
|
||||
'pc_icon_img' => '',
|
||||
'pc_custom_link' => '',
|
||||
'pc_link' => '',
|
||||
'pc_link_text' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'pc_extra_class' => ''
|
||||
), $atts));
|
||||
|
||||
if( $pc_center_content == 'center_icon' ) {
|
||||
// Enqueue needed icon font.
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$pc_icons = $icon_iconsmind;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pc_icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$pc_icon_color.';';
|
||||
}
|
||||
|
||||
if ($pc_icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$pc_icon_size.';';
|
||||
}
|
||||
|
||||
$bar_width = '3';
|
||||
if( $pc_thickness == 'thin_solid' ) { $bar_width = '3'; }
|
||||
if( $pc_thickness == 'medium_solid' ) { $bar_width = '5'; }
|
||||
if( $pc_thickness == 'thick_solid' ) { $bar_width = '7'; }
|
||||
|
||||
if( $pc_center_content == 'center_icon' && !empty($pc_icons) ) {
|
||||
$content_icon = '<i class="'.$pc_icons .' fa" style="'.$icon_size_style.' '.$icon_color_style.'"></i>';
|
||||
}
|
||||
elseif($pc_center_content == 'center_image' && !empty($pc_icon_img)){
|
||||
$kd_piechart_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $pc_icon_img, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_icon = $kd_piechart_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
$href = vc_build_link($pc_link);
|
||||
if ($href['target'] == "") { $href['target'] = "_self"; }
|
||||
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target'])) ? ' target="'.$href['target'].'"' : 'target="_self"';
|
||||
$link_title = (isset($href['title'])) ? ' title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output .= '<div class="kd_pie_chart '.$css_animation.' '.$pc_extra_class.'" '.$animation_delay.'>';
|
||||
$output .='<span class="kd_chart" data-bar-color="'.$pc_main_color.'" '.(!empty($pc_track_color) ? 'data-track-color="'.$pc_track_color.'"' : '').' data-line-width="'.$bar_width.'" data-percent="'.$pc_value.'">';
|
||||
if($pc_center_content == 'percent_value') {
|
||||
$output .='<span class="pc_percent_container" '.(!empty($pc_title_color) ? 'style="color: '.$pc_title_color.';"' : '').'><span class="pc_percent"></span>%</span>';
|
||||
} elseif ($pc_center_content == 'center_icon') {
|
||||
$output .= '<div class="kd-piechart-icon" '.(!empty($pc_title_color) ? 'style="color: '.$pc_title_color.';"' : '').'>';
|
||||
$output .= $content_icon;
|
||||
$output .= '</div>';
|
||||
} elseif ($pc_center_content == 'center_image') {
|
||||
$output .= '<div class="kd-piechart-customimg">';
|
||||
$output .= $content_icon;
|
||||
$output .= '</div>';
|
||||
} elseif ($pc_center_content == 'no_content') {
|
||||
$output .= '';
|
||||
}
|
||||
$output .='</span>';
|
||||
if(!empty($pc_title)) { $output .= '<h5 class="kd_pc_title" '.(!empty($pc_title_color) ? 'style="color: '.$pc_title_color.';"' : '').'>'.esc_html__($pc_title).'</h5>'; }
|
||||
if(!empty($pc_description)) { $output .= '<p class="kd_pc_desc" '.(!empty($pc_description_color) ? 'style="color: '.$pc_description_color.';"' : '').'>'.esc_html__($pc_description).'</p>'; }
|
||||
if ($pc_custom_link == "1") {
|
||||
$output .= '<p class="pc-link"><a href="'.$href['url'].'"'.$link_target.''.$link_title.'>'.$pc_link_text.'</a></p>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_PIE_CHART')) {
|
||||
$KD_ELEM_PIE_CHART = new KD_ELEM_PIE_CHART;
|
||||
}
|
||||
|
||||
?>
|
||||
308
wp-content/plugins/keydesign-addon/elements/priceblock_elem.php
Normal file
308
wp-content/plugins/keydesign-addon/elements/priceblock_elem.php
Normal file
@@ -0,0 +1,308 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_PRICE_BLOCK')) {
|
||||
|
||||
class KD_ELEM_PRICE_BLOCK extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_priceblock_init'));
|
||||
add_shortcode('tek_priceblock', array($this, 'kd_priceblock_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_priceblock_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Price block", "keydesign"),
|
||||
"description" => esc_html__("Price block with thumb image.", "keydesign"),
|
||||
"base" => "tek_priceblock",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/price-block.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Block title", "keydesign"),
|
||||
"param_name" => "pb_title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Price block title.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "pb_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Block description", "keydesign"),
|
||||
"param_name" => "pb_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Price block description.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description color", "keydesign"),
|
||||
"param_name" => "pb_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Block image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Block image", "keydesign"),
|
||||
"param_name" => "pb_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload your image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Block external image", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Price", "keydesign"),
|
||||
"param_name" => "pb_price",
|
||||
"admin_label" => true,
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter product price.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Price currency", "keydesign"),
|
||||
"param_name" => "pb_currency",
|
||||
"value" => array(
|
||||
"Dollar" => "currency-dollar",
|
||||
"Euro" => "currency-euro",
|
||||
"Pound" => "currency-pound"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select price currency.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Other currency", "keydesign"),
|
||||
"param_name" => "pb_other_currency",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Pricing block custom currency.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Currency symbol position", "keydesign"),
|
||||
"param_name" => "pb_currency_position",
|
||||
"value" => array(
|
||||
"Left" => "currency-position-left",
|
||||
"Right" => "currency-position-right"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select price block currency symbol position.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Price color", "keydesign"),
|
||||
"param_name" => "pb_price_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select pret color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "pb_background_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select box background color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "no_animation",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__("Extras", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__("Extras", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "pb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__("Extras", "keydesign"),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_priceblock_shrt($atts, $content = null)
|
||||
{
|
||||
|
||||
// Include required JS and CSS files
|
||||
wp_enqueue_script('kd_jquery_appear');
|
||||
|
||||
// Declare empty vars
|
||||
$output = $pb_img_array = $product_image = $currency_symbol = $content_image = $animation_delay = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'pb_title' => '',
|
||||
'pb_title_color' => '',
|
||||
'pb_description' => '',
|
||||
'pb_description_color' => '',
|
||||
'image_source' => '',
|
||||
'pb_image' => '',
|
||||
'ext_image' => '',
|
||||
'pb_price' => '',
|
||||
'pb_currency' => '',
|
||||
'pb_other_currency' => '',
|
||||
'pb_currency_position' => '',
|
||||
'pb_price_color' => '',
|
||||
'pb_background_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'pb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
switch($pb_currency){
|
||||
case 'currency-dollar':
|
||||
$currency_symbol = "$";
|
||||
break;
|
||||
|
||||
case 'currency-euro':
|
||||
$currency_symbol = "€";
|
||||
break;
|
||||
|
||||
case 'currency-pound':
|
||||
$currency_symbol = "£";
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
if (!empty($pb_other_currency)) {
|
||||
$currency_symbol = $pb_other_currency;
|
||||
}
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$content_image .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$content_image .='<img src="'.$ext_image.'" />';
|
||||
}
|
||||
} else {
|
||||
$block_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $pb_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_image = $block_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
|
||||
$output = '<div class="kd-price-block '.$css_animation.' '.$pb_extra_class.'" '.(!empty($pb_background_color) ? 'style="background-color: '.$pb_background_color.';"' : '').' '.$animation_delay.'>';
|
||||
if ($content_image != '') {
|
||||
$output .= '<div class="pb-image-wrap">'.$content_image.'</div>';
|
||||
}
|
||||
$output .= '<div class="pb-content-wrap">
|
||||
<h5 '.(!empty($pb_title_color) ? 'style="color: '.$pb_title_color.';"' : '').'>'.$pb_title.'</h5>
|
||||
<div class="pb-dots"></div>';
|
||||
if ($pb_currency_position == "currency-position-left") {
|
||||
$output .= '<div class="pb-pricing-wrap"><h5 class="pb-price" '.(!empty($pb_price_color) ? 'style="color: '.$pb_price_color.';"' : '').'><span class="pb-currency">'.$currency_symbol.'</span>'.$pb_price.'</h5></div>';
|
||||
} elseif ($pb_currency_position == "currency-position-right") {
|
||||
$output .= '<div class="pb-pricing-wrap"><h5 class="pb-price" '.(!empty($pb_price_color) ? 'style="color: '.$pb_price_color.';"' : '').'>'.$pb_price.'<span class="pb-currency">'.$currency_symbol.'</span></h5></div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="pb-desc-wrap" '.(!empty($pb_description_color) ? 'style="color: '.$pb_description_color.';"' : '').'>'.$pb_description.'</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_PRICE_BLOCK')) {
|
||||
$KD_ELEM_PRICE_BLOCK = new KD_ELEM_PRICE_BLOCK;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,543 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_PRICING_TABLE')) {
|
||||
class KD_ELEM_PRICING_TABLE extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_pricingtable_init'));
|
||||
add_shortcode('tek_pricing', array($this, 'kd_pricingtable_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_pricingtable_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Pricing table", "keydesign"),
|
||||
"description" => esc_html__("Pricing table with extended settings.", "keydesign"),
|
||||
"base" => "tek_pricing",
|
||||
"class" => "",
|
||||
"icon" => plugins_url("assets/element_icons/pricing-table.png", dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Plan title", "keydesign"),
|
||||
"param_name" => "pricing_title",
|
||||
"admin_label" => true,
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter your pricing plan title.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Plan value", "keydesign"),
|
||||
"param_name" => "pricing_price",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter price for this plan.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Plan period", "keydesign"),
|
||||
"param_name" => "pricing_time",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter your pricing plan period (ex. /month)", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Plan currency", "keydesign"),
|
||||
"param_name" => "pricing_currency",
|
||||
"value" => array(
|
||||
"Dollar" => "currency-dollar",
|
||||
"Euro" => "currency-euro",
|
||||
"Pound" => "currency-pound"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select pricing plan currency.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Other currency", "keydesign"),
|
||||
"param_name" => "pricing_other_currency",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Pricing plan custom currency.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Currency position", "keydesign"),
|
||||
"param_name" => "pricing_currency_position",
|
||||
"value" => array(
|
||||
"Left" => "currency-position-left",
|
||||
"Right" => "currency-position-right"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select pricing plan currency.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon/image","keydesign"),
|
||||
"param_name" => "pricing_icon_type",
|
||||
"value" => array(
|
||||
"Icon browser" => "icon_browser",
|
||||
"Media library" => "custom_image",
|
||||
"External image" => "external_link",
|
||||
"No icon" => "no_icon",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon source.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pricing_icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "pricing_icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pricing_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "pricing_icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pricing_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload custom image", "keydesign"),
|
||||
"param_name" => "pricing_img",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload your own custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pricing_icon_type",
|
||||
"value" => array("custom_image"),
|
||||
),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pricing_icon_type",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("External image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 300x160 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pricing_icon_type",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "param_group",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Pricing option", "keydesign"),
|
||||
"value" => "",
|
||||
"param_name" => "pricing_option",
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"heading" => __("Option value","keydesign"),
|
||||
"param_name" => "pricing_row",
|
||||
"description" =>"",
|
||||
"admin_label" => true,
|
||||
),
|
||||
),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "pricing_button_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Pricing table button text.", "keydesign"),
|
||||
"group" => esc_html__("Button settings", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button link", "keydesign"),
|
||||
"param_name" => "pricing_button_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add link to button.", "keydesign"),
|
||||
"group" => esc_html__("Button settings", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"heading" => __( "Link target", "keydesign" ),
|
||||
"param_name" => "pricing_link_target",
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
"group" => esc_html__("Button settings", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button icon settings", "keydesign"),
|
||||
"param_name" => "pricing_button_enable_icon",
|
||||
"value" => array(
|
||||
"No icon" => "no",
|
||||
"Display icon" => "yes",
|
||||
),
|
||||
"save_always" => true,
|
||||
"group" => esc_html__("Button settings", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon database", "keydesign"),
|
||||
"param_name" => "pricing_button_icon",
|
||||
"dependency" => array(
|
||||
"element" => "pricing_button_enable_icon",
|
||||
"value" => array("yes")
|
||||
),
|
||||
"description" => esc_html__("Select your icon.", "keydesign"),
|
||||
"group" => esc_html__("Button settings", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon position", "keydesign"),
|
||||
"param_name" => "pricing_button_icon_position",
|
||||
"value" => array(
|
||||
"Left" => "icon_left",
|
||||
"Right" => "icon_right",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pricing_button_enable_icon",
|
||||
"value" => array("yes")
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon position.", "keydesign"),
|
||||
"group" => esc_html__("Button settings", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Pricing table style", "keydesign"),
|
||||
"param_name" => "pricing_scheme",
|
||||
"value" => array(
|
||||
"Minimal style" => "MinimalStyle",
|
||||
"Detailed style" => "DetailedStyle"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select pricing plan template style.", "keydesign"),
|
||||
"group" => esc_html__("Design options", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Highlight plan", "keydesign"),
|
||||
"param_name" => "highlight_plan",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Yes" => "active"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select if pricing plan is highlighted", "keydesign"),
|
||||
"group" => esc_html__("Design options", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text color", "keydesign"),
|
||||
"param_name" => "pricing_text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select text color.", "keydesign"),
|
||||
"group" => esc_html__("Design options", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__("Extras", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__("Extras", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "pricing_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__("Extras", "keydesign"),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_pricingtable_shrt($atts, $content = null) {
|
||||
|
||||
$output = $link_target = $link_title = $animation_delay = $wrapper_class = $a_attrs = '';
|
||||
$currency_symbol = $icon_custom_style = $icons = $content_icon = $pricing_options_container = $dimensions = $hwstring = $button_style_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'pricing_title' => '',
|
||||
'pricing_price' => '',
|
||||
'pricing_time' => '',
|
||||
'pricing_currency' => '',
|
||||
'pricing_other_currency' => '',
|
||||
'pricing_currency_position' => '',
|
||||
'pricing_icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'pricing_icon_color' => '',
|
||||
'pricing_icon_size' => '',
|
||||
'pricing_img' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'pricing_option' => '',
|
||||
'pricing_button_text' => '',
|
||||
'pricing_button_link' => '',
|
||||
'pricing_link_target' => '',
|
||||
'pricing_button_enable_icon' => '',
|
||||
'pricing_button_icon' => '',
|
||||
'pricing_button_icon_position' => '',
|
||||
'pricing_scheme' => '',
|
||||
'highlight_plan' => '',
|
||||
'pricing_text_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'pricing_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
if( $pricing_icon_type == 'icon_browser' || $pricing_button_icon == 'yes' ) {
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
switch($pricing_currency){
|
||||
case 'currency-dollar':
|
||||
$currency_symbol = "$";
|
||||
break;
|
||||
|
||||
case 'currency-euro':
|
||||
$currency_symbol = "€";
|
||||
break;
|
||||
|
||||
case 'currency-pound':
|
||||
$currency_symbol = "£";
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$icons = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($pricing_icon_color !== '') {
|
||||
$icon_custom_style .= 'color: '.$pricing_icon_color.';';
|
||||
}
|
||||
|
||||
if ($pricing_icon_size !== '') {
|
||||
$icon_custom_style .= 'font-size: '.$pricing_icon_size.';';
|
||||
}
|
||||
|
||||
if (!empty($pricing_other_currency)) {
|
||||
$currency_symbol = $pricing_other_currency;
|
||||
}
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ( $pricing_icon_type == 'icon_browser' ) {
|
||||
$content_icon .= '<i class="' . $icons . ' fa" style="' . $icon_custom_style . '"></i> ';
|
||||
} elseif ( $pricing_icon_type == 'custom_image' && !empty($pricing_img) ) {
|
||||
$pricing_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $pricing_img, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_icon .= '<div class="pricing-image">'.$pricing_img_array['thumbnail'].'</div>';
|
||||
} elseif ( $pricing_icon_type == 'external_link' && !empty($ext_image) ) {
|
||||
$content_icon .= '<div class="pricing-image"><img src="'.$ext_image.'" '.$hwstring.' /></div>';
|
||||
}
|
||||
|
||||
//Button class
|
||||
if ($highlight_plan == "active") {
|
||||
$button_style_class = "tt_primary_button";
|
||||
} else {
|
||||
$button_style_class = "tt_secondary_button";
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('pricing-table', $highlight_plan, $pricing_scheme, $css_animation, $pricing_extra_class));
|
||||
|
||||
// Pricing options container
|
||||
$pricing_options_container .= '<div class="pricing-options-container ' . $pricing_scheme . '" '.(!empty($pricing_text_color) ? 'style="color: '.$pricing_text_color.';"' : '').'>';
|
||||
$pricing_option = json_decode( urldecode( $pricing_option ), true );
|
||||
|
||||
if( isset( $pricing_option ) ) {
|
||||
foreach ( $pricing_option as $pricing_option_data ){
|
||||
$pricing_options_container .= '<div class="pricing-row"><span class="pricing-value"><span class="pricing-option"><i class="fa fa-check" '.(!empty($pricing_text_color) ? 'style="color: '.$pricing_text_color.';"' : '').'></i>';
|
||||
if ( isset( $pricing_option_data["pricing_row"] ) ){
|
||||
$pricing_options_container .= $pricing_option_data["pricing_row"];
|
||||
}
|
||||
$pricing_options_container .= '</span></span></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$pricing_options_container .= '</div>';
|
||||
|
||||
// Begin element output
|
||||
$output = '<div class="pricing-wrapper">
|
||||
<div class="'.trim($wrapper_class).'" '.$animation_delay.'>
|
||||
<div class="row pricing-title">
|
||||
<h5 class="pricing-title-content" '.(!empty($pricing_text_color) ? 'style="color: '.$pricing_text_color.';"' : '').'>'.$pricing_title.'</h5>
|
||||
</div>
|
||||
<div class="pricing-img">'.$content_icon.'</div>
|
||||
<div class="row pricing">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="row">';
|
||||
if ($pricing_currency_position == "currency-position-left") {
|
||||
$output .= '<span class="pricing-price"><span class="currency">'.$currency_symbol.'</span>'.$pricing_price.'</span>';
|
||||
} elseif ($pricing_currency_position == "currency-position-right") {
|
||||
$output .= '<span class="pricing-price">'.$pricing_price.'<span class="currency">'.$currency_symbol.'</span></span>';
|
||||
}
|
||||
$output .= '<div class="pricing-meta">
|
||||
<span class="pricing-time" '.(!empty($pricing_text_color) ? 'style="color: '.$pricing_text_color.';"' : '').'>'.$pricing_time.'</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
$output .= $pricing_options_container;
|
||||
|
||||
if ($pricing_button_text) {
|
||||
$output .= '<a href="'.$pricing_button_link.'" target="'.$pricing_link_target.'" class="tt_button '.$pricing_button_icon_position.' '.$button_style_class.'">';
|
||||
if ($pricing_button_enable_icon == 'yes' && $pricing_button_icon_position == 'icon_left') {
|
||||
$output .= '<span class="'.$pricing_button_icon.' iconita"></span>';
|
||||
}
|
||||
$output .= '<span class="prim_text">'.$pricing_button_text.'</span>';
|
||||
if ($pricing_button_enable_icon == 'yes' && $pricing_button_icon_position == 'icon_right') {
|
||||
$output .= '<span class="'.$pricing_button_icon.' iconita"></span>';
|
||||
}
|
||||
$output .= '</a>';
|
||||
}
|
||||
|
||||
$output .= '</div>
|
||||
</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_PRICING_TABLE')) {
|
||||
$KD_ELEM_PRICING_TABLE = new KD_ELEM_PRICING_TABLE;
|
||||
}
|
||||
?>
|
||||
476
wp-content/plugins/keydesign-addon/elements/process_elem.php
Normal file
476
wp-content/plugins/keydesign-addon/elements/process_elem.php
Normal file
@@ -0,0 +1,476 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_process extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_process_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_process')) {
|
||||
class tek_process extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_process_init'));
|
||||
add_shortcode('tek_process', array($this, 'kd_process_container'));
|
||||
add_shortcode('tek_process_single', array($this, 'kd_process_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_process_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Process steps", "keydesign"),
|
||||
"description" => esc_html__("Process steps builder.", "keydesign"),
|
||||
"base" => "tek_process",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_process_single'),
|
||||
"icon" => plugins_url('assets/element_icons/process-steps.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Template style","keydesign"),
|
||||
"param_name" => "ps_template_style",
|
||||
"value" => array(
|
||||
esc_html__( 'Process flowchart', 'keydesign' ) => "process-checkbox-template",
|
||||
esc_html__( 'Process boxes', 'keydesign' ) => "process-number-template",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Number of elements","keydesign"),
|
||||
"param_name" => "ps_elements",
|
||||
"value" => array(
|
||||
"Three elements" => "process_three_elem",
|
||||
"Four elements" => "process_four_elem",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select number of elements in this process.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "ps_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Single process step", "keydesign"),
|
||||
"base" => "tek_process_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_process'),
|
||||
"icon" => plugins_url('assets/element_icons/child-tabs.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Title", "keydesign"),
|
||||
"param_name" => "pss_title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter step title.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "pss_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description", "keydesign"),
|
||||
"param_name" => "pss_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter step description.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description color", "keydesign"),
|
||||
"param_name" => "pss_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display step number","keydesign"),
|
||||
"param_name" => "pss_display_number",
|
||||
"value" => array(
|
||||
esc_html__( 'Yes', 'keydesign' ) => "process_number_on",
|
||||
esc_html__( 'No', 'keydesign' ) => "process_number_off",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Step number", "keydesign"),
|
||||
"param_name" => "pss_number",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pss_display_number",
|
||||
"value" => array("process_number_on")
|
||||
),
|
||||
"description" => esc_html__("Enter the step number.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Step number color", "keydesign"),
|
||||
"param_name" => "pss_number_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pss_display_number",
|
||||
"value" => array("process_number_on")
|
||||
),
|
||||
"description" => esc_html__("Select step number color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon","keydesign"),
|
||||
"param_name" => "pss_icon_type",
|
||||
"value" => array(
|
||||
"No icon" => "no_icon",
|
||||
"Icon browser" => "icon_browser",
|
||||
"Custom image" => "custom_image",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon source.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pss_icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "pss_icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pss_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "pss_icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pss_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload image", "keydesign"),
|
||||
"param_name" => "pss_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload your own custom image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pss_icon_type",
|
||||
"value" => array("custom_image"),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background type", "keydesign"),
|
||||
"param_name" => "pss_background_type",
|
||||
"value" => array(
|
||||
esc_html__( 'Default', 'keydesign' ) => 'default_bg_color',
|
||||
esc_html__( 'Custom color', 'keydesign' ) => 'custom_bg_color',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select box background type.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Background color", "keydesign"),
|
||||
"param_name" => "pss_background_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pss_background_type",
|
||||
"value" => array( "custom_bg_color" ),
|
||||
),
|
||||
"description" => esc_html__("Select box background color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Border color", "keydesign"),
|
||||
"param_name" => "pss_border_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose box border color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link type", "keydesign"),
|
||||
"param_name" => "pss_custom_link",
|
||||
"value" => array(
|
||||
esc_html__( 'No link', 'keydesign' ) => '#',
|
||||
esc_html__( 'Button link', 'keydesign' ) => '1',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add/remove custom link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "pss_link_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter button text here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pss_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link settings", "keydesign"),
|
||||
"param_name" => "pss_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pss_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button style", "keydesign"),
|
||||
"param_name" => "pss_button_style",
|
||||
"value" => array(
|
||||
"Solid color" => "",
|
||||
"Outline" => "tt_secondary_button",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pss_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
"description" => esc_html__("Select button style.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button color scheme", "keydesign"),
|
||||
"param_name" => "pss_button_color_scheme",
|
||||
"value" => array(
|
||||
"Primary color" => "btn_primary_color",
|
||||
"Secondary color" => "btn_secondary_color",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pss_custom_link",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
"description" => esc_html__("Select button predefined color scheme.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "no_animation",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"admin_label" => true,
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"admin_label" => true,
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "pss_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_process_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'ps_template_style' => '',
|
||||
'ps_elements' => '',
|
||||
'ps_extra_class' => ''
|
||||
), $atts));
|
||||
|
||||
$output = '
|
||||
<div class="kd-process-steps '.$ps_elements.' '.$ps_template_style.' '.$ps_extra_class.'">
|
||||
<ul>'.do_shortcode($content).'</ul>
|
||||
</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_process_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'pss_title' => '',
|
||||
'pss_title_color' => '',
|
||||
'pss_description' => '',
|
||||
'pss_description_color' => '',
|
||||
'pss_display_number' => '',
|
||||
'pss_number' => '',
|
||||
'pss_number_color' => '',
|
||||
'pss_icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'pss_icon_color' => '',
|
||||
'pss_icon_size' => '',
|
||||
'pss_image' => '',
|
||||
'pss_background_type' => '',
|
||||
'pss_background_color' => '',
|
||||
'pss_border_color' => '',
|
||||
'pss_custom_link' => '',
|
||||
'pss_link_text' => '',
|
||||
'pss_link' => '',
|
||||
'pss_button_style' => '',
|
||||
'pss_button_color_scheme' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'pss_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$content_icon = $icon_color_style = $icon_size_style = $link_title = $link_target = $pss_icon = $pss_custom_style = $animation_delay = '';
|
||||
|
||||
if( $pss_icon_type == 'icon_browser' ) {
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
}
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$pss_icon = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($pss_icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$pss_icon_color.';';
|
||||
}
|
||||
|
||||
if ($pss_icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$pss_icon_size.';';
|
||||
}
|
||||
|
||||
$href = vc_build_link($pss_link);
|
||||
if ($href['target'] == "") { $href['target'] = "_self"; }
|
||||
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target'])) ? ' target="'.$href['target'].'"' : 'target="_self"';
|
||||
$link_title = (isset($href['title'])) ? ' title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
if( $pss_icon_type == 'icon_browser' && !empty($pss_icon) ) {
|
||||
$content_icon = '<div class="process-icon"><i class="'.$pss_icon .' fa" style="'.$icon_size_style.' '.$icon_color_style.'"></i></div>';
|
||||
}
|
||||
elseif($pss_icon_type == 'custom_image' && !empty($pss_image)){
|
||||
$ps_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $pss_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_icon = '<div class="process-customimg">'.$ps_img_array['thumbnail'].'</div>';
|
||||
}
|
||||
|
||||
// Box custom styles
|
||||
if(($pss_background_type != 'default_bg_color') && ($pss_background_color != '')) {
|
||||
$pss_custom_style .= 'background-color: ' . $pss_background_color . ';';
|
||||
}
|
||||
|
||||
if($pss_border_color != '') {
|
||||
$pss_custom_style .= 'border-color: ' . $pss_border_color . ';';
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output = '
|
||||
<li class="pss-item" '.(!empty($pss_custom_style) ? 'style="' . $pss_custom_style . '"' : '').'>
|
||||
<div class="pss-container '.$css_animation.' '.$pss_extra_class.'" '.$animation_delay.'>';
|
||||
if($pss_display_number == "process_number_on") {
|
||||
$output .= '<div class="pss-step-number"><span '.(!empty($pss_number_color) ? 'style="color: '.$pss_number_color.';"' : '').'>'.$pss_number.'</span></div>';
|
||||
}
|
||||
if($pss_icon_type != 'no_icon') {
|
||||
$output .= '<div class="pss-img-area">'.$content_icon.'</div>';
|
||||
}
|
||||
$output .= '<div class="pss-text-area">
|
||||
<h5 '.(!empty($pss_title_color) ? 'style="color: '.$pss_title_color.';"' : '').'>'.$pss_title.'</h5>
|
||||
<p '.(!empty($pss_description_color) ? 'style="color: '.$pss_description_color.';"' : '').'>'.$pss_description.'</p>';
|
||||
if($pss_custom_link == "1") {
|
||||
$output .= '<a class="tt_button '.$pss_button_style.' '.$pss_button_color_scheme.'" href="'.$href['url'].'"'.$link_target.''.$link_title.'>'.$pss_link_text.'</a>';
|
||||
}
|
||||
$output .= '</div>
|
||||
</div>
|
||||
</li>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_process')) {
|
||||
$tek_process = new tek_process;
|
||||
}
|
||||
?>
|
||||
367
wp-content/plugins/keydesign-addon/elements/progressbar_elem.php
Normal file
367
wp-content/plugins/keydesign-addon/elements/progressbar_elem.php
Normal file
@@ -0,0 +1,367 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_PROGRESSBAR')) {
|
||||
|
||||
class KD_ELEM_PROGRESSBAR extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_progressbar_init'));
|
||||
add_shortcode('tek_progress_bar', array($this, 'kd_progressbar_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_progressbar_init() {
|
||||
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Progress bar", "keydesign"),
|
||||
"description" => esc_html__("Animated progress bar with counter.", "keydesign"),
|
||||
"base" => "tek_progress_bar",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/progress-bar.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Bar heading","keydesign"),
|
||||
"param_name" => "pb_heading",
|
||||
"value" => array(
|
||||
"Static text" => "static_text",
|
||||
"Counter" => "counter"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select your progress bar heading.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title", 'keydesign'),
|
||||
"param_name" => "pb_title",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter progress bar title.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pb_heading",
|
||||
"value" => array("static_text"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Display icon","keydesign"),
|
||||
"param_name" => "pb_icon_type",
|
||||
"value" => array(
|
||||
"No icon" => "no_icon",
|
||||
"Icon Browser" => "icon_browser",
|
||||
"Custom Icon" => "custom_icon",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Icon will be displayed in front of title.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "pb_heading",
|
||||
"value" => array("static_text"),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "iconpicker",
|
||||
"heading" => esc_html__( "Icon", "keydesign" ),
|
||||
"param_name" => "icon_iconsmind",
|
||||
"settings" => array(
|
||||
"type" => "iconsmind",
|
||||
"iconsPerPage" => 50,
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "pb_icon_type",
|
||||
"value" => "icon_browser",
|
||||
),
|
||||
"description" => esc_html__( "Select icon from library.", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "pb_icon_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pb_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Choose icon color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon size", "keydesign"),
|
||||
"param_name" => "pb_icon_size",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pb_icon_type",
|
||||
"value" => array("icon_browser")
|
||||
),
|
||||
"description" => esc_html__("Enter icon size. (eg. 10px, 1em, 1rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Upload image icon", "keydesign"),
|
||||
"param_name" => "pb_icon_img",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "pb_icon_type",
|
||||
"value" => array("custom_icon"),
|
||||
),
|
||||
"description" => esc_html__("Upload your own custom image.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Show value marker", "keydesign"),
|
||||
"param_name" => "pb_progress_marker",
|
||||
"value" => array(
|
||||
"No" => "marker_no",
|
||||
"Yes" => "marker_yes",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "pb_heading",
|
||||
"value" => array("static_text"),
|
||||
),
|
||||
"description" => esc_html__("Value marker for your progress bar.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Progress bar value", "keydesign"),
|
||||
"param_name" => "pb_progressbar_value",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Progress bar filling value %. Only 1-100 values accepted.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Progress bar filling time", "keydesign"),
|
||||
"param_name" => "pb_progressbar_filltime",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Filling duration measured in seconds.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description", "keydesign"),
|
||||
"param_name" => "pb_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Displayed under the progress bar.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Bar line thickness","keydesign"),
|
||||
"param_name" => "pb_thickness",
|
||||
"value" => array(
|
||||
"Thin line" => "thin-solid",
|
||||
"Medium line" => "medium-solid",
|
||||
"Thick line" => "thick-solid"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select bar thickness.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Element color", "keydesign"),
|
||||
"param_name" => "pb_main_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Overwrite default title and active progress bar color.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "no_animation",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay:", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "pb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_progressbar_shrt($atts, $content = null)
|
||||
{
|
||||
|
||||
// Include required JS files
|
||||
wp_enqueue_script('kd_jquery_appear');
|
||||
wp_enqueue_script('kd_progressbar');
|
||||
|
||||
// Declare empty vars
|
||||
$output = $content_icon = $icon_color_style = $icon_size_style = $counter_id = $pb_icon_font = $css_class = $animation_delay = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'pb_heading' => '',
|
||||
'pb_title' => '',
|
||||
'pb_icon_type' => '',
|
||||
'icon_iconsmind' => '',
|
||||
'pb_icon_color' => '',
|
||||
'pb_icon_size' => '',
|
||||
'pb_icon_img' => '',
|
||||
'pb_progress_marker' => '',
|
||||
'pb_progressbar_value' => '',
|
||||
'pb_progressbar_filltime' => '',
|
||||
'pb_description' => '',
|
||||
'pb_thickness' => '',
|
||||
'pb_main_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'pb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$counter_id .= 'kd-counter-'.uniqid();
|
||||
if($pb_heading == 'counter') {
|
||||
wp_enqueue_script('kd_countto');
|
||||
|
||||
$js = '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(function($) {
|
||||
|
||||
$(".'.$counter_id.'").appear(function() {
|
||||
$(this).countTo();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
$output .= $js;
|
||||
}
|
||||
|
||||
if( $pb_icon_type == 'icon_browser' ) {
|
||||
// Enqueue needed icon font.
|
||||
wp_enqueue_style( 'kd_iconsmind' );
|
||||
|
||||
if (strlen($icon_iconsmind) > 0) {
|
||||
$pb_icon_font = $icon_iconsmind;
|
||||
}
|
||||
|
||||
if ($pb_icon_color !== '') {
|
||||
$icon_color_style = 'color: '.$pb_icon_color.';';
|
||||
}
|
||||
|
||||
if ($pb_icon_size !== '') {
|
||||
$icon_size_style = 'font-size: '.$pb_icon_size.';';
|
||||
}
|
||||
}
|
||||
|
||||
if( $pb_icon_type == 'icon_browser' && !empty($pb_icon_font) ) {
|
||||
$content_icon = '<div class="kd-progress-icon"><i class="'.$pb_icon_font .' fa" style="'.$icon_size_style.' '.$icon_color_style.'"></i></div>';
|
||||
}
|
||||
elseif($pb_icon_type == 'custom_icon' && !empty($pb_icon_img)){
|
||||
$kd_progress_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $pb_icon_img, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_icon = '<div class="kd-progress-customimg">'.$kd_progress_img_array['thumbnail'].'</div>';
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output .= '<div class="kd_progress_bar '.$css_animation.' '.esc_attr( $pb_extra_class ).'" '.$animation_delay.'>';
|
||||
$output .= '<div class="kd_progb_head">';
|
||||
if($pb_heading == 'static_text') {
|
||||
$output .= '<div class="kd-progb-static">';
|
||||
$output .= $content_icon;
|
||||
$output .= '<div class="kd-progb-title"><h4 '.(!empty($pb_main_color) ? 'style="color: '.$pb_main_color.';"' : '').'>'.$pb_title.'</h4></div>';
|
||||
if($pb_progress_marker !== 'marker_no' && $pb_heading == 'static_text') {
|
||||
$output .= '<span class="kd_progressbarmarker" '.(!empty($pb_main_color) ? 'style="color: '.$pb_main_color.';"' : '').'>'.$pb_progressbar_value.'%</span>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
} elseif ($pb_heading == 'counter') {
|
||||
$output .= '<div class="kd-progb-counter">';
|
||||
$output .= '<span class="pb_counter_number '.$counter_id.'" '.(!empty($pb_main_color) ? 'style="color: '.$pb_main_color.';"' : '').' data-from="0" data-to="'.$pb_progressbar_value.'" data-speed="'.($pb_progressbar_filltime*1000).'" data-refresh-interval="50">0</span> <span class="pb_counter_units" '.(!empty($pb_main_color) ? 'style="color: '.$pb_main_color.';"' : '').'>%</span>';
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="kd_progressbarfull '.$pb_thickness.'">
|
||||
<div class="kd_progressbarfill" '.(!empty($pb_main_color) ? 'style="background-color: '.$pb_main_color.';"' : '').' data-value="'.$pb_progressbar_value.'" data-time="'.($pb_progressbar_filltime*1000).'">
|
||||
</div>';
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="kd_progb_desc">'.$pb_description.'</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_PROGRESSBAR')) {
|
||||
$KD_ELEM_PROGRESSBAR = new KD_ELEM_PROGRESSBAR;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,538 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_reviewcarousel extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_reviewcarousel_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_reviewcarousel')) {
|
||||
class tek_reviewcarousel extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_reviewcarousel_init'));
|
||||
add_shortcode('tek_reviewcarousel', array($this, 'kd_reviewcarousel_container'));
|
||||
add_shortcode('tek_reviewcarousel_single', array($this, 'kd_reviewcarousel_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_reviewcarousel_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Reviews carousel", "keydesign"),
|
||||
"description" => esc_html__("List all your client reviews in a carousel.", "keydesign"),
|
||||
"base" => "tek_reviewcarousel",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_reviewcarousel_single'),
|
||||
"icon" => plugins_url('assets/element_icons/review-carousel.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation style","keydesign"),
|
||||
"param_name" => "rwp_nav_style",
|
||||
"value" => array(
|
||||
"Arrows" => "nav-arrows",
|
||||
"Dots" => "nav-dots",
|
||||
"Arrows and dots" => "nav-arrows-dots",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select navigation style.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation color", "keydesign"),
|
||||
"param_name" => "rwp_navigation_color",
|
||||
"value" => array(
|
||||
"Black" => "black-navigation",
|
||||
"White" => "white-navigation",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select the navigation color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "rwp_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "rwp_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "rwp_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "rwp_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "rwp_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "rwp_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Review item", "keydesign"),
|
||||
"base" => "tek_reviewcarousel_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_reviewcarousel'),
|
||||
"icon" => plugins_url('assets/element_icons/reviews.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Author name", "keydesign"),
|
||||
"param_name" => "rw_author_name",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the review author name.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author name text color", "keydesign"),
|
||||
"param_name" => "rw_author_name_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose author name text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author description", "keydesign"),
|
||||
"param_name" => "rw_author_desc",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the review author description.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author description text color", "keydesign"),
|
||||
"param_name" => "rw_author_desc_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose author description text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author profile image", "keydesign"),
|
||||
"param_name" => "rw_author_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload author profile image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 230x400 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Review message", "keydesign"),
|
||||
"param_name" => "rw_review_message",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the review message.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Review message text color", "keydesign"),
|
||||
"param_name" => "rw_review_message_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose review message text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Show star rating","keydesign"),
|
||||
"param_name" => "rw_show_review_rating",
|
||||
"value" => array(
|
||||
"Show star rating" => "show_stars",
|
||||
"Hide star rating" => "hide_stars"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Display stars rating.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Review rating","keydesign"),
|
||||
"param_name" => "rw_review_rating",
|
||||
"value" => array(
|
||||
"1 star" => "one_star",
|
||||
"2 stars" => "two_stars",
|
||||
"3 stars" => "three_stars",
|
||||
"4 stars" => "four_stars",
|
||||
"5 stars" => "five_stars",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "rw_show_review_rating",
|
||||
"value" => array("show_stars")
|
||||
),
|
||||
"description" => esc_html__("Select review rating.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Star color", "keydesign"),
|
||||
"param_name" => "rw_star_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "rw_show_review_rating",
|
||||
"value" => array("show_stars")
|
||||
),
|
||||
"description" => esc_html__("Choose star color.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "rw_box_background",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose review box background color. If none selected, the default theme color will be used.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "rw_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_reviewcarousel_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'rwp_nav_style' => '',
|
||||
'rwp_navigation_color' => '',
|
||||
'rwp_autoplay' => '',
|
||||
'rwp_autoplay_speed' => '',
|
||||
'rwp_stoponhover' => '',
|
||||
'rwp_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $wrapper_class = '';
|
||||
|
||||
$kd_rwpunique_id = "kd-rwc-".uniqid();
|
||||
|
||||
$wrapper_class = implode(' ', array('review-carousel', 'rc-parent', $kd_rwpunique_id, $rwp_navigation_color, $rwp_nav_style, $rwp_extra_class));
|
||||
|
||||
$output .= '
|
||||
<div class="'.trim($wrapper_class).'">
|
||||
<div class="rc-content">'.do_shortcode($content).'</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".review-carousel.'.$kd_rwpunique_id.' .rc-content").length) {
|
||||
$(".review-carousel.'.$kd_rwpunique_id.' .rc-content").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
},
|
||||
768:{
|
||||
items:2,
|
||||
},
|
||||
1024:{
|
||||
items:3,
|
||||
},
|
||||
1366:{';
|
||||
if($rwp_nav_style == "nav-arrows") {
|
||||
$output .= 'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
} elseif ($rwp_nav_style == "nav-dots") {
|
||||
$output .='dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
dotsEach: true,';
|
||||
} elseif ($rwp_nav_style == "nav-arrows-dots") {
|
||||
$output .= "\n".'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: true,
|
||||
dotsSpeed: 500,
|
||||
dotsEach: true,';
|
||||
}
|
||||
$output .= '}
|
||||
},
|
||||
loop: true,
|
||||
rewind: true,';
|
||||
|
||||
if($rwp_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
}
|
||||
|
||||
if($rwp_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$rwp_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($rwp_autoplay == "auto_on" && $rwp_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
}
|
||||
|
||||
$output .='
|
||||
addClassActive: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_reviewcarousel_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'rw_author_name' => '',
|
||||
'rw_author_name_color' => '',
|
||||
'rw_author_desc' => '',
|
||||
'rw_author_desc_color' => '',
|
||||
'image_source' => '',
|
||||
'rw_author_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'rw_review_message' => '',
|
||||
'rw_review_message_color' => '',
|
||||
'rw_review_rating' => '',
|
||||
'rw_star_color' => '',
|
||||
'rw_show_review_rating' => '',
|
||||
'rw_box_background' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'rw_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$author_img = $full_star = $empty_star = $rating_stars = $rw_author_img_array = $author_image = $animation_delay = $dimensions = $hwstring = '';
|
||||
|
||||
$full_star = '<span class="fa fa-star" '.(!empty($rw_star_color) ? 'style="color: '.$rw_star_color.';"' : '').'></span>';
|
||||
$empty_star = '<span class="fa fa-star-o" '.(!empty($rw_star_color) ? 'style="color: '.$rw_star_color.';"' : '').'></span>';
|
||||
|
||||
switch($rw_review_rating){
|
||||
case 'one_star':
|
||||
$rating_stars = $full_star.str_repeat($empty_star, 4);
|
||||
break;
|
||||
|
||||
case 'two_stars':
|
||||
$rating_stars = str_repeat($full_star, 2).str_repeat($empty_star, 3);
|
||||
break;
|
||||
|
||||
case 'three_stars':
|
||||
$rating_stars = str_repeat($full_star, 3).str_repeat($empty_star, 2);
|
||||
break;
|
||||
|
||||
case 'four_stars':
|
||||
$rating_stars = str_repeat($full_star, 4).$empty_star;
|
||||
break;
|
||||
|
||||
case 'five_stars':
|
||||
$rating_stars = str_repeat($full_star, 5);
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!empty($ext_image)) {
|
||||
$author_image .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} elseif(!empty($rw_author_image)) {
|
||||
$rw_author_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $rw_author_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$author_image = $rw_author_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output = '
|
||||
<div class="key-reviews '.$css_animation.' '.$rw_extra_class.'" '.(!empty($rw_box_background) ? 'style="background-color: '.$rw_box_background.';"' : '').' '.$animation_delay.'>';
|
||||
$output .= '<div class="rw-author-details">';
|
||||
if (!empty($rw_author_image) || !empty($ext_image)) {
|
||||
$output .= '<div class="rw_img_wrapper">
|
||||
<div class="rw-authorimg">'.$author_image.'</div>
|
||||
</div>';
|
||||
}
|
||||
$output .= '<h5 '.(!empty($rw_author_name_color) ? 'style="color: '.$rw_author_name_color.';"' : '').'>'.$rw_author_name.'</h5>
|
||||
<p '.(!empty($rw_author_desc_color) ? 'style="color: '.$rw_author_desc_color.';"' : '').'>'.$rw_author_desc.'</p>
|
||||
</div>';
|
||||
if ($rw_review_message) {
|
||||
$output .= '<div class="rw_message" '.(!empty($rw_review_message_color) ? 'style="color: '.$rw_review_message_color.';"' : '').'>'.$rw_review_message.'</div>';
|
||||
}
|
||||
|
||||
if ( $rw_show_review_rating !== "hide_stars" ) {
|
||||
$output .= '<div class="rw_rating">
|
||||
'.$rating_stars.'
|
||||
</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_reviewcarousel')) {
|
||||
$tek_reviewcarousel = new tek_reviewcarousel;
|
||||
}
|
||||
?>
|
||||
357
wp-content/plugins/keydesign-addon/elements/reviews_elem.php
Normal file
357
wp-content/plugins/keydesign-addon/elements/reviews_elem.php
Normal file
@@ -0,0 +1,357 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_REVIEWS')) {
|
||||
|
||||
class KD_ELEM_REVIEWS extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_reviews_init'));
|
||||
add_shortcode('tek_reviews', array($this, 'kd_reviews_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_reviews_init() {
|
||||
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Review box", "keydesign"),
|
||||
"description" => esc_html__("Display reviews with ratings.", "keydesign"),
|
||||
"base" => "tek_reviews",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/reviews.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Author name", "keydesign"),
|
||||
"param_name" => "rw_author_name",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the review author name.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author name text color", "keydesign"),
|
||||
"param_name" => "rw_author_name_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose author name text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author description", "keydesign"),
|
||||
"param_name" => "rw_author_desc",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the review author description.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author description text color", "keydesign"),
|
||||
"param_name" => "rw_author_desc_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose author description text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image", "keydesign"),
|
||||
"param_name" => "rw_author_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload author profile image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 230x400 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Review message", "keydesign"),
|
||||
"param_name" => "rw_review_message",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the review message.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Review message text color", "keydesign"),
|
||||
"param_name" => "rw_review_message_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose review message text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Show star rating","keydesign"),
|
||||
"param_name" => "rw_show_review_rating",
|
||||
"value" => array(
|
||||
"Show star rating" => "show_stars",
|
||||
"Hide star rating" => "hide_stars"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Display stars rating.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Review rating","keydesign"),
|
||||
"param_name" => "rw_review_rating",
|
||||
"value" => array(
|
||||
"1 star" => "one_star",
|
||||
"2 stars" => "two_stars",
|
||||
"3 stars" => "three_stars",
|
||||
"4 stars" => "four_stars",
|
||||
"5 stars" => "five_stars",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "rw_show_review_rating",
|
||||
"value" => array("show_stars")
|
||||
),
|
||||
"description" => esc_html__("Select review rating.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Star color", "keydesign"),
|
||||
"param_name" => "rw_star_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "rw_show_review_rating",
|
||||
"value" => array("show_stars")
|
||||
),
|
||||
"description" => esc_html__("Choose star color.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "rw_box_background",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose review box background color. If none selected, the default theme color will be used.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "rw_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_reviews_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'rw_author_name' => '',
|
||||
'rw_author_name_color' => '',
|
||||
'rw_author_desc' => '',
|
||||
'rw_author_desc_color' => '',
|
||||
'image_source' => '',
|
||||
'rw_author_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'rw_review_message' => '',
|
||||
'rw_review_message_color' => '',
|
||||
'rw_show_review_rating' => '',
|
||||
'rw_review_rating' => '',
|
||||
'rw_star_color' => '',
|
||||
'rw_box_background' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'rw_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$author_img = $full_star = $empty_star = $rating_stars = $rw_author_img_array = $author_image = $animation_delay = $dimensions = $hwstring = '';
|
||||
|
||||
$full_star = '<span class="fa fa-star" '.(!empty($rw_star_color) ? 'style="color: '.$rw_star_color.';"' : '').'></span>';
|
||||
$empty_star = '<span class="fa fa-star-o" '.(!empty($rw_star_color) ? 'style="color: '.$rw_star_color.';"' : '').'></span>';
|
||||
|
||||
switch($rw_review_rating){
|
||||
case 'one_star':
|
||||
$rating_stars = $full_star.str_repeat($empty_star, 4);
|
||||
break;
|
||||
|
||||
case 'two_stars':
|
||||
$rating_stars = str_repeat($full_star, 2).str_repeat($empty_star, 3);
|
||||
break;
|
||||
|
||||
case 'three_stars':
|
||||
$rating_stars = str_repeat($full_star, 3).str_repeat($empty_star, 2);
|
||||
break;
|
||||
|
||||
case 'four_stars':
|
||||
$rating_stars = str_repeat($full_star, 4).$empty_star;
|
||||
break;
|
||||
|
||||
case 'five_stars':
|
||||
$rating_stars = str_repeat($full_star, 5);
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!empty($ext_image)) {
|
||||
$author_image .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} elseif(!empty($rw_author_image)) {
|
||||
$rw_author_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $rw_author_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$author_image = $rw_author_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output = '
|
||||
<div class="key-reviews single-review-box '.$css_animation.' '.$rw_extra_class.'" '.(!empty($rw_box_background) ? 'style="background-color: '.$rw_box_background.';"' : '').' '.$animation_delay.'>';
|
||||
$output .= '<div class="rw-author-details">';
|
||||
if (!empty($rw_author_image) || !empty($ext_image)) {
|
||||
$output .= '<div class="rw_img_wrapper">
|
||||
<div class="rw-authorimg">'.$author_image.'</div>
|
||||
</div>';
|
||||
}
|
||||
$output .= '<h5 '.(!empty($rw_author_name_color) ? 'style="color: '.$rw_author_name_color.';"' : '').'>'.$rw_author_name.'</h5>
|
||||
<p '.(!empty($rw_author_desc_color) ? 'style="color: '.$rw_author_desc_color.';"' : '').'>'.$rw_author_desc.'</p>
|
||||
</div>';
|
||||
if ($rw_review_message) {
|
||||
$output .= '<div class="rw_message" '.(!empty($rw_review_message_color) ? 'style="color: '.$rw_review_message_color.';"' : '').'>'.$rw_review_message.'</div>';
|
||||
}
|
||||
|
||||
if ( $rw_show_review_rating !== "hide_stars" ) {
|
||||
$output .= '<div class="rw_rating">
|
||||
'.$rating_stars.'
|
||||
</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_REVIEWS')) {
|
||||
$KD_ELEM_REVIEWS = new KD_ELEM_REVIEWS;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_SECTION_TITLE')) {
|
||||
|
||||
class KD_ELEM_SECTION_TITLE extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_sectiontitle_init'));
|
||||
add_shortcode('tek_sectiontitle', array($this, 'kd_sectiontitle_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_sectiontitle_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Section title", "keydesign"),
|
||||
"description" => esc_html__("Custom title, separator and subtitle.", "keydesign"),
|
||||
"base" => "tek_sectiontitle",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/section-title.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Title", "keydesign"),
|
||||
"param_name" => "st_title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add your section title here.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title tag", "keydesign"),
|
||||
"param_name" => "st_title_tag",
|
||||
"value" => array(
|
||||
"Default" => "",
|
||||
"h1" => "h1",
|
||||
"h2" => "h2",
|
||||
"h3" => "h3",
|
||||
"h4" => "h4",
|
||||
"h5" => "h5",
|
||||
"h6" => "h6",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select title tag.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Subtitle", "keydesign"),
|
||||
"param_name" => "st_subtitle",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add your section subtitle here.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Subtitle text decoration", "keydesign"),
|
||||
"param_name" => "st_subtitle_decoration",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Underline" => "subtitle-text-underline"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select to enable subtitle decoration.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "st_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select title color.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Subtitle color", "keydesign"),
|
||||
"param_name" => "st_subtitle_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select subtitle color.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title font size", "keydesign"),
|
||||
"param_name" => "st_title_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter title font size.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title line height", "keydesign"),
|
||||
"param_name" => "st_title_line_height",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter title line height.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Subtitle font size", "keydesign"),
|
||||
"param_name" => "st_subtitle_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter subtitle font size.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Use separator", "keydesign"),
|
||||
"param_name" => "st_separator_enable",
|
||||
"value" => array(
|
||||
"Off" => "separator_off",
|
||||
"On" => "separator_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Enable to add a separator.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Separator position", "keydesign"),
|
||||
"param_name" => "st_separator_position",
|
||||
"value" => array(
|
||||
"Above title" => "above_title",
|
||||
"Below title" => "below_title",
|
||||
"Below subtitle" => "below_subtitle"
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "st_separator_enable",
|
||||
"value" => array("separator_on")
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select separator position.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Separator color", "keydesign"),
|
||||
"param_name" => "st_separator_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "st_separator_enable",
|
||||
"value" => array("separator_on")
|
||||
),
|
||||
"description" => esc_html__("Select color of separator.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Separator style","keydesign"),
|
||||
"param_name" => "st_separator_style",
|
||||
"value" => array(
|
||||
"Solid line" => "solid-line",
|
||||
"Dotted line" => "dotted-line",
|
||||
"Dashed line" => "dashed-line",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "st_separator_enable",
|
||||
"value" => array("separator_on")
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select separator style.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Separator border width","keydesign"),
|
||||
"param_name" => "st_separator_width",
|
||||
"value" => array(
|
||||
"1px" => "sep-border-width-1",
|
||||
"2px" => "sep-border-width-2",
|
||||
"3px" => "sep-border-width-3",
|
||||
"4px" => "sep-border-width-4",
|
||||
"5px" => "sep-border-width-5",
|
||||
"6px" => "sep-border-width-6",
|
||||
"7px" => "sep-border-width-7",
|
||||
"8px" => "sep-border-width-8",
|
||||
"9px" => "sep-border-width-9",
|
||||
"10px" => "sep-border-width-10",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "st_separator_enable",
|
||||
"value" => array("separator_on")
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select border width (pixels).", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Separator length", "keydesign"),
|
||||
"param_name" => "st_separator_length",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "st_separator_enable",
|
||||
"value" => array("separator_on")
|
||||
),
|
||||
"description" => esc_html__("Enter separator length (pixels).", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text align","keydesign"),
|
||||
"param_name" => "st_text_align",
|
||||
"value" => array(
|
||||
"Center" => "text-center",
|
||||
"Left" => "text-left",
|
||||
"Right" => "text-right",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select element alignment.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Section width","keydesign"),
|
||||
"param_name" => "st_width",
|
||||
"value" => array(
|
||||
"Full width" => "st_fullwidth",
|
||||
"2/3 columns" => "st_8_columns",
|
||||
"1/2 columns" => "st_6_columns",
|
||||
"1/3 columns" => "st_4_columns",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select element width.", "keydesign")
|
||||
),
|
||||
array(
|
||||
'type' => 'css_editor',
|
||||
'heading' => esc_html__( 'Css', 'keydesign' ),
|
||||
'param_name' => 'css',
|
||||
'group' => esc_html__( 'Design options', 'keydesign' ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"admin_label" => true,
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "css_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"admin_label" => true,
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "st_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_sectiontitle_shrt($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'st_title' => '',
|
||||
'st_title_tag' => 'h2',
|
||||
'st_subtitle' => '',
|
||||
'st_subtitle_decoration' => '',
|
||||
'st_title_color' => '',
|
||||
'st_subtitle_color' => '',
|
||||
'st_title_size' => '',
|
||||
'st_title_line_height' => '',
|
||||
'st_subtitle_size' => '',
|
||||
'st_separator_enable' => '',
|
||||
'st_separator_position' => 'above_title',
|
||||
'st_separator_color' => '',
|
||||
'st_separator_style' => '',
|
||||
'st_separator_width' => '',
|
||||
'st_separator_length' => '',
|
||||
'st_text_align' => '',
|
||||
'st_width' => '',
|
||||
'css' => '',
|
||||
'css_animation' => '',
|
||||
'css_animation_delay' => '',
|
||||
'st_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$st_title_style = $st_subtitle_style = $st_separator_classes = $separator_structure = $section_width_class = $css_class = $animation_delay = '';
|
||||
|
||||
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $atts );
|
||||
|
||||
if (!empty ($st_title_color) ) {
|
||||
$st_title_style .= 'color: '.$st_title_color.';';
|
||||
}
|
||||
if (!empty ($st_title_size) ) {
|
||||
$st_title_style .= 'font-size: '.$st_title_size.';';
|
||||
}
|
||||
if (!empty ($st_title_line_height) ) {
|
||||
$st_title_style .= 'line-height: '.$st_title_line_height.';';
|
||||
}
|
||||
|
||||
if (!empty ($st_subtitle_color) ) {
|
||||
$st_subtitle_style .= 'color: '.$st_subtitle_color.';';
|
||||
}
|
||||
if (!empty ($st_subtitle_size) ) {
|
||||
$st_subtitle_style .= 'font-size: '.$st_subtitle_size.';';
|
||||
}
|
||||
|
||||
if ($st_separator_enable == 'separator_on') {
|
||||
$st_separator_classes .= $st_separator_style . ' ' . $st_separator_width. ' ' . $st_separator_length;
|
||||
}
|
||||
|
||||
switch($st_width){
|
||||
case 'st_fullwidth':
|
||||
$section_width_class = 'col-lg-12';
|
||||
break;
|
||||
|
||||
case 'st_8_columns':
|
||||
$section_width_class = 'col-lg-8 vc_col-sm-8';
|
||||
break;
|
||||
|
||||
case 'st_6_columns':
|
||||
$section_width_class = 'vc_col-lg-6 vc_col-sm-8';
|
||||
break;
|
||||
|
||||
case 'st_4_columns':
|
||||
$section_width_class = 'vc_col-lg-4 vc_col-sm-8';
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($css_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$css_animation_delay;
|
||||
}
|
||||
|
||||
$separator_structure .= '<div class="kd-separator ' . $st_separator_position . '" '.(!empty($st_separator_length) ? 'style="width:' . $st_separator_length . ';"' : '').'><div class="kd-separator-line" '.(!empty($st_separator_color) ? 'style="border-color:' . $st_separator_color . '"' : '').'></div></div>';
|
||||
|
||||
|
||||
$output = '<header class="kd-section-title '.$section_width_class.' ' . $st_text_align . ' ' . $st_separator_classes . ' '.$css_animation.' ' . $st_extra_class.' '.esc_attr( $css_class ).'" '.$animation_delay.'>';
|
||||
if (( $st_separator_enable == 'separator_on') && ($st_separator_position == 'above_title' )) {
|
||||
$output .= $separator_structure;
|
||||
}
|
||||
if ( $st_title ) {
|
||||
if ($st_title_tag != '') {
|
||||
$output .= '<'.esc_attr($st_title_tag).' class="' . $st_separator_enable . '" '.(!empty($st_title_style) ? 'style="' . $st_title_style . '"' : '').'>' . $st_title . '</'.esc_attr($st_title_tag).'>';
|
||||
} else {
|
||||
$output .= '<h2 class="' . $st_separator_enable . '" '.(!empty($st_title_style) ? 'style="' . $st_title_style . '"' : '').'>' . $st_title . '</h2>';
|
||||
}
|
||||
}
|
||||
|
||||
if (( $st_separator_enable == 'separator_on' ) && ( $st_separator_position == 'below_title' )) {
|
||||
$output .= $separator_structure;
|
||||
}
|
||||
if ( $st_subtitle ) {
|
||||
$output .= '<h6 class="subtitle ' . $st_subtitle_decoration . '" '.(!empty($st_subtitle_style) ? 'style="' . $st_subtitle_style . '"' : '').'>' . $st_subtitle . '</h6>';
|
||||
}
|
||||
if (( $st_separator_enable == 'separator_on' ) && ( $st_separator_position == 'below_subtitle' )) {
|
||||
$output .= $separator_structure;
|
||||
}
|
||||
$output .= '</header>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_SECTION_TITLE')) {
|
||||
$KD_ELEM_SECTION_TITLE = new KD_ELEM_SECTION_TITLE;
|
||||
}
|
||||
|
||||
?>
|
||||
223
wp-content/plugins/keydesign-addon/elements/shape_elem.php
Normal file
223
wp-content/plugins/keydesign-addon/elements/shape_elem.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_SHAPE')) {
|
||||
|
||||
class KD_ELEM_SHAPE extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_shape_init'));
|
||||
add_shortcode('tek_shape', array($this, 'kd_shape_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_shape_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Shape", "keydesign"),
|
||||
"description" => esc_html__("Display basic geometric shapes.", "keydesign"),
|
||||
"base" => "tek_shape",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/shape.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Template","keydesign"),
|
||||
"param_name" => "shape_template",
|
||||
"value" => array(
|
||||
"Rectangle" => "shape_rectangle",
|
||||
"Circle" => "shape_circle",
|
||||
"Egg" => "shape_egg",
|
||||
"Organic 1" => "shape_organic_1",
|
||||
"Organic 1 rotated" => "shape_organic_1_rotate",
|
||||
"Organic 2" => "shape_organic_2",
|
||||
"Organic 2 rotated" => "shape_organic_2_rotate",
|
||||
),
|
||||
"admin_label" => true,
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select shape template.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Horizontal position","keydesign"),
|
||||
"param_name" => "shape_position",
|
||||
"value" => array(
|
||||
"Left" => "shape_left_pos",
|
||||
"Center" => "shape_center_pos",
|
||||
"Right" => "shape_right_pos"
|
||||
),
|
||||
"admin_label" => true,
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select shape position.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Top position", "keydesign"),
|
||||
"param_name" => "shape_top_position",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Accepts values in px, em, rem or auto.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Bottom position", "keydesign"),
|
||||
"param_name" => "shape_bottom_position",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Accepts values in px, em, rem or auto.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Width", "keydesign"),
|
||||
"param_name" => "shape_width",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter shape width.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Height", "keydesign"),
|
||||
"param_name" => "shape_height",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter shape height.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Opacity", "keydesign"),
|
||||
"param_name" => "shape_opacity",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter shape opacity. Only values between 0.1 and 1 accepted.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Background color", "keydesign"),
|
||||
"param_name" => "shape_bg_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select shape background color.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "shape_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "shape_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_shape_shrt($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'shape_template' => '',
|
||||
'shape_position' => '',
|
||||
'shape_top_position' => '',
|
||||
'shape_bottom_position' => '',
|
||||
'shape_width' => '',
|
||||
'shape_height' => '',
|
||||
'shape_opacity' => '',
|
||||
'shape_bg_color' => '',
|
||||
'css_animation' => '',
|
||||
'shape_animation_delay' => '',
|
||||
'shape_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $wrapper_class = $shape_style = $animation_delay = '';
|
||||
|
||||
$wrapper_class = implode(' ', array('kd-shapes', $shape_template, $shape_position, $css_animation));
|
||||
|
||||
if (!empty ($shape_top_position) ) {
|
||||
$shape_style .= 'top: '.$shape_top_position.';';
|
||||
}
|
||||
if (!empty ($shape_bottom_position) ) {
|
||||
$shape_style .= 'bottom: '.$shape_bottom_position.';';
|
||||
}
|
||||
if (!empty ($shape_width) ) {
|
||||
$shape_style .= 'width: '.$shape_width.';';
|
||||
}
|
||||
if (!empty ($shape_height) ) {
|
||||
$shape_style .= 'height: '.$shape_height.';';
|
||||
}
|
||||
if (!empty ($shape_opacity) ) {
|
||||
$shape_style .= 'opacity: '.$shape_opacity.';';
|
||||
}
|
||||
if (!empty ($shape_bg_color) ) {
|
||||
$shape_style .= 'background-color: '.$shape_bg_color.';';
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($shape_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$shape_animation_delay;
|
||||
}
|
||||
|
||||
$output = '<div class="'.$wrapper_class.'" '.(!empty($shape_style) ? 'style="' . $shape_style . '"' : '').' '. $animation_delay . '></div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_SHAPE')) {
|
||||
$KD_ELEM_SHAPE = new KD_ELEM_SHAPE;
|
||||
}
|
||||
|
||||
?>
|
||||
462
wp-content/plugins/keydesign-addon/elements/slidingbox_elem.php
Normal file
462
wp-content/plugins/keydesign-addon/elements/slidingbox_elem.php
Normal file
@@ -0,0 +1,462 @@
|
||||
<?php
|
||||
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_sliding_box extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_sliding_box_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('tek_sliding_box')) {
|
||||
class tek_sliding_box extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_sliding_box_init'));
|
||||
add_shortcode('tek_sliding_box', array($this, 'kd_sliding_box_container'));
|
||||
add_shortcode('tek_sliding_box_single', array($this, 'kd_sliding_box_single'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_sliding_box_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Sliding box", "keydesign"),
|
||||
"description" => esc_html__("Sliding boxes with smooth animations.", "keydesign"),
|
||||
"base" => "tek_sliding_box",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => false,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_sliding_box_single'),
|
||||
"icon" => plugins_url('assets/element_icons/sliding-box.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "sbp_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Sliding box item", "keydesign"),
|
||||
"base" => "tek_sliding_box_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_sliding_box'),
|
||||
"icon" => plugins_url('assets/element_icons/sliding-box.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Active element","keydesign"),
|
||||
"param_name" => "sb_box_active",
|
||||
"value" => array(
|
||||
"No" => "active_no",
|
||||
"Yes" => "active_yes",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Note: only one child sliding box element must be set as active.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box title", "keydesign"),
|
||||
"param_name" => "sb_title",
|
||||
"admin_label" => true,
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter item title here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title color", "keydesign"),
|
||||
"param_name" => "sb_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title size","keydesign"),
|
||||
"param_name" => "sb_title_size",
|
||||
"value" => array(
|
||||
"Small" => "sliding-small-title",
|
||||
"Large" => "sliding-large-title",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select title size.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box description", "keydesign"),
|
||||
"param_name" => "sb_description",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter item description here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description color", "keydesign"),
|
||||
"param_name" => "sb_description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose description text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "sb_img",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select or upload your image using the media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 300x300 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link type", "keydesign"),
|
||||
"param_name" => "sb_link_type",
|
||||
"value" => array(
|
||||
esc_html__( 'No link', 'keydesign' ) => '#',
|
||||
esc_html__( 'Add a custom link', 'keydesign' ) => '1',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("You can add/remove custom link", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "vc_link",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button link", "keydesign"),
|
||||
"param_name" => "sb_button_link",
|
||||
"value" => "",
|
||||
"description" => esc_html__("You can add or remove the existing link from here.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "sb_link_type",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button text", "keydesign"),
|
||||
"param_name" => "sb_button_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the text displayed on the button.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "sb_link_type",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button style", "keydesign"),
|
||||
"param_name" => "sb_button_style",
|
||||
"value" => array(
|
||||
"Solid color" => "tt_primary_button",
|
||||
"Outline" => "tt_secondary_button",
|
||||
),
|
||||
"description" => esc_html__("Select button style.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "sb_link_type",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Button color scheme", "keydesign"),
|
||||
"param_name" => "sb_button_color_scheme",
|
||||
"value" => array(
|
||||
"Primary color" => "btn_primary_color",
|
||||
"Secondary color" => "btn_secondary_color",
|
||||
),
|
||||
"description" => esc_html__("Select button predefined color scheme.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "sb_link_type",
|
||||
"value" => array( "1" ),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background type", "keydesign"),
|
||||
"param_name" => "sb_background_type",
|
||||
"value" => array(
|
||||
esc_html__( 'None', 'keydesign' ) => 'none',
|
||||
esc_html__( 'Select color', 'keydesign' ) => 'custom_bg_color',
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select box background type.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Background color", "keydesign"),
|
||||
"param_name" => "sb_background_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "sb_background_type",
|
||||
"value" => array( "custom_bg_color" ),
|
||||
),
|
||||
"description" => esc_html__("Choose box background color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "sb_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "sb_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_sliding_box_container($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'sbp_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$kd_slidingbox_id = '';
|
||||
|
||||
$kd_slidingbox_id .= "kd-slidingbox-".uniqid();
|
||||
$output = '
|
||||
<div class="sliding_box_parent row '.$kd_slidingbox_id.' '.$sbp_extra_class.'">'.do_shortcode($content).'</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".sliding_box_parent.'.$kd_slidingbox_id.'").length) {
|
||||
$(".'.$kd_slidingbox_id.' .sliding_box_child").on("mouseenter", function() {
|
||||
$(".'.$kd_slidingbox_id.' .sliding_box_child").removeClass("active-elem");
|
||||
$(this).addClass("active-elem");
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_sliding_box_single($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'sb_title' => '',
|
||||
'sb_title_color' => '',
|
||||
'sb_title_size' => '',
|
||||
'sb_description' => '',
|
||||
'sb_description_color' => '',
|
||||
'image_source' => '',
|
||||
'sb_img' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'sb_link_type' => '',
|
||||
'sb_button_link' => '',
|
||||
'sb_button_text' => '',
|
||||
'sb_button_style' => '',
|
||||
'sb_button_color_scheme' => '',
|
||||
'sb_background_type' => '',
|
||||
'sb_background_color' => '',
|
||||
'sb_box_active' => '',
|
||||
'css_animation' => '',
|
||||
'sb_animation_delay' => '',
|
||||
'sb_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$box_active_class = $link_title = $link_target = $kd_slidingbox_id = $sb_image = $default_src = $dimensions = $hwstring = $title_tag = $wrapper_class = $animation_delay = '';
|
||||
|
||||
$sb_image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $sb_img,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
$href = vc_build_link($sb_button_link);
|
||||
if ($href['target'] == "") { $href['target'] = "_self"; }
|
||||
|
||||
if($href['url'] !== '') {
|
||||
$link_target = (isset($href['target'])) ? ' target="'.$href['target'].'"' : 'target="_self"';
|
||||
$link_title = (isset($href['title'])) ? ' title="'.$href['title'].'"' : '';
|
||||
}
|
||||
|
||||
// Title size
|
||||
if ($sb_title_size == 'sliding-small-title') {
|
||||
$title_tag = 'h4';
|
||||
} else {
|
||||
$title_tag = 'h3';
|
||||
}
|
||||
|
||||
// Active element
|
||||
if( $sb_box_active == 'active_no' ) {
|
||||
$box_active_class = '';
|
||||
} elseif ( $sb_box_active == 'active_yes' ) {
|
||||
$box_active_class = 'active-elem';
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($sb_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$sb_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('sliding_box_child', $box_active_class, $css_animation, $sb_extra_class));
|
||||
|
||||
$output = '<div class="' . trim($wrapper_class) . '" '. $animation_delay . '>
|
||||
<div class="sb-image">';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
if (!$sb_image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .= $sb_image['thumbnail'];
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '</div>
|
||||
<div class="sb_content_wrapper" '.(!empty($sb_background_color) ? 'style="background-color: '.$sb_background_color.';"' : '').'>';
|
||||
if ( !empty($sb_title) ) {
|
||||
$output .= '<'.esc_attr($title_tag).' '.(!empty($sb_title_color) ? 'style="color: '.$sb_title_color.';"' : '').'>'.$sb_title.'</'.esc_attr($title_tag).'>';
|
||||
}
|
||||
|
||||
if ( !empty($sb_description) ) {
|
||||
$output .= '<p '.(!empty($sb_description_color) ? 'style="color: '.$sb_description_color.';"' : '').'>'.$sb_description.'</p>';
|
||||
}
|
||||
|
||||
if($sb_link_type !== '#'){
|
||||
$output .= '<div class="sb-btncontainer">
|
||||
<a href="'.$href['url'].'" '.$link_target.' '.$link_title.' class="tt_button '.$sb_button_style.' '.$sb_button_color_scheme.'">'.$sb_button_text.'</a>
|
||||
</div>';
|
||||
}
|
||||
$output .= '</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (class_exists('tek_sliding_box')) {
|
||||
$tek_sliding_box = new tek_sliding_box;
|
||||
}
|
||||
|
||||
?>
|
||||
235
wp-content/plugins/keydesign-addon/elements/socialicons_elem.php
Normal file
235
wp-content/plugins/keydesign-addon/elements/socialicons_elem.php
Normal file
@@ -0,0 +1,235 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_SOCIAL_ICONS')) {
|
||||
|
||||
class KD_ELEM_SOCIAL_ICONS extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_socialicons_init'));
|
||||
add_shortcode('tek_socialicons', array($this, 'kd_socialicons_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_socialicons_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Social icons", "keydesign"),
|
||||
"description" => esc_html__("Connect your social media profiles to your website.", "keydesign"),
|
||||
"base" => "tek_socialicons",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/social-icons.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "kd_param_notice",
|
||||
"text" => '<span style="display: block;">Control which icons are displayed and their urls on the <a href="' . admin_url ( 'admin.php?page=theme-options&tab=0' ) .'">settings page</a>.</span>',
|
||||
"param_name" => "notification",
|
||||
"edit_field_class" => "vc_column vc_col-sm-12",
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon alignment","keydesign"),
|
||||
"param_name" => "si_icon_alignment",
|
||||
"value" => array(
|
||||
"Left" => "icon-left-align",
|
||||
"Right" => "icon-right-align",
|
||||
"Center" => "icon-center-align",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select icon alignment.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon color", "keydesign"),
|
||||
"param_name" => "si_icon_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select icon color.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Background shape","keydesign"),
|
||||
"param_name" => "si_bg_shape",
|
||||
"value" => array(
|
||||
"None" => "bg-shape-none",
|
||||
"Circle" => "bg-shape-circle",
|
||||
"Square" => "bg-shape-square",
|
||||
"Rounded" => "bg-shape-rounded",
|
||||
"Outline circle" => "bg-shape-outline-circle",
|
||||
"Outline square" => "bg-shape-outline-square",
|
||||
"Outline rounded" => "bg-shape-outline-rounded",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select background shape and style for icon.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Background color", "keydesign"),
|
||||
"param_name" => "si_bg_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "si_bg_shape",
|
||||
"value" => array("bg-shape-circle", "bg-shape-square", "bg-shape-rounded", "bg-shape-outline-circle", "bg-shape-outline-square", "bg-shape-outline-rounded")
|
||||
),
|
||||
"description" => esc_html__("Select background color for icon.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Icon font size", "keydesign"),
|
||||
"param_name" => "si_icon_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter icon font size.", "keydesign")
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Hover effect","keydesign"),
|
||||
"param_name" => "si_hover_effect",
|
||||
"value" => array(
|
||||
"Default" => "hover-default",
|
||||
"Float shadow" => "hover-float-shadow",
|
||||
"Opacity" => "hover-opacity",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select hover effect.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "no_animation",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Style particular content element differently - add a class name and refer to it in custom CSS.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_socialicons_shrt($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'si_icon_alignment' => '',
|
||||
'si_icon_color' => '',
|
||||
'si_bg_shape' => '',
|
||||
'si_bg_color' => '',
|
||||
'si_icon_size' => '',
|
||||
'si_hover_effect' => '',
|
||||
'css_animation' => '',
|
||||
'animation_delay' => '',
|
||||
'extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = $redux_options = $social_items = $icon_size = $has_style = $background_style = $icon_bg_style = $wrapper_class = '';
|
||||
|
||||
$redux_options = get_option( 'redux_ThemeTek' );
|
||||
$social_items = $redux_options['tek-social-profiles'];
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$animation_delay;
|
||||
}
|
||||
|
||||
$has_style = false;
|
||||
if ( $si_bg_shape != 'bg-shape-none' ) {
|
||||
$has_style = true;
|
||||
if ( false !== strpos( $si_bg_shape, 'outline' ) ) {
|
||||
$background_style .= 'icon-element-outline';
|
||||
} else {
|
||||
$background_style .= 'icon-element-background';
|
||||
}
|
||||
}
|
||||
|
||||
if ( false !== strpos( $si_bg_shape, 'outline' ) ) {
|
||||
$icon_bg_style = 'border-color:' . $si_bg_color;
|
||||
} else {
|
||||
$icon_bg_style = 'background-color:' . $si_bg_color;
|
||||
}
|
||||
|
||||
$icon_bg_style = $icon_bg_style ? ' style="' . esc_attr( $icon_bg_style ) . '"' : '';
|
||||
|
||||
$wrapper_class = implode(' ', array('kd-social-profiles', $si_icon_alignment, $background_style, $si_bg_shape, $si_hover_effect, $css_animation, $extra_class));
|
||||
|
||||
if( class_exists( 'ReduxFramework' )) {
|
||||
$output .= '<div class="'.$wrapper_class.'" '.(!empty($si_icon_size) ? 'style="font-size:' . $si_icon_size . ';"' : '').' '.$animation_delay.'>';
|
||||
|
||||
$output .= '<ul class="kd-social-list clearfix">';
|
||||
if ( is_array ( $social_items ) ) {
|
||||
foreach ( $social_items as $key => $social_item ) {
|
||||
if ( $social_item[ 'enabled' ] ) {
|
||||
$icon = $social_item[ 'icon' ];
|
||||
$base_url = $social_item[ 'url' ];
|
||||
|
||||
$output .= '<li'.(($has_style) ? $icon_bg_style : '').'>';
|
||||
$output .= '<a target="_blank" href="'. $base_url . '">';
|
||||
$output .= '<i class="fa ' . $icon . '" '.(!empty($si_icon_color) ? 'style="color: '.$si_icon_color.';"' : '').'></i>';
|
||||
$output .= "</a>";
|
||||
$output .= "</li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</ul>';
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_SOCIAL_ICONS')) {
|
||||
$KD_ELEM_SOCIAL_ICONS = new KD_ELEM_SOCIAL_ICONS;
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
333
wp-content/plugins/keydesign-addon/elements/team_elem.php
Normal file
333
wp-content/plugins/keydesign-addon/elements/team_elem.php
Normal file
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_TEAM')) {
|
||||
|
||||
class KD_ELEM_TEAM extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_team_init'));
|
||||
add_shortcode('tek_team', array($this, 'kd_team_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_team_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Team member", "keydesign"),
|
||||
"description" => esc_html__("Team member element", "keydesign"),
|
||||
"base" => "tek_team",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/team-member.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Select design style", "keydesign"),
|
||||
"param_name" => "design_style",
|
||||
"value" => array(
|
||||
esc_html__("Classic", "keydesign") => "classic",
|
||||
esc_html__("Creative", "keydesign") => "creative",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select Team Member box design.", "keydesign"),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Name", "keydesign"),
|
||||
"param_name" => "title",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Name text color", "keydesign"),
|
||||
"param_name" => "title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select team member name color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"group" => esc_html__("Design", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Position", "keydesign"),
|
||||
"param_name" => "position",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Position text color", "keydesign"),
|
||||
"param_name" => "position_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select team member position color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"group" => esc_html__("Design", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description", "keydesign"),
|
||||
"param_name" => "description",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "design_style",
|
||||
"value" => array("classic")
|
||||
),
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description text color", "keydesign"),
|
||||
"param_name" => "description_color",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "design_style",
|
||||
"value" => array("classic")
|
||||
),
|
||||
"description" => esc_html__("Select team member description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"group" => esc_html__("Design", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
"group" => esc_html__("Image", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "image",
|
||||
"description" => esc_html__("Select or upload your image using the media library."),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
"group" => esc_html__("Image", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
"group" => esc_html__("Image", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 400x450 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
"group" => esc_html__("Image", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Phone", "keydesign"),
|
||||
"param_name" => "tm_phone",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Email", "keydesign"),
|
||||
"param_name" => "tm_email",
|
||||
"value" => "",
|
||||
"group" => esc_html__("Content", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Facebook Profile URL", "keydesign"),
|
||||
"param_name" => "facebook_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Facebook link.", "keydesign"),
|
||||
"group" => esc_html__("Social", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Instagram Profile URL", "keydesign"),
|
||||
"param_name" => "instagram_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Instagram link.", "keydesign"),
|
||||
"group" => esc_html__("Social", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Twitter Profile URL", "keydesign"),
|
||||
"param_name" => "twitter_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Twitter link.", "keydesign"),
|
||||
"group" => esc_html__("Social", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Linkedin Profile URL", "keydesign"),
|
||||
"param_name" => "linkedin_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Linkedin link.", "keydesign"),
|
||||
"group" => esc_html__("Social", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("GitHub Profile URL", "keydesign"),
|
||||
"param_name" => "github_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set GitHub link.", "keydesign"),
|
||||
"group" => esc_html__("Social", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Social icons color", "keydesign"),
|
||||
"param_name" => "social_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose social icons color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"group" => esc_html__("Design", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "team_bg_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose box background color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
"group" => esc_html__("Design", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link URL", "keydesign"),
|
||||
"param_name" => "team_external_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set team link.", "keydesign"),
|
||||
"group" => esc_html__("Link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link text", "keydesign"),
|
||||
"param_name" => "team_link_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set team link text. (eg. Read more)", "keydesign"),
|
||||
"group" => esc_html__("Link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
'type' => 'dropdown',
|
||||
'heading' => __( 'Link target', 'keydesign' ),
|
||||
'param_name' => 'team_link_target',
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
"group" => esc_html__("Link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1000 ms" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "team_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_team_shrt($atts, $content = null) {
|
||||
$design_style = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'design_style' => '',
|
||||
), $atts));
|
||||
|
||||
$output = '';
|
||||
if ($design_style == 'classic' || $design_style == 'creative') {
|
||||
require_once(KEYDESIGN_PLUGIN_PATH.'/elements/templates/team-elem/team-'.$design_style.'.php');
|
||||
$template_func = 'kd_team_set_'.$design_style;
|
||||
$output .= $template_func($atts,$content);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_TEAM')) {
|
||||
$KD_ELEM_TEAM = new KD_ELEM_TEAM;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,512 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_teamcarousel extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_teamcarousel_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_teamcarousel')) {
|
||||
class tek_teamcarousel extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_teamcarousel_init'));
|
||||
add_shortcode('tek_teamcarousel', array($this, 'kd_teamcarousel_container'));
|
||||
add_shortcode('tek_teamcarousel_single', array($this, 'kd_teamcarousel_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_teamcarousel_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Team carousel", "keydesign"),
|
||||
"description" => esc_html__("List all your team members in a carousel.", "keydesign"),
|
||||
"base" => "tek_teamcarousel",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_teamcarousel_single'),
|
||||
"icon" => plugins_url('assets/element_icons/team-carousel.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Design style", "keydesign"),
|
||||
"param_name" => "design_style",
|
||||
"value" => array(
|
||||
esc_html__("Classic", "keydesign") => "classic",
|
||||
esc_html__("Creative", "keydesign") => "creative",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select Team Member box design.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Elements per row", "keydesign"),
|
||||
"param_name" => "tc_elements",
|
||||
"value" => array(
|
||||
"3 items" => "3",
|
||||
"4 items" => "4",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Amount of items displayed at a time with the widest browser width.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation color", "keydesign"),
|
||||
"param_name" => "tc_navigation_color",
|
||||
"value" => array(
|
||||
"Black" => "black-navigation",
|
||||
"White" => "white-navigation",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose the navigation arrows color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "tc_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "tc_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "tc_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "tc_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "tc_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "tc_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Team member", "keydesign"),
|
||||
"base" => "tek_teamcarousel_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_teamcarousel'),
|
||||
"icon" => plugins_url('assets/element_icons/team-member.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Name", "keydesign"),
|
||||
"param_name" => "title",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Name text color", "keydesign"),
|
||||
"param_name" => "title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select name text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Position", "keydesign"),
|
||||
"param_name" => "position",
|
||||
"value" => "",
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Position text color", "keydesign"),
|
||||
"param_name" => "position_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select position text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description", "keydesign"),
|
||||
"param_name" => "description",
|
||||
"value" => "",
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Description text color", "keydesign"),
|
||||
"param_name" => "description_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select description color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "image",
|
||||
"description" => esc_html__("Select or upload your image using the media library."),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 400x450 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Phone", "keydesign"),
|
||||
"param_name" => "tm_phone",
|
||||
"value" => "",
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Email", "keydesign"),
|
||||
"param_name" => "tm_email",
|
||||
"value" => "",
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "team_bg_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose box background color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Facebook Profile URL", "keydesign"),
|
||||
"param_name" => "facebook_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Facebook address and target.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Instagram Profile URL", "keydesign"),
|
||||
"param_name" => "instagram_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Instagram link.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Twitter Profile URL", "keydesign"),
|
||||
"param_name" => "twitter_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Twitter address and target.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Linkedin Profile URL", "keydesign"),
|
||||
"param_name" => "linkedin_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set Linkedin address and target.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("GitHub Profile URL", "keydesign"),
|
||||
"param_name" => "github_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set GitHub link.", "keydesign"),
|
||||
"group" => esc_html__("Social", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Social icons color", "keydesign"),
|
||||
"param_name" => "social_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose social icons color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "href",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link URL", "keydesign"),
|
||||
"param_name" => "team_external_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set team link.", "keydesign"),
|
||||
"group" => esc_html__("Link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Link text", "keydesign"),
|
||||
"param_name" => "team_link_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Set team link text. (eg. Read more)", "keydesign"),
|
||||
"group" => esc_html__("Link", "keydesign"),
|
||||
),
|
||||
array(
|
||||
'type' => 'dropdown',
|
||||
'heading' => __( 'Link target', 'keydesign' ),
|
||||
'param_name' => 'team_link_target',
|
||||
"value" => array(
|
||||
esc_html__( 'Same window', 'keydesign' ) => '_self',
|
||||
esc_html__( 'New window', 'keydesign' ) => '_blank',
|
||||
),
|
||||
"group" => esc_html__("Link", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "team_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_teamcarousel_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'design_style' => '',
|
||||
'tc_elements' => '',
|
||||
'tc_navigation_color' => '',
|
||||
'tc_autoplay' => '',
|
||||
'tc_autoplay_speed' => '',
|
||||
'tc_stoponhover' => '',
|
||||
'tc_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$output = '';
|
||||
|
||||
global $global_design_style;
|
||||
$global_design_style = $design_style;
|
||||
|
||||
$kd_tcunique_id = "kd-teamc-".uniqid();
|
||||
|
||||
$output = '
|
||||
<div class="team-carousel '.$kd_tcunique_id.' tc-parent '.$tc_navigation_color.' '.$tc_extra_class.'">
|
||||
<div class="tc-content">'.do_shortcode($content).'</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
|
||||
if (jQuery(".team-carousel.'.$kd_tcunique_id.' .tc-content").length) {
|
||||
var $owl = jQuery(".team-carousel.'.$kd_tcunique_id.' .tc-content");
|
||||
|
||||
$owl.children().each( function( index ) {
|
||||
jQuery(this).attr( "data-position", index );
|
||||
});
|
||||
|
||||
jQuery(document).on("click", ".owl-item>div", function() {
|
||||
$owl.trigger("to.owl.carousel", jQuery(this).data( "position" ) );
|
||||
});
|
||||
|
||||
jQuery(".team-carousel.'.$kd_tcunique_id.' .tc-content").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
},
|
||||
768:{
|
||||
items:2,
|
||||
},
|
||||
1199:{
|
||||
items:3,
|
||||
},
|
||||
1366:{
|
||||
items: '.$tc_elements.',
|
||||
}
|
||||
},
|
||||
slideBy: 1,
|
||||
loop: true,
|
||||
nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
|
||||
if($tc_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,
|
||||
rewind: true,';
|
||||
}
|
||||
|
||||
if($tc_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$tc_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($tc_autoplay == "auto_on" && $tc_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
}
|
||||
|
||||
$output .='
|
||||
addClassActive: true,
|
||||
});
|
||||
}
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_teamcarousel_single($atts, $content = null) {
|
||||
global $global_design_style;
|
||||
|
||||
$output = '';
|
||||
|
||||
if ($GLOBALS['global_design_style'] == 'classic' || $GLOBALS['global_design_style'] == 'creative') {
|
||||
require_once(KEYDESIGN_PLUGIN_PATH.'/elements/templates/team-elem/team-'.$GLOBALS['global_design_style'].'.php');
|
||||
$template_func = 'kd_team_set_'.$GLOBALS['global_design_style'];
|
||||
$output .= $template_func($atts,$content);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_teamcarousel')) {
|
||||
$tek_teamcarousel = new tek_teamcarousel;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* Template: Sticky navbar sections - Side Gallery
|
||||
*/
|
||||
|
||||
if(!function_exists('kd_section_set_side_gallery')) {
|
||||
|
||||
|
||||
|
||||
function kd_section_set_side_gallery($atts,$content = null){
|
||||
|
||||
// Declare empty vars
|
||||
$output = $image = $images = $img = $thumbnail = $gal_images = $featured_gallery_id = $default_src = $dimensions = $hwstring = $animation_delay = $wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'gallery_image_source' => '',
|
||||
'fss_photo_gallery' => '',
|
||||
'gallery_ext_image' => '',
|
||||
'gallery_ext_image_size' => '',
|
||||
'fss_gallery_shadow' => '',
|
||||
'fss_loop' => '',
|
||||
'fss_autoplay' => '',
|
||||
'fss_autoplay_speed' => '',
|
||||
'fss_stoponhover' => '',
|
||||
'css_animation_image' => '',
|
||||
),$atts));
|
||||
|
||||
if ($gallery_image_source == 'external_link') {
|
||||
$images = vc_value_from_safe( $gallery_ext_image );
|
||||
$images = explode( ',', $images );
|
||||
} else {
|
||||
$images = explode( ',', $fss_photo_gallery );
|
||||
}
|
||||
|
||||
if ( '' === $images ) {
|
||||
$images = '-1,-2,-3';
|
||||
}
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
foreach ( $images as $i => $image ) {
|
||||
if ($gallery_image_source == 'external_link') {
|
||||
if ($gallery_ext_image != '') {
|
||||
$image = esc_attr( $image );
|
||||
$dimensions = vc_extract_dimensions( $gallery_ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
$thumbnail = '<img ' . $hwstring . ' src="' . $image . '" />';
|
||||
} else {
|
||||
$thumbnail = '<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
}
|
||||
} else {
|
||||
if ( $image > 0 ) {
|
||||
$img = wpb_getImageBySize( $params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $image,
|
||||
'thumb_size' => 'full',
|
||||
'class' = > 'ffs-gallery-img'
|
||||
));
|
||||
$thumbnail = $img['thumbnail'];
|
||||
} else {
|
||||
$thumbnail = '<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
}
|
||||
}
|
||||
$gal_images .= $thumbnail;
|
||||
}
|
||||
|
||||
$featured_gallery_id = "kd-featured-gallery-".uniqid();
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".'.$featured_gallery_id.' .featured-gallery").length) {
|
||||
$(".'.$featured_gallery_id.' .featured-gallery").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
items: 1,
|
||||
rewind: true,
|
||||
dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,';
|
||||
|
||||
if($fss_loop == "loop_on") {
|
||||
$output .= 'loop: true,';
|
||||
}
|
||||
|
||||
if($fss_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
}
|
||||
|
||||
if($fss_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$fss_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($fss_autoplay == "auto_on" && $fss_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
}
|
||||
|
||||
$output .='
|
||||
addClassActive: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
/* Animation delay */
|
||||
if ('' !== $css_animation_image) {
|
||||
$animation_delay = 'data-animation-delay="200"';
|
||||
} else {
|
||||
$animation_delay = '';
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('side-featured-wrapper', $featured_gallery_id, $css_animation_image, $css_animation_image, $fss_gallery_shadow));
|
||||
|
||||
$output .= '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>
|
||||
<div class="featured-gallery">'.$gal_images.'</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/*
|
||||
* Template: Sticky navbar sections - Side Photo
|
||||
*/
|
||||
|
||||
if(!function_exists('kd_section_set_side_photo')) {
|
||||
|
||||
// Declare empty vars
|
||||
$image = $content_image = $default_src = $dimensions = $hwstring = $animation_delay = $wrapper_class = '';
|
||||
|
||||
function kd_section_set_side_photo($atts,$content = null){
|
||||
extract(shortcode_atts(array(
|
||||
'featured_image_source' => '',
|
||||
'fss_featured_image' => '',
|
||||
'featured_ext_image' => '',
|
||||
'fss_image_style' => '',
|
||||
'fss_image_shadow' => '',
|
||||
'fss_click_action' => '',
|
||||
'fss_image_link' => '',
|
||||
'fss_link_target' => '',
|
||||
'css_animation_image' => '',
|
||||
),$atts));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $fss_featured_image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
if ($featured_image_source == 'external_link') {
|
||||
$src = $featured_ext_image;
|
||||
} elseif ($featured_image_source == 'media_library' && !$image) {
|
||||
$src = $default_src;
|
||||
} else {
|
||||
$link = wp_get_attachment_image_src( $fss_featured_image, 'large' );
|
||||
$link = $link[0];
|
||||
$src = $link;
|
||||
}
|
||||
|
||||
if ($featured_image_source == 'external_link' && $featured_ext_image != '') {
|
||||
list($width, $height) = getimagesize($src);
|
||||
} else {
|
||||
list($width, $height) = getimagesize($link);
|
||||
}
|
||||
|
||||
$a_attrs['href'] = $fss_image_link;
|
||||
$a_attrs['target'] = $fss_link_target;
|
||||
|
||||
if ($featured_image_source == 'external_link') {
|
||||
if (!$featured_ext_image) {
|
||||
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
if ($fss_click_action == 'open_photoswipe') {
|
||||
$content_image = '<a data-size="' . $width. 'x' .$height .'" href='. $featured_ext_image . '><img src="'.$featured_ext_image.'" width="' . $width. '" height="' .$height .'" /></a>';
|
||||
} elseif ($fss_click_action == 'custom_link') {
|
||||
$content_image = '<a ' . vc_stringify_attributes( $a_attrs ) . '><img src="'.$featured_ext_image.'" width="' . $width. '" height="' .$height .'" /></a>';
|
||||
} else {
|
||||
$content_image ='<img src="'.$featured_ext_image.'" width="' . $width. '" height="' .$height .'" />';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!$fss_featured_image) {
|
||||
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
if ($fss_click_action == 'open_photoswipe') {
|
||||
$content_image = '<a data-size="' . $width. 'x' .$height .'" href='. $src . '>' . $image['thumbnail'] . '</a>';
|
||||
} elseif ($fss_click_action == 'custom_link') {
|
||||
$content_image = '<a ' . vc_stringify_attributes( $a_attrs ) . '>' . $image['thumbnail'] . '</a>';
|
||||
} else {
|
||||
$content_image = $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Animation delay */
|
||||
if ('' !== $css_animation_image) {
|
||||
$animation_delay = 'data-animation-delay="200"';
|
||||
} else {
|
||||
$animation_delay = '';
|
||||
}
|
||||
|
||||
|
||||
$wrapper_class = implode(' ', array('side-featured-wrapper', $fss_image_style, $css_animation_image, $fss_image_shadow));
|
||||
|
||||
$output = '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>
|
||||
<div class="featured-image">'.$content_image.'</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
* Template: Sticky navbar sections - Side Video
|
||||
*/
|
||||
|
||||
if(!function_exists('kd_section_set_side_video')) {
|
||||
|
||||
// Declare empty vars
|
||||
$video_w = $video_h = $embed = $cover_image = $content_image = $dimensions = $hwstring = $default_src = $animation_delay = '';
|
||||
|
||||
function kd_section_set_side_video($atts,$content = null){
|
||||
extract(shortcode_atts(array(
|
||||
'fss_video_url' => '',
|
||||
'video_image_source' => '',
|
||||
'fss_video_cover' => '',
|
||||
'video_ext_image' => '',
|
||||
'video_ext_image_size' => '',
|
||||
'fss_video_shadow' => '',
|
||||
'fss_play_button' => '',
|
||||
'css_animation_image' => '',
|
||||
),$atts));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $video_ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ($video_image_source == 'external_link') {
|
||||
if (!$video_ext_image) {
|
||||
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$content_image ='<img src="'.$video_ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
if (!$fss_video_cover) {
|
||||
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$cover_image = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $fss_video_cover, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_image = $cover_image['thumbnail'];
|
||||
}
|
||||
}
|
||||
|
||||
$video_w = 500;
|
||||
$video_h = $video_w / 1.61; //1.61 golden ratio
|
||||
global $wp_embed;
|
||||
if ( is_object( $wp_embed ) ) {
|
||||
$embed = $wp_embed->run_shortcode( '[embed width="' . $video_w . '"' . $video_h . ']' . $fss_video_url . '[/embed]' );
|
||||
}
|
||||
|
||||
/* Animation delay */
|
||||
if ('' !== $css_animation_image) {
|
||||
$animation_delay = 'data-animation-delay="200"';
|
||||
} else {
|
||||
$animation_delay = '';
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('side-featured-wrapper', $fss_video_shadow, $css_animation_image, ));
|
||||
|
||||
$output = '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>
|
||||
<div class="entry-video">
|
||||
<div class="video-cover">
|
||||
<div class="background-video-image">'.$content_image.'</div>
|
||||
<div class="play-video kd-animate '.$fss_play_button.'"><span class="fa fa-play"></span></div>
|
||||
'.$embed.'
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/*
|
||||
* Template: Team Members Classic
|
||||
*/
|
||||
|
||||
if(!function_exists('kd_team_set_classic')) {
|
||||
function kd_team_set_classic($atts,$content = null){
|
||||
extract(shortcode_atts(array(
|
||||
'title' => '',
|
||||
'title_color' => '',
|
||||
'position' => '',
|
||||
'position_color' => '',
|
||||
'description' => '',
|
||||
'description_color' => '',
|
||||
'image_source' => '',
|
||||
'image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'tm_phone' => '',
|
||||
'tm_email' => '',
|
||||
'team_bg_color' => '',
|
||||
'facebook_url' => '',
|
||||
'instagram_url' => '',
|
||||
'twitter_url' => '',
|
||||
'linkedin_url' => '',
|
||||
'github_url' => '',
|
||||
'social_color' => '',
|
||||
'team_external_url' => '',
|
||||
'team_link_text' => '',
|
||||
'team_link_target' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'team_extra_class' => '',
|
||||
),$atts));
|
||||
|
||||
$animation_delay = $default_src = $dimensions = $hwstring = $a_attrs = '';
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$output = '<div class="team-member design-classic '.$css_animation.' '.$team_extra_class.'" '.$animation_delay.'>
|
||||
<div class="team-content">
|
||||
<div class="team-image-overlay"></div>
|
||||
<div class="team-image">';
|
||||
if(isset($team_external_url) && $team_external_url !== '') {
|
||||
$output .='<a href="'.$team_external_url.'" target="'.$team_link_target.'">';
|
||||
}
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
if (!$image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
if(isset($team_external_url) && $team_external_url !== '') {
|
||||
$output .='</a>';
|
||||
}
|
||||
|
||||
$output .= '</div>
|
||||
<div class="team-content-text" '.(!empty($team_bg_color) ? 'style="background-color: '.$team_bg_color.';"' : '').'>
|
||||
<div class="team-content-text-inner">
|
||||
<h5 '.(!empty($title_color) ? 'style="color: '.$title_color.';"' : '').'>'.$title.'</h5>
|
||||
<span class="team-subtitle" '.(!empty($position_color) ? 'style="color: '.$position_color.';"' : '').'>'.$position.'</span>
|
||||
<p '.(!empty($description_color) ? 'style="color: '.$description_color.';"' : '').'>'.$description.'</p>';
|
||||
if ($team_external_url && $team_link_text) {
|
||||
$output .= '<p class="team-link"><a href="'.$team_external_url.'" target="'.$team_link_target.'">'.$team_link_text.'</a></p>';
|
||||
}
|
||||
if ($tm_phone || $tm_email) {
|
||||
$output .= '<div class="kd-team-contact">';
|
||||
if ($tm_phone) {
|
||||
$output .= '<div class="kd-team-phone"><a href="tel:'.$tm_phone.'">'.(!empty($tm_phone_label) ? '<span class="team-phone-label">'.$tm_phone_label.'</span>' : '').'<span class="fa fa-phone"></span>'.$tm_phone.'</a></div>';
|
||||
}
|
||||
|
||||
if ($tm_email) {
|
||||
$output .= '<div class="kd-team-email"><a href="mailto:'.$tm_email.'">'.(!empty($tm_email_label) ? '<span class="team-email-label">'.$tm_email_label.'</span>' : '').'<span class="fa fa-envelope"></span>'.$tm_email.'</a></div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
$output .= '</div>
|
||||
<div class="team-socials">';
|
||||
if(isset($facebook_url) && $facebook_url !== '') {
|
||||
$output .='<a href="'.$facebook_url.'" target="_blank"><span class="fa fa-facebook" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($instagram_url) && $instagram_url !== '') {
|
||||
$output .='<a href="'.$instagram_url.'" target="_blank"><span class="fa fa-instagram" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($twitter_url) && $twitter_url !== '') {
|
||||
$output .='<a href="'.$twitter_url.'" target="_blank"><span class="fa fa-twitter" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($linkedin_url) && $linkedin_url !== '') {
|
||||
$output .='<a href="'.$linkedin_url.'" target="_blank"><span class="fa fa-linkedin" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($github_url) && $github_url !== '') {
|
||||
$output .='<a href="'.$github_url.'" target="_blank"><span class="fa fa-github-alt" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
$output .='</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/*
|
||||
* Template: Team Members Creative
|
||||
*/
|
||||
|
||||
if(!function_exists('kd_team_set_creative')) {
|
||||
function kd_team_set_creative($atts,$content = null){
|
||||
extract(shortcode_atts(array(
|
||||
'title' => '',
|
||||
'title_color' => '',
|
||||
'position' => '',
|
||||
'position_color' => '',
|
||||
'image_source' => '',
|
||||
'image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'tm_phone' => '',
|
||||
'tm_email' => '',
|
||||
'team_bg_color' => '',
|
||||
'facebook_url' => '',
|
||||
'instagram_url' => '',
|
||||
'twitter_url' => '',
|
||||
'linkedin_url' => '',
|
||||
'github_url' => '',
|
||||
'social_color' => '',
|
||||
'team_external_url' => '',
|
||||
'team_link_text' => '',
|
||||
'team_link_target' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'team_extra_class' => '',
|
||||
),$atts));
|
||||
|
||||
$animation_delay = $default_src = $dimensions = $hwstring = $module_with_link = $wrapper_class = '';
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
// Link settings
|
||||
if ($team_external_url) {
|
||||
$module_with_link = 'team-with-link';
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('team-member', 'design-creative', $module_with_link, $css_animation, $team_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>
|
||||
<div class="team-content" '.(!empty($team_bg_color) ? 'style="background-color: '.$team_bg_color.';"' : '').'>
|
||||
<div class="team-image">';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
if (!$image) {
|
||||
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$output .= $image['thumbnail'];
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<div class="team-content-hover">
|
||||
<h4 '.(!empty($title_color) ? 'style="color: '.$title_color.';"' : '').'>'.$title.'</h4>
|
||||
<p class="team-subtitle" '.(!empty($position_color) ? 'style="color: '.$position_color.';"' : '').'>'.$position.'</p>';
|
||||
if ($team_external_url && $team_link_text) {
|
||||
$output .= '<p class="team-link"><a href="'.$team_external_url.'" target="'.$team_link_target.'">'.$team_link_text.'</a></p>';
|
||||
}
|
||||
|
||||
if ($tm_phone || $tm_email) {
|
||||
$output .= '<div class="kd-team-contact">';
|
||||
if ($tm_phone) {
|
||||
$output .= '<div class="kd-team-phone"><a href="tel:'.$tm_phone.'">'.(!empty($tm_phone_label) ? '<span class="team-phone-label">'.$tm_phone_label.'</span>' : '').'<span class="fa fa-phone"></span></a></div>';
|
||||
}
|
||||
|
||||
if ($tm_email) {
|
||||
$output .= '<div class="kd-team-email"><a href="mailto:'.$tm_email.'">'.(!empty($tm_email_label) ? '<span class="team-email-label">'.$tm_email_label.'</span>' : '').'<span class="fa fa-envelope"></span></a></div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
$output .= '<div class="team-socials">';
|
||||
if(isset($facebook_url) && $facebook_url !== '') {
|
||||
$output .='<a href="'.$facebook_url.'" target="_blank"><span class="fa fa-facebook" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($instagram_url) && $instagram_url !== '') {
|
||||
$output .='<a href="'.$instagram_url.'" target="_blank"><span class="fa fa-instagram" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($twitter_url) && $twitter_url !== '') {
|
||||
$output .='<a href="'.$twitter_url.'" target="_blank"><span class="fa fa-twitter" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($linkedin_url) && $linkedin_url !== '') {
|
||||
$output .='<a href="'.$linkedin_url.'" target="_blank"><span class="fa fa-linkedin" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
if(isset($github_url) && $github_url !== '') {
|
||||
$output .='<a href="'.$github_url.'" target="_blank"><span class="fa fa-github-alt" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
|
||||
}
|
||||
$output .='</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,484 @@
|
||||
<?php
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_testimonialcards extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_testimonialcards_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
if (!class_exists('tek_testimonialcards')) {
|
||||
class tek_testimonialcards extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_testimonialcards_init'));
|
||||
add_shortcode('tek_testimonialcards', array($this, 'kd_testimonialcards_container'));
|
||||
add_shortcode('tek_testimonialcards_single', array($this, 'kd_testimonialcards_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
function kd_testimonialcards_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Testimonial cards", "keydesign"),
|
||||
"description" => esc_html__("List all your client testimonials in a carousel.", "keydesign"),
|
||||
"base" => "tek_testimonialcards",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_testimonialcards_single'),
|
||||
"icon" => plugins_url('assets/element_icons/testimonial-cards.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"js_view" => 'VcColumnView',
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title section", "keydesign"),
|
||||
"param_name" => "tcard_title",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Add testimonials section title here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Title section color", "keydesign"),
|
||||
"param_name" => "tcard_title_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select title color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation style","keydesign"),
|
||||
"param_name" => "tcard_nav_style",
|
||||
"value" => array(
|
||||
"Arrows" => "nav-arrows",
|
||||
"Dots" => "nav-dots",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select navigation style.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation arrows color", "keydesign"),
|
||||
"param_name" => "tcard_navigation_color",
|
||||
"value" => array(
|
||||
"Black" => "black-navigation",
|
||||
"White" => "white-navigation",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Choose the navigation arrows color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "tcard_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "tcard_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "tcard_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "tcard_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "tcard_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "tcard_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style a particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign")
|
||||
),
|
||||
)
|
||||
));
|
||||
// Shortcode configuration
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Testimonial card", "keydesign"),
|
||||
"base" => "tek_testimonialcards_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_testimonialcards'),
|
||||
"icon" => plugins_url('assets/element_icons/testimonial-card.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "kd-back-desc",
|
||||
"heading" => esc_html__("Author name", "keydesign"),
|
||||
"param_name" => "tcards_author_name",
|
||||
"holder" => "div",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the testimonial author name.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author name text color", "keydesign"),
|
||||
"param_name" => "tcards_author_name_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose author name text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author job", "keydesign"),
|
||||
"param_name" => "tcards_author_job",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the testimonial author job.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author job text color", "keydesign"),
|
||||
"param_name" => "tcards_author_job_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose author job text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author profile image", "keydesign"),
|
||||
"param_name" => "tcards_author_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Upload author profile image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 100x100 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Testimonial text", "keydesign"),
|
||||
"param_name" => "tcards_testimonial_text",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Write the testimonial message here.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Testimonial text color", "keydesign"),
|
||||
"param_name" => "tcards_testimonial_text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose testimonial text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Testimonial box background color", "keydesign"),
|
||||
"param_name" => "tcards_testimonial_bg_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Choose testimonial box background color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation Delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "tcards_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function kd_testimonialcards_container($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'tcard_title' => '',
|
||||
'tcard_title_color' => '',
|
||||
'tcard_nav_style' => '',
|
||||
'tcard_extra_class' => '',
|
||||
'tcard_autoplay' => '',
|
||||
'tcard_autoplay_speed' => '',
|
||||
'tcard_stoponhover' => '',
|
||||
'tcard_navigation_color' => '',
|
||||
), $atts));
|
||||
|
||||
$output = '';
|
||||
|
||||
$kd_tcardsunique_id = "kd-tcards-".uniqid();
|
||||
|
||||
$output .= '
|
||||
<div class="testimonial-cards container tcards-parent '.$tcard_navigation_color.' '.$kd_tcardsunique_id.' '.$tcard_extra_class.'">
|
||||
<div class="tcards-title-nav">';
|
||||
if (!empty($tcard_title)) {
|
||||
$output .= '<h2 '.(!empty($tcard_title_color) ? 'style="color: '.$tcard_title_color.';"' : '').'>'.$tcard_title.'</h2>';
|
||||
}
|
||||
$output .= '</div>
|
||||
<div class="tcards-content">'.do_shortcode($content).'</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".testimonial-cards.'.$kd_tcardsunique_id.' .tcards-content").length) {
|
||||
$(".testimonial-cards.'.$kd_tcardsunique_id.' .tcards-content").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
dots: true,
|
||||
dotsEach: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
},
|
||||
768:{
|
||||
items:2,
|
||||
center:false,
|
||||
dots: true,
|
||||
dotsEach: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
},
|
||||
1024:{
|
||||
items:3,
|
||||
center:true,
|
||||
}
|
||||
},
|
||||
loop: true,
|
||||
rewind: true,';
|
||||
|
||||
if($tcard_nav_style == "nav-arrows") {
|
||||
$output .= 'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
} else {
|
||||
$output .='dots: true,
|
||||
dotsEach: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,';
|
||||
}
|
||||
|
||||
if($tcard_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
} else {
|
||||
$output .= 'autoplay: false,';
|
||||
}
|
||||
|
||||
if($tcard_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$tcard_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($tcard_autoplay == "auto_on" && $tcard_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
} else {
|
||||
$output .= 'autoplayHoverPause: false,';
|
||||
}
|
||||
|
||||
$output .='
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function kd_testimonialcards_single($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
'tcards_author_name' => '',
|
||||
'tcards_author_name_color' => '',
|
||||
'tcards_author_job' => '',
|
||||
'tcards_author_job_color' => '',
|
||||
'image_source' => '',
|
||||
'tcards_author_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'tcards_testimonial_text' => '',
|
||||
'tcards_testimonial_text_color' => '',
|
||||
'tcards_testimonial_bg_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'tcards_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$author_img = $tcards_author_img_array = $author_image = $animation_delay = $default_src = $dimensions = $hwstring = $kd_tcardchild_id = $child_wrapper_class = '';
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$author_image .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$author_image .='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
$tcards_author_img_array = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $tcards_author_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$author_image = $tcards_author_img_array['thumbnail'];
|
||||
}
|
||||
|
||||
//CSS Animation
|
||||
if ($css_animation == "no_animation") {
|
||||
$css_animation = "";
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$kd_tcardchild_id = "kd-cardchild-".uniqid();
|
||||
|
||||
$child_wrapper_class = implode(' ', array('key-tcards', $css_animation, $tcards_extra_class, $kd_tcardchild_id));
|
||||
|
||||
$output = '<div class="'.trim($child_wrapper_class).'" '.$animation_delay.'>
|
||||
<div class="tcards_message" '.(!empty($tcards_testimonial_bg_color) ? 'style="background-color: '.$tcards_testimonial_bg_color.';"' : '').'>
|
||||
<h6 '.(!empty($tcards_testimonial_text_color) ? 'style="color: '.$tcards_testimonial_text_color.';"' : '').'>'.$tcards_testimonial_text.'</h6>
|
||||
</div>
|
||||
<div class="tcards_header">
|
||||
<div class="tcards-image">'.$author_image.'</div>
|
||||
<h4 class="tcards-name" '.(!empty($tcards_author_name_color) ? 'style="color: '.$tcards_author_name_color.';"' : '').'>'.$tcards_author_name.'</h4>
|
||||
<p class="tcards-job" '.(!empty($tcards_author_job_color) ? 'style="color: '.$tcards_author_job_color.';"' : '').'>'.$tcards_author_job.'</p>
|
||||
</div>';
|
||||
if ($tcards_testimonial_bg_color) {
|
||||
$output .= '<style>.testimonial-cards .'.$kd_tcardchild_id.' .tcards_message:before { border-color: '.$tcards_testimonial_bg_color.' transparent transparent '.$tcards_testimonial_bg_color.'; }</style>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (class_exists('tek_testimonialcards')) {
|
||||
$tek_testimonialcards = new tek_testimonialcards;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,472 @@
|
||||
<?php
|
||||
|
||||
if (class_exists('WPBakeryShortCodesContainer')) {
|
||||
class WPBakeryShortCode_tek_testimonials extends WPBakeryShortCodesContainer {
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('WPBakeryShortCode')) {
|
||||
class WPBakeryShortCode_tek_testimonials_single extends WPBakeryShortCode {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('tek_testimonials')) {
|
||||
class tek_testimonials extends KEYDESIGN_ADDON_CLASS
|
||||
{
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_testimonials_init'));
|
||||
add_shortcode('tek_testimonials', array($this, 'kd_testimonials_container'));
|
||||
add_shortcode('tek_testimonials_single', array($this, 'kd_testimonials_single'));
|
||||
}
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_testimonials_init() {
|
||||
// Container element configuration
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Testimonial slider", "keydesign"),
|
||||
"description" => esc_html__("Sliding testimonials with author image.", "keydesign"),
|
||||
"base" => "tek_testimonials",
|
||||
"class" => "",
|
||||
"show_settings_on_create" => true,
|
||||
"content_element" => true,
|
||||
"as_parent" => array('only' => 'tek_testimonials_single'),
|
||||
"icon" => plugins_url('assets/element_icons/testimonials.png', dirname(__FILE__)),
|
||||
"category" => esc_html("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Testimonials layout","keydesign"),
|
||||
"param_name" => "tt_image_layout",
|
||||
"value" => array(
|
||||
"With image" => "with-image",
|
||||
"No image" => "without-image",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select layout - with or without image.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation style","keydesign"),
|
||||
"param_name" => "tt_nav_style",
|
||||
"value" => array(
|
||||
"Arrows" => "nav-arrows",
|
||||
"Dots" => "nav-dots",
|
||||
"Arrows and dots" => "nav-arrows-dots",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select navigation style.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Navigation color", "keydesign"),
|
||||
"param_name" => "tt_navigation_color",
|
||||
"value" => array(
|
||||
"Black" => "black-navigation",
|
||||
"White" => "white-navigation",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select the navigation color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Enable autoplay","keydesign"),
|
||||
"param_name" => "tt_autoplay",
|
||||
"value" => array(
|
||||
"Off" => "auto_off",
|
||||
"On" => "auto_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Carousel autoplay settings.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Autoplay speed","keydesign"),
|
||||
"param_name" => "tt_autoplay_speed",
|
||||
"value" => array(
|
||||
"10s" => "10000",
|
||||
"9s" => "9000",
|
||||
"8s" => "8000",
|
||||
"7s" => "7000",
|
||||
"6s" => "6000",
|
||||
"5s" => "5000",
|
||||
"4s" => "4000",
|
||||
"3s" => "3000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "tt_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Carousel autoplay speed.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Stop on hover","keydesign"),
|
||||
"param_name" => "tt_stoponhover",
|
||||
"value" => array(
|
||||
"Off" => "hover_off",
|
||||
"On" => "hover_on"
|
||||
),
|
||||
"save_always" => true,
|
||||
"dependency" => array(
|
||||
"element" => "tt_autoplay",
|
||||
"value" => array("auto_on")
|
||||
),
|
||||
"description" => esc_html__("Stop sliding carousel on mouse over.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"None" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "tt_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "tt_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
),
|
||||
"js_view" => 'VcColumnView'
|
||||
));
|
||||
|
||||
// Shortcode configuration
|
||||
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Testimonial slide", "keydesign"),
|
||||
"base" => "tek_testimonials_single",
|
||||
"content_element" => true,
|
||||
"as_child" => array('only' => 'tek_testimonials'),
|
||||
"icon" => plugins_url('assets/element_icons/testimonials.png', dirname(__FILE__)),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "textarea",
|
||||
"heading" => esc_html__("Testimonial text", "keydesign"),
|
||||
"param_name" => "tt_quote",
|
||||
"description" => esc_html__("Testimonial author quote.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"heading" => esc_html__("Author name", "keydesign"),
|
||||
"param_name" => "tt_title",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Testimonial author name.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"heading" => esc_html__("Author description", "keydesign"),
|
||||
"param_name" => "tt_position",
|
||||
"description" => esc_html__("Testimonial author description.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text font size", "keydesign"),
|
||||
"param_name" => "tt_text_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter text font size. (In px - E.g. 24px)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text color", "keydesign"),
|
||||
"param_name" => "tt_text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select text color.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Box background color", "keydesign"),
|
||||
"param_name" => "tt_bg_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select box background color.", "keydesign")
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Author image source", "keydesign"),
|
||||
"param_name" => "image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Author image", "keydesign"),
|
||||
"param_name" => "tt_image",
|
||||
"description" => esc_html__("Display testimonial author image.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external source", "keydesign"),
|
||||
"param_name" => "ext_image",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 1000x500 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "ttc_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function kd_testimonials_container($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'tt_image_layout' => '',
|
||||
'tt_nav_style' => '',
|
||||
'tt_navigation_color' => '',
|
||||
'tt_autoplay' => '',
|
||||
'tt_autoplay_speed' => '',
|
||||
'tt_stoponhover' => '',
|
||||
'css_animation' => '',
|
||||
'tt_animation_delay' => '',
|
||||
'tt_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
|
||||
|
||||
$output = $animation_delay = $wrapper_class = '';
|
||||
|
||||
// Animation delay
|
||||
if ($tt_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$tt_animation_delay;
|
||||
}
|
||||
|
||||
$kd_ttunique_id = "kd-testimonial-".uniqid();
|
||||
|
||||
$wrapper_class = implode(' ', array('slider', 'testimonials', $tt_navigation_color, $kd_ttunique_id, $tt_extra_class, $tt_image_layout, $css_animation));
|
||||
|
||||
$output .= '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>'.do_shortcode($content).'</div>';
|
||||
|
||||
$output .= '<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
if ($(".slider.testimonials.'.$kd_ttunique_id.'").length) {
|
||||
$(".slider.testimonials.'.$kd_ttunique_id.'").owlCarousel({
|
||||
stageClass: "owl-wrapper",
|
||||
stageOuterClass: "owl-wrapper-outer",
|
||||
loadedClass: "owl-carousel",
|
||||
responsive:{
|
||||
0:{
|
||||
dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,
|
||||
},
|
||||
1025:{';
|
||||
if($tt_nav_style == "nav-arrows") {
|
||||
$output .= 'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: false,';
|
||||
} elseif ($tt_nav_style == "nav-dots") {
|
||||
$output .='dots: true,
|
||||
nav: false,
|
||||
dotsSpeed: 500,';
|
||||
} elseif ($tt_nav_style == "nav-arrows-dots") {
|
||||
$output .= "\n".'nav: true,
|
||||
navSpeed: 500,
|
||||
dots: true,
|
||||
dotsSpeed: 500,
|
||||
dotsEach: true,';
|
||||
}
|
||||
$output .= '}
|
||||
},
|
||||
items: 1,
|
||||
rewind: true,
|
||||
loop: true,';
|
||||
|
||||
if($tt_autoplay == "auto_on") {
|
||||
$output .= 'autoplay: true,';
|
||||
} else {
|
||||
$output .= 'autoplay: false,';
|
||||
}
|
||||
|
||||
if($tt_autoplay_speed !== "") {
|
||||
$output .= 'autoplayTimeout: '.$tt_autoplay_speed.',';
|
||||
}
|
||||
|
||||
if($tt_autoplay == "auto_on" && $tt_stoponhover == "hover_on") {
|
||||
$output .= 'autoplayHoverPause: true,';
|
||||
} else {
|
||||
$output .= 'autoplayHoverPause: false,';
|
||||
}
|
||||
|
||||
|
||||
$output .='
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function kd_testimonials_single($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'tt_title' => '',
|
||||
'tt_quote' => '',
|
||||
'tt_position' => '',
|
||||
'tt_text_size' => '',
|
||||
'tt_text_color' => '',
|
||||
'tt_bg_color' => '',
|
||||
'image_source' => '',
|
||||
'tt_image' => '',
|
||||
'ext_image' => '',
|
||||
'ext_image_size' => '',
|
||||
'ttc_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$content_image = $default_src = $dimensions = $hwstring = $tt_color_style = $tt_bg_style = '';
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $tt_image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
if ($image_source == 'external_link') {
|
||||
if (!$ext_image) {
|
||||
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
|
||||
} else {
|
||||
$content_image ='<img src="'.$ext_image.'" '.$hwstring.' />';
|
||||
}
|
||||
} else {
|
||||
$image = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $tt_image, 'thumb_size' => 'full', 'class' => "" ) );
|
||||
$content_image = $image['thumbnail'];
|
||||
}
|
||||
|
||||
|
||||
if ($tt_text_size !== '') {
|
||||
$tt_text_style = 'font-size: '.$tt_text_size.';';
|
||||
}
|
||||
|
||||
if ($tt_text_color !== '') {
|
||||
$tt_color_style = 'color: '.$tt_text_color.';';
|
||||
}
|
||||
|
||||
if ($tt_bg_color !== '') {
|
||||
$tt_bg_style = 'background-color: '.$tt_bg_color.';';
|
||||
}
|
||||
|
||||
$output = '<div class="tt-content '.$ttc_extra_class.'">
|
||||
<div class="tt-content-inner">
|
||||
<div class="tt-container" style="'.$tt_color_style.' '.$tt_bg_style.'">
|
||||
<h6 style="'. $tt_color_style . ' ' . $tt_text_style .'"">'.$tt_quote.'</h6>
|
||||
<span class="author" '.(!empty($tt_text_color) ? 'style="color: ' . $tt_text_color . ';"' : '').'>'.$tt_title.'</span>
|
||||
<span class="content" '.(!empty($tt_text_color) ? 'style="color: ' . $tt_text_color . ';"' : '').'>'.$tt_position.'</span>
|
||||
</div>
|
||||
<div class="tt-image">'.$content_image.'</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('tek_testimonials')) {
|
||||
$tek_testimonials = new tek_testimonials;
|
||||
}
|
||||
|
||||
?>
|
||||
165
wp-content/plugins/keydesign-addon/elements/textrotator_elem.php
Normal file
165
wp-content/plugins/keydesign-addon/elements/textrotator_elem.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_TEXT_ROTATOR')) {
|
||||
|
||||
class KD_ELEM_TEXT_ROTATOR extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_textrotator_init'));
|
||||
add_shortcode('tek_textrotator', array($this, 'kd_textrotator_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_textrotator_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Text rotator", "keydesign"),
|
||||
"description" => esc_html__("Simple shortcode to rotate your texts.", "keydesign"),
|
||||
"base" => "tek_textrotator",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/text-rotator.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "param_group",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text fields", "keydesign"),
|
||||
"value" => "",
|
||||
"param_name" => "tr_text_fields",
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"heading" => __("Single item","keydesign"),
|
||||
"param_name" => "tr_text_item",
|
||||
"description" =>"",
|
||||
"admin_label" => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text align","keydesign"),
|
||||
"param_name" => "tr_text_align",
|
||||
"value" => array(
|
||||
"Left" => "text-left",
|
||||
"Center" => "text-center",
|
||||
"Right" => "text-right",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select text align.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "colorpicker",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Text color", "keydesign"),
|
||||
"param_name" => "tr_text_color",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Select text color. If none selected, the default theme color will be used.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Font size", "keydesign"),
|
||||
"param_name" => "tr_font_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter text font size. (eg. 20px, 2em, 2rem)", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation speed","keydesign"),
|
||||
"param_name" => "tr_speed",
|
||||
"value" => array(
|
||||
"Default (1s until the next word show)" => "",
|
||||
"Slow (2s)" => "slow-text-rotator",
|
||||
"Slower (3s)" => "slower-text-rotator",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select animation speed.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "tr_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
public function kd_textrotator_shrt($atts, $content = null) {
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'tr_text_fields' => '',
|
||||
'tr_text_align' => '',
|
||||
'tr_text_color' => '',
|
||||
'tr_font_size' => '',
|
||||
'tr_speed' => '',
|
||||
'tr_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$text_rotator_container = $kd_rotator_id = $i = $j = $output = $item_increment_class = $last_elem_class = $last_elem_style = $numItems = '';
|
||||
|
||||
$kd_rotator_id = "kd-rotatorid-".uniqid();
|
||||
|
||||
$output .= '<div class="kd-text-rotator '.$kd_rotator_id.' '.$tr_text_align.' '.$tr_speed.' '.$tr_extra_class.'">';
|
||||
// Text rotator container
|
||||
$text_rotator_container .= '<div class="kd-text-rotator-container">';
|
||||
$tr_text_fields = json_decode( urldecode( $tr_text_fields ), true );
|
||||
|
||||
|
||||
if( isset( $tr_text_fields ) ) {
|
||||
$i = 1;
|
||||
$j = 0;
|
||||
$numItems = count($tr_text_fields);
|
||||
foreach ( $tr_text_fields as $tr_text_fields_data ){
|
||||
if(++$j === $numItems) {
|
||||
$j++;
|
||||
$last_elem_class = 'last';
|
||||
if ($tr_speed == 'slow-text-rotator') {
|
||||
$last_elem_style = 'transition: all 0.5s '.(1+$j*2-4).'s;';
|
||||
} elseif ($tr_speed == 'slower-text-rotator') {
|
||||
$last_elem_style = 'transition: all 0.5s '.(1+$j*3-6).'s;';
|
||||
} else {
|
||||
$last_elem_style = 'transition: all 0.5s '.(0.5+$j*1.25-2.5).'s;';
|
||||
}
|
||||
}
|
||||
$item_increment_class = 'kd-rotator-item-'.$i++;
|
||||
$text_rotator_container .= '<h2 class="rotator-single '.$item_increment_class.' '.$last_elem_class.'" style="'.$last_elem_style . (!empty($tr_text_color) ? ' color: '.$tr_text_color.';' : '') . (!empty($tr_font_size) ? ' font-size: '.$tr_font_size.';' : '').'">';
|
||||
if ( isset( $tr_text_fields_data["tr_text_item"] ) ){
|
||||
$text_rotator_container .= $tr_text_fields_data["tr_text_item"];
|
||||
}
|
||||
$text_rotator_container .= '</h2>';
|
||||
}
|
||||
}
|
||||
|
||||
$text_rotator_container .= '</div>';
|
||||
|
||||
$output .= $text_rotator_container;
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_TEXT_ROTATOR')) {
|
||||
$KD_ELEM_TEXT_ROTATOR = new KD_ELEM_TEXT_ROTATOR;
|
||||
}
|
||||
|
||||
?>
|
||||
192
wp-content/plugins/keydesign-addon/elements/vendors/vendor-contact-form-7.php
vendored
Normal file
192
wp-content/plugins/keydesign-addon/elements/vendors/vendor-contact-form-7.php
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('KD_ELEM_CONTACT_FORM')) {
|
||||
|
||||
class KD_ELEM_CONTACT_FORM extends KEYDESIGN_ADDON_CLASS {
|
||||
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_contactform_init'));
|
||||
add_shortcode('tek_contactform', array($this, 'kd_contactform_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
|
||||
function kd_contactform_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
$cf7 = get_posts( 'post_type="wpcf7_contact_form"&numberposts=-1' );
|
||||
|
||||
$contact_forms = array();
|
||||
if ( $cf7 ) {
|
||||
foreach ( $cf7 as $cform ) {
|
||||
$contact_forms[ $cform->post_title ] = $cform->ID;
|
||||
}
|
||||
} else {
|
||||
$contact_forms[ __( 'No contact forms found', 'js_composer' ) ] = 0;
|
||||
}
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Contact Form 7", "keydesign"),
|
||||
"description" => esc_html__("Place Contact Form 7", "keydesign"),
|
||||
"base" => "tek_contactform",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('../assets/element_icons/contact-form.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Form name","keydesign"),
|
||||
"param_name" => "contact_form_id",
|
||||
"value" => $contact_forms,
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select contact form from the drop down list.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Search title", "keydesign"),
|
||||
"param_name" => "contact_form_title",
|
||||
"value" => "",
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter optional title to search if no ID selected or cannot find by ID.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Form style","keydesign"),
|
||||
"param_name" => "contact_form_style",
|
||||
"value" => array(
|
||||
"Full width fields" => "full-width-cf",
|
||||
"Inline fields" => "inline-cf",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select contact from style.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Form field background","keydesign"),
|
||||
"param_name" => "contact_form_bg",
|
||||
"value" => array(
|
||||
"Default" => "",
|
||||
"White background" => "white-input-bg",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select field background color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Label color","keydesign"),
|
||||
"param_name" => "contact_form_label_color",
|
||||
"value" => array(
|
||||
"Default" => "",
|
||||
"White" => "white-label-color",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Overwrite label text color.", "keydesign"),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS Animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "elem_animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "contact_form_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
|
||||
public function kd_contactform_shrt($atts, $content = null) {
|
||||
// Declare empty vars
|
||||
$animation_delay = $wrapper_class = '';
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'contact_form_id' => '',
|
||||
'contact_form_title' => '',
|
||||
'contact_form_style' => '',
|
||||
'contact_form_bg' => '',
|
||||
'contact_form_label_color' => '',
|
||||
'css_animation' => '',
|
||||
'elem_animation_delay' => '',
|
||||
'contact_form_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
// Animation delay
|
||||
if ($elem_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('kd-contact-form', $contact_form_style, $contact_form_bg, $contact_form_label_color, $css_animation, $contact_form_extra_class));
|
||||
|
||||
$output = '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>';
|
||||
$output .= do_shortcode('[contact-form-7 id="'.$contact_form_id .'"]' );
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_CONTACT_FORM')) {
|
||||
$KD_ELEM_CONTACT_FORM = new KD_ELEM_CONTACT_FORM;
|
||||
}
|
||||
|
||||
?>
|
||||
346
wp-content/plugins/keydesign-addon/elements/video_elem.php
Normal file
346
wp-content/plugins/keydesign-addon/elements/video_elem.php
Normal file
@@ -0,0 +1,346 @@
|
||||
<?php
|
||||
if (!class_exists('KD_ELEM_VIDEO')) {
|
||||
class KD_ELEM_VIDEO extends KEYDESIGN_ADDON_CLASS {
|
||||
function __construct() {
|
||||
add_action('init', array($this, 'kd_video_init'));
|
||||
add_shortcode('tek_video', array($this, 'kd_video_shrt'));
|
||||
}
|
||||
|
||||
// Element configuration in admin
|
||||
function kd_video_init() {
|
||||
if (function_exists('vc_map')) {
|
||||
vc_map(array(
|
||||
"name" => esc_html__("Video Modal", "keydesign"),
|
||||
"description" => esc_html__("Video modal", "keydesign"),
|
||||
"base" => "tek_video",
|
||||
"class" => "",
|
||||
"icon" => plugins_url('assets/element_icons/video-modal.png', dirname(__FILE__)),
|
||||
"category" => esc_html__("KeyDesign Elements", "keydesign"),
|
||||
"params" => array(
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video source", "keydesign"),
|
||||
"param_name" => "video_source",
|
||||
"value" => array(
|
||||
"YouTube/Vimeo" => "yt-vimeo-video",
|
||||
"HTML5 Video" => "html-video",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "kd_param_notice",
|
||||
"text" => "<span style='display: block;'>Please use the YouTube embed link for the video - see the following <a href='".plugins_url('assets/img/youtube-embed.png', dirname(__FILE__))."' target='_blank'>image</a>.</span>",
|
||||
"param_name" => "notification",
|
||||
"edit_field_class" => "vc_column vc_col-sm-12",
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("yt-vimeo-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video link", "keydesign"),
|
||||
"param_name" => "video_url",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter link to video.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("yt-vimeo-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video title", "keydesign"),
|
||||
"param_name" => "video_title",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter video title.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("html-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video URL MP4", "keydesign"),
|
||||
"param_name" => "video_url_mp4",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("html-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video URL OGG", "keydesign"),
|
||||
"param_name" => "video_url_ogg",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("html-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video URL WEBM", "keydesign"),
|
||||
"param_name" => "video_url_webm",
|
||||
"value" => "",
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("html-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Video height", "keydesign"),
|
||||
"param_name" => "video_height",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter video height. Default value is 400 pixels.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "video_source",
|
||||
"value" => array("html-video")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Cover image", "keydesign"),
|
||||
"param_name" => "video_image_source",
|
||||
"value" => array(
|
||||
"Media library" => "media_library",
|
||||
"External link" => "external_link",
|
||||
),
|
||||
"description" => esc_html__("Select video preview image source.", "keydesign"),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "attach_image",
|
||||
"heading" => esc_html__("Image", "keydesign"),
|
||||
"param_name" => "video_image",
|
||||
"description" => esc_html__("Select image from media library.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "video_image_source",
|
||||
"value" => array("media_library")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image external link", "keydesign"),
|
||||
"param_name" => "video_image_ext",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image external link.", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "video_image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Image size", "keydesign"),
|
||||
"param_name" => "ext_image_size",
|
||||
"value" => "",
|
||||
"description" => esc_html__("Enter image size in pixels. Example: 200x100 (Width x Height).", "keydesign"),
|
||||
"dependency" => array(
|
||||
"element" => "video_image_source",
|
||||
"value" => array("external_link")
|
||||
),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Play button style","keydesign"),
|
||||
"param_name" => "video_btn_style",
|
||||
"value" => array(
|
||||
"White" => "",
|
||||
"Primary theme color" => "play-btn-primary-color",
|
||||
"Secondary theme color" => "play-btn-secondary-color",
|
||||
),
|
||||
"save_always" => true,
|
||||
"description" => esc_html__("Select play button color scheme.", "keydesign"),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Play button align", "keydesign"),
|
||||
"param_name" => "video_play_align",
|
||||
"value" => array(
|
||||
"Center" => "play-button-center",
|
||||
"Left" => "play-button-left",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Open video in", "keydesign"),
|
||||
"param_name" => "video_location",
|
||||
"value" => array(
|
||||
"Modal" => "",
|
||||
"New window" => "video_location_new",
|
||||
),
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("CSS animation", "keydesign"),
|
||||
"param_name" => "css_animation",
|
||||
"value" => array(
|
||||
"No" => "",
|
||||
"Fade In" => "kd-animated fadeIn",
|
||||
"Fade In Down" => "kd-animated fadeInDown",
|
||||
"Fade In Left" => "kd-animated fadeInLeft",
|
||||
"Fade In Right" => "kd-animated fadeInRight",
|
||||
"Fade In Up" => "kd-animated fadeInUp",
|
||||
"Zoom In" => "kd-animated zoomIn",
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Select type of animation for element to be animated when it enters the browsers viewport (Note: works only in modern browsers).", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Animation delay", "keydesign"),
|
||||
"param_name" => "animation_delay",
|
||||
"value" => array(
|
||||
"0 ms" => "",
|
||||
"200 ms" => "200",
|
||||
"400 ms" => "400",
|
||||
"600 ms" => "600",
|
||||
"800 ms" => "800",
|
||||
"1 s" => "1000",
|
||||
),
|
||||
"dependency" => array(
|
||||
"element" => "css_animation",
|
||||
"value" => array("kd-animated fadeIn", "kd-animated fadeInDown", "kd-animated fadeInLeft", "kd-animated fadeInRight", "kd-animated fadeInUp", "kd-animated zoomIn")
|
||||
),
|
||||
"save_always" => true,
|
||||
"admin_label" => true,
|
||||
"description" => esc_html__("Enter animation delay in ms", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
array(
|
||||
"type" => "textfield",
|
||||
"class" => "",
|
||||
"heading" => esc_html__("Extra class name", "keydesign"),
|
||||
"param_name" => "video_extra_class",
|
||||
"value" => "",
|
||||
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"),
|
||||
"group" => esc_html__( "Extras", "keydesign" ),
|
||||
),
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render the element on front-end
|
||||
public function kd_video_shrt($atts, $content = null)
|
||||
{
|
||||
|
||||
$video_id = $dimensions = $hwstring = $default_src = $img = $image_media = $image_html = $animation_delay = '';
|
||||
extract(shortcode_atts(array(
|
||||
'video_source' => '',
|
||||
'video_title' => '',
|
||||
'video_url' => '',
|
||||
'video_url_mp4' => '',
|
||||
'video_url_ogg' => '',
|
||||
'video_url_webm' => '',
|
||||
'video_height' => '',
|
||||
'video_image_source' => '',
|
||||
'video_image' => '',
|
||||
'video_image_ext' => '',
|
||||
'ext_image_size' => '',
|
||||
'video_btn_style' => '',
|
||||
'video_play_align' => '',
|
||||
'video_location' => '',
|
||||
'css_animation' => '',
|
||||
'video_animation_delay' => '',
|
||||
'video_extra_class' => '',
|
||||
), $atts));
|
||||
|
||||
$image = wpb_getImageBySize($params = array(
|
||||
'post_id' => NULL,
|
||||
'attach_id' => $video_image,
|
||||
'thumb_size' => 'full',
|
||||
'class' => ""
|
||||
));
|
||||
|
||||
$default_src = vc_asset_url( 'vc/no_image.png' );
|
||||
|
||||
$video_id .= 'kd-video-modal-'.uniqid();
|
||||
$vheight = ! empty( $video_height ) ? $video_height : '400px';
|
||||
|
||||
if ($video_image_source == 'external_link') {
|
||||
$dimensions = vc_extract_dimensions( $ext_image_size );
|
||||
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
|
||||
|
||||
$video_image_ext = $video_image_ext ? esc_attr( $video_image_ext ) : $default_src;
|
||||
|
||||
$image_media .= '<img src="'.$video_image_ext.'" '.$hwstring.' />';
|
||||
$image_html = wp_get_attachment_url( $video_image );
|
||||
} else {
|
||||
$image_media .= $image["thumbnail"];
|
||||
$image_html = $video_image_ext;
|
||||
}
|
||||
|
||||
// Animation delay
|
||||
if ($video_animation_delay) {
|
||||
$animation_delay = 'data-animation-delay='.$video_animation_delay;
|
||||
}
|
||||
|
||||
$wrapper_class = implode(' ', array('video-container', $video_play_align, $css_animation, $video_extra_class));
|
||||
|
||||
$output = '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>';
|
||||
$output .= $image_media;
|
||||
if ($video_location == 'video_location_new') {
|
||||
$output .='<a href="'.$video_url.'" class="'.$video_btn_style.'" target="_blank">';
|
||||
} else {
|
||||
$output .='<a data-toggle="modal" data-target="#video-modal-'.$video_id.'" data-src="'.$video_url.'" data-backdrop="true" class="'.$video_btn_style.'">';
|
||||
}
|
||||
|
||||
$output .='<span class="play-video"><span class="fa fa-play"></span></span></a></div>';
|
||||
|
||||
if ($video_location != 'video_location_new') {
|
||||
$output .= '<div class="modal fade video-modal" id="video-modal-'.$video_id.'" role="dialog">
|
||||
<div class="modal-content">
|
||||
<div class="row">';
|
||||
if ( $video_source == "html-video" && !empty($video_url_mp4) ) {
|
||||
$output .= '<video class="video-modal-local" title="'.$video_title.'" poster="'.$image_html.'" height="'.$vheight.'" controls>
|
||||
<source src="'.$video_url_mp4.'" type="video/mp4">';
|
||||
if (!empty($video_url_ogg)) {
|
||||
$output .= '<source src="'.$video_url_ogg.'" type="video/ogg">';
|
||||
}
|
||||
if (!empty($video_url_webm)) {
|
||||
$output .= '<source src="'.$video_url_webm.'" type="video/webm">';
|
||||
}
|
||||
$output .= '<img alt="" src="'.$image_html.'" title="Video playback is not supported by your browser" />
|
||||
</video>';
|
||||
} else {
|
||||
$output .= '<iframe width="1024" height="576" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
||||
}
|
||||
$output .= '</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('KD_ELEM_VIDEO')) {
|
||||
$KD_ELEM_VIDEO = new KD_ELEM_VIDEO;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user