function revslider_element()
 {
     global $wpdb;
     $query = "SELECT id, title, alias FROM " . $wpdb->prefix . "revslider_sliders ORDER BY id ASC LIMIT 999";
     $results = $wpdb->get_results($query);
     $slides = array();
     if ($results) {
         foreach ($results as $slider) {
             $slides[$slider->title] = $slider->alias;
         }
     } else {
         $slides[__('No sliders found', 'detheme_builder')] = 0;
     }
     add_dt_element('rev_slider_shortcode', array('title' => __('Revolution Slider', 'detheme_builder'), 'description' => __('Place Revolution slider', 'detheme_builder'), "options" => array(array('type' => 'textfield', 'heading' => __('Widget title', 'detheme_builder'), 'admin_label' => true, 'param_name' => 'title', 'description' => __('Enter text which will be used as widget title. Leave blank if no title is needed.', 'detheme_builder')), array('type' => 'dropdown', 'heading' => __('Revolution Slider', 'detheme_builder'), 'param_name' => 'alias', 'value' => $slides, 'description' => __('Select your Revolution Slider.', 'detheme_builder')), array('type' => 'textfield', 'heading' => __('Extra class name', 'detheme_builder'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'detheme_builder')))));
     function rev_slider_render_shortcode($output, $content, $atts)
     {
         extract(shortcode_atts(array('alias' => '', 'title' => '', 'el_class' => ''), $atts, 'rev_slider'));
         $output = "<div class=\"rev_slider_wrapper" . ('' != $el_class ? " " . $el_class : "") . "\">";
         $output .= do_shortcode("[rev_slider " . $alias . "]");
         $output .= "</div>";
         return $output;
     }
     function rev_slider_preview_shortcode($output, $content, $atts)
     {
         extract(shortcode_atts(array('alias' => '', 'title' => '', 'el_class' => ''), $atts, 'rev_slider'));
         $output = __('Revolution Slider', 'detheme_builder') . "<br/>";
         $output .= __('Slide', 'detheme_builder') . " :" . $alias;
         return $output;
     }
     add_dt_element_render('rev_slider_shortcode', 'rev_slider_render_shortcode');
     add_dt_element_preview('rev_slider_shortcode', 'rev_slider_preview_shortcode');
 }
                    $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes:hover:after,#{$el_id} .dt-iconboxes span.boxes:hover:before{border-top: 11px solid " . $iconbg . "!important;}";
                }
                break;
        }
        $compile = "<div ";
        if ('' != $el_id) {
            $compile .= "id=\"{$el_id}\" ";
        }
        $compile .= "class=\"" . @implode(" ", $css_class) . "\">";
        $compile .= $output . "</div>";
        if ("" != $css_style) {
            $DEstyle[] = "#{$el_id} {" . $css_style . "}";
        }
        if ($icon_size != '') {
            $DEstyle[] = "#{$el_id} i {font-size:" . $icon_size . "px;}";
        }
        return $compile;
    }
}
add_dt_element('dt_iconbox', array('title' => __('Icon Box', 'detheme_builder'), 'description' => __('Icon box description here', 'detheme_builder'), 'icon' => 'dashicons-exerpt-view', 'options' => array(array('heading' => __('Extra css Class', 'detheme_builder'), 'param_name' => 'el_class', 'type' => 'textfield', 'value' => ""), array('heading' => __('Anchor ID', 'detheme_builder'), 'param_name' => 'el_id', 'type' => 'textfield', "description" => __("Enter anchor ID without pound '#' sign", "detheme_builder")), array('heading' => __('Margin Top', 'detheme_builder'), 'param_name' => 'm_top', 'param_holder_class' => 'm_top', 'type' => 'textfield'), array('heading' => __('Margin Bottom', 'detheme_builder'), 'param_name' => 'm_bottom', 'param_holder_class' => 'm_bottom', 'type' => 'textfield'), array('heading' => __('Margin Left', 'detheme_builder'), 'param_name' => 'm_left', 'param_holder_class' => 'm_left', 'type' => 'textfield'), array('heading' => __('Margin Right', 'detheme_builder'), 'param_name' => 'm_right', 'param_holder_class' => 'm_right', 'type' => 'textfield'), array('heading' => __('Icon', 'detheme_builder'), 'param_name' => 'icon_type', 'class' => '', 'value' => '', 'description' => __('Select the icon to be displayed by clicking the icon.', 'detheme_builder'), 'type' => 'iconlists', 'default' => 'fontellopicker-picture'), array('heading' => __('Icon Size', 'detheme_builder'), 'param_name' => 'icon_size', 'class' => '', 'type' => 'slider_value', 'default' => "10", 'params' => array('min' => 10, 'max' => '100', 'step' => 1)), array('heading' => __('Layout type', 'detheme_builder'), 'param_name' => 'layout_type', 'class' => '', 'param_holder_class' => 'icon-style-label', 'type' => 'select_layout', 'value' => array('1' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-1.png" alt="' . __('Type 1: Squared Border Icon', 'detheme_builder') . '" />', '2' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-2.png" alt="' . __('Type 2: Circled Border Icon', 'detheme_builder') . '"/>', '3' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-3.png" alt="' . __('Type 3: Squared Border Icon with Counter', 'detheme_builder') . '"/>', '4' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-4.png" alt="' . __('Type 4: Squared Border Box', 'detheme_builder') . '"/>', '5' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-5.png" alt="' . __('Type 5: Circled Border and Transparent Icon', 'detheme_builder') . '"/>', '6' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-6.png" alt="' . __('Type 6: Squared Box With Hover Color', 'detheme_builder') . '"/>', '7' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-7.png" alt="' . __('Type 7: Circled boxes Icon On Left', 'detheme_builder') . '"/>', '8' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-8.png" alt="' . __('Type 8: Circled boxes Icon On Right', 'detheme_builder') . '"/>'), 'default' => '1', 'description' => __('Choose the icon layout you want to use.', 'detheme_builder')), array('heading' => __('Iconbox heading', 'detheme_builder'), 'param_name' => 'iconbox_heading', 'class' => '', 'value' => '', 'type' => 'textfield'), array('heading' => __('Iconbox Heading Color', 'detheme_builder'), 'param_name' => 'color_heading', 'class' => '', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Icon Color', 'detheme_builder'), 'param_name' => 'icon_color', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Iconbox Color', 'detheme_builder'), 'param_name' => 'iconbg', 'value' => '', 'type' => 'colorpicker', 'dependency' => array('element' => 'layout_type', 'value' => array('1', '2', '3', '4', '5', '6'))), array('heading' => __('Iconbox Counter Number', 'detheme_builder'), 'param_name' => 'iconbox_number', 'class' => '', 'value' => '', 'description' => __('A value will count-up.', 'detheme_builder'), 'type' => 'textfield', 'dependency' => array('element' => 'layout_type', 'value' => array('3'))), array('heading' => __('Iconbox text', 'detheme_builder'), 'param_name' => 'content', 'class' => '', 'value' => '', 'type' => 'textarea_html'), array('heading' => __('Link', 'detheme_builder'), 'param_name' => 'link', 'class' => '', 'value' => '', 'description' => __('', 'detheme_builder'), 'type' => 'textfield'), array('heading' => __('Target', 'detheme_builder'), 'param_name' => 'target', 'class' => '', 'value' => array(__("Blank", 'detheme_builder') => "_blank", __("Self", "detheme_builder") => "_self"), 'description' => __('Link Target', 'detheme_builder'), 'type' => 'dropdown'), array('heading' => __('Animation Type', 'detheme_builder'), 'param_name' => 'spy', 'class' => '', 'value' => array('none' => __('Scroll Spy not activated', 'detheme_builder'), 'uk-animation-fade' => __('The element fades in', 'detheme_builder'), 'uk-animation-scale-up' => __('The element scales up', 'detheme_builder'), 'uk-animation-scale-down' => __('The element scales down', 'detheme_builder'), 'uk-animation-slide-top' => __('The element slides in from the top', 'detheme_builder'), 'uk-animation-slide-bottom' => __('The element slides in from the bottom', 'detheme_builder'), 'uk-animation-slide-left' => __('The element slides in from the left', 'detheme_builder'), 'uk-animation-slide-right' => __('The element slides in from the right.', 'detheme_builder')), 'description' => __('Scroll spy effects', 'detheme_builder'), 'type' => 'dropdown'), array('heading' => __('Animation Delay', 'detheme_builder'), 'param_name' => 'scroll_delay', 'class' => '', 'default' => '300', 'description' => __('The number of delay the animation effect of the icon. in milisecond', 'detheme_builder'), 'type' => 'textfield', 'dependency' => array('element' => 'spy', 'value' => array('uk-animation-fade', 'uk-animation-scale-up', 'uk-animation-scale-down', 'uk-animation-slide-top', 'uk-animation-slide-bottom', 'uk-animation-slide-left', 'uk-animation-slide-right'))))));
function dt_iconbox_preview($output, $content, $atts)
{
    extract(shortcode_atts(array('icon_type' => '', 'layout_type' => '1'), $atts, 'dt_iconbox'));
    $values = array('1' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-1.png" alt="' . __('Type 1: Squared Border Icon', 'detheme_builder') . '" />', '2' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-2.png" alt="' . __('Type 2: Circled Border Icon', 'detheme_builder') . '"/>', '3' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-3.png" alt="' . __('Type 3: Squared Border Icon with Counter', 'detheme_builder') . '"/>', '4' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-4.png" alt="' . __('Type 4: Squared Border Box', 'detheme_builder') . '"/>', '5' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-5.png" alt="' . __('Type 5: Circled Border and Transparent Icon', 'detheme_builder') . '"/>', '6' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-6.png" alt="' . __('Type 6: Squared Box With Hover Color', 'detheme_builder') . '"/>', '7' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-7.png" alt="' . __('Type 7: Circled boxes Icon On Left', 'detheme_builder') . '"/>', '8' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/layout-8.png" alt="' . __('Type 8: Circled boxes Icon On Right', 'detheme_builder') . '"/>');
    $output = "";
    $output .= __('Icon', 'detheme_builder') . ": <i class=\"" . $icon_type . "\"></i><br/>";
    $output .= $values[$layout_type];
    return $output;
}
add_dt_element_preview('dt_iconbox', 'dt_iconbox_preview');
Example #3
0
            });
    </script>' . "\n";
        $css_style = getCssMargin($atts);
        if ('' == $el_id && '' != $css_style) {
            $el_id = "map" . getCssID() . time() . rand(11, 99);
        }
        $compile = "<div ";
        if ('' != $el_id) {
            $compile .= "id=\"{$el_id}\" ";
        }
        $compile .= '' != $el_class ? "class=\"" . $el_class . "\"" : "";
        $compile .= ">";
        if ("" != $css_style) {
            global $DEstyle;
            $DEstyle[] = "#{$el_id} {" . $css_style . "}";
        }
        $compile .= $mapscript;
        $compile .= "</div>";
        return $compile;
    }
}
add_dt_element('dt_map', array('title' => __('Google Map', 'detheme_builder'), 'icon' => 'dashicons-location', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'default' => __('Google Map', 'detheme_builder'), 'type' => 'textfield'), array('heading' => __('Extra css Class', 'detheme_builder'), 'param_name' => 'el_class', 'type' => 'textfield', 'value' => ""), array('heading' => __('Anchor ID', 'detheme_builder'), 'param_name' => 'el_id', 'type' => 'textfield', "description" => __("Enter anchor ID without pound '#' sign", "detheme_builder")), array('heading' => __('Margin Top', 'detheme_builder'), 'param_name' => 'm_top', 'param_holder_class' => 'm_top', 'type' => 'textfield'), array('heading' => __('Margin Bottom', 'detheme_builder'), 'param_name' => 'm_bottom', 'param_holder_class' => 'm_bottom', 'type' => 'textfield'), array('heading' => __('Margin Left', 'detheme_builder'), 'param_name' => 'm_left', 'param_holder_class' => 'm_left', 'type' => 'textfield'), array('heading' => __('Margin Right', 'detheme_builder'), 'param_name' => 'm_right', 'param_holder_class' => 'm_right', 'type' => 'textfield'), array('heading' => __('Latitude', 'detheme_builder'), 'param_name' => 'lat', 'param_holder_class' => 'latitude-label', 'description' => __('put your latitude coordinate your location, ex: -7.2852292', 'detheme_builder'), 'class' => '', 'value' => '-7.2852292', 'type' => 'textfield', 'default' => '-7.2852292'), array('heading' => __('Longitude', 'detheme_builder'), 'param_name' => 'lang', 'param_holder_class' => 'longitude-label', 'description' => __('put your longitude coordinate your location, ex: 112.6809869', 'detheme_builder'), 'class' => '', 'value' => '112.6809869', 'type' => 'textfield', 'default' => '112.6809869'), array('heading' => __('Zoom Level', 'detheme_builder'), 'param_name' => 'zoom', 'param_holder_class' => 'zoom-label', 'description' => __('zoom level ypur map, higher value present more detail.', 'detheme_builder'), 'class' => '', 'value' => array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21), 'type' => 'dropdown', 'default' => '15'), array('heading' => __('Zoom Control', 'detheme_builder'), 'param_name' => 'zoomcontrol', 'param_holder_class' => 'zoom-control-label', 'description' => __('Show/hide zoom control', 'detheme_builder'), 'class' => '', 'value' => array(1 => __('Show', 'detheme_builder'), 0 => __('Hidden', 'detheme_builder')), 'type' => 'radio', 'default' => '1'), array('heading' => __('Pan Control', 'detheme_builder'), 'param_name' => 'pancontrol', 'param_holder_class' => 'pan-control-label', 'description' => __('Show/hide pan control', 'detheme_builder'), 'class' => '', 'value' => array(1 => __('Show', 'detheme_builder'), 0 => __('Hidden', 'detheme_builder')), 'type' => 'radio', 'default' => '1'), array('heading' => __('Street View Control', 'detheme_builder'), 'param_name' => 'streetcontrol', 'param_holder_class' => 'street-control-label', 'description' => __('Show/hide street view control', 'detheme_builder'), 'class' => '', 'value' => array(1 => __('Show', 'detheme_builder'), 0 => __('Hidden', 'detheme_builder')), 'type' => 'radio', 'default' => '1'), array('heading' => __('Mouse Scroll Wheel', 'detheme_builder'), 'param_name' => 'scrollcontrol', 'param_holder_class' => 'mouse-scroll-label', 'description' => __('Disable/enable mouse scroll to control zoom', 'detheme_builder'), 'class' => '', 'value' => array(1 => __('Enable', 'detheme_builder'), 0 => __('Disable', 'detheme_builder')), 'type' => 'radio', 'default' => '1'), array('heading' => __('Map Height', 'detheme_builder'), 'param_name' => 'height', 'param_holder_class' => 'map-height-label', 'type' => 'textfield', 'default' => '400px'), array('heading' => __('Map Width', 'detheme_builder'), 'param_name' => 'width', 'param_holder_class' => 'map-width-label', 'type' => 'textfield', 'value' => ''), array('heading' => __('Map Marker', 'detheme_builder'), 'param_name' => 'marker', 'param_holder_class' => 'map-marker-label', 'type' => 'radio', 'value' => array('default' => __('Default', 'detheme_builder'), 'image' => __('Custom Image', 'detheme_builder')), 'default' => 'default'), array('heading' => __('Image Marker', 'detheme_builder'), 'param_name' => 'image_marker', 'class' => '', 'value' => '', 'type' => 'image', 'description' => __('Select image as marker your location on the map', 'detheme_builder'), 'dependency' => array('element' => 'marker', 'value' => array('image'))), array('heading' => __('Map Style', 'detheme_builder'), 'param_name' => 'style', 'param_holder_class' => 'map-style-label', 'type' => 'select_layout', 'value' => array('shades' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/shades.png" alt="' . __('Shades of Grey', 'detheme_builder') . '" />', 'midnight' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/midnight.png" alt="' . __('Midnight Commander', 'detheme_builder') . '" />', 'bluewater' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/bluewater.png" alt="' . __('Blue water', 'detheme_builder') . '" />', 'lightmonochrome' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/lightmonochrome.png" alt="' . __('Light Monochrome', 'detheme_builder') . '" />', 'neutralblue' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/neutralblue.png" alt="' . __('Neutral Blue', 'detheme_builder') . '" />', 'avocadoworld' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/avocadoworld.png" alt="' . __('Avocado World', 'detheme_builder') . '" />', 'nature' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/nature.png" alt="' . __('Nature', 'detheme_builder') . '" />', 'pastel' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/pastel.png" alt="' . __('Pastel Tones', 'detheme_builder') . '" />'), 'default' => 'pastel'))));
function preview_dt_map($output, $content, $atts)
{
    extract(shortcode_atts(array('style' => 'pastel'), $atts, 'dt_map'));
    $styles = array('shades' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/shades.png" alt="' . __('Shades of Grey', 'detheme_builder') . '" />', 'midnight' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/midnight.png" alt="' . __('Midnight Commander', 'detheme_builder') . '" />', 'bluewater' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/bluewater.png" alt="' . __('Blue water', 'detheme_builder') . '" />', 'lightmonochrome' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/lightmonochrome.png" alt="' . __('Light Monochrome', 'detheme_builder') . '" />', 'neutralblue' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/neutralblue.png" alt="' . __('Neutral Blue', 'detheme_builder') . '" />', 'avocadoworld' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/avocadoworld.png" alt="' . __('Avocado World', 'detheme_builder') . '" />', 'nature' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/nature.png" alt="' . __('Nature', 'detheme_builder') . '" />', 'pastel' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/pastel.png" alt="' . __('Pastel Tones', 'detheme_builder') . '" />');
    $output = $styles[$style];
    return $output;
}
add_dt_element_preview('dt_map', 'preview_dt_map');