HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/MvAlphen/va-bo.nl/wwwroot/wp-content/plugins/hattan-plugin/modules/VC_Team.php
<?php

if (!class_exists('VC_Team')) {
    class VC_Team extends VC_Module{
        private $shortcode_name = 'studiothemes_team';
        function __construct() {
            add_action('admin_init', array($this, 'studiothemes_shortcode_init'));
            parent::__construct($this->shortcode_name);
            add_shortcode($this->shortcode_name, array($this, 'studiothemes_shortcode'));
        }

        function studiothemes_shortcode_init() {
            if (function_exists('vc_map')) {
                vc_map(array(
                    "name" => "Team",
                    "base" => $this->shortcode_name,
                    "category" => 'by Studio Themes',
                    "icon" => "",
                    "allowed_container_element" => 'vc_row',
                    "params" => array(
                        array(
                            "type" => "attach_image",
                            "class" => "",
                            "admin_label" => false,
                            "heading" => __("Upload Image", 'hattan-plugin'),
                            "param_name" => "image",
                            "value" => "",
                            "description" => __("Upload the image", 'hattan-plugin'),
                        ),
                        array(
                          "type" => "dropdown",
                          "holder" => "",
                          "class" => "",
                          "heading" => __("Type InfoBox",'hattan-plugin'),
                          "param_name" => "type_team",
                          "value" => array(
                            __("Team 1",'hattan-plugin') => "team1",
                            __("Team 2",'hattan-plugin') => "team2",
                          ),
                          "description" => ""
                        ),
                        array(
                            "type" => "textfield",
                            "holder" => "p",
                            "class" => "",
                            "heading" => __("Title",'hattan-plugin'),
                            "param_name" => "team_title",
                            "description" => ""
                        ),
                        array(
                            "type" => "colorpicker",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Title Color",'hattan-plugin'),
                            "param_name" => "title_text_color",
                            "description" => ""
                        ),
                        array(
                            "type" => "textfield",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Subtitle",'hattan-plugin'),
                            "param_name" => "team_subtitle",
                            "description" => ""
                        ),
                        array(
                            "type" => "textarea",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Description",'hattan-plugin'),
                            "param_name" => "description",
                            "value" => "",
                            'dependency' => array(
                                  'element' => 'type_team',
                                  'value' => 'team2',
                              ),
                            "description" => ""
                          ),
                        array(
                            "type" => "colorpicker",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Subtitle Color",'hattan-plugin'),
                            "param_name" => "subtitle_text_color",
                            "description" => ""
                        ),
                        array(
                            "type" => "textfield",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Social Link (Facebook)",'hattan-plugin'),
                            "param_name" => "team_facebook_social_link",
                            "description" => ""
                        ),
                        array(
                            "type" => "textfield",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Social Link (Linkedin)",'hattan-plugin'),
                            "param_name" => "team_linkedin_social_link",
                            "description" => ""
                        ),
                        array(
                            "type" => "textfield",
                            "holder" => "",
                            "class" => "",
                            "heading" => __("Social Link (Google Plus)",'hattan-plugin'),
                            "param_name" => "team_google_plus_social_link",
                            "description" => ""
                        ),
                    )
                ));
            }
        }

        /*
          Shortcode logic how it should be rendered
         */

        function studiothemes_shortcode($atts, $content = null) {
            $args = array(
                'image' => '',
                'type_team' => 'team1',
                'team_title' => '',
                'title_text_color' => '',
                'team_subtitle' => '',
                'subtitle_text_color' => '',
                'description' => '',
                'team_facebook_social_link' => '',
                'team_linkedin_social_link' => '',
                'team_google_plus_social_link' => '',
                'css_animation' => ''
            );

            extract(shortcode_atts($args, $atts));
            $img_src = "";
            if (is_numeric($image)) {
                $img_src = wp_get_attachment_url($image);
            } else {
                $img_src = $image;
            }
            $html = $title_style = $subtitle_style = "";
            if ($title_text_color != "") {
                $title_style .= " style='color:" . $title_text_color . " !important'";
            }
            if ($subtitle_text_color != "") {
                $subtitle_style .= " style='color:" . $subtitle_text_color . " !important'";
            }
            if($type_team == "team1"){
                $html .= "<div class='team-member-2'>";
            }elseif($type_team == "team2"){
                $html .= "<div class='team-member'>";
            }
            $html .= "<div>";
            if ($img_src != "") {
                $html .= '<img src="' . $img_src . '" alt="" class="img-responsive">';
            }
            if($type_team == "team1"){
                if ($team_facebook_social_link != "" || $team_linkedin_social_link != "" || $team_google_plus_social_link != "") {
                    $html .= "<div class='team-info'>";
                    if ($team_facebook_social_link != "") {
                        $html .= '<a href="' . $team_facebook_social_link . '" class="social-2"><i class="fa fa-facebook"></i></a>';
                    }
                    if ($team_linkedin_social_link != "") {
                        $html .= '<a href="' . $team_linkedin_social_link . '" class="social-2"><i class="fa fa-linkedin"></i></a>';
                    }
                    if ($team_google_plus_social_link != "") {
                        $html .= '<a href="' . $team_google_plus_social_link . '" class="social-2"><i class="fa fa-google-plus"></i></a>';
                    }

                    $html .= "</div>";
                }
            }
            elseif($type_team == "team2"){
                $html .= "<div class='team-info'>";
                $html .= "<div class=\"tb\">";
                $html .= "<div class=\"tb-cell\">";
                if($description != ""){
                    $html .= "<p>".$description."</p>";
                }
                if ($team_facebook_social_link != "" || $team_linkedin_social_link != "" || $team_google_plus_social_link != "") {
                    $html .= "<footer>";
                    if ($team_facebook_social_link != "") {
                        $html .= '<a href="' . $team_facebook_social_link . '" class="social-2"><i class="fa fa-facebook"></i></a>';
                    }
                    if ($team_linkedin_social_link != "") {
                        $html .= '<a href="' . $team_linkedin_social_link . '" class="social-2"><i class="fa fa-linkedin"></i></a>';
                    }
                    if ($team_google_plus_social_link != "") {
                        $html .= '<a href="' . $team_google_plus_social_link . '" class="social-2"><i class="fa fa-google-plus"></i></a>';
                    }
                    $html .= "</footer>";
                }
                $html .= "</div>";
                $html .= "</div>";
                $html .= "</div>";
            }

            $html .= "</div>";
            if ($team_title != "") {
                $html .= "<h6" . $title_style . ">" . $team_title . "</h6>";
            }
            if ($team_subtitle != "") {
                $html .= "<p" . $subtitle_style . ">" . $team_subtitle . "</p>";
            }
            $html .= "</div>";


            return parent::add_div_animation($html, $css_animation);
        }

    }

    // Finally initialize code
    new VC_Team();
}