File: D:/HostingSpaces/MvAlphen/va-bo.nl/wwwroot/wp-content/plugins/hattan-plugin/modules/VC_Counter.php
<?php
if(!class_exists('VC_Counter')){
class VC_Counter extends VC_Module{
private $shortcode_name = 'studiothemes_counter';
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() {
$icons= getIconArray();
if(function_exists('vc_map')){
vc_map(array(
"name" => "Counter",
"base" => $this->shortcode_name,
"category" => 'by Studio Themes',
"icon" => "",
"params" => array(
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Digit",'hattan-plugin'),
"param_name" => "digit",
"value" => "",
"description" => ""
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Font size (px)",'hattan-plugin'),
"param_name" => "digit_font_size",
"value" => "",
"description" => ""
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("Color",'hattan-plugin'),
"param_name" => "digit_color",
"description" => ""
),
array(
'type' => 'dropdown',
'heading' => __( 'Icon library', 'js_composer' ),
'value' => array(
__( 'Font Awesome', 'js_composer' ) => 'fontawesome',
__( 'Open Iconic', 'js_composer' ) => 'openiconic',
__( 'Typicons', 'js_composer' ) => 'typicons',
__( 'Entypo', 'js_composer' ) => 'entypo',
__( 'Linecons', 'js_composer' ) => 'linecons',
__( 'Line-Style', 'js_composer' ) => 'linestyle',
__( 'None', 'js_composer' ) => 'none'
),
'admin_label' => true,
'param_name' => 'type',
'description' => __( 'Select icon library.', 'js_composer' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'icon_fontawesome',
'value' => 'fa fa-adjust', // default value to backend editor admin_label
'settings' => array(
'emptyIcon' => false, // default true, display an "EMPTY" icon?
'iconsPerPage' => 4000, // default 100, how many icons per/page to display, we use (big number) to display all icons in single page
),
'dependency' => array(
'element' => 'type',
'value' => 'fontawesome',
),
'description' => __( 'Select icon from library.', 'js_composer' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'icon_openiconic',
'value' => 'vc-oi vc-oi-dial', // default value to backend editor admin_label
'settings' => array(
'emptyIcon' => false, // default true, display an "EMPTY" icon?
'type' => 'openiconic',
'iconsPerPage' => 4000, // default 100, how many icons per/page to display
),
'dependency' => array(
'element' => 'type',
'value' => 'openiconic',
),
'description' => __( 'Select icon from library.', 'js_composer' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'icon_typicons',
'value' => 'typcn typcn-adjust-brightness', // default value to backend editor admin_label
'settings' => array(
'emptyIcon' => false, // default true, display an "EMPTY" icon?
'type' => 'typicons',
'iconsPerPage' => 4000, // default 100, how many icons per/page to display
),
'dependency' => array(
'element' => 'type',
'value' => 'typicons',
),
'description' => __( 'Select icon from library.', 'js_composer' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'icon_entypo',
'value' => 'entypo-icon entypo-icon-note', // default value to backend editor admin_label
'settings' => array(
'emptyIcon' => false, // default true, display an "EMPTY" icon?
'type' => 'entypo',
'iconsPerPage' => 4000, // default 100, how many icons per/page to display
),
'dependency' => array(
'element' => 'type',
'value' => 'entypo',
),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'icon_linecons',
'value' => 'vc_li vc_li-heart', // default value to backend editor admin_label
'settings' => array(
'emptyIcon' => false, // default true, display an "EMPTY" icon?
'type' => 'linecons',
'iconsPerPage' => 4000, // default 100, how many icons per/page to display
),
'dependency' => array(
'element' => 'type',
'value' => 'linecons',
),
'description' => __( 'Select icon from library.', 'js_composer' ),
),
array(
"type" => "dropdown",
"heading" => __("Line-Style", 'hattan-plugin'),
"param_name" => "icon_linestyle",
"value" => $icons,
"dependency" => array('element' => "type", 'value' => array('linestyle')),
"description" => __("Visit the <a href='http://fontawesome.io/icons/'>Icons List</a> and grab the name of the icon you want to display. Ex: fa-car", 'hattan-plugin')
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Icon size (px)",'hattan-plugin'),
"param_name" => "icon_font_size",
"dependency" => array('element' => "type", 'value' => array('linestyle',
'openiconic',
'fontawesome',
'typicons',
'entypo',
'linecons')),
"value" => "",
"description" => ""
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("Icon Color",'hattan-plugin'),
"param_name" => "icon_color",
"dependency" => array('element' => "type", 'value' => array('linestyle',
'openiconic',
'fontawesome',
'typicons',
'entypo',
'linecons')),
"description" => ""
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Text",'hattan-plugin'),
"param_name" => "text",
"value" => "",
"description" => ""
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Font size (px)",'hattan-plugin'),
"param_name" => "text_font_size",
"value" => "",
"description" => ""
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("Color",'hattan-plugin'),
"param_name" => "text_color",
"description" => ""
)
)
)
);
}
}
/*
Shortcode logic how it should be rendered
*/
function studiothemes_shortcode($atts, $content = null) {
$digit = $digit_font_size = $digit_color = $type = $icon_fontawesome = $icon_openiconic = $icon_entypo = $icon_typicons = $icon_linecons = $icon_linestyle = $icon_color = $icon_font_size = $text = $text_font_size = $text_color = $css_animation = $html = $digit_style = $text_style = $icon_style = $icon = "";
$args = array(
'digit' => 'infobox1',
'digit_font_size' => '',
'digit_color' => '',
'type'=>'fontawesome',
'icon_fontawesome'=>'fa fa-adjust',
'icon_openiconic'=>'vc-oi vc-oi-dial',
'icon_typicons'=>'typcn typcn-adjust-brightness',
'icon_entypo'=>'entypo-icon entypo-icon-note',
'icon_linecons'=>'vc_li vc_li-heart',
'icon_linestyle'=>'',
'icon_color'=>'',
'icon_font_size'=>'',
'text' => '',
'text_font_size' => '',
'text_color' => '',
'css_animation' => ''
);
extract(shortcode_atts($args, $atts));
vc_icon_element_fonts_enqueue( $type );
$html .= "<div class='countdown countdown-3'>";
if(parent::setIcon($type,$icon_fontawesome,$icon_openiconic,$icon_typicons,$icon_entypo,$icon_linecons,$icon_linestyle) != ""){
$html .= "<i class='".parent::setIcon($type,$icon_fontawesome,$icon_openiconic,$icon_typicons,$icon_entypo,$icon_linecons,$icon_linestyle)."'".parent::buildStyle($icon_color,$icon_font_size)."></i>";
}
if($digit != "")
{
$html .= "<span".parent::buildStyle($digit_color,$digit_font_size)." data-from='0' data-to='".$digit."'>".$digit."</span>";
}
if($text != "")
{
$html .= "<p".parent::buildStyle($text_color,$text_font_size).">".$text."</p>";
}
$html .= "</div>";
return parent::add_div_animation($html, $css_animation);
}
}
// Finally initialize code
new VC_Counter();
}