File: D:/HostingSpaces/MvAlphen/va-bo.nl/wwwroot/wp-content/plugins/hattan-plugin/modules/VC_FlipBox.php
<?php
if (!class_exists('VC_FlipBox')) {
class VC_FlipBox extends VC_Module {
private $shortcode_name = 'studiothemes_flipbox';
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')) {
$icons = getIconArray();
vc_map(array(
"name" => "Flip Box",
"base" => $this->shortcode_name,
"category" => 'by Studio Themes',
"icon" => "",
"params" => array(
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'
),
'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" => __("Heading", 'hattan-plugin'),
"param_name" => "heading",
"value" => "",
"description" => ""
),
array(
"type" => "textarea",
"holder" => "",
"class" => "",
"heading" => __("Content", 'hattan-plugin'),
"param_name" => "content_flipbox",
"value" => "",
"description" => ""
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Icon Size", 'hattan-plugin'),
"param_name" => "icon_size",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("Icon Color", 'hattan-plugin'),
"param_name" => "icon_color",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Heading Size", 'hattan-plugin'),
"param_name" => "heading_size",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("Heading Color", 'hattan-plugin'),
"param_name" => "heading_color",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => __("Content Size", 'hattan-plugin'),
"param_name" => "content_size",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("Content Color", 'hattan-plugin'),
"param_name" => "content_color",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("FlipBox Backgroud Front", 'hattan-plugin'),
"param_name" => "flipbox_bg",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
array(
"type" => "colorpicker",
"holder" => "",
"class" => "",
"heading" => __("FlipBox Backgroud Back", 'hattan-plugin'),
"param_name" => "flipbox_bgb",
"description" => "",
"group" => __("Style", 'hattan-plugin')
),
)
)
);
}
}
function studiothemes_shortcode($atts, $content = null) {
$output = $type = $icon_fontawesome = $icon_openiconic = $icon_entypo = $icon_typicons = $icon_linecons = $icon_linestyle = $icon = $heading = $content = $icon_size = $icon_color = $heading_size = $heading_color = $content_size = $content_color = $flipbox_bg = $flipbox_bgb = $css_animation = '';
$args = array(
'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'=>'',
'heading' => '',
'content_flipbox' => '',
'icon_size' => '',
'icon_color' => '',
'heading_size' => '',
'heading_color' => '',
'content_color' => '',
'content_size' => '',
'flipbox_bg' => '',
'flipbox_bgb' => '',
'css_animation' => ''
);
extract(shortcode_atts($args, $atts));
vc_icon_element_fonts_enqueue( $type );
$icon = parent::setIcon($type,$icon_fontawesome,$icon_openiconic,$icon_typicons,$icon_entypo,$icon_linecons,$icon_linestyle);
$output .= '<article class="flip-container">';
$output .= '<div class = "flipper">';
$output .= '<div class = "front"'.parent::buildStyle("","",$flipbox_bg).'>';
$output .= '<div class = "flipper-container">';
$output .= "<i class = \"{$icon}\"".parent::buildStyle($icon_color,$icon_size)."></i>";
$output .= "<h4".parent::buildStyle($heading_color,$heading_size).">{$heading}</h4>";
$output .= '</div>';
$output .= '</div>';
$output .= '<div class = "back"'.parent::buildStyle("","",$flipbox_bgb).'>';
$output .= '<div class = "flipper-container">';
$output .= "<p".parent::buildStyle($content_color,$content_size).">".do_shortcode($content_flipbox)."</p>";
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
$output .= '</article>';
return parent::add_div_animation($output, $css_animation);
}
}
// Finally initialize code
new VC_FlipBox();
}