function render($atts, $content = null, $base = "") { wp_register_script('jquery.appear', get_dt_plugin_dir_url() . "js/jquery.appear.js", array()); wp_register_script('jquery.counto', get_dt_plugin_dir_url() . "js/jquery.counto.js", array()); wp_register_script('dt-chart', get_dt_plugin_dir_url() . "js/chart.js", array('jquery.appear', 'jquery.counto')); wp_enqueue_script('dt-chart'); extract(shortcode_atts(array('title' => '', 'el_id' => '', 'el_class' => ''), $atts)); global $DEstyle; if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('icon_type' => '', 'width' => '', 'title' => '', 'unit' => '', 'color' => '#1abc9c', 'bg' => '#ecf0f1', 'label' => '', 'icon_color' => '', 'iconbg' => '', 'value' => '10'), $atts, 'dt_progressbar_item')); $progress_bar = '<div class=\'progress_bar\'> <i class="' . $icon_type . '"></i> <div class="progress_info"> <h4 class=\'progress_title\'>' . $title . '</h4> <span class=\'progress_number\'><span>' . $value . '</span></span><span class="progres-unit">' . $unit . '</span> </div><div class=\'progress_content_outer\'> <div data-percentage=\'' . $value . '\' data-active="' . $color . '" data-nonactive="' . $bg . '" class=\'progress_content\'></div> </div></div>'; $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; }
function render($atts, $content = null, $base = "") { global $dt_el_id; wp_enqueue_script('dt-chart'); if (!isset($compile)) { $compile = ''; } if (!isset($dt_el_id)) { $dt_el_id = 0; } $dt_el_id++; extract(shortcode_atts(array('twitteraccount' => 'detheme_builder', 'numberoftweets' => 4, 'dateformat' => '%b. %d, %Y', 'twittertemplate' => '{{date}}<br />{{tweet}}', 'isautoplay' => 1, 'el_id' => '', 'el_class' => '', 'transitionthreshold' => 500), $atts, 'dt_twitter_slider')); $twittertemplate = preg_replace('/\\n/', '', trim($twittertemplate)); if (!is_admin()) { wp_enqueue_script('tweetie', get_dt_plugin_dir_url() . 'lib/twitter_slider/tweetie.js', array('jquery'), '1.0', false); wp_enqueue_style('owl.carousel'); wp_enqueue_script('owl.carousel'); } $compile .= '<div id="dt_twitter_' . $dt_el_id . '" class="dt-twitter-slider"></div>'; $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; }
function render($atts, $content = null, $base = "") { wp_register_script('jquery.appear', get_dt_plugin_dir_url() . "js/jquery.appear.js", array()); wp_register_script('jquery.counto', get_dt_plugin_dir_url() . "js/jquery.counto.js", array()); wp_register_script('dt-chart', get_dt_plugin_dir_url() . "js/chart.js", array('jquery.appear', 'jquery.counto')); wp_enqueue_script('dt-chart'); if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('unit' => '', 'title' => '', 'item_number' => '1', 'value' => '10', 'size' => '', 'color' => '#19bd9b', 'bg' => '', 'el_id' => '', 'el_class' => '', 'label_color' => '', 'unit_color' => ''), $atts, 'dt_circlebar_item')); global $DEstyle; $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; }
function render($atts, $content = null, $base = '') { 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', '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 = $after_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; 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') { $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; }
function render($atts, $content = null, $base = "") { global $DEstyle; extract(shortcode_atts(array('year' => '', 'month' => '', 'date' => '', 'time' => date('H:s', current_time('timestamp', 0)), 'url' => '', 'countdown_box_color' => '', 'countdown_text_color' => '', 'countdown_label_color' => '', 'dot_color' => '', 'el_id' => '', 'countdown_box_size' => '', 'el_class' => ''), $atts, 'dt_countdown')); if (!stripos($time, ":")) { $time .= ":00"; } $message = str_replace(array("\n", "\t"), array("", ""), do_shortcode($content)); $current_offset = get_option('gmt_offset'); $dateTo = "{$month} {$date} {$year} {$time}"; $timeCurrent = !empty($current_offset) ? time() + $current_offset * 3600 : time(); $timeTo = strtotime($dateTo); $css_class = array('dt-countdown'); if ('' != $el_class) { array_push($css_class, $el_class); } if ($countdown_box_size == 'small' || $countdown_box_size == 'medium') { array_push($css_class, 'dt-countdown-' . $countdown_box_size); } if ('' == $el_id) { $el_id = "dt_ct" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = ""; if ($timeCurrent > $timeTo) { if (!empty($url)) { $compile .= '<meta http-equiv="refresh" content="5;URL=' . $url . '" />'; } $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div id="countdown_' . $el_id . '" class="countdown">' . esc_js($message) . '</div></div>'; } else { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; wp_register_style('jquery.countdown', get_dt_plugin_dir_url() . "css/jquery.countdown.css", array(), false); 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; }
function render($atts, $content = null, $base = "") { extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'value' => '', 'footer_text' => '', 'layout' => '', 'button' => 'button1', 'button_text' => __('Submit', 'detheme_builder'), 'button_text_color' => '', 'button_color' => '', 'font_size' => '', 'vertical_padding' => '', 'horizontal_padding' => '', 'button_radius' => '', 'email_label' => __('Email Label', 'detheme_builder'), 'name_label' => __('Your name', 'detheme_builder'), 'button_font' => '', 'expanded' => 0, 'button_align' => 'left', 'label_align' => 'left', 'input_radius' => '', 'input_vertical_padding' => '', 'input_horizontal_padding' => '', 'element_margin' => '', 'gradient' => false, 'gradient_color_to' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_optin_form')); wp_register_script('optin', get_dt_plugin_dir_url() . 'js/optin_form.js', array('jquery'), '', false); wp_enqueue_script('optin'); global $DEstyle; $code = ""; $compile = ""; $excss = getCssID("optin_form_"); $buttoncss = $buttonHovercss = $inputcss = array(); if (!empty($button_text_color)) { $buttoncss[] = "color:" . $button_text_color; } if (!empty($button_color)) { if ($gradient && !empty($gradient_color_to)) { $buttoncss[] = "background:-webkit-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:-moz-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:-ms-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:-o-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; } else { $buttoncss[] = "background-color:" . $button_color; } $buttonHovercss[] = "background-color:" . darken($button_color, 5); } if (!empty($font_size)) { $buttoncss[] = "font-size:" . $font_size . "px"; } if (!empty($horizontal_padding)) { $buttoncss[] = "padding-left:" . $horizontal_padding . "px"; $buttoncss[] = "padding-right:" . $horizontal_padding . "px"; } if (!empty($vertical_padding)) { $buttoncss[] = "height:" . $vertical_padding . "px"; $inputcss[] = "height:" . $vertical_padding . "px"; } if ($expanded) { $buttoncss[] = "width:100%"; } if (!empty($button_radius)) { $buttoncss[] = "border-radius:" . $button_radius . "px"; } if (!empty($button_font)) { $font = 'http://fonts.googleapis.com/css?family=Droid+Sans%7COpen+Sans%7CTangerine%7CJosefin+Slab%7CArvo%7CLato%7CVollkorn%7CAbril+Fatface%7CUbuntu%7CPT+Sans%7CPT+Serif%7COld+Standard+TT'; wp_enqueue_style('google-font', $font); $buttoncss[] = "font-family:" . $button_font; } if (!empty($element_margin)) { $element_margin = preg_match('/horizontal/', $layout) ? "padding-right:" . $element_margin . "px !important" : "margin-bottom:" . $element_margin . "px !important"; } if (!empty($input_horizontal_padding)) { $inputcss[] = "padding-left:" . $input_horizontal_padding . "px"; $inputcss[] = "padding-right:" . $input_horizontal_padding . "px"; } if (!empty($label_align)) { $inputcss[] = "text-align:" . $label_align; } if (!empty($input_radius)) { $inputcss[] = "border-radius:" . $input_radius . "px"; } $formcode = '<form role="form" class="' . $layout . (preg_match('/horizontal/', $layout) ? " form-inline" : "") . '" id="dt_optin_form_' . $excss . '">'; $formcode .= $layout == 'vertical_email' || $layout == 'horizontal_email' ? "" : "<div class=\"form-group field-wrap\">"; $formcode .= '<input type="' . ($layout == 'vertical_email' || $layout == 'horizontal_email' ? "hidden" : "text") . '" class="dt_name form-control" name="dt_name" placeholder="' . $name_label . '" />'; $formcode .= $layout == 'vertical_email' || $layout == 'horizontal_email' ? "" : "</div>"; $formcode .= '<div class="form-group field-wrap"><input type="text" class="dt_email form-control" name="dt_email" placeholder="' . $email_label . '" /></div>'; $formcode .= '<div class="form-group button-wrap" style="text-align:' . $button_align . '"><button class="form_connector_submit" type="submit" value="' . $button_text . '" >' . $button_text . '</button></div>'; $formcode .= '</form>'; if (count($inputcss)) { $DEstyle[] = "." . $excss . " input,." . $excss . " input.dt_name,." . $excss . " input.dt_email{" . @implode(";", $inputcss) . "}"; } if (count($buttonHovercss)) { $DEstyle[] = "." . $excss . " .form_connector_submit:hover{" . @implode(";", $buttonHovercss) . "}"; } if (!empty($element_margin)) { $DEstyle[] = "." . $excss . " .field-wrap{" . $element_margin . "}"; } $DEstyle[] = "." . $excss . " .form_connector_submit{" . @implode(";", $buttoncss) . "}"; $css_class = array('optin-form', $excss, $button); $css_style = getCssMargin($atts); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id && "" != $css_style) { $el_id = "optin_wrapper" . getCssID() . time() . rand(11, 99); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $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; }
function render($atts, $content = null, $base = "") { global $DEstyle; wp_register_script('jquery.appear', get_dt_plugin_dir_url() . "js/jquery.appear.js", array()); wp_register_script('jquery.counto', get_dt_plugin_dir_url() . "js/jquery.counto.js", array()); wp_register_script('dt-iconbox', get_dt_plugin_dir_url() . "js/dt_iconbox.js", array('jquery.appear', 'jquery.counto')); wp_enqueue_script('dt-iconbox'); if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('el_class' => '', 'el_id' => '', 'iconbox_heading' => '', 'color_heading' => '', 'button_link' => '', 'button_text' => '', 'icon_type' => '', 'layout_type' => '1', 'target' => '_blank', 'iconbox_text' => '', 'link' => '', 'iconbox_number' => 100, 'spy' => 'none', 'icon_size' => '', 'icon_color' => '', 'iconbg' => '', 'scroll_delay' => 300), $atts, 'dt_iconbox')); $content = empty($content) && !empty($iconbox_text) ? $iconbox_text : $content; $iconbox_number = (int) $iconbox_number; $color_heading = !empty($color_heading) ? " style=\"color:" . $color_heading . "\"" : ""; $scollspy = ""; if ('' == $el_id) { $el_id = "module_dt_iconboxes_" . getCssID(); } $css_class = array('module_dt_iconboxes'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}"'; } switch ($layout_type) { case '2': $output = '<div class="dt-iconboxes-2 layout-' . $layout_type . '" ' . $scollspy . '> <div class="dt-section-icon hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5a">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="hi-icon ' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</div> <h4' . $color_heading . '>' . $iconbox_heading . '</h4>' . '<div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div> </div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-2 i {color:" . $icon_color . ";}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-2:hover i {background-color:" . $iconbg . "!important;color: #ffffff;}"; } break; case '3': $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> <span class="boxes">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</span> <h3 class="dt-counter">' . $iconbox_number . '</h3> <h4' . $color_heading . '>' . $iconbox_heading . '</h4><div class="dt-iconboxes-text"> ' . (!empty($content) ? do_shortcode($content) : "") . '</div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes,#{$el_id} .dt-iconboxes h3 {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes.layout-3 span:hover {background-color:" . $iconbg . "!important;color:#fff!important;}"; $DEstyle[] = "#{$el_id} .dt-iconboxes.layout-3 span:hover:after,#{$el_id} .dt-iconboxes.layout-3 span:hover:before{border-top-color:" . $iconbg . "!important;}"; } break; case '4': $output = '<div ' . $scollspy . '><div class="dt-iconboxes-4 layout-' . $layout_type . '"> <div class="dt-section-icon hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5d">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="hi-icon ' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</div> <h4' . $color_heading . '>' . $iconbox_heading . '</h4>' . '<div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div>' . ' </div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-4 i {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-4,#{$el_id} .dt-iconboxes-4:hover .dt-section-icon {background-color:" . $iconbg . "!important;}"; $DEstyle[] = "#{$el_id} .dt-iconboxes-4:hover {background-color: " . darken($iconbg, 20) . "!important;}"; $DEstyle[] = "#{$el_id} .dt-iconboxes-4:hover .dt-section-icon:after,#{$el_id} .dt-iconboxes-4:hover .dt-section-icon:before {border-top-color: " . $iconbg . "!important;}"; } break; case '5': $output = '<div class="dt-iconboxes-5 layout-' . $layout_type . '" ' . $scollspy . '> <div class="dt-section-icon hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5a">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="hi-icon ' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</div> <h4' . $color_heading . '>' . $iconbox_heading . '</h4>' . '<div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div>' . ' </div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-5 .dt-section-icon {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = ".no-touch #{$el_id} .dt-iconboxes-5:hover .hi-icon-effect-5 .hi-icon {background-color:" . $iconbg . "!important;border-color:" . $iconbg . "!important;}"; } break; case '6': $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> ' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . ' <h4' . $color_heading . '>' . $iconbox_heading . '</h4><div class="dt-iconboxes-text"> ' . (!empty($content) ? do_shortcode($content) : "") . '</div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes i {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes.layout-6:hover {background-color:" . $iconbg . "!important;}"; } break; case '7': case '8': $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> ' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . ' <div class="text-box"><h4' . $color_heading . '>' . $iconbox_heading . '</h4> ' . (!empty($content) ? do_shortcode($content) : "") . '</div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes i {color:" . $icon_color . "!important;}"; } break; default: $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> <span class="boxes">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</span> <h4' . $color_heading . '>' . $iconbox_heading . '</h4><div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div> </div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes {color:" . $icon_color . ";}"; $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes:hover {color:#ffffff;}"; } if ($iconbg != '') { $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; }
function render_page_metabox($post) { wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-ui-draggable'); wp_enqueue_script('jquery-ui-droppable'); wp_enqueue_style('wp-color-picker'); wp_enqueue_script('iris'); wp_enqueue_script('wp-color-picker'); wp_enqueue_script('page-editor', get_dt_plugin_dir_url() . 'lib/js/editor.min.js', array('jquery', 'media-views', 'media-editor')); wp_enqueue_script('page-editor-custom', get_dt_plugin_dir_url() . 'lib/js/backend.js', array('page-editor')); wp_enqueue_script('icon_picker', get_dt_plugin_dir_url() . 'lib/js/icon_picker.js', array('jquery')); wp_localize_script('icon_picker', 'picker_i18nLocale', array('search_icon' => __('Search Icon', 'detheme_builder'))); wp_enqueue_style('icon_picker-font', get_dt_plugin_dir_url() . "lib/css/fontello.css"); wp_enqueue_style('page-editor', get_dt_plugin_dir_url() . 'lib/css/editor.css', ''); wp_enqueue_style('flaticon-font', get_dt_plugin_dir_url() . 'lib/css/flaticon.css', ''); do_action('webfonts-font-loaded'); wp_localize_script('page-editor', 'dtb_i18nLocale', array('move_this_element' => __('Move this element', 'detheme_builder'), 'edit_title_panel' => __('Edit', 'detheme_builder'), 'close' => __('Close', 'detheme_builder'), 'save' => __('Save', 'detheme_builder'), 'cancel' => __('Cancel', 'detheme_builder'), 'select_image' => __('Select Image', 'detheme_builder'), 'insert_image' => __('Insert Image', 'detheme_builder'), 'custom_css_title' => __('Custom CSS', 'detheme_builder'), 'show_shortcode_title' => __('Element Shortcode', 'detheme_builder'), 'add_shortcode_title' => __('Add Shortcode', 'detheme_builder'), 'are_you_sure_delete_confirmation' => __('Are you sure delete this element', 'detheme_builder'), 'custom_column_placeholder' => __('4 4 4 Total=12', 'detheme_builder'), 'insert_video' => __('Insert Video', 'detheme_builder'), 'select_video' => __('Select Video', 'detheme_builder'), 'click_to_toggle' => __('Click to toggle row', 'detheme_builder'), 'row' => __('Row', 'detheme_builder'), 'classic_editor' => __('Classic Editor', 'detheme_builder'))); $elements = get_dt_elements(); $elements = apply_filters('allowed_element_in_post', $elements); $custom_css = get_post_meta($post->ID, '_dtbuilder_custom_css', true); wp_nonce_field('dtbuilder_save_custom_css', 'dtbuilder_save_custom_css'); ?> <div id="dtduilder_wrap" style="display:none"> <textarea id="dtbuilder_custom_css_field" style="display:none" name="dtbuilder_custom_css"><?php print htmlspecialchars($custom_css); ?> </textarea> <div class="element-builders"> <div class="element-builder element-row" data-tag="dt_row" data-column="12"> <div class="element-holder dragger"><i class="dashicons dashicons-editor-justify"></i><?php _e('Row', 'detheme_builder'); ?> </div> <div class="element-toolbar"> <div class="toolbar-panel-left"> <div class="element-holder"><i title="<?php _e('Move this row', 'detheme_builder'); ?> " class="flaticon-pointer2"></i></div> <div class="toolbar row-selection"> <div class="select-column"> <div title="<?php _e('Change column', 'detheme_builder'); ?> " class="dashicons dashicons-menu"></div> </div> <ul class="option-column-group"> <li class="option-column"><a href="#" class="column_1" data-column="12"><span></span></a></li> <li class="option-column"><a href="#" class="column_2" data-column="6 6"><span></span><span></span></a></li> <li class="option-column"><a href="#" class="column_3" data-column="4 4 4"><span></span><span></span><span></span></a></li> <li class="option-column"><a href="#" class="column_4" data-column="3 3 3 3"><span></span><span></span><span></span><span></span></a></li> <li class="option-column"><a href="#" class="column_6" data-column="2 2 2 2 2 2"><span></span><span></span><span></span><span></span><span></span><span></span></a></li> <li class="option-column"><a href="#" class="column_custom"><?php _e('Custom', 'detheme_builder'); ?> </a></li> </ul> </div> <div class="toolbar element-shortcode"><a title="<?php _e('Show this shortcode', 'detheme_builder'); ?> " href="#"></></a></div> <div class="toolbar element-setting" data-title="<?php _e('Row', 'detheme_builder'); ?> "><a title="<?php _e('Edit this row', 'detheme_builder'); ?> " href="#"> <div class="dashicons dashicons-admin-generic"></div></a> </div> </div> <ul class="toolbar-panel-right"> <li class="toolbar element-copy"><a title="<?php _e('Copy this row', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-admin-page"></div></a></li> <li class="toolbar element-delete"><a title="<?php _e('Delete this row', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-no-alt"></div></a></li> <li class="toolbar element-up"><a title="<?php _e('Move up this row', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-arrow-up-alt"></div></a></li> <li class="toolbar element-down"><a title="<?php _e('Move down this row', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-arrow-down-alt"></div></a></li> </ul> </div> <div class="open-tag render-tag">[dt_row]</div> <div class="column-container"> <div class="element-builder element-column col-12" data-column="12" data-tag="dt_column"> <div class="toolbar element-setting" data-title="<?php _e('Column', 'detheme_builder'); ?> "><a title="<?php _e('Edit this column', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-admin-generic"></div></a></div> <div class="toolbar element-addshortcode"><a title="<?php _e('Add shortcode to this column', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-welcome-edit-page"></div></a></div> <div class="open-tag render-tag">[dt_column]</div> <div class="element-content dropable-element"></div> <div class="close-tag render-tag">[/dt_column]</div> </div> </div> <div class="close-tag render-tag">[/dt_row]</div> </div> <?php if (count($elements)) { foreach ($elements as $tag => $element) { if (in_array($tag, array('dt_row', 'dt_column', 'dt_inner_row', 'dt_inner_column', 'dt_inner_row_1', 'dt_inner_column_1', 'dt_inner_row_2', 'dt_inner_column_2'))) { continue; } $settings = $element->getSettings(); if ($settings['is_container']) { ?> <div class="element-builder element-container element-<?php print $tag; ?> " data-tag="<?php print $tag; ?> "> <div class="element-holder dragger"><i class="dashicons <?php print $settings['icon'] != '' ? $settings['icon'] : 'dashicons-media-default'; ?> "></i><?php print $settings['title']; ?> </div> <div class="element-panel"> <div class="element-toolbar"> <div class="element-holder-label"><?php print $settings['title']; ?> </div> <div class="toolbar element-setting" data-title="<?php print $settings['title']; ?> "><a title="<?php _e('Edit this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-edit"></div></a></div> <div class="toolbar element-shortcode"><a title="<?php _e('Show this shortcode', 'detheme_builder'); ?> " href="#"></></a></div> <div class="toolbar element-copy"><a title="<?php _e('Copy this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-admin-page"></div></a></div> <div class="toolbar element-delete"><a title="<?php _e('Delete this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-no-alt"></div></a></div> </div> </div> <div class="open-tag render-tag">[<?php print $tag; ?> ]</div> <div class="element-content dropable-element"></div> <div class="close-tag render-tag">[/<?php print $tag; ?> ]</div> </div> <?php } elseif ($settings['as_parent'] && '' != $settings['as_parent']) { ?> <div class="element-builder element-parent element-<?php print $tag; ?> " data-child="<?php print is_array($settings['as_parent']) ? @implode(",", $settings['as_parent']) : $settings['as_parent']; ?> " data-tag="<?php print $tag; ?> "> <div class="element-holder dragger"><i class="dashicons <?php print $settings['icon'] != '' ? $settings['icon'] : 'dashicons-media-default'; ?> "></i><?php print $settings['title']; ?> </div> <div class="element-panel"> <div class="element-holder-label"><?php print $settings['title']; ?> </div> <div class="children-toolbar"> <?php if (is_array($settings['as_parent'])) { foreach ($settings['as_parent'] as $child) { if (isset($elements[$child])) { $childElement = $elements[$child]; $childSettings = $childElement->getSettings(); print '<div class="toolbar"><a title="' . sprintf(__('Add %s', 'detheme_builder'), $childSettings['title']) . '" href="#" data-child="' . $child . '"><div class="dashicons dashicons-plus-alt"></div> ' . $childSettings['title'] . '</a></div>'; } } ?> <?php } else { if (isset($elements[$settings['as_parent']])) { $childElement = $elements[$settings['as_parent']]; $childSettings = $childElement->getSettings(); print '<div class="toolbar"><a title="' . sprintf(__('Add %s', 'detheme_builder'), $childSettings['title']) . '" href="#" data-child="' . $settings['as_parent'] . '"><div class="dashicons dashicons-plus-alt"></div> ' . $childSettings['title'] . '</a></div>'; } ?> <?php } ?> </div> <div class="element-toolbar"> <div class="toolbar element-setting" data-title="<?php print $settings['title']; ?> "><a title="<?php _e('Edit this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-edit"></div></a></div> <div class="toolbar element-shortcode"><a title="<?php _e('Show this shortcode', 'detheme_builder'); ?> " href="#"></></a></div> <div class="toolbar element-copy"><a title="<?php _e('Copy this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-admin-page"></div></a></div> <div class="toolbar element-delete"><a title="<?php _e('Delete this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-no-alt"></div></a></div> </div> </div> <div class="open-tag render-tag">[<?php print $tag; ?> ]</div> <div class="element-content dropable-element"></div> <div class="close-tag render-tag">[/<?php print $tag; ?> ]</div> </div> <?php } elseif ($settings['as_child'] && '' != $settings['as_child']) { ?> <div style="display:none" class="element-builder element-child element-<?php print $tag; ?> " data-parent="<?php print $settings['as_child']; ?> " data-tag="<?php print $tag; ?> "> <div class="element-holder"><i title="<?php _e('Move this element', 'detheme_builder'); ?> " class="flaticon-pointer2"></i></div> <div class="element-toolbar element-panel"> <div class="element-holder-label"><?php print $settings['title']; ?> </div> <div class="toolbar element-setting" data-title="<?php print $settings['title']; ?> "><a title="<?php _e('Edit this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-edit"></div></a></div> <div class="toolbar element-copy"><a title="<?php _e('Copy this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-admin-page"></div></a></div> <div class="toolbar element-delete"><a title="<?php _e('Delete this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-no-alt"></div></a></div> </div> <div class="open-tag render-tag">[<?php print $tag; ?> ]</div> <textarea class="content-tag render-tag"></textarea> <div class="close-tag render-tag">[/<?php print $tag; ?> ]</div> </div> <?php } else { ?> <div class="element-builder element-frebase element-<?php print $tag; ?> " data-tag="<?php print $tag; ?> "> <div class="element-holder dragger"><i class="dashicons <?php print $settings['icon'] != '' ? $settings['icon'] : 'dashicons-media-default'; ?> "></i><?php print $settings['title']; ?> </div> <div class="element-panel"> <div class="element-holder-label"><?php print $settings['title']; ?> </div> <div class="element-toolbar"> <div class="toolbar element-setting" data-title="<?php print $settings['title']; ?> "><a title="<?php _e('Edit this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-edit"></div></a></div> <div class="toolbar element-shortcode"><a title="<?php _e('Show this shortcode', 'detheme_builder'); ?> " href="#"></></a></div> <div class="toolbar element-copy"><a title="<?php _e('Copy this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-admin-page"></div></a></div> <div class="toolbar element-delete"><a title="<?php _e('Delete this element', 'detheme_builder'); ?> " href="#"><div class="dashicons dashicons-no-alt"></div></a></div> </div> </div> <div class="element-preview"><?php print $element->preview_admin(); ?> </div> <div class="open-tag render-tag">[<?php print $tag; ?> ]</div> <textarea class="content-tag render-tag"></textarea> <div class="close-tag render-tag">[/<?php print $tag; ?> ]</div> </div> <?php } } ?> <?php } ?> </div> <?php $content = $post->post_content; foreach ($elements as $tag => $element) { $regexshortcodes = $element->getRegex(); $content = preg_replace_callback('/' . $regexshortcodes . '/s', array($element, 'do_shortcode_tag'), $content); } if ($content == $post->post_content) { $content = '[dt_row][dt_column column="12"]' . ($content != '' ? '[dt_text_html]' . $content . '[/dt_text_html]' : '') . '[/dt_column][/dt_row]'; foreach ($elements as $tag => $element) { $regexshortcodes = $element->getRegex(); $content = preg_replace_callback('/' . $regexshortcodes . '/s', array($element, 'do_shortcode_tag'), $content); } } ?> <div class="dt-editor-container"> <a id="dtbuilder_custom_css_edit" class="btn" href="#"></>CSS</a> <div class="dt-editor-work"> <?php print $content; ?> </div> </div> </div> <?php }
$compile = "<div "; 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'))));
function render($atts, $content = null, $base = '') { extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'spy' => '', 'scroll_delay' => 300, 'perpage' => '-1', 'layout' => '', 'columns' => '', 'desktop_column' => '', 'mobile_column' => '', 'medium_column' => '', 'small_column' => '', 'gutter' => 0, 'cat' => '', 'orderby' => '', 'order' => ''), $atts, 'dt_post')); global $DEstyle; $css_class = array('dt_post'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "dt_post" . getCssID(); } $query_args = array('posts_per_page' => $perpage, 'post_type' => 'post', 'no_found_rows' => false, 'post_status' => 'publish', 'ignore_sticky_posts' => true); if ($orderby != '') { $query_args['orderby'] = in_array(strtolower($orderby), array('date', 'title', 'id', 'modified', 'author', 'comment_count', 'rand')) ? strtolower($orderby) : 'date'; } if (strtolower($order) != '' && in_array(strtolower($order), array('asc', 'desc'))) { $query_args['order'] = strtoupper($order); } if ($cat != '') { $query_args['cat'] = $cat; } wp_enqueue_script('isotope.pkgd', untrailingslashit(get_dt_plugin_dir_url()) . '/js/isotope.pkgd.min.js', array(), '2.0.0', false); wp_enqueue_script('detheme-post-grid', untrailingslashit(get_dt_plugin_dir_url()) . '/js/post_grid.js', array(), '2.0.0', false); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\" data-isotope=\"" . $layout . "\"" . " data-gutter=\"" . intval($gutter) . "\"" . " data-column=\"" . intval($columns) . "\"" . " data-column-lg=\"" . intval($desktop_column) . "\"" . " data-column-md=\"" . intval($medium_column) . "\"" . " data-column-sm=\"" . intval($small_column) . "\"" . " data-column-xs=\"" . intval($mobile_column) . "\"" . "><div class=\"grid-container\">"; $spydly = 0; $query = new WP_Query($query_args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $post = $query->post; $post->post_format = get_post_format(); $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $spydly = $spydly + (int) $scroll_delay; $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } 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; }
function load_front_css_style() { wp_register_style('webfonts-font', get_dt_plugin_dir_url() . "webicons/webfonts.css"); wp_register_style('detheme-builder', get_dt_plugin_dir_url() . "css/plugin_style.css", array('webfonts-font')); wp_enqueue_style('icon_picker-font', get_dt_plugin_dir_url() . "lib/css/fontello.css"); wp_register_style('scroll-spy', get_dt_plugin_dir_url() . "css/scroll_spy.css", array('scroll-spy-ie')); wp_register_style('scroll-spy-ie', get_dt_plugin_dir_url() . '/css/scroll_spy_ie9.css', array()); wp_register_style('owl.carousel', get_dt_plugin_dir_url() . "css/owl_carousel.css", array()); wp_style_add_data('scroll-spy-ie', 'conditional', 'IE 9'); wp_register_script('uilkit', get_dt_plugin_dir_url() . 'js/uilkit.js', array(), '1.0', true); wp_register_script('ScrollSpy', get_dt_plugin_dir_url() . "js/scrollspy.js", array('uilkit'), '1.0', true); wp_register_script('owl.carousel', get_dt_plugin_dir_url() . 'js/owl.carousel.js', array('jquery'), '1.3.3', false); wp_enqueue_style('detheme-builder'); wp_enqueue_style('scroll-spy'); wp_enqueue_script('ScrollSpy'); }
<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'))));
function render($atts, $content = null, $base = "") { extract(shortcode_atts(array('lat' => -7.2852292, 'lang' => 112.6809869, 'zoom' => 7, 'zoomcontrol' => true, 'pancontrol' => true, 'streetcontrol' => true, 'scrollcontrol' => true, 'height' => '400px', 'width' => '', 'style' => 'pastel', 'marker' => 'default', 'image_marker' => '', 'title' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_map')); $height = abs((int) $height) . "px"; $dt_el_id = getCssID(); wp_enqueue_script('gmap', "https://maps.googleapis.com/maps/api/js?v=3.exp", array('jquery')); $mapStyle = array('shades' => '[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]}]', 'midnight' => '[{"featureType":"water","stylers":[{"color":"#021019"}]},{"featureType":"landscape","stylers":[{"color":"#08304b"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#0c4152"},{"lightness":5}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#0b434f"},{"lightness":25}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#0b3d51"},{"lightness":16}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#000000"},{"lightness":13}]},{"featureType":"transit","stylers":[{"color":"#146474"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#144b53"},{"lightness":14},{"weight":1.4}]}]', 'bluewater' => '[{"featureType":"water","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"landscape","stylers":[{"color":"#f2f2f2"}]},{"featureType":"road","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]}]', 'lightmonochrome' => '[{"featureType":"water","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":-78},{"lightness":67},{"visibility":"simplified"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"simplified"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"hue":"#e9ebed"},{"saturation":-90},{"lightness":-8},{"visibility":"simplified"}]},{"featureType":"transit","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":10},{"lightness":69},{"visibility":"on"}]},{"featureType":"administrative.locality","elementType":"all","stylers":[{"hue":"#2c2e33"},{"saturation":7},{"lightness":19},{"visibility":"on"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":-2},{"visibility":"simplified"}]}]', 'neutralblue' => '[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]', 'avocadoworld' => '[{"featureType":"water","elementType":"geometry","stylers":[{"visibility":"on"},{"color":"#aee2e0"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#abce83"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#769E72"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#7B8758"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"color":"#EBF4A4"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"visibility":"simplified"},{"color":"#8dab68"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#5B5B3F"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#ABCE83"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#A4C67D"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#9BBF72"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#EBF4A4"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"visibility":"on"},{"color":"#87ae79"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#7f2200"},{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"},{"visibility":"on"},{"weight":4.1}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#495421"}]},{"featureType":"administrative.neighborhood","elementType":"labels","stylers":[{"visibility":"off"}]}]', 'nature' => '[{"featureType":"landscape","stylers":[{"hue":"#FFA800"},{"saturation":0},{"lightness":0},{"gamma":1}]},{"featureType":"road.highway","stylers":[{"hue":"#53FF00"},{"saturation":-73},{"lightness":40},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FBFF00"},{"saturation":0},{"lightness":0},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#00FFFD"},{"saturation":0},{"lightness":30},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#00BFFF"},{"saturation":6},{"lightness":8},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#679714"},{"saturation":33.4},{"lightness":-25.4},{"gamma":1}]}]', 'pastel' => '[{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":60}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"lightness":30}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ef8c25"},{"lightness":40}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#b6c54c"},{"lightness":40},{"saturation":-40}]},{}]'); $mapOptions = array(); $mapOptions['zoom'] = 'zoom: ' . $zoom; $markerOption = ""; if ($marker !== 'default') { $image_url = get_dt_plugin_dir_url() . 'images/map_marker.png'; if ($image_marker) { $imageMarker = wp_get_attachment_image_src(trim($image_marker), 'full', false); if (!empty($imageMarker[0])) { $image_url = $imageMarker[0]; } } $markerOption = 'var iconMarker = {url: \'' . $image_url . '\'};'; } if (!$zoomcontrol) { $mapOptions['zoomControl'] = 'zoomControl:false'; } if (!$pancontrol) { $mapOptions['panControl'] = 'panControl:false'; } if (!$streetcontrol) { $mapOptions['streetViewControl'] = 'streetViewControl:false'; } if (!$scrollcontrol) { $mapOptions['scrollwheel'] = 'scrollwheel:false'; } $mapscript = "<div id=\"map-canvas" . $dt_el_id . "\" class=\"google-map\" style=\"height:" . $height . (!empty($width) ? ";width:" . $width . "" : "") . "\"></div>"; $mapscript .= '<script type="text/javascript">'; $mapscript .= 'jQuery(document).ready(function($) { try { var map,center = new google.maps.LatLng(' . $lat . ',' . $lang . '),' . (isset($mapStyle[$style]) ? "style=" . $mapStyle[$style] . "," : "") . ' mapOptions = {center: center,mapTypeControl: false,' . @implode(',', $mapOptions) . (isset($mapStyle[$style]) ? ",styles:style" : "") . '}; ' . $markerOption . ' map = new google.maps.Map(document.getElementById(\'map-canvas' . $dt_el_id . '\'),mapOptions); var marker = new google.maps.Marker({ position: center, map: map, ' . (!empty($markerOption) ? "icon: iconMarker" : "") . ' }); } catch ($err) { } }); </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; }
function render($atts, $content = null, $base = '') { 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 ""; } wp_enqueue_script('bootstrap', get_dt_plugin_dir_url() . 'js/bootstrap.js', array('jquery'), '3.0', false); wp_register_script('bootstrap-tabcollapse', get_dt_plugin_dir_url() . 'js/bootstrap-tabcollapse.js', array(), '1.0', false); wp_enqueue_script('bootstrap-tabcollapse'); wp_enqueue_style('bootstrap-tabs', get_dt_plugin_dir_url() . "css/bootstrap_vertical_tab.css", array()); extract(shortcode_atts(array('nav_position' => 'left', 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => ''), $atts, 'dt_verticaltab')); $leftspy = ""; $rightspy = ""; $spydly = $scroll_delay; 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(); $dt_vsliderid = getCssID(); $itemnumber = 0; foreach ($matches as $slideitem) { $slideitem[3] .= $itemnumber == 0 ? " active=\"1\"" : ""; $slideitem[3] .= " id=\"vstabid_" . $dt_vsliderid . '_' . $itemnumber . "\""; $cn_item = do_shortcode("[dt_verticaltab_item " . $slideitem[3] . "]" . $slideitem[5] . "[/dt_verticaltab_item]"); $cn_preview_item = '<div id="vstabid_' . $dt_vsliderid . '_' . $itemnumber . '" class="tab-pane fade' . ($itemnumber == 0 ? " in active" : "") . '">' . do_shortcode($slideitem[5]) . '</div>'; array_push($cn_list, $cn_item); array_push($cn_preview, $cn_preview_item); $itemnumber++; } $css_class = array('dt_vertical_tab'); 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; }