Files
doitinpoland.com/wp-content/plugins/em-helper-plugin/includes/shortcodes/em_team_section.php
2023-09-12 21:41:04 +02:00

519 lines
20 KiB
PHP

<?php
/*
* Team Section
* Author: EM40
* Author URI: http://themexbd.com
* Version: 1.0
*/
/**
* =======================================================
* KC Shortcode Map
* =======================================================
*/
add_action('init', 'em_team_sections');
if(!function_exists('em_team_sections')):
function em_team_sections(){
if(function_exists('kc_add_map')):
kc_add_map(
array(
'em_team_sections' => array(
'name' => __( 'EM Team Item', 'cyber' ),
'title' => 'Team Settings',
'icon' => 'kc-icon-team',
'category' => 'cyber',
'wrapper_class' => 'clearfix',
'description' => __( 'Display teams layout style.', 'cyber' ),
'params' => array(
'general' => array(
array(
'name' => 'image',
'label' => __( 'Avatar Image', 'cyber' ),
'type' => 'attach_image'
),
array(
'type' => 'text',
'label' => __( 'Image Size', 'cyber' ),
'name' => 'img_size',
'value' => 'full',
'description' => __(' Set the image size: "full", "thumbnail", "medium", "large" or other size ', 'cyber'),
),
array(
'type' => 'text',
'name' => 'title',
'label' => __( 'Name', 'cyber' ),
'value' => 'Team Member Name',
'admin_label' => true
),
array(
'name' => 'subtitle',
'label' => __( 'Subtitle', 'cyber' ),
'type' => 'text',
'value' => 'Founder'
),
array(
'type' => 'textarea',
'name' => 'desc',
'label' => __( 'Description', 'cyber' ),
'value' => base64_encode('Lorem ipsum dolor sit amet, consecte tur adipisicing elit. Ipsa libero ab voluptatibus itaque quas in voluptas cyber.')
),
array(
'type' => 'radio_image',
'label' => __( 'Select Team Style', 'cyber' ),
'name' => 'layout',
'admin_label' => true,
'options' => array(
'1' => EM40_EXTENSION_URI . 'asstes/images/blog/layout1.jpg',
'2' => EM40_EXTENSION_URI . 'asstes/images/blog/layout2.jpg',
'3' => EM40_EXTENSION_URI . 'asstes/images/blog/layout3.jpg',
),
'description' => __( 'Select Your Team Style', 'cyber' ),
'value' => '1'
),
array(
'type' => 'text',
'label' => __( 'Custom class', 'cyber' ),
'name' => 'custom_class',
'description' => __( 'Enter extra custom class', 'cyber' )
)
),
'socials' => array(
array(
'name' => 'facebook',
'label' => __( 'Facebook Link', 'cyber' ),
'type' => 'text',
'value' => '#',
'description' => __( 'Insert link facebook. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'twitter',
'label' => __( 'Twitter Link', 'cyber' ),
'type' => 'text',
'value' => '#',
'description' => __( 'Insert link twitter. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'google_plus',
'label' => __( 'Google Plus Link', 'cyber' ),
'type' => 'text',
'value' => '#',
'description' => __( 'Insert link google plus. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'linkedin',
'label' => __( 'Linkedin Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link linkedin. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'pinterest',
'label' => __( 'Pinterest Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link pinterest. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'flickr',
'label' => __( 'Flickr Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link flickr. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'instagram',
'label' => __( 'Instagram Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link instagram. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'dribbble',
'label' => __( 'Dribbble Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link dribbble. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'reddit',
'label' => __( 'Reddit Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link reddit. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
array(
'name' => 'email',
'label' => __( 'Email Link', 'cyber' ),
'type' => 'text',
'value' => '',
'description' => __( 'Insert link email. It hidden when field blank.', 'cyber' ),
'relation' => array(
'parent' => 'show_icon',
'show_when' => 'yes'
)
),
),
'styling' => array(
array(
'name' => 'css_custom',
'type' => 'css',
'options' => array(
array(
"screens" => "any,1024,999,767,479",
'Title' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.em-team-content-title h2'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em-team-content-title h2'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em-team-content-title h2'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em-team-content-title h2'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em-team-content-title h2'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em-team-content-title h2'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em-team-content-title h2'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em-team-content-title h2'),
),
'Subtitle' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.em-team-content-subtitle'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em-team-content-subtitle'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em-team-content-subtitle'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em-team-content-subtitle'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em-team-content-subtitle'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em-team-content-subtitle'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em-team-content-subtitle'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em-team-content-subtitle'),
),
'content bg' => array(
array('property' => 'background', 'label' => 'Background Hover Color', 'selector' => '+:hover .em-team-content-waraper'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '+:hover .em-team-content-waraper'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '+:hover .em-team-content-waraper'),
),
'Social' => array(
array('property' => 'color', 'label' => 'Icon Color', 'selector' => '.em-team-content-socials a'),
array('property' => 'color', 'label' => 'Icon Color Hover', 'selector' => '.em-team-content-socials a:hover'),
array('property' => 'background-color', 'selector' => '.em-team-content-socials a'),
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '.em-team-content-socials a:hover'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em-team-content-socials a'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em-team-content-socials a'),
array('property' => 'width', 'label' => 'Width', 'selector' => '.em-team-content-socials a'),
array('property' => 'height', 'label' => 'Height', 'selector' => '.em-team-content-socials a'),
array('property' => 'border', 'label' => 'Border', 'selector' => '.em-team-content-socials a'),
array('property' => 'border-color', 'label' => 'Border Color Hover', 'selector' => '.em-team-content-socials a:hover'),
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.em-team-content-socials a'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em-team-content-socials a'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em-team-content-socials a'),
),
'Box' => array(
array('property' => 'background'),
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+:hover'),
array('property' => 'text-align', 'label' => 'Box Text Align'),
array('property' => 'border', 'label' => 'Border'),
array('property' => 'border-color', 'label' => 'Border Color Hover'),
array('property' => 'display', 'label' => 'Display'),
array('property' => 'border-radius', 'label' => 'Border Radius'),
array('property' => 'box-shadow', 'label' => 'Box Shadow', 'selector' => '+.em-team'),
array('property' => 'box-shadow', 'label' => 'Box Shadow Hover', 'selector' => '+.em-team:hover'),
array('property' => 'margin', 'label' => 'Margin'),
array('property' => 'padding', 'label' => 'Padding'),
array('property' => 'margin', 'label' => 'Position Hover', 'selector' => '+.em-team:hover')
)
)
)
)
),
'animate' => array(
array(
'name' => 'animate',
'type' => 'animate'
)
),
)
),
)// first array
); // End add map
endif;
}
endif;
/**
* =======================================================
* Register Shortcode team section
* =======================================================
*/
// [em_team_sections title="" desc="" custom_css_class=""]
if(!function_exists('em_team_section_shortcode')){
function em_team_section_shortcode($atts,$content){
ob_start();
$em_team_sections = shortcode_atts(array(
'image' => '',
'title' => '',
'subtitle' => '',
'desc' => '',
'layout' => '1',
'facebook' => '',
'twitter' => '',
'google_plus' => '',
'flickr' => '',
'linkedin' => '',
'pinterest' => '',
'instagram' => '',
'dribbble' => '',
'email' => '',
'reddit' => '',
'custom_css' => '',
'custom_class' => '',
),$atts);
extract( $em_team_sections );
//custom class
$wrap_class = apply_filters( 'kc-el-class', $atts );
if( !empty( $custom_class ) ):
$wrap_class[] = $custom_class;
endif;
$extra_class = implode( ' ', $wrap_class );
$data_title=$data_desc=$data_subtitle=$data_img=$img_size=$img_link="";
$size_array = array('full', 'medium', 'large', 'thumbnail');
if ( !empty( $image ) ) {
if( in_array( $img_size, $size_array ) ){
$image_data = wp_get_attachment_image_src( $image, $img_size );
$img_link = $image_data[0];
}else{
$image_full_width = wp_get_attachment_image_src( $image, 'full' );
$img_link = kc_tools::createImageSize( $image_full_width[0], $img_size );
}
}
if ( !empty( $title ) ) {
$data_title .= '<div class="em-team-content-title"><h2>';
$data_title .= $title;
$data_title .= '</h2></div>';
}
if ( !empty( $desc ) ) {
$data_desc .= '<div class="em-team-content-desc">';
$data_desc .= $desc;
$data_desc .= '</div>';
}
if ( !empty( $subtitle ) ) {
$data_subtitle .= '<div class="em-team-content-subtitle">';
$data_subtitle .= $subtitle;
$data_subtitle .= '</div>';
}
switch ($layout){
case'3':
?>
<div class="em-team main-style style-three <?php echo esc_attr( $extra_class ); ?>">
<div class="em-team-content-image-inner">
<div class="em-team-content-image">
<img src="<?php echo $img_link; ?>" alt="">
</div>
<div class="em-team-content-socials-inner">
<div class="em-team-content-socials">
<?php if( !empty( $facebook ) ) : ?>
<a href="<?php echo esc_url( $facebook ); ?>" title="facebook" target="_blank"><i class="fa fa-facebook"></i></a>
<?php endif; if( !empty( $twitter ) ): ?>
<a href="<?php echo esc_url( $twitter ); ?>" title="twitter"><i class="fa fa-twitter"></i></a>
<?php endif; if( !empty( $google_plus ) ): ?>
<a href="<?php echo esc_url( $google_plus ); ?>" title="google-plus"><i class="fa fa-google-plus"></i></a>
<?php endif; if( !empty($linkedin)): ?>
<a href="<?php echo esc_url( $linkedin ); ?>" title="linkedin"><i class="fa fa-linkedin"></i></a>
<?php endif; if( !empty( $pinterest )): ?>
<a href="<?php echo esc_url( $pinterest ); ?>" title="pinterest"><i class="fa fa-pinterest"></i></a>
<?php endif; if( !empty( $flickr ) ): ?>
<a href="<?php echo esc_url( $flickr ); ?>" title="flickr"><i class="fa fa-flickr"></i></a>
<?php endif; if( !empty( $instagram ) ): ?>
<a href="<?php echo esc_url( $instagram ); ?>" title="instagram"><i class="fa fa-instagram"></i></a>
<?php endif; if( !empty( $dribbble ) ): ?>
<a href="<?php echo esc_url( $dribbble ); ?>" title="dribbble"><i class="fa fa-dribbble"></i></a>
<?php endif; if( !empty( $envelope ) ): ?>
<a href="<?php echo esc_url( $envelope ); ?>" title="envelope"><i class="fa fa-envelope"></i></a>
<?php endif; if( !empty( $reddit ) ): ?>
<a href="<?php echo esc_url( $reddit ); ?>" title="reddit"><i class="fa fa-reddit"></i></a>
<?php endif; ?>
</div>
</div>
</div>
<div class="em-team-content-waraper">
<div class="em-team-content-inner">
<div class="em-team-content-title-inner">
<?php echo $data_title; ?>
</div>
<div class="em-team-content-subtitle-inner">
<?php echo $data_subtitle; ?>
</div>
</div>
</div>
</div>
<?php
break;
case'2':
?>
<div class="em-team style-two <?php echo esc_attr( $extra_class ); ?>">
<div class="em-team-content-image-inner">
<div class="em-team-content-image">
<img src="<?php echo $img_link; ?>" alt="">
</div>
</div>
<div class="em-team-content-waraper">
<div class="em-team-content-inner">
<?php echo $data_title; ?>
<?php echo $data_subtitle; ?>
</div>
<div class="em-team-content-socials-inner">
<div class="em-team-content-socials">
<?php if( !empty( $facebook ) ) : ?>
<a href="<?php echo esc_url( $facebook ); ?>" title="facebook" target="_blank"><i class="fa fa-facebook"></i></a>
<?php endif; if( !empty( $twitter ) ): ?>
<a href="<?php echo esc_url( $twitter ); ?>" title="twitter" target="_blank"><i class="fa fa-twitter"></i></a>
<?php endif; if( !empty( $google_plus ) ): ?>
<a href="<?php echo esc_url( $google_plus ); ?>" title="google-plus" target="_blank"><i class="fa fa-google-plus"></i></a>
<?php endif; if( !empty($linkedin)): ?>
<a href="<?php echo esc_url( $linkedin ); ?>" title="linkedin" target="_blank"><i class="fa fa-linkedin"></i></a>
<?php endif; if( !empty( $pinterest )): ?>
<a href="<?php echo esc_url( $pinterest ); ?>" title="pinterest target="_blank""><i class="fa fa-pinterest"></i></a>
<?php endif; if( !empty( $flickr ) ): ?>
<a href="<?php echo esc_url( $flickr ); ?>" title="flickr" target="_blank"><i class="fa fa-flickr"></i></a>
<?php endif; if( !empty( $instagram ) ): ?>
<a href="<?php echo esc_url( $instagram ); ?>" title="instagram" target="_blank"><i class="fa fa-instagram"></i></a>
<?php endif; if( !empty( $dribbble ) ): ?>
<a href="<?php echo esc_url( $dribbble ); ?>" title="dribbble" target="_blank"><i class="fa fa-dribbble"></i></a>
<?php endif; if( !empty( $envelope ) ): ?>
<a href="<?php echo esc_url( $envelope ); ?>" title="envelope" target="_blank"><i class="fa fa-envelope"></i></a>
<?php endif; if( !empty( $reddit ) ): ?>
<a href="<?php echo esc_url( $reddit ); ?>" title="reddit" target="_blank"><i class="fa fa-reddit"></i></a>
<?php endif; ?>
</div>
</div>
<div class="em-team-content-desc">
<?php echo $data_desc; ?>
</div>
</div>
</div>
<?php
break;
default:
?>
<div class="em-team main-style <?php echo esc_attr( $extra_class ); ?>">
<div class="em-team-content-image-inner">
<div class="em-team-content-image">
<img src="<?php echo $img_link; ?>" alt="">
</div>
<div class="em-team-content-socials-inner">
<div class="em-team-content-socials">
<?php if( !empty( $facebook ) ) : ?>
<a href="<?php echo esc_url( $facebook ); ?>" title="facebook"><i class="fa fa-facebook"></i></a>
<?php endif; if( !empty( $twitter ) ): ?>
<a href="<?php echo esc_url( $twitter ); ?>" title="twitter"><i class="fa fa-twitter"></i></a>
<?php endif; if( !empty( $google_plus ) ): ?>
<a href="<?php echo esc_url( $google_plus ); ?>" title="google-plus"><i class="fa fa-google-plus"></i></a>
<?php endif; if( !empty($linkedin)): ?>
<a href="<?php echo esc_url( $linkedin ); ?>" title="linkedin"><i class="fa fa-linkedin"></i></a>
<?php endif; if( !empty( $pinterest )): ?>
<a href="<?php echo esc_url( $pinterest ); ?>" title="pinterest"><i class="fa fa-pinterest"></i></a>
<?php endif; if( !empty( $flickr ) ): ?>
<a href="<?php echo esc_url( $flickr ); ?>" title="flickr"><i class="fa fa-flickr"></i></a>
<?php endif; if( !empty( $instagram ) ): ?>
<a href="<?php echo esc_url( $instagram ); ?>" title="instagram"><i class="fa fa-instagram"></i></a>
<?php endif; if( !empty( $dribbble ) ): ?>
<a href="<?php echo esc_url( $dribbble ); ?>" title="dribbble"><i class="fa fa-dribbble"></i></a>
<?php endif; if( !empty( $envelope ) ): ?>
<a href="<?php echo esc_url( $envelope ); ?>" title="envelope"><i class="fa fa-envelope"></i></a>
<?php endif; if( !empty( $reddit ) ): ?>
<a href="<?php echo esc_url( $reddit ); ?>" title="reddit"><i class="fa fa-reddit"></i></a>
<?php endif; ?>
</div>
</div>
</div>
<div class="em-team-content-waraper">
<div class="em-team-content-inner">
<div class="em-team-content-title-inner">
<?php echo $data_title; ?>
</div>
<div class="em-team-content-subtitle-inner">
<?php echo $data_subtitle; ?>
</div>
</div>
</div>
</div>
<?php
break;
}
return ob_get_clean();
}
add_shortcode('em_team_sections' ,'em_team_section_shortcode');
}