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'); }
' . $widgetID . '.trigger(\'owl.prev\'); });'; $script .= '} catch(err){} });</script>'; $compile .= $script; if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } } wp_reset_query(); return $compile; } } add_dt_element('dt_portfolio', array('title' => __('Portfolio Image', 'detheme_builder'), 'icon' => 'dashicons-schedule', 'class' => '', 'options' => array(array('heading' => __('Label', 'detheme_builder'), 'param_name' => 'label', 'type' => 'textfield', 'admin_label' => true), 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' => __('Category', 'detheme_builder'), 'param_name' => 'portfolio_cat', 'value' => '', 'type' => 'portfolio_categories'), array('heading' => __('Number of Posts to be displayed', 'detheme_builder'), 'param_name' => 'portfolio_num', 'value' => '10', 'type' => 'textfield'), array('heading' => __('Slide Speed', 'detheme_builder'), 'param_name' => 'speed', 'class' => '', 'value' => '800', 'description' => __('Slide speed (in millisecond). The lower value the faster slides', 'detheme_builder'), 'type' => 'textfield'), array('heading' => __('Scroll Per Page', 'detheme_builder'), 'param_name' => 'scroll_page', 'class' => '', 'default' => 0, 'value' => array('1' => __('Yes', 'detheme_builder'), '0' => __('No', 'detheme_builder')), 'type' => 'radio'), array('heading' => __('Autoplay', 'detheme_builder'), 'param_name' => 'autoplay', 'description' => __('Set Autoplay', 'detheme_builder'), 'class' => '', 'default' => '0', 'value' => array('1' => __('Yes', 'detheme_builder'), '0' => __('No', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Slide Interval', 'detheme_builder'), 'param_name' => 'interval', 'class' => '', 'default' => '1000', 'description' => __('Slide Interval (in millisecond)', 'detheme_builder'), 'type' => 'textfield', 'dependency' => array('element' => 'autoplay', 'value' => array('1'))), 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' => '', 'value' => '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 get_portfolio_categories($settings, $value) { $dependency = create_dependency_param($settings); $output = ""; $args = array('orderby' => 'name', 'show_count' => 0, 'pad_counts' => 0, 'hierarchical' => 0, 'taxonomy' => 'portcat', 'title_li' => ''); $categories = get_categories($args); $output .= '<select name="' . $settings['param_name'] . '" class="' . $settings['param_name'] . ' ' . $settings['type'] . ' ">'; $output .= '<option value="">' . __('All Categories', 'detheme_builder') . '</option>'; if (count($categories)) { foreach ($categories as $category) { $selected = ''; if ($value !== '' && $category->term_id === $value) { $selected = ' selected="selected"'; } $output .= '<option value="' . $category->term_id . '"' . $selected . '>' . $category->name . '</option>';
if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div class="liner">'; $spydly = 0; $scollspy = ""; foreach ($matches as $timelineitem) { $spydly = $spydly + (int) $scroll_delay; if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } if ($timelineitem[2] == 'dt_timeline_item') { $param = shortcode_atts(array('title' => '', 'text' => '', 'icon_type' => '', 'position' => 'left'), shortcode_parse_atts($timelineitem[3]), 'dt_timeline_item'); $timelineitemcontent = '<div class="time-item ' . $param['position'] . '" ' . $scollspy . '>' . do_shortcode($timelineitem[0]) . '</div>'; } else { $timelineitemcontent = '<div class="time-separator" ' . $scollspy . '>' . do_shortcode($timelineitem[0]) . '</div>'; } $compile .= $timelineitemcontent; } $compile .= "</div></div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return "<!--- start timeline -->" . $compile . "<!--- end timeline -->"; } } add_dt_element('dt_timeline', array('title' => __('Timeline', 'detheme_builder'), 'as_parent' => array('dt_timeline_item', 'dt_timeline_sep'), 'icon' => 'dashicons-flag', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => __('Timeline', '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' => __('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')))))); add_dt_element('dt_timeline_item', array('title' => __('Timeline Item', 'detheme_builder'), 'as_child' => 'dt_timeline', 'options' => array(array('heading' => __('Layout type', 'detheme_builder'), 'param_name' => 'position', 'param_holder_class' => 'item-position', 'admin_label' => true, 'value' => array('left' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/timeline-left.png" alt="' . __('Left', 'detheme_builder') . '" />', 'right' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/timeline-right.png" alt="' . __('Right', 'detheme_builder') . '"/>'), 'type' => 'select_layout', 'default' => 'left'), array('heading' => __('Icon Box Style', 'detheme_builder'), 'param_name' => 'icon_box', 'class' => '', 'value' => array('square' => __('Square', 'detheme_builder'), 'circle' => __('Circle', 'detheme_builder')), 'default' => 'square', 'type' => 'radio'), 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'), array('heading' => __('Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Text', 'detheme_builder'), 'param_name' => 'content', 'value' => '', 'type' => 'textarea_html')))); add_dt_element('dt_timeline_sep', array('title' => __('Timeline Separator', 'detheme_builder'), 'as_child' => 'dt_timeline', 'options' => array(array('heading' => __('Content', 'detheme_builder'), 'param_name' => 'text', 'admin_label' => true, 'value' => '', 'type' => 'textarea'))));
} }); </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');
array_push($css_class, $layout_type); } if ('section-heading-polkadot-left-right' == $layout_type) { array_push($css_class, "hide-overflow"); } if ($layout_type == 'section-heading-swirl') { $after_heading .= '<svg viewBox="0 0 ' . ($text_align == 'left' ? "104" : ($text_align == 'right' ? "24" : "64")) . ' 22"' . ($separator_color != '' ? " style=\"color:" . $separator_color . "\"" : "") . '> <use xlink:href="' . get_dt_plugin_dir_url() . 'images/source.svg#swirl"></use> </svg>'; } elseif ($layout_type == 'section-heading-wave') { $after_heading .= '<svg viewBox="0 0 ' . ($text_align == 'left' ? "126" : ($text_align == 'right' ? "2" : "64")) . ' 30"' . ($separator_color != '' ? " style=\"color:" . $separator_color . "\"" : "") . '> <use xlink:href="' . get_dt_plugin_dir_url() . 'images/source.svg#wave"></use> </svg>'; } $compile .= 'class="' . @implode(" ", $css_class) . '">'; $compile .= '<div class="dt-section-container"><h2 class="section-main-title ' . $layout_type . ' ' . $decoration_position . '"' . (count($heading_style) ? " style=\"" . @implode(";", $heading_style) . "\"" : "") . '> ' . $main_heading . ' </h2>' . $after_heading . ' </div></div>'; } else { $compile .= 'class="' . @implode(" ", $css_class) . '"> <div>' . (!empty($main_heading) ? '<h2' . (count($heading_style) ? " style=\"" . @implode(";", $heading_style) . "\"" : "") . ' class="section-main-title">' . $main_heading . '</h2>' : '') . '</div></div>'; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } add_dt_element('section_header', array('title' => __('Section Heading', 'detheme_builder'), 'base' => 'section_header', 'icon' => 'dashicons-editor-textcolor', 'class' => '', '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' => __('Separator', 'detheme_builder'), 'param_name' => 'use_decoration', 'type' => 'radio', 'value' => array('1' => __("Yes", 'detheme_builder'), '0' => __("No", 'detheme_builder')), 'default' => 1), array('heading' => __('Layout type', 'detheme_builder'), 'param_name' => 'layout_type', 'class' => '', 'param_holder_class' => 'section-heading-style', 'type' => 'select_layout', 'value' => array('section-heading-border' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_01.png" alt="' . __('Type 1: Borderer', 'detheme_builder') . '" />', 'section-heading-border-top-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_02.png" alt="' . __('Type 2: Border Top-Bottom', 'detheme_builder') . '"/>', 'section-heading-polkadot-two-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_03.png" alt="' . __('Type 3: Two Bottom Polkadot', 'detheme_builder') . '"/>', 'section-heading-colorblock' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_06.png" alt="' . __('Type 4: Color Background', 'detheme_builder') . '"/>', 'section-heading-point-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_07.png" alt="' . __('Type 5: ', 'detheme_builder') . '"/>', 'section-heading-thick-border' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_08.png" alt="' . __('Type 6: ', 'detheme_builder') . '"/>', 'section-heading-thin-border' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_11.png" alt="' . __('Type 7: ', 'detheme_builder') . '"/>', 'section-heading-polkadot-left-right' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_14.png" alt="' . __('Type 8: ', 'detheme_builder') . '"/>', 'section-heading-polkadot-top' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_15.png" alt="' . __('Type 9: ', 'detheme_builder') . '"/>', 'section-heading-polkadot-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_16.png" alt="' . __('Type 10: ', 'detheme_builder') . '"/>', 'section-heading-double-border-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_17.png" alt="' . __('Type 11: ', 'detheme_builder') . '"/>', 'section-heading-thin-border-top-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_18.png" alt="' . __('Type 12: ', 'detheme_builder') . '"/>', 'section-heading-swirl' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_19.png" alt="' . __('Type 13: ', 'detheme_builder') . '"/>', 'section-heading-wave' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_20.png" alt="' . __('Type 14: ', 'detheme_builder') . '"/>'), 'dependency' => array('element' => 'use_decoration', 'value' => array('1'))), array('heading' => __('Separator Position', 'detheme_builder'), 'param_name' => 'separator_position', 'class' => '', 'value' => array('center' => __('Center', 'detheme_builder'), 'left' => __('Left', 'detheme_builder'), 'right' => __('Right', 'detheme_builder')), 'type' => 'dropdown', 'default' => 'center', 'dependency' => array('element' => 'use_decoration', 'value' => array('1'))), 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' => __('Text Heading', 'detheme_builder'), 'param_name' => 'main_heading', 'class' => '', 'value' => '', 'type' => 'textfield'), array('heading' => __('Text Alignment', 'detheme_builder'), 'param_name' => 'text_align', 'class' => '', 'value' => array('center' => __('Center', 'detheme_builder'), 'left' => __('Left', 'detheme_builder'), 'right' => __('Right', 'detheme_builder')), 'type' => 'dropdown', 'default' => 'center'), array('heading' => __('Font Size', 'detheme_builder'), 'param_name' => 'font_size', 'default' => "default", 'value' => array('xlarge' => __('Extra Large', 'detheme_builder'), 'large' => __('Large', 'detheme_builder'), 'default' => __('Default', 'detheme_builder'), 'small' => __('Small', 'detheme_builder'), 'exsmall' => __('Extra small', 'detheme_builder'), 'custom' => __('Custom Size', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Custom Font Size', 'detheme_builder'), 'param_name' => 'custom_font_size', 'value' => '', 'type' => 'textfield', 'dependency' => array('element' => 'font_size', 'value' => array('custom'))), array('heading' => __('Font Style', 'detheme_builder'), 'param_name' => 'font_style', 'default' => "default", 'value' => array('italic' => __('Italic', 'detheme_builder'), 'oblique' => __('Oblique', 'detheme_builder'), 'default' => __('Default', 'detheme_builder'), 'normal' => __('Normal', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Font Weight', 'detheme_builder'), 'param_name' => 'font_weight', 'default' => "default", 'value' => array('bold' => __('Bold', 'detheme_builder'), 'bolder' => __('Bolder', 'detheme_builder'), 'normal' => __('Normal', 'detheme_builder'), 'lighter' => __('lighter', 'detheme_builder'), '100' => '100', '200' => '200', '300' => '300', '400' => '400', '500' => '500', '600' => '600', '700' => '700', '800' => '800', '900' => '900', 'default' => __('Default', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Text Color', 'detheme_builder'), 'param_name' => 'color', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Separator Color', 'detheme_builder'), 'param_name' => 'separator_color', 'value' => '', 'type' => 'colorpicker', 'dependency' => array('element' => 'use_decoration', 'value' => array('1'))), 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'))))));
wp_enqueue_style('jquery.countdown'); wp_register_script('jquery.plugin', get_dt_plugin_dir_url() . "js/jquery.plugin" . $suffix . ".js", array('jquery')); wp_enqueue_script('jquery.plugin'); wp_register_script('jquery.countdown', get_dt_plugin_dir_url() . "js/jquery.countdown" . $suffix . ".js", array('jquery.plugin')); wp_enqueue_script('jquery.countdown'); $until = $timeTo - $timeCurrent; $compile .= "<script type=\"text/javascript\">" . 'jQuery(document).ready(function($) {' . '\'use strict\';' . '$(\'#countdown_' . $el_id . '\').countdown({until: +' . $until . (!empty($message) && empty($url) ? ",expiryText:'" . esc_js($message) . "'" : "") . (!empty($url) ? ",expiryUrl:'" . esc_url($url) . "'" : "") . '}); ' . '});</script>'; $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div id="countdown_' . $el_id . '" class="countdown"></div></div>'; if (!empty($countdown_box_color)) { $DEstyle[] = '#countdown_' . $el_id . ' .countdown-amount{border-color: ' . $countdown_box_color . ';}'; } if (!empty($countdown_text_color)) { $DEstyle[] = '#countdown_' . $el_id . ' .countdown-amount{color: ' . $countdown_text_color . ';}'; } if (!empty($countdown_label_color)) { $DEstyle[] = '#countdown_' . $el_id . ' .countdown-period{color: ' . $countdown_label_color . ';}'; } } if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } add_dt_element('dt_countdown', array('title' => __('Countdown Timer', 'detheme_builder'), 'icon' => 'dashicons-clock', 'options' => array(array('heading' => __('Label', 'detheme_builder'), 'param_name' => 'label', 'type' => 'textfield', 'admin_label' => true), 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' => __('Box Size', 'detheme_builder'), 'param_name' => 'countdown_box_size', 'value' => array('default' => __('Default', 'detheme_builder'), 'medium' => __('Medium', 'detheme_builder'), 'small' => __('Small', 'detheme_builder')), 'default' => "default", 'type' => 'radio'), array('heading' => __('Countdown Box Color', 'detheme_builder'), 'param_name' => 'countdown_box_color', 'param_holder_class' => 'countdown-box-color', 'value' => "", 'default' => "#f16338", 'type' => 'colorpicker'), array('heading' => __('Countdown Text Color', 'detheme_builder'), 'param_name' => 'countdown_text_color', 'param_holder_class' => 'countdown-text-color', 'value' => "", 'default' => "", 'type' => 'colorpicker'), array('heading' => __('Countdown Label Color', 'detheme_builder'), 'param_name' => 'countdown_label_color', 'param_holder_class' => 'countdown-label-color', 'value' => "", 'default' => "", 'type' => 'colorpicker'), array('heading' => __('Time', 'detheme_builder'), 'param_name' => 'time', 'description' => sprintf(__('Time format hour:minute. example: %s', 'detheme_builder'), date('H:s', current_time('timestamp', 0))), 'class' => '', 'default' => date('H:s', current_time('timestamp', 0)), 'type' => 'textfield'), array('heading' => __('Day', 'detheme_builder'), 'param_name' => 'date', 'description' => sprintf(__('Fill with the day of the event. example: %s', 'detheme_builder'), date('d', current_time('timestamp', 0))), 'class' => '', 'default' => date('d', current_time('timestamp', 0)), 'type' => 'textfield'), array('heading' => __('Month', 'detheme_builder'), 'param_name' => 'month', 'description' => __('Choose the month of the event', 'detheme_builder'), 'class' => '', 'default' => date('F', current_time('timestamp', 0)), 'value' => array('January' => __('January'), 'February' => __('February'), 'March' => __('March'), 'April' => __('April'), 'May' => __('May'), 'June' => __('June'), 'July' => __('July'), 'August' => __('August'), 'September' => __('September'), 'October' => __('October'), 'November' => __('November'), 'December' => __('December')), 'type' => 'dropdown'), array('heading' => __('Year', 'detheme_builder'), 'param_name' => 'year', 'description' => sprintf(__('Fill with the year of the event. example: %d', 'detheme_builder'), date('Y', current_time('timestamp', 0))), 'class' => '', 'default' => date('Y', current_time('timestamp', 0)), 'type' => 'textfield'), array('heading' => __('On Complete Countdown Message', 'detheme_builder'), 'param_name' => 'content', 'value' => '', 'description' => __('The content will show after countdown expired. Simple html allowed', 'detheme_builder'), 'type' => 'textarea_html'), array('heading' => __('Redirect Url after countdown is completed', 'detheme_builder'), 'param_name' => 'url', 'description' => __('If countdown expired, the page will be redirected to this url', 'detheme_builder'), 'value' => '', 'type' => 'textfield'))));
function krypton_dt_builder_addon() { function krypton_dt_progressbar_item_shortcode($output, $content = "", $atts = array()) { global $DEstyle; extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'icon_type' => '', 'width' => '', 'title' => '', 'unit' => '', 'color' => '#1abc9c', 'bg' => '#ecf0f1', 'label' => '', 'icon_color' => '', 'iconbg' => '', 'value' => '10'), $atts, 'dt_progressbar_item')); $css_class = array('progress_bars'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "progress-bar" . getCssID(); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= 'class="' . @implode(" ", $css_class) . '">'; $compile .= '<div class="progress_bar"><div class=\'progress_title\'><h4>' . $title . '</h4></div> <span class=\'progress_number\'><span>' . $value . '</span>%</span> <div class=\'progress_content_outer\'> <div data-percentage=\'' . esc_attr($value) . '\' data-active="' . esc_attr($color) . '" data-nonactive="' . esc_attr($bg) . '" class=\'progress_content\'></div> </div> </div>'; $compile .= "</div>"; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_progressbar_item', 'krypton_dt_progressbar_item_shortcode'); function krypton_dt_circlebar_item_shortcode($output, $content = "", $atts = array()) { global $DEstyle; extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'unit' => '', 'title' => '', 'item_number' => '1', 'value' => '10', 'size' => '', 'color' => '#19bd9b', 'bg' => '', 'el_id' => '', 'el_class' => '', 'label_color' => '', 'unit_color' => ''), $atts, 'dt_circlebar_item')); $css_class = array('pie_chart_holder', 'normal'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "progress-bar" . getCssID(); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= 'class="' . @implode(" ", $css_class) . '">'; $compile .= '<canvas class="doughnutChart" data-noactive="' . esc_attr($bg) . '" data-active="' . esc_attr($color) . '" data-percent=\'' . esc_attr($value) . '\'></canvas> <div class=\'pie_chart_text\'> <span class=\'tocounter\'>' . $value . '</span> <h4>' . $title . '</h4> </div>'; $compile .= "</div>"; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_circlebar_item', 'krypton_dt_circlebar_item_shortcode'); remove_dt_element_option('dt_circlebar_item', 'unit'); remove_dt_element_option('dt_circlebar_item', 'size'); remove_dt_element_option('dt_circlebar_item', 'label_color'); remove_dt_element_option('dt_circlebar_item', 'unit_color'); add_dt_element_option('dt_row', array('heading' => __('Expand section width', 'Krypton'), 'param_name' => 'expanded', 'class' => '', 'value' => array("3" => __('Default', 'Krypton'), "1" => __('Expand Column', 'Krypton'), "2" => __('Expand Background', 'Krypton')), 'description' => __('Make section "out of the box".', 'Krypton'), 'type' => 'radio', 'default' => "3"), 'background_style'); function krypton_dt_row_shortcode($output, $content, $atts) { global $DEstyle; extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'image' => '', 'background_style' => '', 'background_video' => '', 'background_video_webm' => '', 'background_type' => 'image', 'background_poster' => '', 'bg_color' => '', 'm_top' => '', 'm_bottom' => '', 'm_left' => '', 'm_right' => '', 'p_top' => '', 'p_bottom' => '', 'p_left' => '', 'p_right' => '', 'expanded' => '3', 'font_color' => '', 'scroll_delay' => 300, 'spy' => ''), $atts, 'dt_row')); $css_class = array(); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_row_" . getCssID(); } $css_style = getCssMargin($atts, true); $parallax = $video = ""; if ('' != $bg_color) { $css_style['background-color'] = "background-color:{$bg_color}"; } if ($background_type == 'image' && '' != $image && ($background_image = wp_get_attachment_image_src($image, 'full'))) { $css_style['background-image'] = "background-image:url(" . esc_url($background_image[0]) . ")!important;"; switch ($background_style) { case 'parallax': $parallax = " data-speed=\"2\" data-type=\"background\" "; $css_style['background-position'] = "background-position: 0% 0%; background-repeat: no-repeat; background-size: cover"; break; case 'cover': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important; background-size: cover!important"; break; case 'no-repeat': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important;background-size:auto !important"; break; case 'repeat': $css_style['background-position'] = "background-position: 0 0 !important;background-repeat: repeat !important;background-size:auto !important"; break; case 'contain': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important;background-size: contain!important"; break; case 'fixed': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important; background-size: cover!important;background-attachment: fixed !important"; break; default: $parallax = ""; break; } } elseif ($background_type == 'video' && ($background_video != '' || $background_video_webm != '')) { $source_video = array(); if ($background_video != '') { $video_url = wp_get_attachment_url(intval($background_video)); $videodata = wp_get_attachment_metadata(intval($background_video)); if ('' != $video_url && isset($videodata['mime_type'])) { $videoformat = "video/mp4"; if (is_array($videodata) && $videodata['mime_type'] == 'video/webm') { $videoformat = "video/webm"; } $source_video[] = "<source src=\"" . esc_url($video_url) . "\" type=\"" . $videoformat . "\" />"; } } if ($background_video_webm != '' && isset($videodata['mime_type'])) { $video_url = wp_get_attachment_url(intval($background_video_webm)); $videodata = wp_get_attachment_metadata(intval($background_video_webm)); if ('' != $video_url && $background_type == 'video') { $videoformat = "video/mp4"; if (is_array($videodata) && $videodata['mime_type'] == 'video/webm') { $videoformat = "video/webm"; } $source_video[] = "<source src=\"" . esc_url($video_url) . "\" type=\"" . $videoformat . "\" />"; } } if (count($source_video)) { $poster = ""; if ($background_poster != '' && ($poster_image = wp_get_attachment_image_src($background_poster, 'full'))) { if (isset($poster_image[0]) && $poster_image[0] != '') { $poster = $poster_image[0]; } $DEstyle[] = "#{$el_id} video {background:url('" . esc_url($poster_image[0]) . "') no-repeat 0% 0% ;background-size: cover}"; } array_push($css_class, 'has-video'); $video = "<video class=\"video_background\" poster=\"" . esc_attr($poster) . "\" autoplay loop>\n" . @implode("\n", $source_video) . "</video>"; } } $templateName = get_page_template_slug(); $boxed = false; if (in_array($templateName, array('squeezeboxed.php', 'squeeze.php', 'fullwidth.php', 'woocommerce-page-full.php')) || 'nosidebar' == get_query_var('sidebar')) { $boxed = true; } $compile = ""; array_push($css_class, 'clearfix', 'dt_row'); switch ($expanded) { case "1": $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}"'; } $compile .= "class=\"" . @implode(" ", $css_class) . "\"" . $parallax . ">"; $compile .= $video . do_shortcode($content); $compile .= "</div>"; break; case "2": $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}"'; } $compile .= "class=\"" . @implode(" ", $css_class) . "\"" . $parallax . ">"; $compile .= $boxed ? "<div class=\"container\">" . $video . "<div class=\"row\">" : ""; $compile .= do_shortcode($content); $compile .= $boxed ? "</div></div>" : ""; $compile .= "</div>"; break; default: $compile .= $boxed ? "<div class=\"row\"><div class=\"container\">" : ""; $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}"'; } $compile .= "class=\"" . @implode(" ", $css_class) . "\"" . $parallax . ">"; $compile .= $video . do_shortcode($content); $compile .= "</div>"; $compile .= $boxed ? "</div></div>" : ""; break; } if ('' != $font_color) { $DEstyle[] = "#{$el_id} {color:{$font_color}}"; } if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . @implode(";", $css_style) . "}"; } return $compile; } add_dt_element_render('dt_row', 'krypton_dt_row_shortcode'); add_dt_element_option('section_header', array('heading' => __('Layout type', 'detheme_builder'), 'param_name' => 'layout_type', 'class' => '', 'param_holder_class' => 'section-heading-style', 'type' => 'select_layout', 'value' => array('section-heading-border' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_01.png" alt="' . __('Type 1: Borderer', 'detheme_builder') . '" />', 'section-heading-border-top-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_02.png" alt="' . __('Type 2: Border Top-Bottom', 'detheme_builder') . '"/>', 'section-heading-polkadot-two-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_03.png" alt="' . __('Type 3: Two Bottom Polkadot', 'detheme_builder') . '"/>', 'section-heading-colorblock' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_06.png" alt="' . __('Type 4: Color Background', 'detheme_builder') . '"/>', 'section-heading-point-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_07.png" alt="' . __('Type 5: ', 'detheme_builder') . '"/>', 'section-heading-thick-border' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_08.png" alt="' . __('Type 6: ', 'detheme_builder') . '"/>', 'section-heading-thin-border' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_11.png" alt="' . __('Type 7: ', 'detheme_builder') . '"/>', 'section-heading-polkadot-left-right' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_14.png" alt="' . __('Type 8: ', 'detheme_builder') . '"/>', 'section-heading-polkadot-top' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_15.png" alt="' . __('Type 9: ', 'detheme_builder') . '"/>', 'section-heading-polkadot-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_16.png" alt="' . __('Type 10: ', 'detheme_builder') . '"/>', 'section-heading-double-border-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_17.png" alt="' . __('Type 11: ', 'detheme_builder') . '"/>', 'section-heading-thin-border-top-bottom' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_18.png" alt="' . __('Type 12: ', 'detheme_builder') . '"/>', 'section-heading-swirl' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_19.png" alt="' . __('Type 13: ', 'detheme_builder') . '"/>', 'section-heading-wave' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/section_heading_20.png" alt="' . __('Type 14: ', 'detheme_builder') . '"/>', 'section-heading-krypton' => '<img src="' . get_template_directory_uri() . '/lib/images/section_heading_krypton.png" alt="' . __('Type 15: Krypton', 'Krypton') . '"/>'), 'dependency' => array('element' => 'use_decoration', 'value' => array('1')))); add_dt_element_option('section_header', array('heading' => __('Sub Heading', 'detheme_builder'), 'param_name' => 'after_heading', 'class' => '', 'type' => 'textfield', 'dependency' => array('element' => 'select_layout', 'value' => array('section-heading-krypton'))), 'main_heading'); add_dt_element_option('section_header', array('heading' => __('Pre Heading', 'detheme_builder'), 'param_name' => 'pre_heading', 'class' => '', 'type' => 'textfield', 'dependency' => array('element' => 'select_layout', 'value' => array('section-heading-krypton'))), 'main_heading'); function krypton_section_header_shortcode($output, $content, $atts) { wp_enqueue_style('detheme-builder'); global $DEstyle; extract(shortcode_atts(array('layout_type' => 'section-heading-border', 'separator_position' => '', 'use_decoration' => false, 'separator_color' => '', 'main_heading' => '', 'text_align' => 'center', 'after_heading' => '', 'pre_heading' => '', 'color' => '', 'el_id' => '', 'el_class' => '', 'font_weight' => '', 'font_style' => '', 'font_size' => 'default', 'custom_font_size' => '', 'separator_color' => '', 'spy' => '', 'scroll_delay' => 300), $atts, 'section_header')); $css_class = array('dt-section-head', $text_align); $heading_style = array(); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-section-head-" . getCssID(); } if ('default' !== $font_size) { array_push($css_class, " size-" . $font_size); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}" '; } if (!empty($color)) { $heading_style['color'] = "color:" . $color; } if (!empty($font_weight) && $font_weight != 'default') { $heading_style['font-weight'] = "font-weight:" . $font_weight; } if (!empty($font_style) && $font_style != 'default') { $heading_style['font-style'] = "font-style:" . $font_style; } if (!empty($custom_font_size) && $font_size == 'custom') { $custom_font_size = preg_match('/(px|pt)$/', $custom_font_size) ? $custom_font_size : $custom_font_size . "px"; $heading_style['font-size'] = "font-size:" . $custom_font_size; } if ($use_decoration) { $decoration_position = $decor_heading = ""; if ($layout_type == 'section-heading-polkadot-two-bottom') { $decoration_position = "polka-" . $separator_position; } elseif ($layout_type == 'section-heading-thick-border') { $decoration_position = "thick-" . $separator_position; } elseif ($layout_type == 'section-heading-thin-border') { $decoration_position = "thin-" . $separator_position; } elseif ($layout_type == 'section-heading-double-border-bottom') { $decoration_position = "double-border-bottom-" . $separator_position; } elseif ($layout_type == 'section-heading-thin-border-top-bottom') { $decoration_position = "top-bottom-" . $separator_position; } if (!empty($separator_color)) { $heading_style['border-color'] = "border-color:" . $separator_color; switch ($layout_type) { case 'section-heading-border-top-bottom': case 'section-heading-thin-border-top-bottom': case 'section-heading-thick-border': case 'section-heading-thin-border': case 'section-heading-double-border-bottom': case 'section-heading-swirl': $DEstyle[] = "#" . $el_id . " h2:after,#" . $el_id . " h2:before{background-color:" . $separator_color . ";}"; break; case 'section-heading-colorblock': $DEstyle[] = "#" . $el_id . " h2{background-color:" . $separator_color . ";}"; break; case 'section-heading-point-bottom': $DEstyle[] = "#" . $el_id . " h2:before{border-top-color:" . $separator_color . ";}"; break; case 'section-heading-krypton': $DEstyle[] = "#" . $el_id . " hr:after{background-color:" . $separator_color . ";}"; break; default: break; } } if ($layout_type == 'section-heading-swirl' || $layout_type == 'section-heading-wave') { array_push($css_class, $layout_type); } if ('section-heading-polkadot-left-right' == $layout_type) { array_push($css_class, "hide-overflow"); } if ($layout_type == 'section-heading-swirl') { $decor_heading .= '<svg viewBox="0 0 ' . ($text_align == 'left' ? "104" : ($text_align == 'right' ? "24" : "64")) . ' 22"' . ($separator_color != '' ? " style=\"color:" . $separator_color . "\"" : "") . '> <use xlink:href="' . get_dt_plugin_dir_url() . 'images/source.svg#swirl"></use> </svg>'; } elseif ($layout_type == 'section-heading-wave') { $decor_heading .= '<svg viewBox="0 0 ' . ($text_align == 'left' ? "126" : ($text_align == 'right' ? "2" : "64")) . ' 30"' . ($separator_color != '' ? " style=\"color:" . $separator_color . "\"" : "") . '> <use xlink:href="' . get_dt_plugin_dir_url() . 'images/source.svg#wave"></use> </svg>'; } elseif ($layout_type == 'section-heading-krypton') { $decor_heading = "<hr/>"; } $compile .= 'class="' . @implode(" ", $css_class) . '">'; $compile .= '<div class="dt-section-container">' . ($pre_heading != '' ? '<p>' . $pre_heading . '</p>' : '') . '<h2 class="section-main-title ' . $layout_type . ' ' . $decoration_position . '"' . (count($heading_style) ? " style=\"" . @implode(";", $heading_style) . "\"" : "") . '> ' . $main_heading . ' </h2>' . $decor_heading . ' </div>' . ($after_heading != '' ? '<p class="descriptionText">' . $after_heading . '</p>' : '') . '</div>'; } else { $compile .= 'class="' . @implode(" ", $css_class) . '"> <div>' . (!empty($main_heading) ? '<h2' . (count($heading_style) ? " style=\"" . @implode(";", $heading_style) . "\"" : "") . ' class="section-main-title">' . $main_heading . '</h2>' : '') . '</div></div>'; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('section_header', 'krypton_section_header_shortcode'); function krypton_dt_verticaltab_shortcode($output, $content, $atts) { if (!has_shortcode($content, 'dt_verticaltab_item')) { return ""; } $regexshortcodes = '\\[' . '(\\[?)' . "(dt_verticaltab_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } global $DEstyle; extract(shortcode_atts(array('nav_position' => 'left', 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => ''), $atts, 'dt_verticaltab')); $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "vsliderid_" . getCssID(); } $css_class = array('dt_vertical', 'cn_wrapper', 'row'); if ('' != $el_class) { array_push($css_class, $el_class); } $leftspy = ""; $rightspy = ""; $spydly = $scroll_delay; $itemnumber = 0; if ('none' !== $spy && !empty($spy)) { switch ($spy) { case 'uk-animation-slide-left': $leftspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\',delay:' . ($spydly + 600) . '}"'; $rightspy = 'data-uk-scrollspy="{cls:\'uk-animation-slide-right\',delay:' . $spydly . '}"'; break; case 'uk-animation-slide-right': $leftspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . ($spydly + 600) . '}"'; $rightspy = 'data-uk-scrollspy="{cls:\'uk-animation-slide-left\',delay:' . $spydly . '}"'; break; default: $leftspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\',delay:' . $spydly . '}"'; $rightspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; break; } } $cn_list = array(); $cn_preview = array(); foreach ($matches as $slideitem) { $slide_args = wp_parse_args(shortcode_parse_atts($slideitem[3]), array('title' => '', 'sub_title' => '', 'link' => '', 'icon_type' => '')); $cn_item = "\n" . '<div class="cn_item' . ($itemnumber == 0 ? " selected" : "") . '"> <div class="row"> <div class="col col-sm-2 vs_icon"> <i class="' . sanitize_html_class($slide_args['icon_type']) . '"></i> </div> <div class="col col-sm-10 vs_text"> <h2 class="vs_title">' . $slide_args['title'] . '</h2> <p class="vs_description">' . $slide_args['sub_title'] . '</p> </div> </div> </div>'; $cn_preview_item = '<div class="cn_content"' . ($itemnumber == 0 ? " style=\"top:0;\" " . $rightspy : "") . '>' . $slideitem[5] . '<div class="vs-text-preview visible-sm visible-xs"> <h2 class="vs_title">' . $slide_args['title'] . '</h2> <p class="vs_description">' . $slide_args['sub_title'] . '</p> </div> </div>'; array_push($cn_list, $cn_item); array_push($cn_preview, $cn_preview_item); $itemnumber++; } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div class="cn_list col col-xs-4' . ($nav_position == 'right' ? " col-xs-push-8" : "") . '" ' . $leftspy . '> <div class="cn_page" style="display:block;"> ' . @implode("\n", $cn_list) . ' </div> </div>' . "\n" . ' <div class="cn_preview col col-xs-8' . ($nav_position == 'right' ? " col-xs-pull-4" : "") . '"> ' . @implode("\n", $cn_preview) . ' </div>' . "\n" . '</div>'; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_verticaltab', 'krypton_dt_verticaltab_shortcode'); remove_dt_element_option('dt_pricetable', 'body_back_color'); remove_dt_element_option('dt_pricetable', 'header_back_color'); remove_dt_element_option('dt_pricetable', 'evencell_back_color'); remove_dt_element_option('dt_pricetable', 'oddcell_back_color'); add_dt_element('dt_accordion', array('title' => __('Accordion', 'Krypton'), 'as_parent' => 'dt_accordion_item', 'icon' => 'dashicons-id', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => __('Accordion', 'Krypton'), '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')))); add_dt_element('dt_accordion_item', array('title' => __('Tab Item', 'detheme_builder'), 'as_child' => 'dt_accordion', 'options' => array(array('heading' => __('Expanded', 'Krypton'), 'param_name' => 'title', 'value' => '', 'type' => 'textfield'), array('heading' => __('Title', 'detheme_builder'), 'param_name' => 'expanded_state', 'value' => array('yes' => __('Yes', 'detheme_builder'), 'no' => __('No', 'detheme_builder')), 'type' => 'radio'), array('heading' => __('Content', 'detheme_builder'), 'param_name' => 'content', 'class' => '', 'value' => '', 'type' => 'textarea_html')))); function krypton_dt_accordion_shortcode($output, $content, $atts) { global $DEstyle; extract(shortcode_atts(array('el_id' => '', 'el_class' => ''), $atts, 'dt_accordion')); $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "accordion_" . getCssID(); } $css_class = array('dt-accordion', 'panel-group', 'custom-accordion'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $content = preg_replace('/\\[dt_accordion_item/', '[dt_accordion_item parent_id="' . $el_id . '"', $content); $compile .= do_shortcode($content) . '</div>'; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_accordion', 'krypton_dt_accordion_shortcode'); function krypton_dt_accordion_item_shortcode($output, $content, $atts) { extract(shortcode_atts(array('title' => '', 'expanded_state' => '', 'parent_id' => ''), $atts)); $dt_accordion_item = getCssID(); $compile = '<div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">' . $title . '</h4> <a class="btn-accordion" data-toggle="collapse" data-parent="#' . $parent_id . '" href="#collapse' . $dt_accordion_item . '"><span>' . ($expanded_state == 'yes' ? "-" : "+") . '</span></a> </div> <div id="collapse' . $dt_accordion_item . '" class="panel-collapse collapse' . ($expanded_state == 'yes' ? " in" : "") . '"> <div class="panel-body">' . wp_specialchars_decode($content, 'double') . '</div> </div> </div>'; return $compile; } add_dt_element_render('dt_accordion_item', 'krypton_dt_accordion_item_shortcode'); add_dt_element('dt_subslider', array('title' => __('Sub Slider', 'Krypton'), 'icon' => 'dashicons-image-flip-horizontal', 'as_parent' => 'dt_subslider_item', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Sub Slider', 'Krypton'), '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("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "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')))); add_dt_element('dt_subslider_item', array('title' => __('Slide Item', 'Krypton'), 'as_child' => 'dt_subslider', 'options' => array(array('heading' => __('Slide Image', 'Krypton'), 'param_name' => 'slider_image', 'value' => '', 'type' => 'image'), array('heading' => __('Title', 'Krypton'), 'param_name' => 'title', 'value' => '', 'type' => 'textfield'), array('heading' => __('Sub Title', 'Krypton'), 'param_name' => 'sub_title', 'value' => '', 'type' => 'textfield'), array('heading' => __('Content', 'detheme_builder'), 'param_name' => 'content', 'class' => '', 'value' => '', 'type' => 'textarea_html'), array('heading' => __('Link', 'Krypton'), 'param_name' => 'link', 'value' => '', 'type' => 'textfield'), array('heading' => __('Link Label', 'Krypton'), 'param_name' => 'linklabel', 'value' => '', 'type' => 'textfield'), array('heading' => __('Link Target', 'Krypton'), 'param_name' => 'linktarget', 'value' => array('_blank' => __('Blank'), '_self' => __('Self')), 'type' => 'dropdown')))); function krypton_dt_subslider_shortcode($output, $content, $atts) { if (!has_shortcode($content, 'dt_subslider_item')) { return ""; } $regexshortcodes = '\\[' . '(\\[?)' . "(dt_subslider_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } global $DEstyle; extract(shortcode_atts(array('font_color' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_subslider')); wp_enqueue_script('sequence', get_template_directory_uri() . '/js/jquery.sequence.js', array('jquery'), '1.0'); wp_enqueue_script('dt-subslider', get_template_directory_uri() . '/js/dt_subslider.js', array('jquery'), '1.0'); wp_enqueue_style('subslider', get_template_directory_uri() . '/css/sub_slider.css', array()); $css_style = getCssMargin($atts, true); if ($font_color != '') { $css_style['color'] = "color:" . $font_color . ";"; } if ('' == $el_id) { $el_id = "sequence_" . getCssID(); } $css_class = array('sequence-sub-slider'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<span class="sequence-prev"><i class="icon-left-open-big"></i></span> <span class="sequence-next"><i class="icon-right-open-big"></i></span><ul class="sequence-canvas">'; $i = 0; foreach ($matches as $subslider_item) { $slide_args = wp_parse_args(shortcode_parse_atts($subslider_item[3]), array('title' => '', 'sub_title' => '', 'link' => '', 'slider_image' => '', 'linklabel' => '', 'linktarget' => '')); $sliderImage = wp_get_attachment_image_src($slide_args['slider_image'], 'full', false); $compile .= '<li' . ('1' == $i ? ' class="animate-in"' : '') . '> <div class="row">'; if ($sliderImage) { $alt_image = get_post_meta($slide_args['slider_image'], '_wp_attachment_image_alt', true); $compile .= '<div class="col col-sm-5 col-sm-offset-1 col-xs-12 slide-image-container"> <img class="img-responsive absolute-pos slide-image" src="' . esc_url($sliderImage[0]) . '" alt="' . esc_attr($alt_image) . '"> </div>'; } $compile .= '<div class="col ' . ($sliderImage ? "col-sm-5" : "col-sm-10 col-sm-offset-1") . ' col-xs-12"> <div class="slide-panel absolute-pos"> <section>' . ('' != $slide_args['sub_title'] ? '<p>' . strip_tags($slide_args['sub_title']) . '</p>' : "") . ('' != $slide_args['title'] ? '<h2>' . $slide_args['title'] . '</h2>' : "") . ' </section> <hr> <div class="slide-description-text">' . $subslider_item[5] . '</div> ' . (!empty($slide_args['linklabel']) ? '<div class="slide-readmore"> <a ' . (!empty($slide_args['link']) ? ' href="' . esc_url($slide_args['link']) . '" target="' . esc_attr($slide_args['linktarget']) . '"' : "") . 'class="button-more">' . $slide_args['linklabel'] . '</a> </div>' : "") . ' </div> </div> </div> </li><!-- Frame ' . $i . ' -->'; $i++; } $compile .= '</ul></div>'; if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . @implode(";", $css_style) . "}"; } return $compile; } add_dt_element_render('dt_subslider', 'krypton_dt_subslider_shortcode'); class DElement_Field_sidebars extends DElement_Field { function render($option = array(), $value = null) { $fieldname = $option['param_name']; $fieldid = sanitize_html_class($fieldname); $css = isset($option['class']) && '' != $option['class'] ? " " . (is_array($option['class']) ? @implode(" ", $option['class']) : $option['class']) : ""; //sanitize_html_class($fieldname); $dependency = create_dependency_param($option); $sidebars = krypton_get_registered_sidebars(); $compile = "<select id=\"" . $fieldid . "\" class=\"param_value select-option" . $css . "\" name=\"" . $fieldname . "\"" . $dependency . ">"; if (is_array($sidebars) && count($sidebars)) { foreach ($sidebars as $key => $label) { if (is_numeric($key) && !is_assoc_array($sidebars)) { $key = $label; } $compile .= "<option value=\"" . $key . "\"" . ($key == $value && '' != $value ? " selected=\"selected\"" : "") . ">" . $label . "</option>"; } } $compile .= "</select>"; return $compile; } } add_dt_element('dt_widget', array('title' => __('Widget Area', 'Krypton'), 'icon' => 'dashicons-images-alt', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Widget Area', 'Krypton'), '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' => __('Select Widget Area', 'detheme_builder'), 'param_name' => 'position', 'type' => 'sidebars')))); function krypton_dt_widget_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('position' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_widget')); global $DEstyle; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "wid" . getCssID(); } $css_class = array('dt-widget-area'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if (is_active_sidebar($position)) { ob_start(); dynamic_sidebar($position); $compile .= ob_get_clean(); } $compile .= '</div>'; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_widget', 'krypton_dt_widget_shortcode'); class DElement_Field_woocategories extends DElement_Field { function render($option = array(), $value = null) { $fieldname = $option['param_name']; $fieldid = sanitize_html_class($fieldname); $css = isset($option['class']) && '' != $option['class'] ? " " . (is_array($option['class']) ? @implode(" ", $option['class']) : $option['class']) : ""; //sanitize_html_class($fieldname); $output = '<div class="checkbox-options ' . $css . '">'; $array_value = @explode(",", trim($value)); $dependency = create_dependency_param($option); $terms_woocategories = get_terms('product_cat', array('taxonomy' => 'Category')); if (is_array($terms_woocategories) && count($terms_woocategories)) { $output .= '<input type="checkbox" name="' . $fieldname . '_option" class="all-option checkbox-option" ' . (!count($array_value) || in_array('all', $array_value) ? 'checked="checked"' : '') . 'value="all" />' . __('All Categories', 'Krypton'); foreach ($terms_woocategories as $cat) { $output .= ' <input type="checkbox" name="' . $fieldname . '_option" class="checkbox-option" ' . (in_array($cat->term_id, $array_value) ? 'checked="checked"' : '') . 'value="' . $cat->term_id . '" /> ' . $cat->name; } } $output .= '<input type="hidden" name="' . $fieldname . '" class="param_value checkbox-input-value" value="' . $value . '" ' . $dependency . '/>'; $output .= '</div>'; return $output; } } if (is_plugin_active('woocommerce/woocommerce.php')) { add_dt_element('dt_wooproduct', array('title' => __('Woocommerce Product', 'Krypton'), 'icon' => 'dashicons-cart', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Woocommerce Product', 'Krypton'), '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' => __('Num Item', 'Krypton'), 'param_name' => 'posts_per_page', 'type' => 'textfield'), array('heading' => __('View type', 'Krypton'), 'param_name' => 'view_type', 'type' => 'dropdown', 'value' => array(2 => __('2 Columns', 'Krypton'), 3 => __('3 Columns', 'Krypton'), 4 => __('4 Columns', 'Krypton'))), array('heading' => __('Filter', 'Krypton'), 'param_name' => 'filter', 'type' => 'radio', 'default' => 'off', 'value' => array('on' => __('Show', 'Krypton'), 'off' => __('Hidden', 'Krypton'))), array('heading' => __('All Category Label', 'Krypton'), 'param_name' => 'all_label', 'type' => 'textfield', 'default' => __('All Category', 'Krypton'), 'value' => '', 'dependency' => array('element' => 'filter', 'value' => array('on'))), array('heading' => __('Categories', 'Krypton'), 'param_name' => 'selected_categories', 'type' => 'woocategories'), 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' => '', 'value' => '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 krypton_dt_wooproduct_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('posts_per_page' => get_option('posts_per_page'), 'view_type' => '4', 'filter' => 'on', 'all_label' => __('All Category', 'Krypton'), 'selected_categories' => '', 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => ''), $atts, 'dt_wooproduct')); global $DEstyle; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-wooproduct" . getCssID(); } $css_class = array('woocommerce-module', "col-" . $view_type); if ('' != $el_class) { array_push($css_class, $el_class); } $post_type_terms = array(); if (strlen($selected_categories) > 0 && $selected_categories != 'all') { $post_type_terms = @explode(",", $selected_categories); } $wooargs = array('post_type' => 'product', 'order' => 'ASC', 'posts_per_page' => intval($posts_per_page)); if (count($post_type_terms) > 0) { $wooargs['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $post_type_terms)); } $woo_products = $temsAvailable = array(); $spydly = 0; $wp_query_in_shortcodes = new WP_Query(); $wp_query_in_shortcodes->query($wooargs); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if ($wp_query_in_shortcodes->have_posts()) { while ($wp_query_in_shortcodes->have_posts()) { $wp_query_in_shortcodes->the_post(); $scollspy = $echoallterm = ""; if ('none' !== $spy && !empty($spy)) { $spydly = $spydly + (int) $scroll_delay; $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } if ($filter == "on") { $new_term_list = get_the_terms(get_the_id(), "product_cat"); if (is_array($new_term_list)) { $echoallterm = array(); foreach ($new_term_list as $term) { $echoallterm[$term->term_id] = strtolower($term->slug); $temsAvailable[$term->term_id] = $term; } $echoallterm = " " . @implode(" ", $echoallterm); } } $contentcompile = '<div id="product-' . get_the_ID() . '" class="masonry-item' . $echoallterm . '"><div' . $scollspy . '>'; ob_start(); wc_get_template_part('content', 'product_masonry'); $wooitem = ob_get_contents(); ob_end_clean(); $contentcompile .= $wooitem; $contentcompile .= '</div></div>'; array_push($woo_products, $contentcompile); } } wp_reset_query(); if ($filter == "on" && count($temsAvailable)) { $compile .= '<div class="row" > <nav id="featured-navbar" class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#dt-featured-filter"> <span class="sr-only">' . __('Toggle navigation', 'Krypton') . '</span> <span class="icon-bars"></span> <span class="icon-bars"></span> <span class="icon-bars"></span> </button> </div> <div class="collapse navbar-collapse" id="dt-featured-filter"> <ul id="featured-filter" class="dt-featured-filter nav navbar-nav"> <li class="active"><a href="#" data-filter="*" class="active">' . $all_label . '</a></li>'; if (count($temsAvailable)) { foreach ($temsAvailable as $key => $value) { $compile .= '<li><a href="' . add_query_arg("slug", $value->term_id) . '" data-filter=".' . $value->slug . '">' . $value->name . '</a></li>'; } } $compile .= '</ul> </div> </nav> </div>'; } if (count($woo_products)) { $compile .= '<div class="row"><div class="container"><div class="woocommerce woocommerce-module-items">' . @implode("", $woo_products) . '</div></div></div>'; } $compile .= '</div>'; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_wooproduct', 'krypton_dt_wooproduct_shortcode'); } add_dt_element('dt_promotion', array('title' => __('Promotion Box', 'Krypton'), 'icon' => 'dashicons-tag', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Promotion Box', 'Krypton'), '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' => __('Background Image', 'Krypton'), 'param_name' => 'bg_image', 'type' => 'image'), array('heading' => __('Button Label', 'Krypton'), 'param_name' => 'button_label', 'type' => 'textfield'), array('heading' => __('Button Link', 'Krypton'), 'param_name' => 'button_link', 'type' => 'textfield'), array('heading' => __('Promotion Text', 'Krypton'), 'param_name' => 'content', 'type' => 'textarea')))); function krypton_dt_promotion_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('bg_image' => '', 'button_label' => '', 'button_link' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_promotion')); global $DEstyle; $sliderImage = wp_get_attachment_image_src($bg_image, 'full', false); $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-promotion" . getCssID(); } $css_class = array('module_dt_promotion'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div class="boxed">'; if ($sliderImage) { $alt_image = get_post_meta($bg_image, '_wp_attachment_image_alt', true); $compile .= '<img class="img-responsive" src="' . esc_url($sliderImage[0]) . '" alt="' . esc_attr($alt_image) . '">'; } $compile .= '<div class="thumbnail-description-text"> <div class="text-container">' . $content . (!empty($button_label) ? "<div class='btn-cta'>\r\n <a href='" . (!empty($button_link) ? esc_url($button_link) : "#") . "'>" . __($button_label) . "</a>\r\n </div>" : "") . ' </div> </div> </div>'; $compile .= '</div>'; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_promotion', 'krypton_dt_promotion_shortcode'); add_dt_element('dt_contact_form', array('title' => __('Contact Form', 'Krypton'), 'icon' => 'dashicons-email', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Contact Form', 'Krypton'), '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("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "detheme_builder"))))); function krypton_dt_contact_form_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('font_color' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_contact_form')); global $DEstyle; $css_style = getCssMargin($atts, true); if ('' != $font_color) { $css_style['color'] = "color:" . $font_color; } if ('' == $el_id) { $el_id = "dt-contact-form" . getCssID(); } $css_class = array('module_dt_contact_form'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; ob_start(); locate_template('pagetemplates/dt_contact_form.php', true); $compile .= ob_get_clean(); $compile .= '</div>'; if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . @implode(";", $css_style) . "}"; } return $compile; } add_dt_element_render('dt_contact_form', 'krypton_dt_contact_form_shortcode'); add_dt_element('krypton_map', array('title' => __('Krypton Map', 'Krypton'), 'icon' => 'dashicons-admin-site', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Krypton Map', 'Krypton'), '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("type" => "dropdown", "heading" => __('Map type', 'Krypton'), "param_name" => "map_type", "value" => array('Static Image' => __('Static Image', 'Krypton'), 'Parallax Image' => __('Parallax Image', 'Krypton'), 'Fixed Image' => __('Fixed Image', 'Krypton'), 'Google Map' => __('Google Map', 'Krypton')), "description" => __("Select map type", "Krypton"))))); function krypton_map_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'map_type' => 'Google Map'), $atts, 'krypton_map')); global $DEstyle, $krypton_config; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "krypton-map" . getCssID(); } $css_class = array('module_dt_contact_form'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if (strtolower($map_type) == 'static image') { $compile .= ' <section class="map-image-area"> <div class="map"> <div class="circle-address" data-uk-scrollspy="{cls:\'uk-animation-fade\', delay:600}"> <section> <h1>' . $krypton_config['map-circle-number'] . '</h1> ' . $krypton_config['map-circle-address'] . ' <hr> ' . $krypton_config['map-circle-city'] . '<br> ' . $krypton_config['map-circle-zipcode'] . ' </section> </div> <div class="map-info hidden-xs"> <div class="container"> <div class="row"> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-location-3"></i> </div> <address class="address"> ' . $krypton_config['map-address'] . ' </address> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-phone"></i> </div> <div class="phone"> ' . $krypton_config['map-phone'] . ' </div> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-mail-1"></i> </div> <div class="email"> <a href="mailto:' . sanitize_email($krypton_config['map-email']) . '">' . sanitize_email($krypton_config['map-email']) . '</a> </div> </div> </div> </div> </div> </div> </section>'; } elseif (strtolower($map_type) == 'parallax image') { $compile .= ' <section class="map-image-area" data-type="background" data-speed="3"> <div class="map"> <div class="circle-address" data-uk-scrollspy="{cls:\'uk-animation-fade\', delay:600}"> <section> <h1>' . $krypton_config['map-circle-number'] . '</h1> ' . $krypton_config['map-circle-address'] . ' <hr> ' . $krypton_config['map-circle-city'] . '<br> ' . $krypton_config['map-circle-zipcode'] . ' </section> </div> <div class="map-info hidden-xs"> <div class="container"> <div class="row"> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-location-3"></i> </div> <address class="address"> ' . $krypton_config['map-address'] . ' </address> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-phone"></i> </div> <div class="phone"> ' . $krypton_config['map-phone'] . ' </div> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-mail-1"></i> </div> <div class="email"> <a href="mailto:' . sanitize_email($krypton_config['map-email']) . '">' . sanitize_email($krypton_config['map-email']) . '</a> </div> </div> </div> </div> </div> </div> </section>'; } elseif (strtolower($map_type) == 'fixed image') { $compile .= ' <section class="map-image-area background_fixed"> <div class="map"> <div class="circle-address" data-uk-scrollspy="{cls:\'uk-animation-fade\', delay:600}"> <section> <h1>' . $krypton_config['map-circle-number'] . '</h1> ' . $krypton_config['map-circle-address'] . ' <hr> ' . $krypton_config['map-circle-city'] . '<br> ' . $krypton_config['map-circle-zipcode'] . ' </section> </div> <div class="map-info hidden-xs"> <div class="container"> <div class="row"> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-location-3"></i> </div> <address class="address"> ' . $krypton_config['map-address'] . ' </address> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-phone"></i> </div> <div class="phone"> ' . $krypton_config['map-phone'] . ' </div> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-mail-1"></i> </div> <div class="email"> <a href="mailto:' . sanitize_email($krypton_config['map-email']) . '">' . sanitize_email($krypton_config['map-email']) . '</a> </div> </div> </div> </div> </div> </div> </section>'; } else { wp_enqueue_script('google-map-apis', "https://maps.googleapis.com/maps/api/js?v=3.exp", array('jquery')); wp_register_script('google-map', get_template_directory_uri() . '/js/google_map.js', array('jquery', 'google-map-apis'), '1.0', true); wp_enqueue_script('google-map-apis'); wp_enqueue_script('google-map'); $compile .= ' <section class="dt-google-map-section"> <div id="map" data-latitude="' . esc_attr($krypton_config['map-latitude']) . '" data-longitude="' . esc_attr($krypton_config['map-longitude']) . '" data-marker-url="' . get_template_directory_uri() . '/images/map_marker.png" data-zoom="' . esc_attr($krypton_config['map-zoom-level']) . '"></div> <div class="map"> <div class="map-info hidden-xs"> <div class="container"> <div class="row"> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-location-3"></i> </div> <address class="address"> ' . $krypton_config['map-address'] . ' </address> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-phone"></i> </div> <div class="phone"> ' . $krypton_config['map-phone'] . ' </div> </div> <div class="col col-sm-4"> <div class="icon-container"> <i class="icon-mail-1"></i> </div> <div class="email"> <a href="mailto:' . sanitize_email($krypton_config['map-email']) . '">' . $krypton_config['map-email'] . '</a> </div> </div> </div> </div> </div> </div> </section>'; } $compile .= '</div>'; if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . @implode(";", $css_style) . "}"; } return $compile; } add_dt_element_render('krypton_map', 'krypton_map_shortcode'); add_dt_element('dt_linechart', array('title' => __('Line Chart', 'Krypton'), 'icon' => 'dashicons-chart-line', 'as_parent' => 'dt_linechart_item', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Line Chart', 'Krypton'), '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' => __('Line Size', 'Krypton'), 'param_name' => 'size', 'default' => 6, 'type' => 'textfield'), array("type" => "colorpicker", "heading" => __('Line Color', 'Krypton'), "param_name" => "color"), array('heading' => __('Show Label', 'Krypton'), 'param_name' => 'show_label', 'type' => 'radio', 'value' => array("1" => __("Yes", "detheme_builder"), "0" => __("No", 'detheme_builder'))), array("type" => "colorpicker", "heading" => __('Label Color', 'Krypton'), "param_name" => "lblcolor", 'dependency' => array('element' => 'show_label', 'value' => array('1'))), array("type" => "dropdown", "value" => array(6 => '6', 7 => '7', 8 => '8', 9 => '9', 10 => '10', 11 => '11', 12 => '12', 14 => '14', 16 => '16', 18 => '18', 24 => '24', 27 => '27'), "heading" => __('Label Font Size', 'Krypton'), "param_name" => "lblfsize", "default" => 18, 'dependency' => array('element' => 'show_label', 'value' => array('1')))))); add_dt_element('dt_linechart_item', array('title' => __('Line', 'Krypton'), 'as_child' => 'dt_linechart', 'options' => array(array('heading' => __('Label', 'Krypton'), 'param_name' => 'content', 'class' => '', 'value' => '', 'type' => 'textfield'), array('heading' => __('Value', 'Krypton'), 'param_name' => 'value', 'value' => '', 'type' => 'textfield')))); function krypton_dt_linechart_shortcode($output, $content = "", $atts = array()) { if (!has_shortcode($content, 'dt_linechart_item')) { return ""; } $regexshortcodes = '\\[' . '(\\[?)' . "(dt_linechart_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } extract(shortcode_atts(array('color' => '', 'size' => '', 'show_label' => 1, 'lblcolor' => '', 'lblfsize' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_linechart')); global $DEstyle; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-line-cart" . getCssID(); } $css_class = array(); if ('' != $el_class) { array_push($css_class, $el_class); } $diagram_data = array(); $diagram_label = array(); foreach ($matches as $line) { $line_args = wp_parse_args(shortcode_parse_atts($line[3]), array('value' => '')); array_push($diagram_data, trim($line_args['value'])); array_push($diagram_label, trim(strip_tags($line[5]))); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= "<canvas " . ($color ? " data-color=\"" . trim($color) . "\"" : "") . ($size ? " data-size=\"" . (int) trim($size) . "\"" : "") . ($diagram_data ? " data-source=\"" . @implode(",", $diagram_data) . "\"" : "") . ($diagram_label ? " data-label=\"" . @implode("||", $diagram_label) . "\"" : "") . ($show_label ? " data-showlabel=\"1\"" : "") . ($lblcolor ? " data-lblcolor=\"" . $lblcolor . "\"" : "") . ($lblfsize ? " data-lblfsize=\"" . (int) trim($lblfsize) . "\"" : "") . " class=\"lineChart\"></canvas>"; $compile .= '</div>'; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_linechart', 'krypton_dt_linechart_shortcode'); function krypton_dt_team_custom_item_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'text' => '', 'layout_type' => 'fix', 'image_url' => '', 'facebook' => '', 'twitter' => '', 'gplus' => '', 'pinterest' => '', 'linkedin' => '', 'website' => '', 'email' => '', 'social_link' => 'show', 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => '', 'color' => '', 'titlecolor' => '', 'separator_color' => '', 'subtitlecolor' => ''), $atts, 'dt_team_custom_item')); global $DEstyle; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "module_dt_team" . getCssID(); } $css_class = array('profile_team'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $scroll_delay . '}"'; } $featured_image = wp_get_attachment_image_src($image_url, 'full', false); $alt_image = get_post_meta($image_url, '_wp_attachment_image_alt', true); $compile .= '<div class="profile" ' . $scollspy . '> <figure> <div class="top-image cd"> <img src="' . esc_url($featured_image[0]) . '" class="img-responsive" alt="' . esc_attr($alt_image) . '"/> </div> <figcaption>' . ($title != '' ? '<h3><span class="profile-heading">' . $title . '</span></h3>' : "") . ($sub_title != '' ? '<span class="profile-subheading">' . $sub_title . '</span>' : "") . (!empty($text) ? '<p>' . $text . '</p>' : ""); if ($social_link == 'show') { $socicons = array('twitter' => 'icon-twitter', 'linkedin' => 'icon-linkedin', 'gplus' => 'icon-gplus', 'facebook' => 'icon-facebook', 'email' => 'icon-mail-alt', 'pinterest' => 'icon-pinterest', 'website' => 'icon-globe'); $compile .= '<ul class="profile-scocial">'; foreach ($socicons as $key => $icon) { if (${$key} != '') { $compile .= '<li><a href="' . esc_url($key == 'email' ? "mailto:" . ${$key} : ${$key}) . '" class="teamlink" title="' . esc_attr($key) . '" ><i class="' . $icon . '"></i></a></li>'; } } $compile .= "</ul>"; } $compile .= '<div class="figcap"></div> </figcaption> </figure> </div>'; $compile .= '</div>'; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_team_custom_item', 'krypton_dt_team_custom_item_shortcode'); class DElement_Field_team_members extends DElement_Field { function render($option = array(), $value = null) { $fieldname = $option['param_name']; $fieldid = sanitize_html_class($fieldname); $css = isset($option['class']) && '' != $option['class'] ? " " . (is_array($option['class']) ? @implode(" ", $option['class']) : $option['class']) : ""; //sanitize_html_class($fieldname); $output = '<div class="checkbox-options ' . $css . '">'; $array_value = @explode(",", trim($value)); $dependency = create_dependency_param($option); $args = array('post_type' => 'team', 'post_status' => 'publish', 'posts_per_page' => -1); $wp_query_cpt_posts = new WP_Query($args); if ($wp_query_cpt_posts->have_posts()) { $output .= '<input type="checkbox" name="' . $fieldname . '_option" class="all-option checkbox-option" ' . (!count($array_value) || in_array('all', $array_value) ? 'checked="checked"' : '') . 'value="all" />' . __('All Team', 'Krypton'); while ($wp_query_cpt_posts->have_posts()) { $wp_query_cpt_posts->the_post(); $output .= ' <input type="checkbox" name="' . $fieldname . '_option" class="checkbox-option" ' . (in_array(get_the_ID(), $array_value) ? 'checked="checked"' : '') . 'value="' . get_the_ID() . '" /> ' . get_the_title(); } } wp_reset_query(); $output .= '<input type="hidden" name="' . $fieldname . '" class="param_value checkbox-input-value" value="' . $value . '" ' . $dependency . '/>'; $output .= '</div>'; return $output; } } if (is_plugin_active('detheme-team/detheme_team.php') || post_type_exists('team')) { add_dt_element('dt_team', array('title' => __('Team Block', 'Krypton'), 'icon' => 'dashicons-id-alt', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Team Block', 'Krypton'), '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' => __('Select team members', 'Krypton'), 'param_name' => 'cpt_ids', 'type' => 'team_members'), array('heading' => __('Items Count', 'Krypton'), 'param_name' => 'items_per_page', 'default' => 6, 'type' => 'textfield'), array('heading' => __('Items per line', 'Krypton'), 'param_name' => 'items_per_line', 'default' => 3, 'type' => 'textfield'), array("type" => "radio", "heading" => __('Order type', 'Krypton'), "param_name" => "order", "default" => 'asc', 'value' => array('asc' => __('Ascending', 'Krypton'), 'desc' => __('Descending', 'Krypton'))), 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' => '', 'value' => '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 krypton_dt_team_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => '', 'order' => 'asc', 'cpt_ids' => '0', 'items_per_line' => 1, 'items_per_page' => 0), $atts, 'dt_team')); global $DEstyle; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "module_dt_team" . getCssID(); } $css_class = array('profile_team'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\"><div class=\"row\">"; $scollspy = ""; $wp_query = new WP_Query(); $args = array('post_type' => 'team', 'order' => strtoupper($order)); if (strlen($cpt_ids) > 0 && $cpt_ids !== "0" && $cpt_ids != 'all') { $cpt_ids = @explode(",", $cpt_ids); } if (is_array($cpt_ids) && count($cpt_ids) > 0) { $args['post__in'] = $cpt_ids; } if ($items_per_page) { $args['posts_per_page'] = $items_per_page; } $colclass = "col-xs-12"; switch ($items_per_line) { case '4': $colclass = "col-lg-3 col-md-4 col-sm-6 col-xs-12"; break; case '3': $colclass = "col-md-4 col-sm-6 col-xs-12"; break; case '2': $colclass = "col-sm-6 col-xs-12"; break; default: $colclass = "col-xs-12"; break; } $spydly = $scroll_delay; $wp_query->query($args); if ($wp_query->have_posts()) { while ($wp_query->have_posts()) { $wp_query->the_post(); $pagebuilder = get_post_meta(get_the_ID(), "pagebuilder", true); $position = $pagebuilder['page_settings']['team']['position']; $image_url = get_post_thumbnail_id(get_the_ID()); if ('none' !== $spy && !empty($spy)) { $spydly += (int) $scroll_delay; } $shortcode = "[dt_team_custom_item " . ($image_url ? "image_url=\"" . $image_url . "\"" : "") . ($spy != 'none' ? " spy=\"" . $spy . "\" scroll_delay=\"" . $spydly . "\"" : "") . " title=\"" . esc_attr(get_the_title()) . "\" sub_title=\"" . esc_attr($position) . "\" text=\"" . esc_attr(get_the_content()) . "\" social_link=\"show\" el_class=\"" . $colclass . "\""; if (isset($pagebuilder['page_settings']['icons']) && is_array($pagebuilder['page_settings']['icons']) && count($pagebuilder['page_settings']['icons'])) { foreach ($pagebuilder['page_settings']['icons'] as $key => $value) { if ($value['link'] !== '') { $shortcode .= " " . ($key == 'google' ? "gplus" : $key) . "=\"" . $value['link'] . "\""; } } } $shortcode .= "][/dt_team_custom_item]"; $compile .= do_shortcode($shortcode); } } wp_reset_query(); $compile .= '</div></div>'; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_team', 'krypton_dt_team_shortcode'); } /* end team */ /* carousel navigation */ function krypton_dt_carousel_navigation_btn($out) { return array("<span class=\"btn btn-owl prev\"></span>", "<span class=\"btn btn-owl next\"></span>"); } add_filter('dt_carousel_navigation_btn', 'krypton_dt_carousel_navigation_btn'); /* testimonials */ if (is_plugin_active('detheme-team/detheme_testimoni.php') || post_type_exists('testimonials')) { class DElement_Field_testimonial_members extends DElement_Field { function render($option = array(), $value = null) { $fieldname = $option['param_name']; $fieldid = sanitize_html_class($fieldname); $css = isset($option['class']) && '' != $option['class'] ? " " . (is_array($option['class']) ? @implode(" ", $option['class']) : $option['class']) : ""; //sanitize_html_class($fieldname); $output = '<div class="checkbox-options ' . $css . '">'; $array_value = @explode(",", trim($value)); $dependency = create_dependency_param($option); $args = array('post_type' => 'testimonials', 'post_status' => 'publish', 'posts_per_page' => -1); $wp_query_cpt_posts = new WP_Query($args); if ($wp_query_cpt_posts->have_posts()) { $output .= '<input type="checkbox" name="' . $fieldname . '_option" class="all-option checkbox-option" ' . (!count($array_value) || in_array('all', $array_value) ? 'checked="checked"' : '') . 'value="all" />' . __('All Testimonials', 'Krypton'); while ($wp_query_cpt_posts->have_posts()) { $wp_query_cpt_posts->the_post(); $output .= ' <input type="checkbox" name="' . $fieldname . '_option" class="checkbox-option" ' . (in_array(get_the_ID(), $array_value) ? 'checked="checked"' : '') . 'value="' . get_the_ID() . '" /> ' . get_the_title(); } } wp_reset_query(); $output .= '<input type="hidden" name="' . $fieldname . '" class="param_value checkbox-input-value" value="' . $value . '" ' . $dependency . '/>'; $output .= '</div>'; return $output; } } add_dt_element('dt_testimonial', array('title' => __('Testimonials', 'Krypton'), 'icon' => 'dashicons-testimonial', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Testimonials', 'Krypton'), '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' => __('Select testimonial', 'Krypton'), 'param_name' => 'cpt_ids', 'type' => 'testimonial_members'), array("type" => "radio", "heading" => __('Sorting type', 'Krypton'), "param_name" => "order", "default" => 'new', 'value' => array('new' => __('New', 'Krypton'), 'random' => __('Random', 'Krypton'))), array('heading' => __('Slide Speed', 'Krypton'), 'param_name' => 'slide_speed', 'type' => 'textfield', 'default' => 400), 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' => '', 'value' => '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 krypton_dt_testimonial_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => '', 'sorting_type' => 'new', 'cpt_ids' => '0', 'slide_speed' => 400), $atts, 'dt_testimonial')); $wp_query = new WP_Query(); switch ($sorting_type) { case "new": $sort_type = "post_date"; break; case "random": $sort_type = "rand"; break; } $args = array('post_type' => 'testimonials', 'orderby' => $sort_type); if (strlen($cpt_ids) > 0 && $cpt_ids !== "0" && $cpt_ids != 'all') { $cpt_ids = @explode(",", $cpt_ids); } if (is_array($cpt_ids) && count($cpt_ids) > 0) { $args['post__in'] = $cpt_ids; } $carousel_code = "[dt_carousel pagination=\"1\" spy=\"{$spy}\" el_id=\"{$el_id}\" scroll_delay=\"{$scroll_delay}\" pagination_type=\"navigation\" " . "el_class=\"" . (empty($el_class) ? "dt-testimonial" : $el_class . " dt-testimonial") . "\" speed=\"{$slide_speed}\"]"; $wp_query->query($args); if ($wp_query->have_posts()) { while ($wp_query->have_posts()) { $wp_query->the_post(); $pagebuilder = get_post_meta(get_the_ID(), "pagebuilder", true); $testimonials_author = $pagebuilder['page_settings']['testimonials']['testimonials_author']; $testimonials_company = $pagebuilder['page_settings']['testimonials']['company']; $thumbnail_id = get_post_thumbnail_id(get_the_ID()); $featured_image = wp_get_attachment_image_src($thumbnail_id, 'thumbnail'); $alt_image = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true); if (strlen($testimonials_company) > 0) { $coma = ", "; } else { $coma = ""; } $carousel_code .= "[dt_inner_row]"; $carousel_code .= '<div class="testimoni col-lg-12"> <div class="client-say"> <blockquote> ' . get_the_content() . ' </blockquote> </div>' . (strlen($featured_image[0]) > 0 ? '<div class="client-avatar"> <img src="' . aq_resize($featured_image[0], 100, 100, true, true, true) . '" alt="' . esc_attr($alt_image) . '"/> </div>' : '') . ' <div class="client-profile"> <h4 style="color:#000 !important;font-size: 28px;">' . $testimonials_author . '</h4> <span class="client-name" style="color: #2a2929;font-size: 20px;">' . $testimonials_company . '</span> <div class="ranking"><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i></div> </div> <span class="date">' . mysql2date('d M Y', get_the_date()) . '</span> </div>'; $carousel_code .= "[/dt_inner_row]"; } } wp_reset_query(); $carousel_code .= "[/dt_carousel]"; return do_shortcode($carousel_code); } add_dt_element_render('dt_testimonial', 'krypton_dt_testimonial_shortcode'); } /* portfolio */ if (is_plugin_active('detheme-port/detheme_port.php') || post_type_exists('port')) { remove_dt_element_option('dt_portfolio', 'speed'); remove_dt_element_option('dt_portfolio', 'scroll_page'); remove_dt_element_option('dt_portfolio', 'autoplay'); remove_dt_element_option('dt_portfolio', 'interval'); class DElement_Field_krypton_portfolio_categories extends DElement_Field { function render($option = array(), $value = null) { $fieldname = $option['param_name']; $fieldid = sanitize_html_class($fieldname); $css = isset($option['class']) && '' != $option['class'] ? " " . (is_array($option['class']) ? @implode(" ", $option['class']) : $option['class']) : ""; //sanitize_html_class($fieldname); $output = '<div class="checkbox-options ' . $css . '">'; $array_value = @explode(",", trim($value)); $dependency = create_dependency_param($option); $args = array('orderby' => 'name', 'show_count' => 0, 'pad_counts' => 0, 'hierarchical' => 0, 'taxonomy' => 'portcat', 'title_li' => ''); $categories = get_categories($args); if (count($categories)) { $output .= '<input type="checkbox" name="' . $fieldname . '_option" class="all-option checkbox-option" ' . (!count($array_value) || in_array('all', $array_value) ? 'checked="checked"' : '') . 'value="all" />' . __('All', 'Krypton'); foreach ($categories as $category) { $output .= ' <input type="checkbox" name="' . $fieldname . '_option" class="checkbox-option" ' . (in_array($category->term_id, $array_value) ? 'checked="checked"' : '') . 'value="' . $category->term_id . '" /> ' . $category->name; } } $output .= '<input type="hidden" name="' . $fieldname . '" class="param_value checkbox-input-value" value="' . $value . '" ' . $dependency . '/>'; $output .= '</div>'; return $output; } } add_dt_element_option('dt_portfolio', array('heading' => __('Column', 'Krypton'), 'param_name' => 'column', 'class' => '', 'value' => array('2' => __('Two Columns', 'Krypton'), '3' => __('Three Columns', 'Krypton'), '4' => __('Four Columns', 'Krypton')), 'type' => 'dropdown', 'default' => '4'), 'portfolio_num'); add_dt_element_option('dt_portfolio', array('heading' => __('Show Filter', 'Krypton'), 'param_name' => 'show_filter', 'class' => '', 'value' => array('on' => __('Yes', 'Krypton'), 'off' => __('No', 'Krypton')), 'type' => 'radio', 'default' => 'on'), 'column'); add_dt_element_option('dt_portfolio', array('heading' => __('Category', 'detheme_builder'), 'param_name' => 'portfolio_cat', 'value' => '', 'type' => 'krypton_portfolio_categories'), true); function krypton_dt_portfolio_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('spy' => 'none', 'portfolio_num' => get_option('posts_per_page'), 'scroll_delay' => 300, 'el_id' => '', 'show_filter' => 'on', 'el_class' => '', 'portfolio_cat' => '', 'column' => 4, 'layout' => 1), $atts, 'dt_portfolio')); global $DEstyle, $scollspy; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "portfolio-module" . getCssID(); } $css_class = array('portfolio-module', "col-" . intval($column)); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $args = array('post_type' => 'port', 'order' => 'ASC', 'paged' => 1, 'posts_per_page' => $portfolio_num); if (strlen($portfolio_cat) > 0 && $portfolio_cat != 'all') { $args['tax_query'] = array(array('taxonomy' => 'portcat', 'field' => 'id', 'terms' => @explode(",", trim($portfolio_cat)))); } $temsAvailable = array(); $posts = array(); $i = 1; $spydly = 0; $scollspy = ""; $wp_query = new WP_Query($args); if ($wp_query->have_posts()) { while ($wp_query->have_posts()) { $wp_query->the_post(); if ('none' !== $spy && !empty($spy)) { $spydly = $spydly + (int) $scroll_delay; $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } if ($show_filter != "off") { $new_term_list = get_the_terms(get_the_id(), "portcat"); if (is_array($new_term_list)) { foreach ($new_term_list as $term) { $temsAvailable[$term->term_id] = $term; } } } ob_start(); get_template_part('content', 'portfolio3'); $posts[] = ob_get_clean(); } } wp_reset_query(); if (count($posts)) { if ($show_filter != "off") { $compile .= '<div class="row" > <nav id="featured-work-navbar" class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#dt-featured-filter"> <span class="sr-only">' . __('Toggle navigation', 'Krypton') . '</span> <span class="icon-bars"></span> <span class="icon-bars"></span> <span class="icon-bars"></span> </button> </div> <div class="collapse navbar-collapse" id="dt-featured-filter"> <ul id="featured-filter" class="dt-portfolio-filter nav navbar-nav"> <li class="active"><a href="#" data-filter="*" class="active">' . __('All Category', 'Krypton') . '</a></li>'; if (count($temsAvailable)) { foreach ($temsAvailable as $key => $value) { $compile .= '<li><a href="' . esc_url(add_query_arg("slug", $value->term_id)) . '" data-filter=".' . esc_attr($value->slug) . '">' . $value->name . '</a></li>'; } } $compile .= '</ul> </div> </nav> </div>'; } $compile .= '<div class="portfolio-module-items">' . @implode("", $posts) . '</div>'; } $compile .= '</div>'; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_portfolio', 'krypton_dt_portfolio_shortcode'); } /* dt twitter slider */ add_dt_element_option('dt_twitter_slider', array('heading' => __('Text Color', 'Krypton'), 'param_name' => 'color_text', 'class' => '', 'type' => 'colorpicker', 'default' => '')); function krypton_dt_twitter_slider_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('twitteraccount' => 'envato', 'numberoftweets' => 10, 'dateformat' => '%b. %d, %Y', 'twittertemplate' => '{{tweet}} {{date}}', 'isautoplay' => 'true', 'color_text' => '', 'el_id' => '', 'el_class' => '', 'transitionthreshold' => '200'), $atts, 'dt_twitter_slider')); global $DEstyle; wp_enqueue_script('tweetie', get_template_directory_uri() . '/js/tweetie.js', array('jquery'), '1.0', false); wp_enqueue_style('twitter_slider', get_template_directory_uri() . '/css/twitter_slider.css', array(), '', 'all'); $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-twitter" . getCssID(); } $css_class = array('module_dt_twitter_slider'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $sequence_id = "sequence" . preg_replace('/[\\-]/', '', $el_id); $compile .= '<div class="col col-xs-2 col-sm-1 container-icon"> <a href="https://twitter.com/' . $twitteraccount . '" target="_blank"><i class="icon-twitter"></i></a> </div> <div class="col col-xs-10 col-sm-11"> <div id="' . $sequence_id . '" class="sequence-twitter"></div> </div> <script type="text/javascript"> jQuery(document).ready(function($){ $(\'#' . $sequence_id . '\').twittie({ username: \'' . $twitteraccount . '\', count: ' . $numberoftweets . ', hideReplies: false, dateFormat: \'' . $dateformat . '\', template: \'' . $twittertemplate . '\', apiPath: \'' . DTPB_DIR_URL . 'lib/twitter_slider/api/tweet.php\' },function(){ $(\'#' . $sequence_id . '\').append(\'<span class="sequence-prev"><i class="icon-left-open-big"></i></span><span class="sequence-next"><i class="icon-right-open-big"></i></span>\'); // Twitter Slider var options' . $sequence_id . ' = { autoPlay: ' . $isautoplay . ', nextButton: true, prevButton: true, preloader: false, navigationSkip: true, animateStartingFrameIn: ' . $isautoplay . ', autoPlayDelay: 3000, pauseOnHover : true, transitionThreshold:' . $transitionthreshold . ' }; var $' . $sequence_id . ' = $("#' . $sequence_id . '").sequence(options' . $sequence_id . ').data("sequence"); $' . $sequence_id . '.afterLoaded = function(){$(".sequence-prev, .sequence-next").fadeIn(100);} if ($(document).width()<=480) { $("#' . $sequence_id . ' .sequence-prev, #' . $sequence_id . ' .sequence-next").hide(); } $(document).resize(function() { if ($(document).width()<=480) { $("#' . $sequence_id . ' .sequence-prev, #' . $sequence_id . ' .sequence-next").hide(); } }); }); }); </script>'; $compile .= '</div>'; if ($color_text != '') { $DEstyle[] = "#{$sequence_id} {color:" . $color_text . "}"; } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('dt_twitter_slider', 'krypton_dt_twitter_slider_shortcode'); /* post carousel */ class DElement_Field_post_categories extends DElement_Field { function render($option = array(), $value = null) { $fieldname = $option['param_name']; $fieldid = sanitize_html_class($fieldname); $css = isset($option['class']) && '' != $option['class'] ? " " . (is_array($option['class']) ? @implode(" ", $option['class']) : $option['class']) : ""; //sanitize_html_class($fieldname); $output = '<div class="checkbox-options ' . $css . '">'; $array_value = @explode(",", trim($value)); $dependency = create_dependency_param($option); $args = array('orderby' => 'name', 'show_count' => 0, 'pad_counts' => 0, 'hierarchical' => 0, 'title_li' => ''); $categories = get_categories($args); if (count($categories)) { $output .= '<input type="checkbox" name="' . $fieldname . '_option" class="all-option checkbox-option" ' . (!count($array_value) || in_array('all', $array_value) ? 'checked="checked"' : '') . 'value="all" />' . __('All', 'Krypton'); foreach ($categories as $category) { $output .= ' <input type="checkbox" name="' . $fieldname . '_option" class="checkbox-option" ' . (in_array($category->term_id, $array_value) ? 'checked="checked"' : '') . 'value="' . $category->term_id . '" /> ' . $category->name; } } $output .= '<input type="hidden" name="' . $fieldname . '" class="param_value checkbox-input-value" value="' . $value . '" ' . $dependency . '/>'; $output .= '</div>'; return $output; } } add_dt_element('post_carousel', array('title' => __('Featured Post', 'Krypton'), 'icon' => 'dashicons-feedback', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'value' => __('Featured Post', 'Krypton'), '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' => __('Number of posts', 'Krypton'), 'param_name' => 'number_of_posts', 'type' => 'textfield'), array('heading' => __('Column', 'Krypton'), 'param_name' => 'col', 'class' => '', 'value' => array('1' => __('One Column', 'Krypton'), '2' => __('Two Columns', 'Krypton'), '3' => __('Three Columns', 'Krypton'), '4' => __('Four Columns', 'Krypton')), 'type' => 'dropdown', 'default' => '4'), array('heading' => __('Catehories', 'Krypton'), 'param_name' => 'category', 'class' => '', 'type' => 'post_categories'), array("type" => "radio", "heading" => __('Sorting type', 'Krypton'), "param_name" => "order", "default" => 'new', 'value' => array('new' => __('New', 'Krypton'), 'random' => __('Random', 'Krypton'))), array("type" => "radio", "heading" => __('Layout Type', 'Krypton'), "param_name" => "type", "default" => '1', 'value' => array('1' => __('Type 1: Show author avatar', 'Krypton'), '2' => __('Type 2: No author avatar', 'Krypton'))), array('heading' => __('Slide Speed', 'Krypton'), 'param_name' => 'speed', 'type' => 'textfield', 'default' => 400), 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' => '', 'value' => '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 krypton_post_carousel_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('number_of_posts' => 12, 'category' => 0, 'sorting_type' => 'new', 'show_text' => 'no', 'col' => 3, 'speed' => 400, 'type' => 0, 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => ''), $atts, 'post_carousel')); global $DEstyle, $krypton_Scripts, $dt_revealData; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "featured" . getCssID(); } $css_class = array(); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $widgetID = "carousel" . preg_replace('/[\\-]/', '', $el_id); switch ($sorting_type) { case "new": $sort_type = "post_date"; break; case "random": $sort_type = "rand"; break; } $args = array('posts_per_page' => $number_of_posts, 'post_type' => 'post', 'post_status' => 'publish', 'cat' => $category, 'featured' => true, 'meta_key' => '_thumbnail_id', 'orderby' => $sort_type, 'order' => 'DESC'); $query = new WP_Query(); $query->query($args); if ($query->have_posts()) { wp_register_script('owl.carousel', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '', false); wp_enqueue_script('owl.carousel'); if ($type == 2) { if ($col > 2) { ?> <style> @media (min-width: 1024px) and (max-width: 1200px) { #<?php print $widgetID; ?> .owl-slide { max-width: 300px; margin: 40px 20px; } } </style> <?php } $compile .= '<div id="' . $widgetID . '" class="dt-featured-posts owl-carousel">'; $thumbSize = 1200 / $col; if ($query->have_posts()) { $i = 0; $spydly = 0; while ($query->have_posts()) { $query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'single-post-thumbnail'); $featured_image_url = aq_resize($featured_image[0], $thumbSize, $thumbSize, true, true, true); $alt_image = get_post_meta(get_post_thumbnail_id(get_the_ID()), '_wp_attachment_image_alt', true); $post = get_post(); $post_excerpt = strlen($post->post_excerpt) > 0 ? smarty_modifier_truncate($post->post_excerpt, 100, "") : smarty_modifier_truncate(get_the_content(), 100, ""); if (strlen($featured_image[0]) > 0) { $full_image_url = $featured_image[0]; $excerpt = $post_excerpt ? '<div class="md-description"><p>' . $post_excerpt . '</p></div>' : ""; $modalContent = '<div id="' . $widgetID . '-' . get_the_ID() . '" class="popup-gallery md-modal md-effect-15"> <div class="md-content"> <img src="' . esc_url($featured_image[0]) . '" class="img-responsive" alt="' . esc_attr($alt_image) . '"/> ' . $excerpt . ' <button class="button md-close right btn-cross"><i class="icon-cancel"></i></button> </div></div>'; array_push($dt_revealData, $modalContent); } else { $modalContent = ''; } $scollspy = ""; if ('none' !== $spy && !empty($spy) && $i < $col) { $spydly = $spydly + (int) $scroll_delay; $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $compile .= '<div class="owl-slide col-sd-12" ' . $scollspy . '> <div class="top-image"> <img src="' . esc_url($featured_image_url) . '" alt="' . esc_attr($alt_image) . '"/> </div> <div class="description"> <div class="slide-content"> <h4>' . get_the_title() . '</h4> </div> <div class="nav-slide"><a href="' . get_permalink() . '" class="btn icon-link"></a><a onClick="return false;" data-modal="' . $widgetID . '-' . get_the_ID() . '" class="md-trigger btn icon-zoom-in"></a></div> </div> </div>'; $i++; } } wp_reset_postdata(); $compile .= '</div><div class="owl-carousel-navigation"> <a class="btn btn-owl prev"></a> <a class="btn btn-owl next"></a></div>'; $script = 'jQuery(document).ready(function($) { \'use strict\'; var ' . $widgetID . ' = $("#' . $widgetID . '"); try{ ' . $widgetID . '.owlCarousel({ items : ' . $col . ', //10 items above 1000px browser width itemsDesktop : [1200,3], //5 items between 1000px and 901px itemsDesktopSmall : [1023,2], // 3 items betweem 900px and 601px itemsTablet : [768,2], //2 items between 600 and 0; itemsMobile : [600,1], // itemsMobile disabled - inherit from itemsTablet option pagination : false, slideSpeed : ' . $speed . ' }); ' . $widgetID . '.parent().find(".next").click(function(){ ' . $widgetID . '.trigger(\'owl.next\'); }); ' . $widgetID . '.parent().find(".prev").click(function(){ ' . $widgetID . '.trigger(\'owl.prev\'); }); ' . $widgetID . '.owlCarousel(\'reload\'); $(".owl-slide",' . $widgetID . ') .each(function(){ this.slide = $(this).find(\'.top-image img\'); this.slide.height($(this).width()); $(this).height($(this).width()); this.desc = $(this).find(\'.description\').height(this.slide.height()); }) .hover(function(){ this.desc.animate({\'margin-top\':-this.slide.height()}); },function(){ this.desc.animate({\'margin-top\':\'0px\'}); }); } catch(err){} });'; array_push($krypton_Scripts, $script); } else { $compile .= '<div id="' . $widgetID . '" class="dt-blog-posts owl-carousel">'; $thumbSize = 1200 / $col; if ($query->have_posts()) { $i = 0; $spydly = 0; while ($query->have_posts()) { $query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'single-post-thumbnail'); $featured_image_url = aq_resize($featured_image[0], $thumbSize, $thumbSize, true, true, true); $alt_image = get_post_meta(get_post_thumbnail_id(get_the_ID()), '_wp_attachment_image_alt', true); $post = get_post(); $miniatura = get_post_meta(get_the_ID(), 'imagen_miniatura', true); $post_excerpt = strlen($post->post_excerpt) > 0 ? smarty_modifier_truncate($post->post_excerpt, 100, "") : smarty_modifier_truncate(get_the_content(), 100, ""); $avatar_url = get_avatar_url(get_the_author_meta('ID'), array('size' => 85)); $idpost = get_the_id(); $category_detail = get_the_category($idpost); $idcat = $category_detail[0]->cat_ID; $icocat = json_decode($category_detail[0]->term_thumbnail); $scollspy = ""; if ('none' !== $spy && !empty($spy) && $i < $col) { $spydly = $spydly + (int) $scroll_delay; $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $countview = 0; $countview = get_post_meta(get_the_ID(), 'post_views_count', true); if ($countview == '') { delete_post_meta(get_the_ID(), 'post_views_count'); add_post_meta(get_the_ID(), 'post_views_count', '0'); } // echo 'nom'; // print_r($category_detail[0]->slug); // print_r($category_detail[0]->cat_ID); $compile .= ' <div class="col-sd-12" ' . $scollspy . '> <div class="owl-slide"> <figure> <div class="top-image vd"> <img src="' . esc_url($featured_image_url) . '" alt="' . esc_attr($alt_image) . '"/> </div> <div class="thumb-image"> <img src="' . $icocat->url . '"/> </div> <figcaption> <div class="description"> <a href="' . get_permalink() . '" class="post-title">' . strtoupper(get_the_title()) . '</a> ' . $post_excerpt . ' </div> </figcaption> </figure> <div class="mini-panel cat-' . $category_detail[0]->slug . '"> <div class="col-sm-4 col-md-4 col-xs-4"><i class="icon-clock-8"></i>' . get_the_date('d M') . '</div> <div class="col-sm-4 col-md-4 col-xs-4"><i class="icon-chat-inv"></i>' . get_comments_number(get_the_ID()) . '</div> <div class="col-sm-4 col-md-4 col-xs-4"><i class="icon-eye-5"></i>' . $countview . '</div> </div> </div> </div>'; $i++; } } wp_reset_postdata(); $compile .= '</div><div class="owl-carousel-navigation"> <a class="btn btn-owl prev"></a> <a class="btn btn-owl next"></a></div>'; $script = 'jQuery(document).ready(function($) { \'use strict\'; var ' . $widgetID . ' = $("#' . $widgetID . '"); try{ ' . $widgetID . '.owlCarousel({ items : ' . $col . ', itemsDesktop : [1200,3], itemsDesktopSmall : [1023,2], itemsTablet : [768,2], itemsMobile : [600,1], pagination : false, slideSpeed : ' . $speed . '}); ' . $widgetID . '.parent().find(".next").click(function(){ ' . $widgetID . '.trigger(\'owl.next\'); }); ' . $widgetID . '.parent().find(".prev").click(function(){ ' . $widgetID . '.trigger(\'owl.prev\'); }); ' . $widgetID . '.owlCarousel(\'reload\'); } catch(err){} });'; array_push($krypton_Scripts, $script); } } $compile .= '</div>'; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } add_dt_element_render('post_carousel', 'krypton_post_carousel_shortcode'); }
$DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes:hover {background-color:" . $iconbg . "!important;border-color: " . $iconbg . ";}"; $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');
if ('' != $el_class) { array_push($class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "button" . getCssID() . time() . rand(11, 99); } if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if (!empty($ico)) { $class[] = $ico; } if (!empty($size)) { $class[] = $size; } if (!empty($style)) { $class[] = "btn-" . $style; } if (!empty($skin)) { $class[] = "skin-" . $skin; } if (count($class)) { $result = '<a ' . ('' != $el_id ? "id=\"" . $el_id . "\" " : "") . (!empty($url) ? "href=\"" . $url . "\"" : "") . 'class="' . @implode(" ", $class) . '" target="' . $target . '">' . $content . '</a>'; } return $result; } } add_dt_element('dt_button_cta', array('title' => __('Button', 'detheme_builder'), 'icon' => 'dashicons-megaphone', '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' => __('Button Text', 'detheme_builder'), 'param_name' => 'text', 'admin_label' => true, 'type' => 'textfield'), array('heading' => __('Button URL', 'detheme_builder'), 'param_name' => 'url', 'type' => 'textfield'), array('heading' => __('Button skin', 'detheme_builder'), 'param_name' => 'skin', 'type' => 'radio', 'value' => array('dark' => __('Dark (default)'), 'light' => __('Light', 'detheme_builder')), 'default' => 'dark'), array('heading' => __('Button style', 'detheme_builder'), 'param_name' => 'style', 'value' => array('color-primary' => __('Primary', 'detheme_builder'), 'color-secondary' => __('Secondary', 'detheme_builder'), 'success' => __('Success', 'detheme_builder'), 'info' => __('Info', 'detheme_builder'), 'warning' => __('Warning', 'detheme_builder'), 'danger' => __('Danger', 'detheme_builder'), 'ghost' => __('Ghost Button', 'detheme_builder'), 'link' => __('Link', 'detheme_builder')), 'type' => 'dropdown', 'default' => 'ghost'), array('heading' => __('Button size', 'detheme_builder'), 'param_name' => 'size', 'type' => 'dropdown', 'value' => array('btn-lg' => __('Large', 'detheme_builder'), 'btn-default' => __('Default', 'detheme_builder'), 'btn-sm' => __('Small', 'detheme_builder'), 'btn-xs' => __('Extra small', 'detheme_builder'))), array('heading' => __('Button Target', 'detheme_builder'), 'param_name' => 'target', 'type' => 'dropdown', 'value' => array('_self' => __('Self', 'detheme_builder'), '_blank' => __('Blank', 'detheme_builder'))))));
class DElement_wp_tag_cloud extends DElement { function render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('el_class' => '', 'el_id' => '', 'title' => '', 'spy' => 'none', 'taxonomy' => '', 'scroll_delay' => 300), $atts, 'tag_cloud')); $class = array('tag_cloud'); if ('' != $el_class) { array_push($class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "tag_cloud_" . getCssID(); } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $scroll_delay . '}"'; } $compile = "<div id=\"" . $el_id . "\" class=\"" . @implode(" ", $class) . "\"" . $scollspy . ">"; ob_start(); the_widget('WP_Widget_Tag_Cloud', $atts, array()); $compile .= ob_get_clean(); $compile .= "</div>"; return $compile; } } add_dt_element('wp_tag_cloud', array('title' => "WP " . __('Tag Cloud'), 'description' => __('A cloud of your most used tags.'), 'icon' => 'dashicons-wordpress-alt', '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' => __('Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'class' => '', 'value' => '', 'type' => 'textfield'), array('heading' => __('Taxonomy:'), 'param_name' => 'taxonomy', 'class' => '', 'value' => '', 'type' => 'taxonomy'), 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'))))));
$css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-custom-team" . getCssID(); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ("" != $titlecolor) { $DEstyle[] = "#{$el_id} .profile-title {color:" . $titlecolor . "}"; } if ("" != $separator_color) { $DEstyle[] = "#{$el_id} hr:after {background-color:" . $separator_color . "}"; } if ("" != $subtitlecolor) { $DEstyle[] = "#{$el_id} .profile-position {color:" . $subtitlecolor . " !important;}"; } if ("" != $color) { $DEstyle[] = "#{$el_id} .text,#{$el_id} .profile-scocial i {color:" . $color . "}"; } $compile .= 'class="' . @implode(" ", $css_class) . '" ' . $scollspy . '>'; $compile .= $custom_team; $compile .= '</div>'; return $compile; } } add_dt_element('dt_team_custom_item', array('title' => __('Custom Team Item', 'detheme_builder'), 'icon' => 'dashicons-id', 'class' => '', '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' => __('Main Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Sub Title', 'detheme_builder'), 'param_name' => 'sub_title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Description', 'detheme_builder'), 'param_name' => 'text', 'value' => '', 'type' => 'textarea'), array('heading' => __('Image', 'detheme_builder'), 'param_name' => 'image_url', 'class' => '', 'value' => '', 'type' => 'image'), array('heading' => __('Title Color', 'detheme_builder'), 'param_name' => 'titlecolor', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Sub Title Color', 'detheme_builder'), 'param_name' => 'subtitlecolor', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Separator Color', 'detheme_builder'), 'param_name' => 'separator_color', 'value' => '', 'type' => 'colorpicker', 'dependency' => array('element' => 'use_decoration', 'value' => array('1'))), array('heading' => __('Social Link', 'detheme_builder'), 'param_name' => 'social_link', 'value' => array('show' => __('Show', 'detheme_builder'), 'hide' => __('Hidden', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => 'Facebook', 'param_name' => 'facebook', 'class' => 'fontelloicon-facebook', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => 'Twitter', 'param_name' => 'twitter', 'class' => 'fontelloicon-twitter-5', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => 'Google Plus', 'param_name' => 'gplus', 'class' => 'fontelloicon-gplus', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => 'Pinterest', 'param_name' => 'pinterest', 'class' => 'fontelloicon-pinterest-2', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => 'Linkedin', 'param_name' => 'linkedin', 'class' => 'fontelloicon-linkedin-5', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => __('Website', 'detheme_builder'), 'param_name' => 'website', 'class' => 'fontelloicon-globe', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => __('Email', 'detheme_builder'), 'param_name' => 'email', 'class' => 'fontelloicon-mail-alt', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), 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 render($atts, $content = null, $base = '') { $regexshortcodes = '\\[' . '(\\[?)' . "(dt_pricetable_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } global $DEstyle; extract(shortcode_atts(array('title' => '', 'table_column' => '3', 'body_back_color' => '', 'header_back_color' => '', 'evencell_back_color' => '', 'oddcell_back_color' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_pricetable')); wp_enqueue_style('detheme-builder'); $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "pricing-table-" . getCssID() . time() . rand(11, 99); } $content = preg_replace('/\\[dt_pricetable_item/', '[dt_pricetable_item price_colum="' . $table_column . '" body_back_color="' . $body_back_color . '" header_back_color="' . $header_back_color . '" evencell_back_color="' . $evencell_back_color . '" oddcell_back_color="' . $oddcell_back_color . '"', $content); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= ("" != $el_class ? "class=\"" . $el_class . "\"" : "") . ">"; $compile .= '<div class="dt-pricing-table ' . $table_column . '-column" data-column="' . $table_column . '">' . do_shortcode($content) . '</div>'; $compile .= "</div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } add_dt_element('dt_pricetable_item', array('title' => __('Price Item', 'detheme_builder'), 'as_child' => 'dt_pricetable', 'options' => array(array('heading' => __('Most popular', 'detheme_builder'), 'param_name' => 'most_popular', 'value' => array('yes' => __('Yes', 'detheme_builder'), 'no' => __('No', 'detheme_builder')), 'type' => 'radio', 'default' => 'no'), array('heading' => __('Package Name', 'detheme_builder'), 'param_name' => 'block_name', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Price Unit', 'detheme_builder'), 'param_name' => 'block_subtitle', 'value' => '', 'type' => 'textfield'), array('heading' => __('Currency Symbol', 'detheme_builder'), 'param_name' => 'block_symbol', 'value' => '', 'type' => 'textfield'), array('heading' => __('Price', 'detheme_builder'), 'param_name' => 'block_price', 'value' => '', 'type' => 'textfield'), array('heading' => __('Package Detail', 'detheme_builder'), 'param_name' => 'content', 'value' => '', 'description' => __('Type package detail in single line (without breakline/enter). Each breakline is automatically detected as new detail item', 'detheme_builder'), 'type' => 'textarea'), array('heading' => __('"Button" Link', 'detheme_builder'), 'param_name' => 'block_link', 'value' => '', 'type' => 'textfield'), array('heading' => __('"Button" Text', 'detheme_builder'), 'param_name' => 'get_it_now_caption', 'value' => '', 'type' => 'textfield'), 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')))))); add_dt_element('dt_pricetable', array('title' => __('Pricing Table', 'detheme_builder'), 'icon' => 'dashicons-awards', 'as_parent' => 'dt_pricetable_item', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => __('Pricing Table', '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' => __('Number of Price Column', 'detheme_builder'), 'param_name' => 'table_column', 'value' => array('3' => __('Three', 'detheme_builder'), '4' => __('Four', 'detheme_builder')), 'type' => 'dropdown', 'default' => '3'), array('heading' => __('Header Background Color', 'detheme_builder'), 'param_name' => 'header_back_color', 'param_holder_class' => 'header-background-color', 'value' => "", 'default' => "", 'type' => 'colorpicker', "group" => __('Advanced', 'detheme_builder')), array('heading' => __('Body Background Color', 'detheme_builder'), 'param_name' => 'body_back_color', 'param_holder_class' => 'body-background-color', 'value' => "", 'default' => "", 'type' => 'colorpicker', "group" => __('Advanced', 'detheme_builder')), array('heading' => __('Odd Rows Background Color', 'detheme_builder'), 'param_name' => 'oddcell_back_color', 'param_holder_class' => 'oddcell-background-color', 'value' => "", 'default' => "", 'type' => 'colorpicker', "group" => __('Advanced', 'detheme_builder')), array('heading' => __('Even Rows Background Color', 'detheme_builder'), 'param_name' => 'evencell_back_color', 'param_holder_class' => 'evencell-background-color', 'value' => "", 'default' => "", 'type' => 'colorpicker', "group" => __('Advanced', 'detheme_builder')))));
$compile .= '<script type="text/javascript">'; $compile .= 'jQuery(document).ready(function($) { \'use strict\'; $(\'#dt_twitter_' . $dt_el_id . '\').twittie({ element_id: \'dt_twitter_slider_' . $dt_el_id . '\', username: \'' . $twitteraccount . '\', count: ' . $numberoftweets . ', hideReplies: false, dateFormat: \'' . $dateformat . '\', template: \'' . $twittertemplate . '\', apiPath: \'' . get_dt_plugin_dir_url() . 'lib/twitter_slider/api/tweet.php\' },function(){ $(\'#dt_twitter_slider_' . $dt_el_id . '\').owlCarousel({ items : 1, //10 items above 1000px browser width itemsDesktop : [1000,1], //5 items between 1000px and 901px itemsDesktopSmall : [900,1], // 3 items betweem 900px and 601px itemsTablet : [600,1], //2 items between 600 and 0; itemsMobile : false, // itemsMobile disabled - inherit from itemsTablet option pagination : true, autoPlay : ' . ($isautoplay ? "true" : "false") . ', slideSpeed : 200, paginationSpeed : ' . $transitionthreshold . ' }); }); });</script>' . "\n"; return $compile; } } add_dt_element('dt_twitter_slider', array('title' => __('DT Twitter Slider', 'detheme_builder'), 'icon' => "dashicons-twitter", 'options' => array(array('heading' => __('Label', 'detheme_builder'), 'param_name' => 'label', 'type' => 'textfield', 'admin_label' => true), 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' => __('Twitter Account', 'detheme_builder'), 'param_name' => 'twitteraccount', 'value' => '', 'type' => 'textfield', 'default' => 'detheme_builder'), array('heading' => __('Number of tweets to show', 'detheme_builder'), 'param_name' => 'numberoftweets', 'value' => '', 'type' => 'textfield', 'default' => 4), array('heading' => __('Date Format', 'detheme_builder'), 'param_name' => 'dateformat', 'description' => __('%d : day, %m: month in number, %b: textual month abbreviation, %B: textual month, %y: 2 digit year, %Y: 4 digit year', 'detheme_builder'), 'value' => '', 'type' => 'textfield', 'default' => '%b. %d, %Y'), array('heading' => __('Template', 'detheme_builder'), 'param_name' => 'twittertemplate', 'value' => '', 'default' => '{{date}}<br />{{tweet}}', 'type' => 'textarea', 'description' => __('{{date}}: Post Date, {{tweet}}: tweet text', 'detheme_builder')), array('heading' => __('Auto Play', 'detheme_builder'), 'param_name' => 'isautoplay', 'description' => __('Set Autoplay', 'detheme_builder'), 'class' => '', 'default' => '1', 'value' => array('1' => __('Yes', 'detheme_builder'), '0' => __('No', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Transition Threshold (msec)', 'detheme_builder'), 'param_name' => 'transitionthreshold', 'class' => '', 'default' => '500', 'description' => __('Slide speed (in millisecond). The lower value the faster slides', 'detheme_builder'), 'type' => 'textfield'))));
<svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="50" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 5: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" id="bigTriangleDown"> <path d="M0 -1 L50 99 L100 -1 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 6: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" id="bigTriangleUp"> <path d="M0 101 L50 1 L100 101 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; default: $compile = ''; break; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } add_dt_element('dt_section_separator', array('title' => __('Section Separator', 'detheme_builder'), 'icon' => 'dashicons-editor-insertmore', 'base' => 'dt_section_separator', 'class' => '', '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' => __('Separator Type', 'detheme_builder'), 'param_name' => 'separator', 'class' => '', 'param_holder_class' => 'section-heading-style', 'type' => 'select_layout', 'value' => array('1' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/separator_1.jpg" alt="' . __('Type 1', 'detheme_builder') . '" />', '2' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/separator_2.jpg" alt="' . __('Type 2', 'detheme_builder') . '"/>', '3' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/separator_3.jpg" alt="' . __('Type 3', 'detheme_builder') . '"/>', '4' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/separator_4.jpg" alt="' . __('Type 4', 'detheme_builder') . '"/>', '5' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/separator_5.jpg" alt="' . __('Type 5', 'detheme_builder') . '"/>', '6' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/separator_6.jpg" alt="' . __('Type 6', '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' => __('Separator Color', 'detheme_builder'), 'param_name' => 'separatorcolor', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'backgroundcolor', 'value' => '', 'type' => 'colorpicker'))));
case 3: $class .= 'col-md-4 col-sm-6 col-xs-6'; break; case 4: $class .= 'col-lg-3 col-md-4 col-sm-6 col-xs-6'; break; case 6: $class .= 'col-lg-2 col-md-3 col-sm-6 col-xs-6'; break; case 1: default: $class .= 'col-sm-12'; break; } foreach ($matches as $partneritem) { $spydly = $spydly + (int) $scroll_delay; if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $compile .= '<div class="border-right ' . $class . '" ' . $scollspy . '>' . do_shortcode($partneritem[0]) . '</div>'; } if (count($matches) % $column) { $compile .= str_repeat("<div class=\"dummy " . $class . "\"></div>", $column - count($matches) % $column); } $compile .= "</div>"; return "<!--- start partner -->" . $compile . "<!--- end partner -->"; } } add_dt_element('dt_partner_item', array('title' => __('Partner Item', 'detheme_builder'), 'as_child' => 'dt_partner', 'options' => array(array('heading' => __('Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Image/Logo', 'detheme_builder'), 'param_name' => 'image_url', 'class' => '', 'value' => '', 'type' => 'image'), array('heading' => __('Website', 'detheme_builder'), 'param_name' => 'website', 'value' => '', 'type' => 'textfield')))); add_dt_element('dt_partner', array('title' => __('Partner', 'detheme_builder'), 'icon' => 'dashicons-businessman', 'as_parent' => 'dt_partner_item', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => __('Partner', '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' => __('Number of Columns', 'detheme_builder'), 'param_name' => 'column', 'description' => __('Number of columns on screen larger than 1200px screen resolution', 'detheme_builder'), 'class' => '', 'value' => array('1' => __('One Column', 'detheme_builder'), '2' => __('Two Columns', 'detheme_builder'), '3' => __('Three Columns', 'detheme_builder'), '4' => __('Four Columns', 'detheme_builder'), '6' => __('Six Columns', 'detheme_builder')), 'type' => 'dropdown', 'default' => '4'), 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 render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('facebook' => '', 'twitter' => '', 'gplus' => '', 'pinterest' => '', 'linkedin' => '', 'color' => '', 'shape' => 'circle', 'size' => 'medium', 'bg_color' => '', 'align' => 'center', 'el_class' => '', 'el_id' => '', 'spy' => 'none', 'scroll_delay' => 300), $atts, 'dt_social')); $class = array('dt-social', "shape-" . $shape, "size-" . $size, "align-" . $align); if ('' != $el_class) { array_push($class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "social_" . getCssID(); } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ('' != $color) { $DEstyle[] = "#{$el_id} li a{color:" . $color . ";}"; } if ('' != $bg_color) { $DEstyle[] = "#{$el_id} li{background-color:" . $bg_color . ";}"; } $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $scroll_delay . '}"'; } $compile = "<ul id=\"" . $el_id . "\" class=\"" . @implode(" ", $class) . "\"" . $scollspy . ">" . ($facebook ? "<li><a href=\"" . $facebook . "\" target=\"_blank\"><i class=\"fontelloicon-facebook-1\"></i></a></li>" : "") . ($twitter ? "<li><a href=\"" . $twitter . "\" target=\"_blank\"><i class=\"fontelloicon-twitter-1\"></i></a></li>" : "") . ($gplus ? "<li><a href=\"" . $gplus . "\" target=\"_blank\"><i class=\"fontelloicon-gplus\"></i></a></li>" : "") . ($linkedin ? "<li><a href=\"" . $linkedin . "\" target=\"_blank\"><i class=\"fontelloicon-linkedin-1\"></i></a></li>" : "") . ($pinterest ? "<li><a href=\"" . $pinterest . "\" target=\"_blank\"><i class=\"fontelloicon-pinterest\"></i></a></li>" : "") . "</ul>"; return $compile; } } add_dt_element('dt_social', array('title' => __('Social Box', 'detheme_builder'), 'icon' => 'dashicons-groups', 'options' => array(array('heading' => __('Label', 'detheme_builder'), 'param_name' => 'label', 'type' => 'textfield', 'admin_label' => true), 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' => '', 'param_name' => 'facebook', 'class' => 'fontelloicon-facebook', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => '', 'param_name' => 'twitter', 'class' => 'fontelloicon-twitter-5', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => '', 'param_name' => 'gplus', 'class' => 'fontelloicon-gplus', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => '', 'param_name' => 'pinterest', 'class' => 'fontelloicon-pinterest-2', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => '', 'param_name' => 'linkedin', 'class' => 'fontelloicon-linkedin-5', 'value' => '', 'type' => 'iconfield', 'dependency' => array('element' => 'social_link', 'value' => array('show'))), array('heading' => __('Size', 'detheme_builder'), 'param_name' => 'size', 'value' => array('small' => __('Small', 'detheme_builder'), 'medium' => __('Medium', 'detheme_builder'), 'large' => __('Large', 'detheme_builder')), 'default' => 'medium', 'type' => 'radio'), array('heading' => __('Shape', 'detheme_builder'), 'param_name' => 'shape', 'value' => array('square' => __('Square', 'detheme_builder'), 'circle' => __('Circle', 'detheme_builder'), "rounded" => __("Rounded", 'detheme_builder')), 'default' => 'square', 'type' => 'radio'), array('heading' => __('Align', 'detheme_builder'), 'param_name' => 'align', 'value' => array('left' => __('Left', 'detheme_builder'), 'center' => __('Center', 'detheme_builder'), 'right' => __('Right', 'detheme_builder')), 'type' => 'radio', 'default' => 'center'), array('heading' => __('Color', 'detheme_builder'), 'param_name' => 'color', 'class' => '', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'class' => '', 'value' => '', 'type' => 'colorpicker'), 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'))))));
$css_class = array('progress_bars'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_progress" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ("" != $label) { $DEstyle[] = "#{$el_id} .progress_info * {color:" . $label . "}"; } if ("" != $icon_color) { $DEstyle[] = "#{$el_id} i:before,#{$el_id} i:after,#{$el_id} i {color:" . $icon_color . "}"; } if ("" != $iconbg) { $DEstyle[] = "#{$el_id} i {background-color:" . $iconbg . "}"; } $compile .= $progress_bar . "</div>"; return $compile; } } add_dt_element('dt_progressbar_item', array('title' => __('Progress Bar Item', 'detheme_builder'), 'icon' => 'dashicons-chart-bar', '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'), array('heading' => __('Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Value', 'detheme_builder'), 'param_name' => 'value', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Units', 'detheme_builder'), 'param_name' => 'unit', 'value' => '', 'type' => 'textfield'), array('heading' => __('Label Color', 'detheme_builder'), 'param_name' => 'label', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Icon Color', 'detheme_builder'), 'param_name' => 'icon_color', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Icon Background Color', 'detheme_builder'), 'param_name' => 'iconbg', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Bar Color', 'detheme_builder'), 'param_name' => 'color', 'value' => '#90d5e5', 'type' => 'colorpicker'), array('heading' => __('Bar Background Color', 'detheme_builder'), 'param_name' => 'bg', 'value' => '', 'type' => 'colorpicker'))));
} $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if (!empty($title)) { $compile .= '<h2 class="optin-heading">' . $title . '</h2>'; } if (!empty($sub_title)) { $compile .= '<div class="optin-subheading">' . $sub_title . '</div>'; } $compile .= '<div class="optin-content">' . $formcode . '</div>'; if (!empty($footer_text)) { $compile .= '<div class="optin-footer">' . $footer_text . '</div>'; } $compile .= '<div class="optin_code" >' . html_entity_decode($content) . '</div>'; $compile .= "</div>"; $compile .= '<script type="text/javascript">var ajaxurl = \'' . admin_url('admin-ajax.php') . '\';</script>'; return $compile; } } add_dt_element('dt_optin_form', array('title' => __('Optin Form', 'detheme_builder'), 'icon' => 'dashicons-index-card', 'options' => array(array('heading' => __('Label', 'detheme_builder'), 'param_name' => 'label', 'type' => 'textfield', 'admin_label' => true), 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' => __('Optin Code', 'detheme_builder'), 'param_name' => 'content', 'description' => __('put your optin form code here', 'detheme_builder'), 'value' => '', 'css' => 'optin-code', 'type' => 'textarea'), array('heading' => __('Choose Layout', 'detheme_builder'), 'param_name' => 'layout', 'class' => 'select_optin_layout', 'type' => 'select_layout', 'value' => array('vertical' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/optin-1.gif" alt="" />', 'vertical_email' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/optin-3.gif" alt=""/>', 'horizontal_email' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/optin-2.gif" alt=""/>', 'horizontal' => '<img src="' . get_dt_plugin_dir_url() . 'lib/images/optin-4.gif" alt=""/>'), 'default' => 'vertical', 'description' => __('Choose the icon layout you want to use.', 'detheme_builder')), array('heading' => __('Form Preview', 'detheme_builder'), 'param_name' => 'button_preview', 'value' => "", 'param_holder_class' => 'preview-optin-form optin-preview', 'type' => 'button_preview', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Name Label', 'detheme_builder'), 'param_name' => 'name_label', 'default' => __('Your name', 'detheme_builder'), 'param_holder_class' => 'name-optin-form optin-preview', 'type' => 'textfield', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Email Label', 'detheme_builder'), 'param_name' => 'email_label', 'param_holder_class' => 'email-optin-form optin-preview', 'default' => __('Your email', 'detheme_builder'), 'type' => 'textfield', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Text', 'detheme_builder'), 'param_name' => 'button_text', 'param_holder_class' => 'button-optin-form optin-preview', 'default' => __('Submit Button', 'detheme_builder'), 'type' => 'textfield', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Font Type', 'detheme_builder'), 'param_name' => 'button_font', 'param_holder_class' => 'font-optin-form optin-preview', 'value' => $font_formats, 'type' => 'dropdown', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Text Color', 'detheme_builder'), 'param_name' => 'button_text_color', 'param_holder_class' => 'button-text-color optin-preview', 'value' => "", 'default' => "#fff", 'type' => 'colorpicker', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Font Size', 'detheme_builder'), 'param_name' => 'font_size', 'param_holder_class' => 'font-size-selector optin-preview', 'default' => "12", 'type' => 'slider_value', 'params' => array('min' => 12, 'max' => '50', 'step' => 1), "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Element Height', 'detheme_builder'), 'param_name' => 'vertical_padding', 'param_holder_class' => 'vertical-padding optin-preview', 'default' => "40", 'type' => 'slider_value', 'params' => array('min' => 18, 'max' => '100', 'step' => 1), "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Width', 'detheme_builder'), 'param_name' => 'horizontal_padding', 'param_holder_class' => 'horizontal-padding optin-preview', 'default' => "16", 'params' => array('min' => 0, 'max' => '50', 'step' => 1), 'type' => 'slider_value', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Border Radius', 'detheme_builder'), 'param_name' => 'button_radius', 'param_holder_class' => 'border-radius optin-preview', 'default' => "0", 'params' => array('min' => 0, 'max' => '50', 'step' => 1), 'type' => 'slider_value', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Inputbox Radius', 'detheme_builder'), 'param_name' => 'input_radius', 'param_holder_class' => 'input-radius optin-preview', 'default' => "0", 'params' => array('min' => 0, 'max' => '50', 'step' => 1), 'type' => 'slider_value', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Inputbox Padding Horizontal', 'detheme_builder'), 'param_name' => 'input_horizontal_padding', 'param_holder_class' => 'input-horizontal-padding optin-preview', 'default' => "15", 'params' => array('min' => 15, 'max' => '50', 'step' => 1), 'type' => 'slider_value', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Element Margin', 'detheme_builder'), 'param_name' => 'element_margin', 'param_holder_class' => 'element-margin optin-preview', 'default' => "10", 'params' => array('min' => 0, 'max' => '50', 'step' => 1), 'type' => 'slider_value', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Full Width Button', 'detheme_builder'), 'param_name' => 'expanded', 'param_holder_class' => 'expanded-button optin-preview', 'value' => '', 'type' => 'check', 'group' => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Align', 'detheme_builder'), 'param_name' => 'button_align', 'param_holder_class' => 'button-align optin-preview', 'value' => array('left' => __('Left', 'detheme_builder'), 'center' => __('Center', 'detheme_builder'), 'right' => __('Right', 'detheme_builder')), 'type' => 'radio', 'default' => 'left', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Label Align', 'detheme_builder'), 'param_name' => 'label_align', 'param_holder_class' => 'label-align optin-preview', 'value' => array('left' => __('Left', 'detheme_builder'), 'center' => __('Center', 'detheme_builder'), 'right' => __('Right', 'detheme_builder')), 'type' => 'radio', 'default' => 'left', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Color', 'detheme_builder'), 'param_name' => 'button_color', 'param_holder_class' => 'button-color optin-preview', 'value' => "", 'default' => "#444444", 'type' => 'colorpicker', "group" => __('Form Preview', 'detheme_builder')), array('heading' => __('Button Gradient Color', 'detheme_builder'), 'param_name' => 'gradient', 'param_holder_class' => 'gradient-color optin-preview', 'value' => '', 'type' => 'check', 'group' => __('Form Preview', 'detheme_builder')), array('heading' => '', 'param_name' => 'gradient_color_to', 'param_holder_class' => 'gradient-color-to optin-preview', 'value' => "", 'default' => "#fff", 'type' => 'colorpicker', "group" => __('Form Preview', 'detheme_builder'))))); function get_button_preview($settings, $value) { $output = '<div class="optin-form"> <div role="form"> <div class="form-group"><input disabled="disabled" type="text" class="form-control dt_name" name="dt_name" placeholder="' . __('Your name', 'detheme_builder') . '" /></div> <div class="form-group"><input disabled="disabled" type="text" class="form-control dt_email" name="dt_email" placeholder="' . __('Your email', 'detheme_builder') . '" /></div> <div class="form-group"><button class="btn optin_button_preview">' . __('Button Text Color', 'detheme_builder') . '</button></div> </div> </div>'; print $output; } add_dt_field_type('button_preview', 'get_button_preview');
$css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "circlebar" . getCssID(); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= '' != $el_class ? "class=\"" . $el_class . "\"" : ""; $compile .= ">"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ("" != $label_color) { $DEstyle[] = "#{$el_id} .pie-title {color:" . $label_color . "}"; } if ("" != $unit_color) { $DEstyle[] = "#{$el_id} .tocounter,#{$el_id} .tocounter-unit {color:" . $unit_color . "}"; } $compile .= '<div class="dt_circlebar"> <div class=\'pie_chart_holder normal\'> <canvas class="doughnutChart" data-noactive="' . $bg . '" data-size="' . $size . '" data-unit="' . $unit . '" data-active="' . $color . '" data-percent=\'' . $value . '\'></canvas> </div> <h4 class="pie-title">' . $title . '</h4> <div class="pie-description"></div> </div></div>'; return $compile; } } add_dt_element('dt_circlebar_item', array('title' => __('Circle Bar', 'detheme_builder'), 'icon' => 'dashicons-marker', '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' => __('Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Value', 'detheme_builder'), 'param_name' => 'value', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Units', 'detheme_builder'), 'param_name' => 'unit', 'value' => '', 'type' => 'textfield'), array('heading' => __('Bar Width', 'detheme_builder'), 'param_name' => 'size', 'value' => '', 'type' => 'textfield'), array('heading' => __('Label Color', 'detheme_builder'), 'param_name' => 'label_color', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Unit Color', 'detheme_builder'), 'param_name' => 'unit_color', 'value' => '', 'type' => 'colorpicker'), array('heading' => __('Bar Color', 'detheme_builder'), 'param_name' => 'color', 'value' => '#90d5e5', 'type' => 'colorpicker'), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg', 'value' => '', 'type' => 'colorpicker'))));
ob_start(); ?> <div class="isotope-item"<?php print $scollspy; ?> > <div class="isotope-inner <?php print $post->post_format; ?> "> <?php get_template_part('content', get_post_format()); ?> </div> </div> <?php $compile .= ob_get_contents(); ob_end_clean(); } } wp_reset_postdata(); $compile .= "</div></div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } add_dt_element('dt_post', array('title' => __('Posts Grid', 'detheme_builder'), 'description' => __('Show posts in grid view', 'detheme_builder'), 'icon' => 'dashicons-screenoptions', 'options' => array(array('heading' => __('Label', 'detheme_builder'), 'param_name' => 'label', 'type' => 'textfield', 'admin_label' => true), 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' => __('Category', 'detheme_builder'), 'param_name' => 'cat', 'type' => 'categories'), array('heading' => __('Order By', 'detheme_builder'), 'param_name' => 'orderby', 'type' => 'dropdown', 'value' => array('id' => __('ID', 'detheme_builder'), 'date' => __('Date', 'detheme_builder'), 'modified' => __('Modified Date', 'detheme_builder'), 'title' => __('Title', 'detheme_builder'), 'author' => __('Author', 'detheme_builder'), 'comment_count' => __('Comment Count', 'detheme_builder'), 'rand' => __('Random', 'detheme_builder')), 'default' => 'date'), array('heading' => __('Order', 'detheme_builder'), 'param_name' => 'order', 'type' => 'radio', 'value' => array('asc' => __('Ascending', 'detheme_builder'), 'desc' => __('Descending', 'detheme_builder')), 'default' => 'asc'), array('heading' => __('Total items', 'detheme_builder'), 'param_name' => 'perpage', 'type' => 'textfield', "description" => __("Set max limit for items in grid or enter -1 to display all.", "detheme_builder")), array('type' => 'dropdown', 'heading' => __('Layout mode', 'detheme_builder'), 'param_name' => 'layout', 'value' => array('fitRows' => __('Fit rows', 'detheme_builder'), 'masonry' => __('Masonry', 'detheme_builder'))), array('heading' => __('Gutter', 'detheme_builder'), 'param_name' => 'gutter', 'type' => 'textfield', "description" => __("Set column space", "detheme_builder")), array('type' => 'dropdown', 'heading' => __('Column', 'detheme_builder'), 'param_name' => 'columns', 'value' => array(6, 5, 4, 3, 2, 1), 'default' => 3), array('heading' => __('Desktop Column', 'detheme_builder'), 'param_name' => 'desktop_column', 'description' => __('items between 992px and 1200px', 'detheme_builder'), 'class' => '', 'value' => array(6, 5, 4, 3, 2, 1), 'type' => 'dropdown', 'default' => 3), array('heading' => __('Desktop Small Column', 'detheme_builder'), 'param_name' => 'medium_column', 'description' => __('items between 992px and 768px', 'detheme_builder'), 'class' => '', 'value' => array(6, 5, 4, 3, 2, 1), 'type' => 'dropdown', 'default' => 3), array('heading' => __('Tablet Column', 'detheme_builder'), 'param_name' => 'small_column', 'description' => __('items between 768px and 480px', 'detheme_builder'), 'class' => '', 'value' => array(6, 5, 4, 3, 2, 1), 'type' => 'dropdown', 'default' => 2), array('heading' => __('Mobile Column', 'detheme_builder'), 'param_name' => 'mobile_column', 'description' => __('items below 480px', 'detheme_builder'), 'class' => '', 'value' => array(6, 5, 4, 3, 2, 1), 'type' => 'dropdown', 'default' => 1), 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'))))));
$css_column = in_array($column, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) ? "col-sm-" . min($column, 12) : "column_custom_" . $column; array_push($css_class, $css_column); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= do_shortcode($content); $compile .= "</div>"; if ('' != $font_color) { $DEstyle[] = "#{$el_id} * {color:{$font_color}}"; } if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . @implode(";", $css_style) . "}"; } return $compile; } } class DElement_dt_inner_column extends DElement_dt_column { } class DElement_dt_inner_column_1 extends DElement_dt_column { } add_dt_element('dt_row', array('title' => __('Row', 'detheme_builder'), 'icon' => 'dashicons-editor-justify', '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("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "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' => __('Padding Top', 'detheme_builder'), 'param_name' => 'p_top', 'param_holder_class' => 'p_top', 'type' => 'textfield'), array('heading' => __('Padding Bottom', 'detheme_builder'), 'param_name' => 'p_bottom', 'param_holder_class' => 'p_bottom', 'type' => 'textfield'), array('heading' => __('Padding Left', 'detheme_builder'), 'param_name' => 'p_left', 'param_holder_class' => 'p_left', 'type' => 'textfield'), array('heading' => __('Padding Right', 'detheme_builder'), 'param_name' => 'p_right', 'param_holder_class' => 'p_right', 'type' => 'textfield'), array('heading' => __('Background Type', 'detheme_builder'), 'param_name' => 'background_type', 'value' => array('image' => __('Image', 'detheme_builder'), 'video' => __('Video', 'detheme_builder')), 'type' => 'radio', 'default' => 'image'), array('heading' => __('Background Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image', 'dependency' => array('element' => 'background_type', 'value' => array('image'))), array('heading' => __('Background Video (mp4)', 'detheme_builder'), 'param_name' => 'background_video', 'type' => 'video', 'params' => array('mime_type' => 'video/mp4'), 'dependency' => array('element' => 'background_type', 'value' => array('video'))), array('heading' => __('Background Video (webm)', 'detheme_builder'), 'param_name' => 'background_video_webm', 'type' => 'video', 'params' => array('mime_type' => 'video/webm'), 'dependency' => array('element' => 'background_type', 'value' => array('video'))), array('heading' => __('Image Thumb/Poster', 'detheme_builder'), 'param_name' => 'background_poster', 'type' => 'image', 'dependency' => array('element' => 'background_type', 'value' => array('video'))), array('heading' => __('Background Image Style', 'detheme_builder'), 'param_name' => 'background_style', 'type' => 'dropdown', 'value' => array('cover' => __("Cover", 'detheme_builder'), 'contain' => __('Contain', 'detheme_builder'), 'no-repeat' => __('No Repeat', 'detheme_builder'), 'repeat' => __('Repeat', 'detheme_builder'), 'fixed' => __("Fixed", 'detheme_builder')), 'group' => __('Extended options', 'detheme_builder'), 'dependency' => array('element' => 'background_type', 'value' => array('image'))), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'type' => 'colorpicker'), 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')))))); add_dt_element('dt_inner_row', array('title' => __('Row', 'detheme_builder'), '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("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "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' => __('Padding Top', 'detheme_builder'), 'param_name' => 'p_top', 'param_holder_class' => 'p_top', 'type' => 'textfield'), array('heading' => __('Padding Bottom', 'detheme_builder'), 'param_name' => 'p_bottom', 'param_holder_class' => 'p_bottom', 'type' => 'textfield'), array('heading' => __('Padding Left', 'detheme_builder'), 'param_name' => 'p_left', 'param_holder_class' => 'p_left', 'type' => 'textfield'), array('heading' => __('Padding Right', 'detheme_builder'), 'param_name' => 'p_right', 'param_holder_class' => 'p_right', 'type' => 'textfield'), array('heading' => __('Background Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image'), array('heading' => __('Background Image Style', 'detheme_builder'), 'param_name' => 'background_style', 'type' => 'dropdown', 'value' => array('cover' => __("Cover", 'detheme_builder'), 'contain' => __('Contain', 'detheme_builder'), 'no-repeat' => __('No Repeat', 'detheme_builder'), 'repeat' => __('Repeat', 'detheme_builder'), 'fixed' => __("Fixed", 'detheme_builder')), 'group' => __('Extended options', 'detheme_builder'), 'dependency' => array('element' => 'image', 'not_empty' => true)), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'type' => 'colorpicker')))); add_dt_element('dt_inner_row_1', array('title' => __('Row', 'detheme_builder'), '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("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "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' => __('Padding Top', 'detheme_builder'), 'param_name' => 'p_top', 'param_holder_class' => 'p_top', 'type' => 'textfield'), array('heading' => __('Padding Bottom', 'detheme_builder'), 'param_name' => 'p_bottom', 'param_holder_class' => 'p_bottom', 'type' => 'textfield'), array('heading' => __('Padding Left', 'detheme_builder'), 'param_name' => 'p_left', 'param_holder_class' => 'p_left', 'type' => 'textfield'), array('heading' => __('Padding Right', 'detheme_builder'), 'param_name' => 'p_right', 'param_holder_class' => 'p_right', 'type' => 'textfield'), array('heading' => __('Background Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image'), array('heading' => __('Background Image Style', 'detheme_builder'), 'param_name' => 'background_style', 'type' => 'dropdown', 'value' => array('cover' => __("Cover", 'detheme_builder'), 'contain' => __('Contain', 'detheme_builder'), 'no-repeat' => __('No Repeat', 'detheme_builder'), 'repeat' => __('Repeat', 'detheme_builder'), 'fixed' => __("Fixed", 'detheme_builder')), 'group' => __('Extended options', 'detheme_builder'), 'dependency' => array('element' => 'image', 'not_empty' => true)), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'type' => 'colorpicker')))); add_dt_element('dt_column', array('title' => __('Column', 'detheme_builder'), '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" => __("If you wish to add anchor id to this column. Anchor id may used as link like href=\"#yourid\"", "detheme_builder")), array("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "detheme_builder")), array('heading' => __('Background Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image'), array('heading' => __('Padding Top', 'detheme_builder'), 'param_name' => 'p_top', 'param_holder_class' => 'p_top', 'type' => 'textfield'), array('heading' => __('Padding Bottom', 'detheme_builder'), 'param_name' => 'p_bottom', 'param_holder_class' => 'p_bottom', 'type' => 'textfield'), array('heading' => __('Padding Left', 'detheme_builder'), 'param_name' => 'p_left', 'param_holder_class' => 'p_left', 'type' => 'textfield'), array('heading' => __('Padding Right', 'detheme_builder'), 'param_name' => 'p_right', 'param_holder_class' => 'p_right', 'type' => 'textfield'), array('heading' => __('Background Image Style', 'detheme_builder'), 'param_name' => 'background_style', 'type' => 'dropdown', 'value' => array('cover' => __("Cover", 'detheme_builder'), 'contain' => __('Contain', 'detheme_builder'), 'no-repeat' => __('No Repeat', 'detheme_builder'), 'repeat' => __('Repeat', 'detheme_builder'), 'fixed' => __("Fixed", 'detheme_builder')), 'group' => __('Extended options', 'detheme_builder'), 'dependency' => array('element' => 'image', 'not_empty' => true)), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'type' => 'colorpicker')))); add_dt_element('dt_inner_column', array('title' => __('Column', 'detheme_builder'), '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" => __("If you wish to add anchor id to this column. Anchor id may used as link like href=\"#yourid\"", "detheme_builder")), array("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "detheme_builder")), array('heading' => __('Background Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image'), array('heading' => __('Padding Top', 'detheme_builder'), 'param_name' => 'p_top', 'param_holder_class' => 'p_top', 'type' => 'textfield'), array('heading' => __('Padding Bottom', 'detheme_builder'), 'param_name' => 'p_bottom', 'param_holder_class' => 'p_bottom', 'type' => 'textfield'), array('heading' => __('Padding Left', 'detheme_builder'), 'param_name' => 'p_left', 'param_holder_class' => 'p_left', 'type' => 'textfield'), array('heading' => __('Padding Right', 'detheme_builder'), 'param_name' => 'p_right', 'param_holder_class' => 'p_right', 'type' => 'textfield'), array('heading' => __('Background Image Style', 'detheme_builder'), 'param_name' => 'background_style', 'type' => 'dropdown', 'value' => array('cover' => __("Cover", 'detheme_builder'), 'contain' => __('Contain', 'detheme_builder'), 'no-repeat' => __('No Repeat', 'detheme_builder'), 'repeat' => __('Repeat', 'detheme_builder'), 'fixed' => __("Fixed", 'detheme_builder')), 'group' => __('Extended options', 'detheme_builder'), 'dependency' => array('element' => 'image', 'not_empty' => true)), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'type' => 'colorpicker')))); add_dt_element('dt_inner_column_1', array('title' => __('Column', 'detheme_builder'), '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" => __("If you wish to add anchor id to this column. Anchor id may used as link like href=\"#yourid\"", "detheme_builder")), array('heading' => __('Padding Top', 'detheme_builder'), 'param_name' => 'p_top', 'param_holder_class' => 'p_top', 'type' => 'textfield'), array('heading' => __('Padding Bottom', 'detheme_builder'), 'param_name' => 'p_bottom', 'param_holder_class' => 'p_bottom', 'type' => 'textfield'), array('heading' => __('Padding Left', 'detheme_builder'), 'param_name' => 'p_left', 'param_holder_class' => 'p_left', 'type' => 'textfield'), array('heading' => __('Padding Right', 'detheme_builder'), 'param_name' => 'p_right', 'param_holder_class' => 'p_right', 'type' => 'textfield'), array("type" => "colorpicker", "heading" => __('Font Color', 'detheme_builder'), "param_name" => "font_color", "description" => __("Select font color", "detheme_builder")), array('heading' => __('Background Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image'), array('heading' => __('Background Image Style', 'detheme_builder'), 'param_name' => 'background_style', 'type' => 'dropdown', 'value' => array('cover' => __("Cover", 'detheme_builder'), 'contain' => __('Contain', 'detheme_builder'), 'no-repeat' => __('No Repeat', 'detheme_builder'), 'repeat' => __('Repeat', 'detheme_builder'), 'fixed' => __("Fixed", 'detheme_builder')), 'group' => __('Extended options', 'detheme_builder'), 'dependency' => array('element' => 'image', 'not_empty' => true)), array('heading' => __('Background Color', 'detheme_builder'), 'param_name' => 'bg_color', 'type' => 'colorpicker'))));
global $DEstyle; extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'scroll_delay' => '300', 'spy' => ''), $atts, 'dt_text')); $css_class = array('dt_text'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_text" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}" '; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= do_shortcode($content); $compile .= "</div>"; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } class DElement_dt_text_html extends DElement_dt_text { } add_dt_element('dt_text_html', array('title' => __('Text Editor', 'detheme_builder'), 'icon' => "dashicons-edit", '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' => __('Text', 'detheme_builder'), 'param_name' => 'content', 'type' => 'textarea_html', 'default' => '<p>I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.</p>' . '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.</p>'), 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'))))));
$image_id = $image; if (!($image = get_image_size($image, $size))) { return ""; } $image_alt_text = get_post_meta($image_id, '_wp_attachment_image_alt', true); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}" '; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $link = $url != '' ? "<a href=\"" . esc_url($url) . "\" target=\"" . $target . "\">" : ""; $link_end = $url != '' ? "</a>" : ""; $compile .= "<div class=\"image-align-" . $align . "\">"; if ($image_style == 'diamond') { $compile .= "<div class=\"ketupat0\"" . ($image[1] ? " style=\"width:" . ($image[1] - $image[1] * 10 / 100) . "px;height:" . ($image[1] - $image[1] * 10 / 100) . "px\"" : "") . ">" . "<div class=\"ketupat1\" " . ('' != $border ? " style=\"border:{$border} solid\"" : "") . ">" . "<div class=\"ketupat2\">" . $link . "<img class=\"img-responsive " . ('' != $image_style ? "style-" . $image_style : "") . "\" src=\"" . esc_url($image[0]) . "\" alt=\"" . esc_attr($image_alt_text) . "\"/>" . $link_end . "</div></div></div>"; } else { $compile .= $link . "<img " . ('' != $border ? "style=\"border:{$border} solid\"" : "") . " class=\"img-responsive " . ('' != $image_style ? "style-" . $image_style : "") . "\" src=\"" . esc_url($image[0]) . "\" alt=\"" . esc_attr($image_alt_text) . "\"/>" . $link_end; } $compile .= "</div>"; $compile .= "</div>"; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; } } add_dt_element('dt_image', array('title' => __('Image', 'detheme_builder'), 'icon ' => 'dashicons-format-image', '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' => __('Image', 'detheme_builder'), 'param_name' => 'image', 'type' => 'image'), array('heading' => __('Image Align', 'detheme_builder'), 'param_name' => 'align', 'type' => 'dropdown', 'value' => array('left' => __('Align Left', 'detheme_builder'), 'right' => __('Align Right', 'detheme_builder'), 'center' => __('Align Center', 'detheme_builder'))), array('heading' => __('Image Size', 'detheme_builder'), 'param_name' => 'size', 'type' => 'textfield', 'value' => "", 'description' => __('Enter image size. Example: thumbnail, small, medium, large, full or other sizes defined by current theme. Alternatively enter image size in pixels: 200x200 (Width x Height).', 'detheme_builder')), array('heading' => __('Image Style', 'detheme_builder'), 'param_name' => 'image_style', 'type' => 'dropdown', 'value' => array('default' => __('Default', 'detheme_builder'), 'rounded' => __('Rounded', 'detheme_builder'), 'circle' => __('Circle', 'detheme_builder'), 'diamond' => __('Diamond', 'detheme_builder'))), array('heading' => __('Border Color', 'detheme_builder'), 'param_name' => 'border', 'type' => 'colorpicker', 'value' => ""), array('heading' => __('Image Link', 'detheme_builder'), 'param_name' => 'url', 'type' => 'textfield'), array('heading' => __('Link Target', 'detheme_builder'), 'param_name' => 'target', 'type' => 'dropdown', 'value' => array('_self' => __('Self', 'detheme_builder'), '_blank' => __('Blank', 'detheme_builder'))), 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'))))));
$(el).click(function(){ $(\'.owl-custom-pagination .owl-page\',$base.parent()).removeClass(\'active\'); $(this).addClass(\'active\'); $base.trigger(\'owl.goTo\',(i*perpage)); }); }); }'; } else { if (count($paginationthumb) && $pagination_type == 'navigation') { $script .= 'afterInit:function(el){ var $base=el; $(\'.owl-custom-pagination .next\',$base.parent()).click(function(){ $base.trigger(\'owl.next\'); }); $(\'.owl-custom-pagination .prev\',$base.parent()).click(function(){ $base.trigger(\'owl.prev\'); }); }'; } } $script .= '});'; $script .= '} catch(err){} });</script>'; return $compile . $script; } } add_dt_element('dt_carousel', array('title' => __('Carousel', 'detheme_builder'), 'icon' => 'dashicons-image-flip-horizontal', 'is_container' => true, 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, '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' => __('Slide Speed', 'detheme_builder'), 'param_name' => 'speed', 'class' => '', 'default' => '800', 'description' => __('Slide speed (in millisecond). The lower value the faster slides', 'detheme_builder'), 'type' => 'textfield'), array('heading' => __('Autoplay', 'detheme_builder'), 'param_name' => 'autoplay', 'description' => __('Set Autoplay', 'detheme_builder'), 'class' => '', 'default' => '0', 'value' => array('1' => __('Yes', 'detheme_builder'), '0' => __('No', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Slide Interval', 'detheme_builder'), 'param_name' => 'interval', 'class' => '', 'default' => '1000', 'description' => __('Slide Interval (in millisecond)', 'detheme_builder'), 'type' => 'textfield', 'dependency' => array('element' => 'autoplay', 'value' => array('1'))), array('heading' => __('Pagination', 'detheme_builder'), 'param_name' => 'pagination', 'description' => __('Pagination Setting', 'detheme_builder'), 'class' => '', 'default' => '1', 'value' => array('1' => __('Show', 'detheme_builder'), '0' => __('Hidden', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Pagination Type', 'detheme_builder'), 'param_name' => 'pagination_type', 'class' => '', 'default' => 'bullet', 'value' => array('bullet' => __('Standard', 'detheme_builder'), 'image' => __('Custom Image', 'detheme_builder'), 'icon' => __('Custom Icon', 'detheme_builder'), 'navigation' => __('Navigation Button', 'detheme_builder')), 'type' => 'dropdown', 'dependency' => array('element' => 'pagination', 'value' => array('1'))), array('heading' => __('Color', 'detheme_builder'), 'param_name' => 'pagination_color', 'value' => '', 'type' => 'colorpicker', 'dependency' => array('element' => 'pagination_type', 'value' => array('bullet'))), array('heading' => __('Pagination Preview', 'detheme_builder'), 'param_name' => 'pagination_to_preview', 'value' => '', 'type' => 'carousel_preview', 'dependency' => array('element' => 'pagination_type', 'value' => array('bullet'))), array('heading' => __('Size', 'detheme_builder'), 'param_name' => 'pagination_size', 'params' => array('min' => 12, 'max' => 50, 'step' => 1), 'type' => 'slider_value', 'dependency' => array('element' => 'pagination_type', 'value' => array('bullet'))), array('heading' => __('Pagination Image', 'detheme_builder'), 'param_name' => 'pagination_image', 'class' => '', 'value' => '', 'type' => 'images', 'dependency' => array('element' => 'pagination_type', 'value' => array('image'))), array('heading' => __('Pagination Icon', 'detheme_builder'), 'param_name' => 'pagination_icon', 'class' => '', 'value' => '', 'description' => __('The icon you want as pagination', 'detheme_builder'), 'type' => 'iconlists_multi', 'dependency' => array('element' => 'pagination_type', 'value' => array('icon'))), array('heading' => __('Number of Columns', 'detheme_builder'), 'param_name' => 'column', 'description' => __('Number of columns on screen larger than 1200px screen resolution', 'detheme_builder'), 'class' => '', 'value' => array('1' => __('One Column', 'detheme_builder'), '2' => __('Two Columns', 'detheme_builder'), '3' => __('Three Columns', 'detheme_builder'), '4' => __('Four Columns', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Desktop Column', 'detheme_builder'), 'param_name' => 'desktop_column', 'description' => __('items between 1200px and 1023px', 'detheme_builder'), 'class' => '', 'value' => array('1' => __('One Column', 'detheme_builder'), '2' => __('Two Columns', 'detheme_builder'), '3' => __('Three Columns', 'detheme_builder'), '4' => __('Four Columns', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Desktop Small Column', 'detheme_builder'), 'param_name' => 'small_column', 'description' => __('items between 1024px and 768px', 'detheme_builder'), 'class' => '', 'value' => array('1' => __('One Column', 'detheme_builder'), '2' => __('Two Columns', 'detheme_builder'), '3' => __('Three Columns', 'detheme_builder'), '4' => __('Four Columns', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Tablet Column', 'detheme_builder'), 'param_name' => 'tablet_column', 'description' => __('items between 768px and 600px', 'detheme_builder'), 'class' => '', 'value' => array('1' => __('One Column', 'detheme_builder'), '2' => __('Two Columns', 'detheme_builder'), '3' => __('Three Columns', 'detheme_builder'), '4' => __('Four Columns', 'detheme_builder')), 'type' => 'dropdown'), array('heading' => __('Mobile Column', 'detheme_builder'), 'param_name' => 'mobile_column', 'description' => __('items below 600px', 'detheme_builder'), 'class' => '', 'value' => array('1' => __('One Column', 'detheme_builder'), '2' => __('Two Columns', 'detheme_builder'), '3' => __('Three Columns', 'detheme_builder'), '4' => __('Four Columns', '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'))))));
if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "dt_tab_wrapper" . getCssID() . time() . rand(11, 99); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<ul id="vstabid_' . $dt_vsliderid . '" class="nav nav-tabs vertical-nav-tab tab-' . $nav_position . '" ' . $leftspy . '>' . @implode("\n", $cn_list) . ' </ul>' . "\n" . '<div class="tab-content vertical-tab-content tab-' . $nav_position . '" ' . $rightspy . '> ' . @implode("\n", $cn_preview) . '</div>' . "\n"; $compile .= '</div>'; $compile .= '<script type="text/javascript"> jQuery(document).ready(function($){ $(\'#vstabid_' . $dt_vsliderid . '\').tabCollapse(); }); </script>'; return $compile; } } add_dt_element('dt_verticaltab', array('title' => __('Vertical Tab', 'detheme_builder'), 'as_parent' => 'dt_verticaltab_item', 'icon' => 'dashicons-image-flip-vertical', 'options' => array(array('heading' => __('Module Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => __('Vertical Tab', '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' => __('Navigation Position', 'detheme_builder'), 'param_name' => 'nav_position', 'class' => '', 'value' => array('left' => __('Left', 'detheme_builder'), 'right' => __('Right', 'detheme_builder')), 'description' => __('Navigation position', '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')))))); add_dt_element('dt_verticaltab_item', array('title' => __('Tab Item', 'detheme_builder'), 'as_child' => 'dt_verticaltab', 'options' => array(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'), array('heading' => __('Main Title', 'detheme_builder'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'type' => 'textfield'), array('heading' => __('Sub Title', 'detheme_builder'), 'param_name' => 'sub_title', 'admin_label' => true, 'value' => '', 'type' => 'textarea'), array('heading' => __('Content', 'detheme_builder'), 'param_name' => 'content', 'class' => '', 'value' => '', 'type' => 'textarea_html'))));