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_Module.php
<?php
if(!class_exists('VC_Module'))
{
	class VC_Module {
		private  $name;
		public function __construct($name) {
			$this->name = $name;
			add_action( 'admin_init', array( $this, 'add_animation' ) );
		}

		public function add_animation(){
			$animations = array(
				'' => 'none',
				'flash' => 'flash',
				'bounce' => 'bounce',
				'shake' => 'shake',
				'tada' => 'tada',
				'swing' => 'swing',
				'flip' => 'flip',
				'fadeIn' => 'fadeIn',
				'fadeInUp' => 'fadeInUp',
				'fadeInDown' => 'fadeInDown',
				'fadeInLeft' => 'fadeInLeft',
				'fadeInRight' => 'fadeInRight',
			);
			if(function_exists('vc_add_param')){
			vc_add_param($this->name, array(
				"type" => "dropdown",
				"heading" => __("CSS Animation", 'hattan-plugin'),
				"param_name" => "css_animation",
				"value" => $animations,
				"description" => __("Select Animation type", 'hattan-plugin'),
				"group" => __("Animations", 'hattan-plugin')
				) );
			}
			
		}
		
		public function add_div_animation($html,$animation){
			if($animation != ""  && !empty($animation)){
				$new_html = "<div data-animate=\"{$animation}\">";
				$new_html .= $html;
				$new_html .= "</div>"; 
				return $new_html;
			}  else {
				return $html;
			} 

		}
                
                public function buildStyle($color = "", $size = "", $background = "",$border_color = ""){
                    $custom_css = "";
                    
                    if($color != "")
                    {
                        $custom_css .= "color:{$color} !important;";
                    }
                    
                    if($size != ""){
                        $custom_css .= "font-size:{$size} !important;";
                    }
                    
                    if($background != ""){
                        $custom_css .= "background-color:{$background} !important;";
                    }

                    if($border_color != ""){
                        $custom_css .= "border-color:{$border_color} !important;";
                    }
                    if($background != "" || $size != "" || $color != ""){
                        return " style=\"".$custom_css."\"";
                    }
                    
                }

        public function setIcon($type,$icon_fontawesome,$icon_openiconic,$icon_typicons,$icon_entypo,$icon_lineicons,$icon_linestyle){
            $icon = "";
            if($type == 'fontawesome'){
                $icon = $icon_fontawesome;
            }elseif($type == 'openiconic'){
                $icon = $icon_openiconic;
            }elseif($type == 'typicons'){
                $icon = $icon_typicons;
            }elseif($type == 'entypo'){
                $icon = $icon_entypo;
            }elseif($type == 'linecons'){
                $icon = $icon_lineicons;
            }elseif($type == 'linestyle'){
                $icon = $icon_linestyle;
            }

            return $icon;
        }
	}
}