public static function box($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 'default', 'title' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_BOX_TITLE_DEFAULT'), 'title_color' => '#FFFFFF', 'box_color' => '#333333', 'color' => null, 'radius' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'box'); // Initioal Variables $id = uniqid('su_box_'); $radius = ''; $css = array(); // Color Manage if ($atts['color'] !== null) { $atts['box_color'] = $atts['color']; } // Radius Manage if ($atts['radius']) { $radius = $atts['radius'] != '0' ? 'border-radius:' . $atts['radius'] . 'px;' : ''; } // Get Css in $css variable $css[] = '#' . $id . '{' . $radius . 'border-color:' . $atts['box_color'] . ';} #' . $id . ' .su-box-title { background-color:' . $atts['box_color'] . ';color:' . $atts['title_color'] . ';}'; // Add CSS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'box.css', __FUNCTION__); // Output HTML $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-box su-box-style-' . $atts['style'] . su_ecssc($atts) . '"> <div class="su-box-title">' . su_scattr($atts['title']) . ' </div> <div class="su-box-content su-clearfix">' . has_child_shortcode($content, 'b') . '</div> </div>'; return $return; }
public static function modal($atts = null, $content = null) { $atts = su_shortcode_atts(array('effect' => 1, 'button_text' => 'Open Modal', 'button_class' => '', 'close_button' => '', 'title' => 'Modal Title', 'title_background' => 'rgba(0,0,0,0.1)', 'title_color' => '#222222', 'background' => '#ffffff', 'color' => '#666666', 'border' => 'none', 'shadow' => '0 solid #000000', 'width' => '', 'height' => '', 'overlay_background' => 'rgba(0,0,0,0.4)', 'scroll_reveal' => '', 'class' => ''), $atts, 'modal'); $id = uniqid('sum_'); $css = array(); $height = $atts['height'] ? 'height: ' . $atts['height'] . ';' : ''; $width = $atts['width'] ? 'width: ' . $atts['width'] . ';' : ''; $css[] = '#' . $id . ' .su-modal-content-wrapper { background: ' . $atts['background'] . '; color: ' . $atts['color'] . '; border: ' . $atts['border'] . '; box-shadow: ' . $atts['shadow'] . ';' . $height . $width . '}'; $css[] = '#' . $id . ' .su-modal-title-wrapper { background: ' . $atts['title_background'] . ';}'; $css[] = '#' . $id . ' .su-modal-title-wrapper h3 { color: ' . $atts['title_color'] . ';}'; $overlay_style = 'style=" background-color: ' . $atts['overlay_background'] . ';"'; $close_button = $atts['close_button'] === 'yes' ? '<a href="javascript:void(0);" class="su-modal-close"><i class="fa fa-remove"></i></a>' : ''; suAsset::addString('css', implode('', $css)); suAsset::addFile('css', 'modal.css', __FUNCTION__); suAsset::addFile('js', 'modal.js', __FUNCTION__); $return = '<a href="javascript:void(0);"' . su_scroll_reveal($atts) . ' class="su-modal-trigger ' . $atts['button_class'] . '" data-modal="' . $id . '">' . $atts['button_text'] . '</a>'; $return .= '<div class="su-modal-wrapper">'; $return .= '<div class="su-modal su-modal-effect-' . $atts['effect'] . '" id="' . $id . '"> <div class="su-modal-content-wrapper">'; $return .= '<div class="su-modal-title-wrapper">'; $return .= '<h3>' . $atts['title'] . '</h3>'; $return .= $close_button; $return .= '</div>'; $return .= '<div class="su-content">'; $return .= su_do_shortcode($content); $return .= '</div> </div> </div> <div class="su-modal-overlay" ' . $overlay_style . '></div>'; $return .= '</div>'; return $return; }
public static function progress_bar($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => '1', 'percent' => 75, 'show_percent' => 'yes', 'text' => '', 'bar_color' => '', 'fill_color' => '', 'text_color' => '', 'animation' => 'easeInOutExpo', 'duration' => 1.5, 'delay' => 0.3, 'scroll_reveal' => '', 'class' => ''), $atts, 'progress_bar'); $id = uniqid('suc'); $css = array(); $classes = array('su-progress-bar', 'su-progress-bar-style-' . $atts['style'], su_ecssc($atts)); if ($atts['bar_color']) { $css[] = '#' . $id . '.su-progress-bar { background-color:' . $atts['bar_color'] . '; border-color:' . su_color::darken($atts['bar_color'], '10%') . ';' . '}'; } if ($atts['fill_color'] or $atts['text_color']) { $fill_color = $atts['fill_color'] ? 'background-color:' . $atts['fill_color'] . ';' : ''; $text_color = $atts['text_color'] ? 'color:' . $atts['text_color'] . ';' : ''; $css[] = '#' . $id . '.su-progress-bar > span {' . $fill_color . $text_color . '}'; } $text = $atts['text'] ? '<span class="su-pb-text">' . $atts['text'] . '</span>' : ''; $show_percent = $atts['show_percent'] !== 'no' ? '<span class="su-pb-percent">' . $atts['percent'] . '%</span>' : ''; // Add CSS and JS in head suAsset::addFile('css', 'progress-bar.css', __FUNCTION__); suAsset::addFile('js', 'jquery.easing.js'); suAsset::addFile('js', 'jquery.appear.js'); suAsset::addFile('js', 'progress-bar.js', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"><span class="su-pb-fill" data-percent="' . $atts['percent'] . '" data-animation="' . $atts['animation'] . '" data-duration="' . $atts['duration'] . '" data-delay="' . $atts['delay'] . '">' . $text . $show_percent . '</span></div>'; return $return; }
public static function trailer_box($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 1, 'title' => 'Trailer Box Title', 'title_color' => '', 'title_font_weight' => 'bold', 'title_size' => '', 'image' => BDT_SU_URI . '/images/no-image.jpg', 'url' => '#', 'target' => 'self', 'color' => '', 'background' => '', 'opacity' => '1', 'hover_opacity' => '0.7', 'radius' => '', 'align' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'trailer_box'); $id = uniqid('sutb'); $css = array(); $css[] = $atts['color'] ? '#' . $id . ' .su-trailer-box-content { color: ' . $atts['color'] . ';}' : ''; $css[] = $atts['title_color'] ? '#' . $id . ' .su-trailer-box-title { color: ' . $atts['title_color'] . ';}' : ''; $border_radius = $atts['radius'] ? 'overflow: hidden; -webkit-border-radius:' . $atts['radius'] . '; border-radius:' . $atts['radius'] . ';' : ''; $background = $atts['background'] ? 'background:' . $atts['background'] . ';' : ''; if ($border_radius or $background) { $css[] = '#' . $id . ' {' . $border_radius . $background . '}'; } $css[] = $atts['title_size'] ? '#' . $id . ' .su-trailer-box-title {font-size: ' . $atts['title_size'] . ';line-height: ' . $atts['title_size'] . ';}' : ''; $css[] = $atts['align'] ? '#' . $id . ' .su-trailer-box-desc {text-align: ' . $atts['align'] . ';}' : ''; // Add CSS and JS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'trailer_box.css', __FUNCTION__); suAsset::addFile('js', 'trailer_box.js', __FUNCTION__); return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-trailer-box su-trailer-box-style' . $atts['style'] . su_ecssc($atts) . '" data-opacity="' . $atts['opacity'] . '" data-hover-opacity="' . $atts['hover_opacity'] . '"> <img class="su-trailer-box-img" src="' . image_media($atts['image']) . '" alt="' . $atts['title'] . '"> <div class="su-trailer-box-desc"> <h2 class="su-trailer-box-title">' . $atts['title'] . '</h2> <div class="su-trailer-box-content">' . su_do_shortcode($content) . '</div> </div> <a class="su-trailer-box-link" href="' . $atts['url'] . '" target="_' . $atts['target'] . '"></a> </div>'; }
public static function image_compare($atts = null, $content = null) { $atts = su_shortcode_atts(array('before_image' => '', 'after_image' => '', 'orientation' => '', 'before_text' => 'Original', 'after_text' => 'Modified', 'scroll_reveal' => '', 'class' => ''), $atts, 'image_compare'); // Unique Id $id = uniqid("suic"); if (image_media($atts['before_image']) && image_media($atts['after_image'])) { $orientation = $atts['orientation'] == 'vertical' ? ', orientation: "vertical"' : ''; $css[] = '#' . $id . ' .twentytwenty-before-label:before {content: "' . $atts['before_text'] . '"}'; $css[] = '#' . $id . ' .twentytwenty-after-label:before {content: "' . $atts['after_text'] . '"}'; // OUtput Structure in here $return = ' <div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="twentytwenty-container ' . su_ecssc($atts) . '"> <img src="' . image_media($atts['before_image']) . '" alt="' . $atts['before_text'] . '"> <img src="' . image_media($atts['after_image']) . '" alt="' . $atts['before_text'] . '"> </div>'; $js = ' jQuery(window).load(function(){ jQuery("#' . $id . '").twentytwenty({default_offset_pct: 0.7' . $orientation . '}); });'; suAsset::addString('css', implode("\n", $css)); // Css Adding in Head suAsset::addFile('css', 'image_compare.css', __FUNCTION__); // JavaScipt additon in Head suAsset::addFile('js', 'jquery.event.move.js', __FUNCTION__); suAsset::addFile('js', 'jquery.twentytwenty.js', __FUNCTION__); suAsset::addString('js', $js); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_IMAGE_COMPARE_INF'), 'warning'); } return $return; }
public static function livicon($atts = null, $content = null) { $atts = su_shortcode_atts(array('icon' => 'heart', 'size' => 32, 'color' => '#666666', 'original_color' => 'false', 'hover_color' => '#000000', 'background_color' => '#eeeeee', 'padding' => '15px', 'radius' => '3px', 'border' => 'none', 'margin' => '', 'event_type' => 'hover', 'animate' => 'yes', 'loop' => 'no', 'parent' => 'no', 'morph_duration' => 0.6, 'duration' => 0.6, 'iteration' => 1, 'url' => '', 'target' => 'self', 'scroll_reveal' => '', 'class' => ''), $atts, 'livicon'); $id = uniqid('sulic_'); $css[] = ''; $atts['animate'] = $atts['animate'] === 'yes' ? 'true' : 'false'; $atts['loop'] = $atts['loop'] === 'yes' ? 'true' : 'false'; $atts['parent'] = $atts['parent'] === 'yes' ? 'true' : 'false'; $atts['morph_duration'] = $atts['morph_duration'] * 1000; $atts['duration'] = $atts['duration'] * 1000; $margin = $atts['margin'] ? 'margin:' . $atts['margin'] . ';' : ''; $padding = $atts['padding'] ? 'padding:' . $atts['padding'] . ';' : ''; $background_color = $atts['background_color'] ? 'background-color:' . $atts['background_color'] . ';' : ''; $border = $atts['border'] ? 'border:' . $atts['border'] . ';' : ''; $radius = $atts['radius'] ? 'border-radius:' . $atts['radius'] . ';' : ''; if ($margin or $padding or $background_color or $radius or $border) { $css[] = '#' . $id . '.su-livicon { ' . $margin . $padding . $background_color . $border . $radius . '}'; } if ($atts['url']) { $return = '<a id="' . $id . '" ' . su_scroll_reveal($atts) . ' href="' . $atts['url'] . '" class="su-livicon ' . su_ecssc($atts) . '" target="_' . $atts['target'] . '"><span class="livicon" data-name="' . $atts['icon'] . '" data-size="' . intval($atts['size']) . '" data-color="' . $atts['color'] . '" data-hovercolor="' . $atts['hover_color'] . '" data-animate="' . $atts['animate'] . '" data-loop="' . $atts['loop'] . '" data-iteration="' . $atts['iteration'] . '" data-duration="' . $atts['duration'] . '" data-eventtype="' . $atts['event_type'] . '" data-onparent="' . $atts['parent'] . '"></span>' . su_do_shortcode($content) . '</a>'; } else { $return = '<span id="' . $id . '" ' . su_scroll_reveal($atts) . ' class="su-livicon' . su_ecssc($atts) . ' livicon" data-name="' . $atts['icon'] . '" data-size="' . intval($atts['size']) . '" data-color="' . $atts['color'] . '" data-hovercolor="' . $atts['hover_color'] . '" data-animate="' . $atts['animate'] . '" data-loop="' . $atts['loop'] . '" data-iteration="' . $atts['iteration'] . '" data-duration="' . $atts['duration'] . '" data-eventtype="' . $atts['event_type'] . '" data-onparent="' . $atts['parent'] . '"></span>' . su_do_shortcode($content); } // Asset added suAsset::addFile('css', 'livicon.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); suAsset::addFile('js', 'raphael.min.js', __FUNCTION__); suAsset::addFile('js', 'livicons.min.js', __FUNCTION__); return $return; }
public static function calltoaction($atts = null, $content = null) { $atts = su_shortcode_atts(array('title' => 'This is Call To Action Title', 'title_color' => '#ffffff', 'button_text' => 'Click Here', 'align' => 'default', 'button_link' => '#', 'target' => 'self', 'color' => '#ddd', 'background' => '#2D89EF', 'button_color' => '#fff', 'button_background' => '#165194', 'button_background_hover' => '', 'radius' => '3px', 'button_radius' => '3px', 'desc' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'calltoaction'); $id = uniqid('suca_'); $css = array(); $padding = ''; $title = $atts['title'] ? "<h3>" . $atts['title'] . "</h3>" : ''; $target = $atts['target'] === 'yes' || $atts['target'] === 'blank' ? ' target="_blank"' : 'target="_self"'; $bdt_hbg = $atts['button_background_hover'] ? $atts['button_background_hover'] : su_color::lighten($atts['button_background'], '5%'); if (intval($atts['radius']) > 40 && intval($atts['button_radius']) > 40) { $padding = "padding: 20px 20px 20px 40px;"; } $css[] = '#' . $id . ' {' . $padding . ' background-color:' . $atts['background'] . '; border-radius:' . $atts['radius'] . '; }'; $css[] = '#' . $id . ' a.cta-dbtn { border-radius:' . $atts['button_radius'] . '; color:' . $atts['button_color'] . '; background:' . $atts['button_background'] . ';}'; $css[] = '#' . $id . ' a.cta-dbtn:hover { background:' . $bdt_hbg . ';}'; $css[] = '#' . $id . ' .cta-content > h3 { color: ' . $atts['title_color'] . ';}'; $css[] = '#' . $id . ' .cta-content div { color:' . $atts['color'] . ';}'; suAsset::addFile('css', 'call-to-action.css', 'calltoaction'); suAsset::addString('css', implode("\n", $css)); $return = '<section id="' . $id . '"' . su_scroll_reveal($atts) . ' class="call-to-action' . su_ecssc($atts) . ' cta-align-' . $atts['align'] . '">'; $return .= "<a class='cta-dbtn hidden-phone' " . $target . " href='" . $atts['button_link'] . "'>" . $atts['button_text'] . "</a>"; $return .= "<div class='cta-content'>" . $title . "<div>" . su_do_shortcode($content) . '</div></div>'; $return .= "<a class='cta-dbtn visible-phone' " . $target . " href='" . $atts['button_link'] . "'>" . $atts['button_text'] . "</a>"; $return .= '<div class="clear"></div></section>'; return $return; }
public static function progress_pie($atts = null, $content = null) { $atts = su_shortcode_atts(array('percent' => 75, 'text' => '', 'before' => '', 'after' => '', 'size' => 200, 'line_width' => 10, 'text_size' => 22, 'align' => 'center', 'bar_color' => '#F14B51', 'fill_color' => '#f5f5f5', 'show_scale' => 'yes', 'scale_color' => '#dddddd', 'text_color' => '#bbbbbb', 'line_cap' => 'round', 'animation' => 'easeInOut', 'duration' => 1, 'delay' => 0.3, 'scroll_reveal' => '', 'class' => ''), $atts, 'progress_pie'); $id = uniqid('sud'); $css[] = ''; $classes = array('su-progress-pie', 'su-pp-align-' . $atts['align'], su_ecssc($atts)); $scale = $atts['show_scale'] === 'yes' ? $atts['scale_color'] : 'false'; if (!$atts['text']) { $atts['text'] = $atts['percent']; $classes[] = 'su-pp-percent'; } $css[] = '#' . $id . ' { width:' . intval($atts['size']) . 'px; height:' . intval($atts['size']) . 'px;' . '}'; $css[] = '#' . $id . ' .su-pp-tc { color:' . $atts['text_color'] . '; line-height:' . $atts['size'] . 'px; font-size:' . $atts['text_size'] . 'px }'; // Add CSS and JS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'progress-pie.css', __FUNCTION__); suAsset::addFile('js', 'jquery.easing.js'); suAsset::addFile('js', 'jquery.appear.js'); suAsset::addFile('js', 'easypiechart.js', __FUNCTION__); suAsset::addFile('js', 'progress-pie.js', __FUNCTION__); $return = '<div' . su_scroll_reveal($atts) . ' id="' . $id . '" class="' . su_acssc($classes) . '" data-percent="' . intval($atts['percent']) . '" data-size="' . intval($atts['size']) . '" data-line_width="' . intval($atts['line_width']) . '" data-line_cap="' . $atts['line_cap'] . '" data-bar_color="' . $atts['bar_color'] . '" data-fill_color="' . $atts['fill_color'] . '" data-scale_color="' . $scale . '" data-animation="' . $atts['animation'] . '" data-delay="' . $atts['delay'] . '" data-duration="' . floatval($atts['duration']) . '">'; $return .= '<div class="su-pp-tc">'; $return .= '<span class="su-pp-before">' . $atts['before'] . '</span>'; $return .= '<span class="su-pp-text">' . $atts['text'] . '</span>'; $return .= '<span class="su-pp-after">' . $atts['after'] . '</span>'; $return .= '</div>'; $return .= '</div>'; return $return; }
public static function divider($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 1, 'align' => 'center', 'icon' => '', 'icon_style' => '1', 'icon_color' => '#b5b5b5', 'icon_size' => '16', 'icon_align' => 'center', 'top' => 'no', 'color' => '#EEEEEE', 'width' => 100, 'margin_top' => 10, 'margin_bottom' => 10, 'margin_left' => '', 'margin_right' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'divider'); $id = uniqid('sud'); $classes = array('su-divider', 'su-divider-style-' . $atts['style'], 'su-icon-style-' . $atts['icon_style'], 'su-divider-align-' . $atts['align'], su_ecssc($atts)); $top_link_margin = ''; $margin = ''; $has_icon = ''; $icon = ''; $css = array(); if ($atts['icon']) { if (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-divider > span {font-size:' . $atts['icon_size'] . 'px;border-color:' . $atts['color'] . ';}'; $css[] = '#' . $id . '.su-divider i {color:' . $atts['icon_color'] . ';height:' . $atts['icon_size'] . 'px;width:' . $atts['icon_size'] . 'px;padding:' . round($atts['icon_size'] / 2) . 'px;}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-divider > span {font-size:' . $atts['icon_size'] . 'px;border-color:' . $atts['color'] . ';}'; $css[] = '#' . $id . '.su-divider i {color:' . $atts['icon_color'] . ';height:' . $atts['icon_size'] . 'px;width:' . $atts['icon_size'] . 'px;padding:' . round($atts['icon_size'] / 2) . 'px;}'; } elseif (strpos($atts['icon'], '/') !== false) { $icon = '<img src="' . image_media($atts['icon']) . '" alt="" />'; $css[] = '#' . $id . ' img {width:' . $atts['icon_size'] . 'px;}'; } if ($atts['top'] === 'yes') { $icon = '<a data-uk-smooth-scroll href="#">' . $icon . '</a>'; $classes[] = 'has-toplink'; } } if ($atts['style'] == 7) { $css[] = '#' . $id . '.su-divider-style-7 span.divider-left { background-image: -webkit-linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent);}'; $css[] = '#' . $id . '.su-divider-style-7 span.divider-right {background-image: -webkit-linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent);}'; } if ($atts['margin_top'] or $atts['margin_right'] or $atts['margin_bottom'] or $atts['margin_left']) { $margin = 'margin: '; $margin .= $atts['margin_top'] ? intval($atts['margin_top']) . 'px ' : '0 '; $margin .= $atts['margin_right'] ? intval($atts['margin_right']) . 'px ' : 'auto '; $margin .= $atts['margin_bottom'] ? intval($atts['margin_bottom']) . 'px ' : '0 '; $margin .= $atts['margin_left'] ? intval($atts['margin_left']) . 'px;' : 'auto;'; } // Get Css in $css variable $css[] = '#' . $id . '.su-divider { width:' . intval($atts['width']) . '%;' . $margin . ';text-align: ' . $atts['icon_align'] . ';}'; $css[] = '#' . $id . '.su-divider span:before, #' . $id . ' span:after { border-color: ' . $atts['color'] . ';}'; $css[] = '#' . $id . '.su-icon-style-2 > span { background: ' . $atts['color'] . ';border-radius: 50%;}'; // Add CSS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'divider.css', __FUNCTION__); // Output HTML return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"> <span> <span class="divider-left"></span> ' . $icon . ' <span class="divider-right"></span> </span> </div>'; }
public static function exit_bar($atts = null, $content = null) { $atts = su_shortcode_atts(array('background' => '', 'color' => '', 'text_align' => '', 'title' => '', 'title_color' => '', 'padding' => '', 'width' => '', 'expiration_day' => '7', 'hide_close' => 'no', 'always_visible' => 'no', 'cycle' => '0', 'auto' => 'no', 'class' => ''), $atts, 'exit_bar'); if (@$_REQUEST["action"] == 'su_generator_preview') { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_EB_NOT_WORKING')); } $id = uniqid('sueb_'); $css = array(); $js = array(); $width = $atts['width'] ? 'max-width: ' . intval($atts['width']) . 'px;' : ''; $return = array(); $background = $atts['background'] ? 'background-color: ' . $atts['background'] . ';' : ''; $color = $atts['color'] ? 'color: ' . $atts['color'] . ';' : ''; $text_align = $atts['text_align'] ? 'text-align: ' . $atts['text_align'] . ';' : ''; $padding = $atts['padding'] ? 'padding: ' . $atts['padding'] . ';' : ''; $title_color = $atts['title_color'] ? 'color: ' . $atts['title_color'] . ';' : ''; if ($background) { $css[] = '#' . $id . '.su-eb {' . $background . '}'; } if ($width or $color or $text_align) { $css[] = '#' . $id . ' .su-eb-container {' . $width . $color . $text_align . '}'; } if ($padding) { $css[] = '#' . $id . ' .su-eb-content {' . $padding . '}'; } if ($title_color) { $css[] = '#' . $id . ' .su-eb-content .su-eb-title {' . $title_color . '}'; } else { $css[] = '#' . $id . ' .su-eb-content .su-eb-title {' . $color . '}'; } $close_tt = $atts['always_visible'] === 'yes' ? '' : ' title="' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_EB_CLS_MESSAGE') . '"'; $atts['always_visible'] = $atts['always_visible'] === 'yes' ? 'true' : 'false'; $atts['auto'] = $atts['auto'] === 'yes' ? 'true' : 'false'; $js[] = "\r\n jQuery(document).ready(function(\$) {\r\n 'use strict';\r\n\r\n \$('#" . $id . ".su-eb').firstTime({\r\n name: 'su-eb',\r\n closeClass: 'eb-close',\r\n onPageExit: true,\r\n alwaysVisible: " . $atts['always_visible'] . ",\r\n expirationDays: " . $atts['expiration_day'] . ",\r\n cycle: " . $atts['cycle'] . ",\r\n auto: " . $atts['auto'] . ",\r\n showStartFunction: function() {\r\n \$('body').addClass('su-eb-stoped');\r\n },\r\n showFunction: function() {\r\n \$('body').addClass('su-eb-stoped');\r\n },\r\n hideStartFunction: function() {\r\n \$('body').removeClass('su-eb-stoped');\r\n },\r\n hideFunction: function() {\r\n \$('body').removeClass('su-eb-stoped');\r\n }\r\n });\r\n\r\n \$('#" . $id . "').prependTo(document.body);\r\n }); \r\n "; suAsset::addFile('css', 'exit-bar.css', __FUNCTION__); suAsset::addFile('js', 'jquery.firsttime.min.js'); suAsset::addString('css', implode('', $css)); suAsset::addString('js', implode('', $js)); $return[] = '<div class="su-eb" id="' . $id . '" data-expireday="' . $atts['expiration_day'] . '" data-alwaysvisible="' . $atts['always_visible'] . '" data-cycle="' . $atts['cycle'] . '" data-auto="' . $atts['auto'] . '">'; $return[] = '<div class="su-eb-container"> <div class="su-eb-content">'; if ($atts['title']) { $return[] = '<h1 class="su-eb-title">'; $return[] = $atts['title']; $return[] = '</h1>'; } $return[] = su_do_shortcode($content); if ($atts['hide_close'] != 'yes') { // Close button show/hide $return[] = '<div class="eb-close"' . $close_tt . '>×</div>'; } $return[] = '</div> </div> </div>'; return implode('', $return); }
public static function gmap_advanced($atts = null, $content = null) { $atts = su_shortcode_atts(array('width' => 600, 'height' => 400, 'border' => '0px solid #ccc', 'lat' => '24.824874643579022', 'lng' => '89.38262999446634', 'zoom' => '16', 'zoom_on_scroll' => 'false', 'responsive' => 'yes', 'pan_control' => 'yes', 'street_view_control' => 'yes', 'map_location_marker' => 'yes', 'address' => '', 'custom_marker' => '', 'zoom_control' => '1', 'zoom_control_style' => 'SMALL', 'map_as_background' => 'no', 'map_type' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'gmap'); $atts['zoom_control'] = $atts['zoom_control'] == 'yes' ? "true" : 'false'; $atts['pan_control'] = $atts['pan_control'] == 'yes' ? "true" : 'false'; $atts['street_view_control'] = $atts['street_view_control'] == 'yes' ? "true" : 'false'; $atts['zoom_on_scroll'] = $atts['zoom_on_scroll'] == 'yes' ? "true" : 'false'; if ($atts['address'] && $atts['map_location_marker']) { $atts['address'] = 'infoWindow: { content: "' . $atts['address'] . '" }'; } else { $atts['address'] = ''; } if ($atts['map_location_marker'] == 'yes') { $custom_marker = $atts['custom_marker'] ? 'icon:"' . image_media($atts['custom_marker']) . '",' : ''; $atts['map_location_marker'] = 'map.addMarker({ lat: ' . $atts['lat'] . ', lng: ' . $atts['lng'] . ',' . $custom_marker . $atts['address'] . '});'; } else { $atts['map_location_marker'] = ''; } $atts['width'] = $atts['responsive'] == 'yes' ? "auto;" : $atts['width'] . 'px;'; $unique_id = uniqid('gmap_'); $atts['zoom_control_style'] = $atts['zoom_control_style'] ? "zoomControlOpt: {\r\n style : '" . $atts['zoom_control_style'] . "',\r\n position: 'TOP_LEFT' \r\n }," : ""; $map_as_background = $atts['map_as_background'] == 'yes' ? 'map-as-background' : ''; if (@$_REQUEST["action"] == 'su_generator_preview') { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_GMAPA_NOT_WORKING')); } suAsset::addFile('css', 'gmap_advanced.css', __FUNCTION__); // Prepare protocol $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? "https://" : "http://"; JFactory::getDocument()->addScript($protocol . 'maps.google.com/maps/api/js?sensor=true'); suAsset::addFile('js', 'gmap-styles.js', __FUNCTION__); suAsset::addFile('js', 'gmaps.js', __FUNCTION__); suAsset::addFile('js', 'gmap_advanced.js', __FUNCTION__); suAsset::addFile('css', 'gmap_advanced.css', __FUNCTION__); $script = ' jQuery(document).ready(function(){ var map; map = new GMaps({ el: ' . $unique_id . ', lat: ' . $atts['lat'] . ', lng: ' . $atts['lng'] . ', zoomControl : ' . $atts['zoom_control'] . ', mapType: "' . $atts['map_type'] . '", mapTypeControl: false, zoom: ' . $atts['zoom'] . ', ' . $atts['zoom_control_style'] . ' panControl : ' . $atts['pan_control'] . ', streetViewControl: ' . $atts['street_view_control'] . ', scrollwheel: ' . $atts['zoom_on_scroll'] . ' }); ' . $atts['map_location_marker'] . ' });'; suAsset::addString('js', $script); return '<div style="width:' . $atts['width'] . 'height:' . $atts['height'] . 'px;border:' . $atts['border'] . ';" id="' . $unique_id . '"' . su_scroll_reveal($atts) . ' class="map_advanced ' . su_ecssc($atts) . $map_as_background . '"></div>'; }
public static function exit_popup($atts = null, $content = null) { $atts = su_shortcode_atts(array('background' => '', 'color' => '', 'text_align' => '', 'border' => '', 'shadow' => '', 'radius' => '', 'padding' => '', 'width' => '', 'height' => '', 'overlay_background' => '', 'expiration_day' => '7', 'hide_close' => 'no', 'always_visible' => 'no', 'cycle' => '0', 'auto' => 'no', 'class' => ''), $atts, 'exit_popup'); if (@$_REQUEST["action"] == 'su_generator_preview') { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_EP_NOT_WORKING')); } $id = uniqid('suep_'); $css = array(); $js = array(); $height = $atts['height'] ? 'height: ' . intval($atts['height']) . 'px;' : ''; $width = $atts['width'] ? 'width: ' . intval($atts['width']) . 'px;' : ''; $return = array(); $background = $atts['background'] ? 'background-color: ' . $atts['background'] . ';' : ''; $obg = $atts['overlay_background'] ? 'background-color: ' . $atts['overlay_background'] . ';' : ''; $color = $atts['color'] ? 'color: ' . $atts['color'] . ';' : ''; $text_align = $atts['text_align'] ? 'text-align: ' . $atts['text_align'] . ';' : ''; $border = $atts['border'] ? 'border: ' . $atts['border'] . ';' : ''; $radius = $atts['radius'] ? 'border-radius: ' . $atts['radius'] . ';' : ''; $shadow = $atts['shadow'] ? 'box-shadow: ' . $atts['shadow'] . ';' : ''; $padding = $atts['padding'] ? 'padding: ' . $atts['padding'] . ';' : ''; if ($obg) { $css[] = '#' . $id . ' .su-ep-container {' . $obg . '}'; } if ($background or $border or $radius or $shadow or $height or $width) { $css[] = '#' . $id . ' .su-ep-content {' . $background . $border . $radius . $shadow . $height . $width . '}'; } if ($padding or $text_align or $color) { $css[] = '#' . $id . ' .su-ep-content .su-ep-inner {' . $padding . $text_align . $color . '}'; } $atts['always_visible'] = $atts['always_visible'] === 'yes' ? 'true' : 'false'; $atts['auto'] = $atts['auto'] === 'yes' ? 'true' : 'false'; $js[] = "\r\n jQuery(document).ready(function(\$) {\r\n 'use strict';\r\n\r\n \$('#" . $id . " .su-ep-container').firstTime({\r\n name: 'su-ep-container',\r\n stepClass: 'su-ep-content',\r\n closeClass: 'ep-close',\r\n onPageExit: true,\r\n alwaysVisible: " . $atts['always_visible'] . ",\r\n expirationDays: " . $atts['expiration_day'] . ",\r\n cycle: " . $atts['cycle'] . ",\r\n auto: " . $atts['auto'] . "\r\n });\r\n\r\n \$('#" . $id . "').appendTo(document.body);\r\n }); \r\n "; suAsset::addString('css', implode('', $css)); suAsset::addFile('js', 'jquery.firsttime.min.js'); suAsset::addString('js', implode('', $js)); $return[] = '<div class="su-ep" id="' . $id . '" data-expireday="' . $atts['expiration_day'] . '" data-alwaysvisible="' . $atts['always_visible'] . '" data-cycle="' . $atts['cycle'] . '" data-auto="' . $atts['auto'] . '">'; $return[] = '<div class="su-ep-container"> <div class="su-ep-content"> <div class="su-ep-inner">'; $return[] = su_do_shortcode($content); $return[] = '</div>'; if ($atts['hide_close'] != 'yes') { // Close button show/hide $return[] = '<div class="ep-close">×</div>'; } $return[] = '</div> </div> </div>'; return implode('', $return); }
public static function note($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => '1', 'type' => 'info', 'icon' => 'no', 'radius' => '3px', 'scroll_reveal' => '', 'class' => ''), $atts, 'note'); $id = uniqid('sunote_'); if ($atts['radius']) { $css = '#' . $id . '.su-note { -webkit-border-radius:' . $atts['radius'] . ';border-radius:' . $atts['radius'] . ';}'; suAsset::addString('css', $css); } $note_icon = $atts['icon'] === 'yes' ? ' su-note-icon' : ''; suAsset::addFile('css', 'note.css', __FUNCTION__); return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-note' . su_ecssc($atts) . ' su-note-style' . $atts['style'] . ' su-note-' . $atts['type'] . '' . $note_icon . '"> <div class="su-note-inner su-clearfix">' . su_do_shortcode($content) . '</div> </div>'; }
public static function column($atts = null, $content = null) { $atts = su_shortcode_atts(array('size' => '1/1', 'medium' => '', 'small' => '', 'visible' => '', 'hidden' => '', 'center' => 'no', 'last' => '', 'background' => '', 'color' => '', 'padding' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'column'); $id = uniqid('sucol'); $css = array(); $classes = array('su-column', su_ecssc($atts)); if ($atts['small']) { $classes[] = 'su-column-size-small-' . str_replace('/', '-', $atts['small']); } else { $classes[] = 'su-column-size-1-1'; } if ($atts['medium']) { $classes[] = 'su-column-size-medium-' . str_replace('/', '-', $atts['medium']); } if ($atts['size'] and $atts['medium']) { $classes[] = 'su-column-size-large-' . str_replace('/', '-', $atts['size']); } else { $classes[] = 'su-column-size-medium-' . str_replace('/', '-', $atts['size']); } if ($atts['visible']) { $classes[] = 'su-visible-' . $atts['visible']; } if ($atts['hidden']) { $classes[] = 'su-hidden-' . $atts['hidden']; } if ($atts['last'] == 'yes' or $atts['last'] == '1') { $classes[] = 'su-column-last'; } if ($atts['center'] === 'yes') { $classes[] = 'su-column-centered'; } if ($atts['background']) { $atts['background'] = 'background-color: ' . $atts['background'] . ';'; } if ($atts['color']) { $atts['color'] = 'color: ' . $atts['color'] . ';'; } if ($atts['padding']) { $atts['padding'] = 'padding: ' . $atts['padding'] . 'px;'; } if ($atts['background'] or $atts['color']) { $css[] = '#' . $id . '.su-column .su-column-inner {' . $atts['background'] . $atts['color'] . $atts['padding'] . '}'; } suAsset::addFile('css', 'row-column.css'); suAsset::addString('css', implode("\n", $css)); return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"><div class="su-column-inner su-clearfix">' . su_do_shortcode($content) . '</div></div>'; }
public static function splash($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 'dark', 'width' => 480, 'padding' => '', 'opacity' => 80, 'onclick' => 'close-bg', 'url' => 'http://www.bdthemes.com', 'delay' => 0, 'esc' => 'yes', 'close' => 'yes', 'class' => ''), $atts, 'splash'); $id = uniqid('suss_'); $css = array(); $atts['opacity'] = !is_numeric($atts['opacity']) || $atts['opacity'] > 100 || $atts['opacity'] < 0 ? 0.8 : $atts['opacity'] / 100; if (@$_REQUEST["action"] == 'su_generator_preview') { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_NOT_WORK_IN_GENERATOR'), 'warning'); } if ($atts['padding']) { $css[] = '#' . $id . '.su-splash-screen {padding:' . $atts['padding'] . ';}'; } suAsset::addString('css', implode('', $css)); suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('css', 'splash.css', __FUNCTION__); suAsset::addFile('js', 'magnific-popup.js'); suAsset::addFile('js', 'splash.js', __FUNCTION__); return '<div class="su-splash" data-esc="' . $atts['esc'] . '" data-close="' . $atts['close'] . '" data-onclick="' . $atts['onclick'] . '" data-url="' . $atts['url'] . '" data-opacity="' . (string) $atts['opacity'] . '" data-width="' . $atts['width'] . '" data-style="su-splash-style-' . $atts['style'] . '" data-delay="' . (string) $atts['delay'] . '"><div id="' . $id . '" class="su-splash-screen su-content-wrap' . su_ecssc($atts) . '">' . su_do_shortcode($content) . '</div></div>'; }
public static function heading($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 'default', 'size' => '', 'align' => 'center', 'style_color' => '', 'margin' => '', 'width' => '', 'heading' => 'h3', 'color' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'heading'); $id = uniqid('suhead'); $css = array(); $width = $atts['width'] ? 'width: ' . intVal($atts['width']) . '%;' : ''; $margin = $atts['margin'] ? 'margin-bottom: ' . intVal($atts['margin']) . 'px;' : ''; $size = $atts['size'] ? 'font-size: ' . intVal($atts['size']) . 'px;line-height: ' . $atts['size'] . 'px;' : ''; $color = $atts['color'] ? ' color: ' . $atts['color'] . ';' : ''; if ($atts['width'] or $atts['margin']) { $css[] = '#' . $id . '.su-heading {' . $width . $margin . '}'; } if ($atts['size'] or $atts['color']) { $css[] = '#' . $id . '.su-heading .su-heading-inner {' . $size . $color . '}'; } if ($atts['style_color']) { if ($atts['style'] == 1 or $atts['style'] == 2 or $atts['style'] == 3) { $css[] = '#' . $id . ' .su-heading-inner:before {background: ' . $atts['style_color'] . '}'; } if ($atts['style'] == 4) { $css[] = '#' . $id . ' .su-heading-inner {border-bottom-color: ' . $atts['style_color'] . '}'; } if ($atts['style'] == 5) { $css[] = '#' . $id . ' .su-heading-inner:before, #' . $id . ' .su-heading-inner:after { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'5\' height=\'10\' viewBox=\'0 0 5 10\'><line x1=\'-2\' y1=\'1\' x2=\'7\' y2=\'10\' stroke=\'' . $atts['style_color'] . '\' stroke-width=\'1\'/><line x1=\'-2\' y1=\'6\' x2=\'7\' y2=\'15\' stroke=\'' . $atts['style_color'] . '\' stroke-width=\'1\'/><line x1=\'-2\' y1=\'-4\' x2=\'7\' y2=\'5\' stroke=\'' . $atts['style_color'] . '\' stroke-width=\'1\'/></svg>");}'; } if ($atts['style'] == 6) { $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'11\' height=\'8\' viewBox=\'0 0 100 100\' xml:space=\'preserve\'><rect x=\'14.614\' y=\'14.824\' transform=\'matrix(0.7071 -0.7071 0.7071 0.7071 -20.8159 49.9564)\' fill=\'' . $atts['style_color'] . '\' width=\'70\' height=\'70\'/></svg>");}'; } if ($atts['style'] == 7) { $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'9\' height=\'6\' viewBox=\'0 0 100 100\' xml:space=\'preserve\'><circle fill=\'' . $atts['style_color'] . '\' cx=\'50\' cy=\'50\' r=\'50\'/></svg>");}'; } if ($atts['style'] == 8) { $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'122px\' height=\'12px\' viewBox=\'0 0 122 12\' enable-background=\'new 0 0 122 12\' xml:space=\'preserve\'><circle fill=\'transparent\' stroke=\'' . su_color::darken($atts['style_color'], '10%') . '\' stroke-width=\'2\' cx=\'61\' cy=\'6\' r=\'5\'/><rect y=\'5\' width=\'50\' height=\'1\' fill=\'' . $atts['style_color'] . '\' /><rect x=\'72\' y=\'5\' width=\'50\' height=\'1\' fill=\'' . $atts['style_color'] . '\'/></svg>");}'; } if ($atts['style'] == 9) { $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' x=\'0px\' y=\'0px\' viewBox=\'-244 391 122 12\' style=\'enable-background:new -244 391 122 12;\' xml:space=\'preserve\'><polygon points=\'-172.6,391 -173.8,391 -175.6,392.8 -183,400.2 -190.4,392.8 -192.2,391 -193.4,391 -244,391 -244,392.8 -192.9,392.8 -183,402.7 -173.1,392.8 -122,392.8 -122,391 \' fill=\'' . $atts['style_color'] . '\'/></svg>");}'; } } // Add CSS in head suAsset::addFile('css', 'heading.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-heading su-heading-style-' . $atts['style'] . ' su-heading-align-' . $atts['align'] . su_ecssc($atts) . '"><' . $atts['heading'] . ' class="su-heading-inner">' . su_do_shortcode($content) . '</' . $atts['heading'] . '></div>'; }
public static function icon($atts = null, $content = null) { $atts = su_shortcode_atts(array('icon' => 'icon: heart', 'background' => '', 'color' => '', 'size' => '20', 'padding' => '', 'radius' => '', 'square_size' => 'yes', 'border' => '', 'margin' => '', 'url' => '', 'target' => 'blank', 'scroll_reveal' => '', 'class' => ''), $atts, 'icon'); $id = uniqid('suico_'); $css = array(); $atts['size'] = intval($atts['size']); $square_size = $atts['square_size'] === 'no' ? '' : ' square-size'; $background = $atts['background'] ? 'background-color:' . $atts['background'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; $border = $atts['border'] ? 'border:' . $atts['border'] . ';' : ''; $border_radius = $atts['radius'] ? '-webkit-border-radius:' . $atts['radius'] . ';border-radius:' . $atts['radius'] . ';' : ''; $padding = $atts['padding'] ? 'padding:' . $atts['padding'] . ';' : ''; if ($atts['margin']) { $css[] = '#' . $id . '.su-icon{ margin:' . $atts['margin'] . '}'; } if (strpos($atts['icon'], '/') !== false) { $css[] = '#' . $id . '.su-icon img { width:' . intval($atts['size']) . 'px;height:' . intval($atts['size']) . 'px;' . $background . $color . $border . $border_radius . $padding . '}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $css[] = '#' . $id . '.su-icon i { font-size:' . intval($atts['size']) . 'px;line-height:' . intval($atts['size']) . 'px;' . $background . $color . $border . $border_radius . $padding . '}'; } // Image Icon if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } // Prepare text if ($content) { $content = '<span class="su-icon-text">' . $content . '</span>'; } if (!$atts['url']) { $icon = '<span id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-icon' . $square_size . su_ecssc($atts) . '">' . $atts['icon'] . su_do_shortcode($content) . '</span>'; } else { $icon = '<a id="' . $id . '" href="' . $atts['url'] . '"' . su_scroll_reveal($atts) . ' class="su-icon' . $square_size . su_ecssc($atts) . '" target="_' . $atts['target'] . '">' . $atts['icon'] . su_do_shortcode($content) . '</a>'; } // Asset added suAsset::addFile('css', 'icon.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); return $icon; }
public static function su_list($atts = null, $content = null) { $atts = su_shortcode_atts(array('icon' => 'icon: star', 'icon_color' => '#333333', 'style' => 'default', 'scroll_reveal' => '', 'class' => ''), $atts, 'list'); $id = uniqid('sul_'); $css = array(); if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; $css[] = '#' . $id . '.su-list img { color:' . $atts['icon_color'] . '; }'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-list i { color:' . $atts['icon_color'] . '; }'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-list i { color:' . $atts['icon_color'] . '; }'; } suAsset::addFile('css', 'list.css', 'list'); suAsset::addString('css', implode("\n", $css)); return '<div id="' . $id . '" ' . su_scroll_reveal($atts) . ' class="su-list su-list-style-' . $atts['style'] . su_ecssc($atts) . '">' . str_replace('<li>', '<li>' . $atts['icon'] . ' ', has_child_shortcode($content, 'l')) . '</div>'; }
public static function social_locker($atts = null, $content = null) { $atts = su_shortcode_atts(array('id' => uniqid('suf'), 'style' => 'starter', 'title' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SL_LOCKED'), 'message' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SL_LOCKED_MSG'), 'timer' => 0, 'close' => 'no', 'mobile' => 'no', 'demo_mode' => 'no', 'guest_only' => 'no', 'facebook' => 'yes', 'google_plus' => 'yes', 'twitter' => 'yes', 'overlap' => 'full', 'url' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'social_locker'); $return = array(); $current_url = JURI::current(); $active = 1; $button = array(); if ($atts['facebook'] === 'yes') { $button[] = 'facebook-like'; } if ($atts['google_plus'] === 'yes') { $button[] = 'google-plus'; } if ($atts['twitter'] === 'yes') { $button[] = 'twitter-tweet'; } if ($atts['guest_only'] === 'yes') { $guest = JFactory::getUser(); $active = !$guest->guest ? 0 : 1; } $settings = array('url' => $atts['url'] ? urlencode($atts['url']) : urlencode($current_url), 'theme' => $atts['style'], 'text' => array('header' => $atts['title'], 'message' => $atts['message']), 'locker' => array('close' => $atts['close'] === 'yes' ? true : false, 'timer' => $atts['timer'], 'mobile' => $atts['mobile'] === 'yes' ? true : false), 'overlap' => array('mode' => $atts['overlap'], 'intensity' => 5), 'buttons' => array('order' => $button), 'demo' => $atts['demo_mode'] === 'yes' ? true : false); $js = ' jQuery(document).ready(function($) { "use strict"; $("#' . $atts['id'] . '.su-social-lock").sociallocker( ' . json_encode($settings) . ' ); }); '; if ($active && !is_null($content)) { $return[] = '<div id="' . $atts['id'] . '"' . su_scroll_reveal($atts) . ' class="su-social-lock ' . su_ecssc($atts) . '">'; $return[] = su_do_shortcode($content); $return[] = '</div>'; suAsset::addFile('css', 'sociallocker.min.css'); suAsset::addFile('js', 'sociallocker.min.js'); suAsset::addString('js', $js); } else { $return[] = su_do_shortcode($content); } return implode("\n", $return); }
public static function counter($atts = null, $content = null) { $atts = su_shortcode_atts(array('align' => 'top', 'count_start' => 1, 'count_end' => 5000, 'counter_refresh_interval' => 50, 'counter_speed' => 5, 'separator' => 'no', 'decimal' => 'no', 'prefix' => '', 'suffix' => '', 'count_color' => '', 'count_size' => '32px', 'text_color' => '', 'text_size' => '14px', 'icon' => '', 'icon_color' => '', 'icon_size' => '24', 'border' => '', 'background' => '', 'scroll_reveal' => '', 'class' => ''), $atts); $id = uniqid('suc'); $css = array(); if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } $icon = $atts['icon'] ? '<div class="su-counter-icon">' . $atts['icon'] . '</div>' : ''; $border = $atts['border'] ? 'border:' . $atts['border'] . ';' : ''; $background = $atts['background'] ? 'background-color:' . $atts['background'] . ';' : ''; if ($border or $background) { $css[] = '#' . $id . ' {' . $background . $border . '}'; } $count_color = $atts['count_color'] ? 'color:' . $atts['count_color'] . ';' : ''; $text_color = $atts['text_color'] ? 'color:' . $atts['text_color'] . ';' : ''; $icon_color = $atts['icon_color'] ? 'color:' . $atts['icon_color'] . ';' : ''; $icon_size = $atts['icon_size'] ? 'font-size: ' . intval($atts['icon_size']) . 'px;' : 'font-size: ' . $atts['count_size'] . ';'; $css[] = '#' . $id . ' .su-counter-number { font-size: ' . $atts['count_size'] . '; ' . $count_color . ' }'; $css[] = '#' . $id . ' .su-counter-text {' . $text_color . ' font-size: ' . $atts['text_size'] . ';}'; $css[] = '#' . $id . ' .su-counter-icon i {' . $icon_color . $icon_size . '}'; suAsset::addString('css', implode("\n", $css)); suAsset::addFile('js', 'jquery.appear.js'); suAsset::addFile('js', 'countUp.js', __FUNCTION__); suAsset::addFile('css', 'counter.css', __FUNCTION__); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-counter-wrapper clearfix su-counter-' . $atts['align'] . ' ' . su_ecssc($atts) . '" data-id="' . $id . '" data-from="' . $atts['count_start'] . '" data-to="' . $atts['count_end'] . '" data-speed="' . $atts['counter_speed'] . '" data-separator="' . $atts['separator'] . '" data-prefix="' . $atts['prefix'] . '" data-suffix="' . $atts['suffix'] . '">'; $return .= $icon; $return .= '<div class="su-counter-desc"> <div id="' . $id . '_count" class="su-counter-number"> </div> <div class="su-counter-text">' . su_do_shortcode($content) . '</div> </div> </div>'; return $return; }
public static function instagram($atts = null, $content = null) { $atts = su_shortcode_atts(array('user' => 'https://instagram.com/google', 'hash_tag' => '', 'client_id' => '', 'limit' => '10', 'link_type' => 'popup', 'column' => 6, 'medium' => 3, 'small' => 2, 'gap' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'instagram'); $id = uniqid('suig'); $css = array(); $atts['gap'] = $atts['gap'] == "yes" ? 'su-has-gap' : ''; $link_type = 'su-link-type-' . $atts['link_type']; $classes = array('su-instagram', $atts['gap'], $link_type, su_ecssc($atts)); $settings = array('user' => rtrim($atts['user'], '/'), 'clientId' => $atts['client_id'], 'hashtag' => $atts['hash_tag'] ? explode(",", $atts['hash_tag']) : '', 'tagScope' => "global", 'selectedTab' => $atts['hash_tag'] ? "h1" : "p", 'displayMode' => $atts['link_type'], 'maxResults' => $atts['limit'], 'minItemWidth' => 300, 'maxItemWidth' => 400); $js = ' jQuery(document).ready(function($) { "use strict"; $(".su-instagram").instamax( ' . json_encode($settings) . ' ); }); '; if ($atts['column'] != 6) { $css[] = '#' . $id . ' .instamax-gallery-item { width: ' . 100 / intval($atts['column']) . '%;}'; } if ($atts['medium'] != 3) { $css[] = '@media only screen and (min-width: 480px) and (max-width: 767px) { #' . $id . ' .instamax-gallery-item { width: ' . 100 / intval($atts['medium']) . '%;} }'; } if ($atts['small'] != 2) { $css[] = '@media only screen and (max-width: 479px) { #' . $id . ' .instamax-gallery-item { width: ' . 100 / intval($atts['small']) . '%;} }'; } suAsset::addFile('css', 'instagram.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); suAsset::addFile('js', 'jquery.imagesloaded.js', __FUNCTION__); suAsset::addFile('js', 'jquery.instamax.js', __FUNCTION__); suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('js', 'magnific-popup.js'); suAsset::addString('js', $js); return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"></div>'; }
public static function animate($atts = null, $content = null) { $atts = su_shortcode_atts(array('type' => 'bounceIn', 'duration' => 1, 'delay' => 0, 'inline' => 'no', 'class' => ''), $atts, 'animate'); $id = uniqid('sua'); $inline = $atts['inline'] === 'yes' ? ' display: inline-block;' : ''; $style = array('duration' => array(), 'delay' => array()); // CSS Prefix manage foreach (array('-webkit-', '-moz-', '-ms-', '-o-', '') as $vendor) { $style['duration'][] = $vendor . 'animation-duration:' . $atts['duration'] . 's'; $style['delay'][] = $vendor . 'animation-delay:' . $atts['delay'] . 's'; } // Get Css in $css variable $css = '#' . $id . ' {visibility:hidden;' . $inline . implode(';', $style['duration']) . ';' . implode(';', $style['delay']) . '}'; // Add CSS in head suAsset::addString('css', $css); // Add CSS file in head suAsset::addFile('css', 'animate.css'); suAsset::addFile('js', 'jquery.appear.js'); suAsset::addFile('js', 'animate.js', __FUNCTION__); // Output HTML $output = '<div id="' . $id . '" class="su-animate ' . su_ecssc($atts) . '" data-animation="' . $atts['type'] . '">' . su_do_shortcode($content) . '</div>'; return $output; }
public static function panel($atts = null, $content = null) { $atts = su_shortcode_atts(array('background' => '', 'color' => '', 'shadow' => '', 'padding' => '', 'margin' => '', 'border' => '', 'radius' => '', 'text_align' => 'left', 'url' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'panel'); $id = uniqid('supnl'); $padding = ''; $margin = ''; $css = array(); $classes = array('su-panel', su_ecssc($atts)); if ($atts['url']) { $classes[] = 'su-panel-clickable'; suAsset::addFile('js', 'panel.js', __FUNCTION__); } if ($atts['padding'] != '' and !intval($atts['padding'])) { $padding = 'padding:' . $atts['padding'] . 'px;'; } elseif ($atts['padding'] != '') { $padding = 'padding:' . $atts['padding'] . ';'; } if ($atts['margin'] != '') { $margin = 'margin:' . $atts['margin'] . ';'; } $radius = $atts['radius'] ? '-webkit-border-radius:' . $atts['radius'] . ';border-radius:' . $atts['radius'] . ';' : ''; $border = $atts['border'] != '' ? 'border:' . $atts['border'] . ';' : ''; $shadow = $atts['shadow'] != '' ? '-webkit-box-shadow:' . $atts['shadow'] . ';box-shadow:' . $atts['shadow'] . ';' : ''; $background = $atts['background'] != '' ? 'background-color:' . $atts['background'] . ';' : ''; $color = $atts['color'] != '' ? 'color:' . $atts['color'] . ';' : ''; $classes[] = $atts['text_align'] ? 'sup-align-' . $atts['text_align'] : ''; if ($radius or $border or $shadow or $background or $color) { $css[] = '#' . $id . '.su-panel { ' . $background . $color . $border . $shadow . $radius . $margin . '}'; } if ($atts['text_align'] or $atts['padding'] != '') { $css[] = '#' . $id . '.su-panel .su-panel-content { ' . $padding . '}'; } suAsset::addFile('css', 'panel.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '" data-url="' . $atts['url'] . '"><div class="su-panel-content su-content-wrap">' . su_do_shortcode($content) . '</div></div>'; return $return; }
public static function icon_list_item($atts = null, $content = null) { $atts = su_shortcode_atts(array('title' => 'Icon List Heading', 'title_color' => '', 'title_size' => '', 'color' => '', 'icon_background' => 'transparent', 'icon' => 'icon: heart', 'icon_color' => '', 'icon_size' => 24, 'icon_animation' => '', 'icon_border' => '', 'icon_shadow' => '', 'icon_radius' => '', 'icon_align' => 'left', 'icon_padding' => '20px', 'icon_gap' => '', 'connector' => 'no', 'url' => '', 'target' => 'self', 'scroll_reveal' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'icon_list_item'); $id = uniqid('suil'); $css[] = ''; $has_connector = ''; $icon_animation = ''; $shadow = ''; $icon = ''; $lang = JFactory::getLanguage(); if ($lang->isRTL()) { if ($atts['icon_align'] === 'left') { $atts['icon_align'] = 'right'; } elseif ($atts['icon_align'] === 'right') { $atts['icon_align'] = 'left'; } } $has_connector = $atts['connector'] == 'yes' ? ' has-connector ' : ''; $icon_animation = $atts['icon_animation'] ? 'su-il-animation-' . $atts['icon_animation'] . '' : ''; $title_color = $atts['title_color'] ? 'color:' . $atts['title_color'] . ';' : ''; $title_size = $atts['title_size'] ? 'font-size: ' . $atts['title_size'] . ';' : ''; $radius = $atts['icon_radius'] ? '-webkit-border-radius:' . $atts['icon_radius'] . '; border-radius:' . $atts['icon_radius'] . ';' : ''; $shadow = $atts['icon_shadow'] ? '-webkit-box-shadow:' . $atts['icon_shadow'] . '; box-shadow:' . $atts['icon_shadow'] . ';' : ''; $padding = $atts['icon_padding'] ? 'padding:' . $atts['icon_padding'] . ';' : ''; $border = $atts['icon_border'] ? 'border:' . $atts['icon_border'] . ';' : ''; $icon_color = $atts['icon_color'] ? 'color:' . $atts['icon_color'] . ';' : ''; $icon_size = $atts['icon_size'] ? 'font-size: ' . intval($atts['icon_size']) . 'px;' : ''; $has_url = $atts['url'] != '' ? 'su-il-has-url' : ''; $classes = array('su-icon-list', 'su-icon-align-' . $atts['icon_align'], $has_connector, $icon_animation, $has_url, su_ecssc($atts)); if (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="list-img-icon li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; if ($icon_color or $icon_size) { $css[] .= '#' . $id . ' .icon_list_icon .list-img-icon {' . $icon_color . $icon_size . '}'; } } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon = '<i class="list-img-icon fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; if ($icon_color or $icon_size) { $css[] .= '#' . $id . ' .icon_list_icon .list-img-icon {' . $icon_color . $icon_size . '}'; } } else { $icon = '<img class="list-img-icon" src="' . image_media($atts['icon']) . '" style="width:' . $atts['icon_size'] . 'px" alt="" />'; } if ($atts['icon_align'] == 'right') { if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $description_margin = 'margin-right: ' . ($atts['icon_size'] + 30) . 'px;'; } else { $description_margin = 'margin-right: ' . ($atts['icon_size'] + intval($atts['icon_padding']) * 2 + 30 + intval($atts['icon_border']) * 2) . 'px;'; } $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : $description_margin; } elseif ($atts['icon_align'] == 'top') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; } elseif ($atts['icon_align'] == 'title') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; $padding = 'padding: 0;'; } elseif ($atts['icon_align'] == 'top_left') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $padding = 'padding: 0;'; } } elseif ($atts['icon_align'] == 'top_right') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $padding = 'padding: 0;'; } } else { if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $description_margin = 'margin-left: ' . ($atts['icon_size'] + 20) . 'px;'; $padding = 'padding: 0;'; } else { $description_margin = 'margin-left: ' . ($atts['icon_size'] + intval($atts['icon_padding']) * 2 + 30 + intval($atts['icon_border']) * 2) . 'px;'; } $description_margin = $atts['icon_gap'] ? 'margin-left: ' . $atts['icon_gap'] . 'px;' : $description_margin; } if ($atts['icon_animation'] == 6) { $css[] = '#' . $id . '.su-il-animation-6 .icon_list_icon i:before { margin-right: -' . round($atts['icon_size'] / 2) . 'px}'; } $icon_list_connector = ($atts['connector'] == "yes" and ($atts['icon_align'] == 'right' or $atts['icon_align'] == 'left')) ? 'icon_list_connector' : ''; $css[] = '#' . $id . ' .icon_list_icon { background:' . $atts['icon_background'] . '; font-size:' . $atts['icon_size'] . 'px; max-width:' . $atts['icon_size'] . 'px; height:' . $atts['icon_size'] . 'px;' . $border . $padding . $radius . $shadow . '}'; $css[] = '#' . $id . ' .icon_description { ' . $description_margin . '}'; if ($title_color or $title_size) { $css[] = '#' . $id . ' .icon_description h3 {' . $title_color . $title_size . '}'; } if ($atts['color']) { $css[] = '#' . $id . ' .icon_description_text { color:' . $atts['color'] . ';}'; } $url = $atts['url'] != '' ? 'data-url="' . $atts['url'] . '" data-target="' . $atts['target'] . '"' : ''; // Add CSS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'icon-list.css', __FUNCTION__); if ($atts['url'] != '') { suAsset::addFile('js', 'icon-list.js', __FUNCTION__); } $return = ' <div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"> <div class="icon_list_item" ' . $url . '> <div class="icon_list_wrapper ' . $icon_list_connector . '"> <div class="icon_list_icon">' . $icon . ' </div> </div> <div class="icon_description"> <h3>' . $atts['title'] . '</h3> <div class="icon_description_text">' . su_do_shortcode($content) . '</div> </div> <div class="clearfix"></div> </div> </div>'; return $return; }
public static function section($atts = null, $content = null) { $atts = su_shortcode_atts(array('background' => '', 'background_color' => '', 'color' => '', 'background_position' => '', 'background_repeat' => '', 'repeat' => '', 'background_attachment' => '', 'background_size' => '', 'background_overlay' => '', 'overlay_opacity' => '0.4', 'background_image' => '', 'image' => '', 'parallax' => 'no', 'parallax_transition' => 'no', 'speed' => '5', 'max_width' => '', 'force_fullwidth' => 'no', 'margin' => '', 'padding' => '', 'border' => '', 'text_align' => '', 'text_shadow' => '', 'url' => '', 'video_url' => '', 'video_loop' => 'yes', 'video_muted' => 'yes', 'video_ratio' => '1.77', 'video_autoplay' => 'yes', 'video_overlay' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'section'); $id = uniqid('sec_'); $css[] = ''; $classes = array('su-section', su_ecssc($atts)); $return = array(); $video = ''; $lang = JFactory::getLanguage(); if ($atts['background']) { $atts['background_color'] = $atts['background']; } if ($atts['repeat']) { $atts['background_repeat'] = $atts['repeat']; } if ($atts['image']) { $atts['background_image'] = $atts['image']; } if ($atts['parallax'] === 'yes') { $classes[] = 'su-section-parallax'; } if ($atts['parallax_transition'] === 'yes') { $classes[] = 'su-sp-transition'; } $rtl_check = $lang->isRTL() ? 1 : 0; $background_size = $atts['background_size'] ? 'background-size:' . $atts['background_size'] . ';' : ''; $background_position = $atts['background_position'] ? 'background-position:' . $atts['background_position'] . ';' : ''; $background_repeat = $atts['background_repeat'] ? 'background-repeat:' . $atts['background_repeat'] . ';' : ''; $background_color = $atts['background_color'] ? 'background-color:' . $atts['background_color'] . ';' : ''; $background_attachment = $atts['background_attachment'] ? 'background-attachment:' . $atts['background_attachment'] . ';' : ''; $background_overlay = $atts['background_overlay'] ? 'background-image: url(\'' . image_media($atts['background_overlay']) . '\');' : ''; $overlay_opacity = $atts['overlay_opacity'] ? 'opacity:' . $atts['overlay_opacity'] . ';' : ''; $background_image = $atts['background_image'] ? 'background-image: url(\'' . image_media($atts['background_image']) . '\');' : $background_color; $text_align = $atts['text_align'] ? 'text-align:' . $atts['text_align'] . ';' : ''; $text_shadow = $atts['text_shadow'] ? ' -webkit-text-shadow:' . $atts['text_shadow'] . '; text-shadow:' . $atts['text_shadow'] . ';' : ''; $border = $atts['border'] ? 'border-top:' . $atts['border'] . '; border-bottom:' . $atts['border'] . ';' : ''; $margin = $atts['margin'] ? 'margin:' . $atts['margin'] . ';' : ''; $padding = $atts['padding'] ? 'padding:' . $atts['padding'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; if (is_numeric($atts['max_width'])) { $max_width = $atts['max_width'] ? 'max-width:' . $atts['max_width'] . 'px;' : ''; } else { $max_width = $atts['max_width'] ? 'max-width:' . $atts['max_width'] . ';' : ''; } $force_fullwidth = $atts['force_fullwidth'] === 'yes' ? 'su-section-forcefullwidth' : ''; $loop = $atts['video_loop'] === 'yes' ? 'true' : 'false'; $muted = $atts['video_muted'] === 'yes' ? 'true' : 'false'; $autoplay = $atts['video_autoplay'] === 'yes' ? 'true' : 'false'; if (preg_match('"\\.mp4$"', $atts['video_url'])) { $video = ' data-mp4="' . image_media($atts['video_url']) . '"'; } elseif (preg_match('"\\.webm$"', $atts['video_url'])) { $video = ' data-webm="' . image_media($atts['video_url']) . '"'; } elseif (preg_match('"\\.flv$"', $atts['video_url'])) { $video = ' data-flv="' . image_media($atts['video_url']) . '"'; } elseif (preg_match('"(?:watch\\?v=|be\\.com\\/v\\/)(.{8,})"', $atts['video_url'])) { preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $atts['video_url'], $yurl); $video = ' data-youtube="' . $yurl[0] . '"'; } elseif (preg_match('"(vimeo\\.com?\\/[^\\s]*)"', $atts['video_url'])) { preg_match('~(?:<iframe [^>]*src=")?(?:https?:\\/\\/(?:[\\w]+\\.)*vimeo\\.com(?:[\\/\\w]*\\/videos?)?\\/([0-9]+)[^\\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~ix', $atts['video_url'], $vurl); $video = ' data-vimeo="' . $vurl[1] . '"'; } $fallback_image = $atts['image'] ? ' data-fallback_image="' . image_media($atts['image']) . '"' : ''; if ($atts['image'] && $atts['parallax'] === 'yes') { $classes[] = 'su-section-parallax'; } if ($atts['url']) { $classes[] = 'su-section-clickable'; } $css[] = '#' . $id . ' .su-section {' . $background_size . $background_position . $background_repeat . $background_attachment . $border . $margin . $color . '}'; $css[] = '#' . $id . ' .su-section-overlay {' . $background_overlay . $overlay_opacity . '}'; $css[] = '#' . $id . ' .su-section-content {' . $color . $max_width . $text_align . $text_shadow . $padding . '}'; if ($atts['video_url']) { suAsset::addFile('js', 'modernizr.video.js'); suAsset::addFile('js', 'swfobject.js'); suAsset::addFile('js', 'video_background.js'); } suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'section.css', __FUNCTION__); suAsset::addFile('js', 'section.js', __FUNCTION__); if ($atts['force_fullwidth'] === 'yes') { $return[] = '<div class="su-section-forcefullwidth">'; } $return[] = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-section-wrapper" data-id="' . $id . '" data-rtl="' . $rtl_check . '">'; $return[] = '<div class="' . su_acssc($classes) . '" data-url="' . $atts['url'] . '" data-speed="' . $atts['speed'] . '" style="' . $background_image . ';">'; $return[] = '<div class="su-section-content su-content-wrap">'; $return[] = su_do_shortcode($content); $return[] = '</div>'; if ($atts['background_overlay']) { $return[] = '<div class="su-section-overlay"></div>'; } if ($atts['video_url']) { $return[] = '<div class="su-section-video" id="svb_' . $id . '" data-id="svb_' . $id . '" data-loop="' . $loop . '" data-muted="' . $muted . '" data-autoplay="' . $autoplay . '" data-ratio="' . $atts['video_ratio'] . '" data-overlay="' . $atts['video_overlay'] . '" data-swfpath="' . BDT_SU_URI . '/other/video.swf"' . $video . '></div>'; } $return[] = '</div>'; $return[] = '</div>'; if ($atts['force_fullwidth'] === 'yes') { $return[] = '</div>'; } return implode('', $return); }
public static function testimonial($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => '1', 'name' => '', 'title' => '', 'photo' => '', 'company' => '', 'url' => '', 'target' => 'blank', 'italic' => 'no', 'background' => '', 'color' => '', 'border_color' => '', 'radius' => '0px', 'scroll_reveal' => '', 'class' => ''), $atts, 'testimonial'); $id = uniqid('sutm'); $cite = ''; $title = ''; $name = ''; $company = ''; $photo = ''; $css = array(); if (!$atts['title'] && !$atts['name'] && !$atts['photo'] && !$atts['company']) { $atts['class'] .= ' su-testimonial-no-cite'; } else { if ($atts['photo']) { $atts['class'] .= ' su-testimonial-has-photo'; $photo = '<div class="su-testimonial-photo"> <img src="' . image_media($atts['photo']) . '" alt="' . esc_attr($atts['name']) . '" /></div>'; } if ($atts['title']) { $title = '<span class="su-testimonial-title">' . $atts['title'] . '</span>'; } if ($atts['name']) { $name = '<span class="su-testimonial-name">' . $atts['name'] . '</span>'; } if ($atts['company']) { $company = $atts['url'] ? '<a href="' . $atts['url'] . '" class="su-testimonial-company" target="_' . $atts['target'] . '">' . $atts['company'] . '</a>' : '<span class="su-testimonial-company">' . $atts['company'] . '</span>'; if ($atts['title']) { $company = ' - ' . $company; } } $cite = "<div class='su-testimonial-cite'>{$name}{$title}{$company}</div>"; } $italic = $atts['italic'] == 'yes' ? 'su-testimonial-italic' : ''; if ($atts['radius'] != '0px') { $css[] = '#' . $id . ' .su-content-wrap { border-radius:' . $atts['radius'] . '}'; } if ($atts['background'] or $atts['color']) { $css[] = '#' . $id . ' .su-content-wrap {background-color:' . $atts['background'] . ';color:' . $atts['color'] . ';}'; } if ($atts['style'] == 1) { $css[] = '#' . $id . '.su-testimonial-style-1 .su-testimonial-text {border-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-1 .su-testimonial-text:before {border-top-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-1 .su-testimonial-text:after {border-top-color:' . $atts['background'] . ';}'; } if ($atts['style'] == 2) { $css[] = '#' . $id . '.su-testimonial-style-2 .su-testimonial-text:before {border-top-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-2 .su-testimonial-text:after {border-top-color:' . $atts['background'] . ';}'; if ($atts['border_color'] != '') { $css[] = '#' . $id . '.su-testimonial-style-2 .su-testimonial-text {box-shadow: -4px 0px 0 ' . $atts['border_color'] . ';}'; } } if ($atts['style'] == 4) { if ($atts['background']) { $css[] = '#' . $id . '.su-testimonial-style-4 .su-testimonial-text:after {border-top-color:' . $atts['background'] . ';}'; } if ($atts['border_color']) { $css[] = '#' . $id . '.su-testimonial-style-4 .su-testimonial-text {border-bottom-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-4 .su-testimonial-text:before {border-top-color:' . $atts['border_color'] . ';}'; } } suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'testimonial.css', __FUNCTION__); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-testimonial' . su_ecssc($atts) . ' su-testimonial-style-' . $atts['style'] . ' ' . $italic . '">'; $return .= '<div class="su-testimonial-text su-content-wrap">'; if ($atts['style'] == 4) { $return .= $photo; } $return .= '<span class="quote"></span>' . su_do_shortcode($content); $return .= '</div>'; if ($atts['style'] != 4) { $return .= $photo; } $return .= $cite; $return .= '</div>'; return $return; }
public static function button($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 'default', 'url' => '#', 'target' => 'self', 'color' => '#FFFFFF', 'background' => '#2D89EF', 'background_hover' => '', 'size' => 3, 'wide' => 'no', 'center' => 'no', 'radius' => '3px', 'icon' => false, 'icon_color' => '#FFFFFF', 'desc' => '', 'onclick' => '', 'rel' => '', 'title' => '', 'padding' => '', 'margin' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'button'); // Initioal Variables $id = uniqid('subtn_'); $css = array(); $js = array(); $borderBtn = ''; $borderBtnHover = ''; // Prepare vars $before = $after = ''; // Common styles for button $btn_size = round(($atts['size'] + 7) * 1.25); // Background hover check if ($atts['background_hover']) { $bg_hover = $atts['background_hover']; } elseif ($atts['background'] != 'transparent') { $bg_hover = su_color::lighten($atts['background']); } else { $bg_hover = ''; } $lineheight = $atts['icon'] ? 'line-height:' . round($btn_size * 1.5) . 'px;' : 'line-height:' . round($btn_size * 2) . 'px;'; if ($atts['padding']) { $padding = 'padding: ' . $atts['padding'] . ';'; } else { $padding = $atts['icon'] ? 'padding: ' . round($atts['size'] / 2 + 4) . 'px ' . round($atts['size'] * 2 + 10) . 'px;' : 'padding: ' . '4px ' . round($atts['size'] * 2 + 10) . 'px;'; } $radius = $atts['radius'] ? '-webkit-border-radius: ' . $atts['radius'] . '; border-radius: ' . $atts['radius'] . ';' : ''; $margin = $atts['margin'] ? 'margin: ' . $atts['margin'] . ';' : ''; if ($atts['style'] === 'border') { $borderBtn = 'border-color: ' . $atts['color'] . ';'; $borderBtnHover = 'border-color: ' . su_color::lighten($atts['color']) . ';'; } // CSS rules for <a> tag $css[] = 'a#' . $id . ' { color: ' . $atts['color'] . '; background-color: ' . $atts['background'] . ';' . $radius . $borderBtn . $margin . '}'; $css[] = 'a#' . $id . ' span { font-size: ' . $btn_size . 'px;' . $radius . $lineheight . $padding . '}'; if ($bg_hover) { $css[] = 'a#' . $id . ':hover { background-color: ' . $bg_hover . ';}'; } elseif ($atts['style'] === 'border') { $css[] = 'a#' . $id . ':hover {' . $borderBtnHover . '}'; } if ($atts['desc']) { $css[] = 'a#' . $id . ' small {padding-bottom:' . round($atts['size'] / 2 + 4) . 'px;color: ' . $atts['color'] . ';}'; } if ($atts['style'] === '3d') { $css[] = 'a#' . $id . '.su-button-style-3d { box-shadow: 0 ' . round($atts['size']) . 'px 0 ' . su_color::darken($atts['background'], '6%') . '; }'; $css[] = 'a#' . $id . '.su-button-style-3d:active { box-shadow: 0 1px 0 ' . su_color::darken($atts['background'], '8%') . '; top: ' . round($atts['size'] - 1) . 'px }'; } // Prepare button classes $classes = array('su-button', 'su-button-style-' . $atts['style']); // Additional classes if ($atts['class']) { $classes[] = $atts['class']; } // Wide class if ($atts['wide'] === 'yes') { $classes[] = 'su-button-wide'; } // Prepare icon if ($atts['icon']) { if (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = 'a#' . $id . ' i {font-size:' . $btn_size . 'px; color:' . $atts['icon_color'] . '}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = 'a#' . $id . ' i {font-size:' . $btn_size . 'px; color:' . $atts['icon_color'] . '}'; } else { $icon = '<img src="' . image_media($atts['icon']) . '" alt="' . esc_attr($content) . '"/>'; $css[] = 'a#' . $id . ' img {width:' . round($btn_size * 1.5) . 'px; height:' . round($btn_size * 1.5) . 'px;}'; } } else { $icon = ''; } // Prepare <small> with description $desc = $atts['desc'] ? '<small>' . su_scattr($atts['desc']) . '</small>' : ''; // Wrap with div if button centered if ($atts['center'] === 'yes') { $before .= '<div class="su-button-center">'; $after .= '</div>'; } // Replace icon marker in content, // add float-icon class to rearrange margins if (strpos($content, '%icon%') !== false) { $content = str_replace('%icon%', $icon, $content); $classes[] = 'su-button-float-icon'; } else { $content = $icon . ' ' . $content; } // Prepare onclick action $atts['onclick'] = $atts['onclick'] ? ' onClick="' . $atts['onclick'] . '"' : ''; // Prepare rel attribute $atts['rel'] = $atts['rel'] ? ' rel="' . $atts['rel'] . '"' : ''; // Prepare title attribute $atts['title'] = $atts['title'] ? ' title="' . $atts['title'] . '"' : ''; // put css in head suAsset::addFile('css', 'button.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); return $before . '<a id="' . $id . '" href="' . su_scattr($atts['url']) . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '" target="_' . $atts['target'] . '"' . $atts['onclick'] . $atts['rel'] . $atts['title'] . '><span>' . su_do_shortcode(stripcslashes($content)) . $desc . '</span></a>' . $after; }
public static function file_download($atts = null, $content = null) { $atts = su_shortcode_atts(array('id' => '', 'url' => '', 'custom_title' => '', 'save_as' => '', 'show_title' => 'yes', 'color' => '#999999', 'background' => '#f9f9f9', 'radius' => '3px', 'padding' => '25px', 'margin' => '0', 'icon' => 'icon: download', 'show_count' => 'yes', 'show_download_count' => 'yes', 'show_like_count' => 'yes', 'resumable' => 'yes', 'download_speed' => 500, 'show_file_size' => 'yes', 'button_text' => 'Download Now', 'button_color' => '#f5f5f5', 'button_hover_color' => '#ffffff', 'button_background' => '#ff6a56', 'button_hover_background' => '#ff543d', 'button_class' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'file_download'); $uniqid = uniqid('sufd_'); $css[] = ''; $js[] = ''; $return = array(); $id = $atts['id'] ? $atts['id'] : md5($atts['url']); $id = substr($id, 0, 30); //get saved data $sdata = Su_FileManager::getFileInfo($id, JPATH_SITE . DIRECTORY_SEPARATOR . $atts['url']); $file = JPATH_SITE . DIRECTORY_SEPARATOR . $atts['url']; $file_title = $atts["custom_title"] ? $atts["custom_title"] : basename($atts['url']); $ldata = json_decode($sdata->liked_ip); if (!$ldata || !is_array($ldata)) { $ldata = array(); } $ip = Su_FileManager::getIp(); $liked = 0; if (in_array($ip, $ldata)) { $liked = 1; } if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } $liked_style = $liked ? 'su-fd-like' : ''; $liked = (int) $sdata->liked; $downloaded = (int) $sdata->downloaded; $button_class = $atts["button_class"] ? $atts['button_class'] : ''; // internal javascript $js[] = 'jQuery(document).ready(function() { jQuery("#like' . $id . '").click(function() { jQuery.ajax({ method: "POST", url: "' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=like') . '", data: {id: "' . $id . '"}, dataType: "json" }) .done(function(data) { if (data) { var nlike = data.nlike; jQuery("#nlike' . $id . '").html(nlike); if (data.like == 1) { jQuery("#like' . $id . '").addClass("su-fd-like"); } else { jQuery("#like' . $id . '").removeClass("su-fd-like"); } } }) }); });'; // CSS prepare $css[] = '#' . $uniqid . ' {color: ' . $atts['color'] . ';background: ' . $atts['background'] . ';padding: ' . $atts['padding'] . ';margin: ' . $atts['margin'] . ';border-radius: ' . $atts['radius'] . ';}'; if (!$button_class) { $css[] = '#' . $uniqid . ' .su-download-btn {color: ' . $atts['button_color'] . ';background: ' . $atts['button_background'] . ';}'; $css[] = '#' . $uniqid . ' .su-download-btn:hover {color: ' . $atts['button_hover_color'] . ';background: ' . $atts['button_hover_background'] . ';}'; } // Asset added suAsset::addFile('css', 'file_download.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); suAsset::addString('js', implode("\n", $js)); // Output HTML if ($atts['url'] && file_exists($file)) { $return[] = '<div' . su_scroll_reveal($atts) . ' id="' . $uniqid . '" class="su-download' . su_ecssc($atts) . '"> <input type="hidden" name="id" value="' . $id . '" /> <a class="su-download-btn ' . $button_class . '" href="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=download&id=' . $id) . '" >' . $atts['icon'] . ' ' . $atts['button_text'] . '</a>'; $return[] = $atts['show_title'] == 'yes' ? '<h4 class="su-file-name"><b>' . JTEXT::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_FILE_NAME') . ' </b>' . $file_title . '</h4>' : ''; @($sdata->see = $sdata->see ? $sdata->see : 0); $sdata->see += 1; $params = new stdClass(); $params->download_speed = $atts["download_speed"]; $params->save_as = rawurlencode($atts["save_as"]); $params->resumable = $atts["resumable"]; $sdata->params = json_encode($params); Su_FileManager::updateFileInfo($sdata); $return[] = '<div class="su-download-counter">'; $return[] = $atts['show_count'] == 'yes' ? '<span class="see"><i class="fa fa-eye"></i>' . $sdata->see . '</span>' : ''; $return[] = $atts['show_download_count'] == 'yes' ? '<span class="downloaded"><i class="fa fa-download"></i>' . $downloaded . '</span>' : ''; $return[] = $atts['show_like_count'] == 'yes' ? '<span class="like"><span class="su-dwn-like ' . $liked_style . '" id="like' . $id . '" ><i class="fa fa-thumbs-up"></i></span><span class="like-number" id="nlike' . $id . '">' . $liked . '</span></span>' : ''; $return[] = $atts['show_file_size'] == 'yes' ? '<span class="like"><i class="fa fa-folder"></i>' . self::human_filesize(filesize($file), 2) . '</span>' : ''; $return[] = '</div>' . su_do_shortcode($content) . '</div>'; return implode("\n", $return); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_FILE_DOWNLOAD_ERROR'), 'warning'); } }
public static function carousel($atts = null, $content = null) { $return = ''; $atts = su_shortcode_atts(array('style' => '1', 'source' => '', 'limit' => 5, 'order' => 'created', 'order_by' => 'desc', 'items' => 4, 'large' => 4, 'medium' => 3, 'small' => 1, 'image' => 'yes', 'quality' => 95, 'title' => 'yes', 'title_link' => 'yes', 'title_limit' => '', 'intro_text' => 'yes', 'intro_text_limit' => '60', 'background' => '', 'color' => '', 'title_color' => '', 'date' => 'no', 'category' => 'no', 'image_width' => 360, 'image_height' => 320, 'thumb_resize' => 'yes', 'margin' => 10, 'scroll' => 1, 'arrows' => 'no', 'arrow_position' => 'default', 'pagination' => 'yes', 'autoplay' => 'yes', 'delay' => 4, 'speed' => 0.35, 'hoverpause' => 'no', 'lazyload' => 'no', 'loop' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'carousel'); $id = uniqid('suc'); $title = ""; $image = ""; $intro_text = ''; $css[] = ''; $background = ''; $color = ''; $date = ''; $category = ''; $lang = JFactory::getLanguage(); $lang = $lang->isRTL() ? 'true' : 'false'; $slides = (array) Su_Tools::get_slides($atts); $atts['items'] = $atts['large'] != 4 ? $atts['large'] : $atts['items']; $css[] = '#' . $id . '.su-carousel-style-3 .su-carousel-caption:after {border-bottom-color: ' . $atts['background'] . ';}'; if ($atts['background'] or $atts['color']) { $background = $atts['background'] ? 'background-color:' . $atts['background'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; $css[] = '#' . $id . ' .su-carousel-slide {' . $background . $color . '}'; } $thumb_resize_check = $atts['thumb_resize'] === 'yes' ? true : false; if ($atts['title_color']) { $css[] = '#' . $id . ' .su-carousel-slide .su-carousel-slide-title a {color: ' . $atts['title_color'] . ';}'; $css[] = '#' . $id . ' .su-carousel-slide .su-carousel-slide-title a:hover {color: ' . su_color::lighten($atts['title_color'], '10%') . ';}'; } if (count($slides) and ($atts['title'] == 'yes' or $atts['image'] == 'yes' or $atts['intro_text'] === 'yes')) { $source = substr($atts['source'], 0, 5); if ($source == 'media') { $atts['class'] .= ' su-carousel-media'; } $return[] = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-carousel su-carousel-style-' . $atts['style'] . ' su-carousel-title-' . $atts['title'] . ' arrow-' . $atts['arrow_position'] . ' ' . su_ecssc($atts) . '" data-autoplay="' . $atts['autoplay'] . '" data-delay="' . $atts['delay'] . '" data-speed="' . $atts['speed'] . '" data-arrows="' . $atts['arrows'] . '" data-pagination="' . $atts['pagination'] . '" data-lazyload="' . $atts['lazyload'] . '" data-hoverpause="' . $atts['hoverpause'] . '" data-items="' . $atts['items'] . '" data-medium="' . $atts['medium'] . '" data-small="' . $atts['small'] . '" data-margin="' . $atts['margin'] . '" data-scroll="' . $atts['scroll'] . '" data-loop="' . $atts['loop'] . '" data-rtl="' . $lang . '" ><div class="su-carousel-slides">'; $limit = 1; foreach ((array) $slides as $slide) { $image_url = su_image_resize($slide['image'], $atts['image_width'], $atts['image_height'], $thumb_resize_check, $atts['quality']); if ($atts['title'] == 'yes' && $slide['title']) { $title = stripslashes($slide['title']); if ($atts['title_limit']) { $title = su_char_limit($title, $atts['title_limit']); } if ($atts['title_link'] == "yes") { $title = '<a href="' . $slide['link'] . '">' . $title . '</a>'; } $title = '<h3 class="su-carousel-slide-title">' . $title . '</h3>'; } if ($atts['date'] === 'yes') { $date = JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')); $date = '<div class="su-cdate">' . $date . '</div>'; } if ($atts['category'] === 'yes') { $category = '<div class="su-ccategory">' . $slide['category'] . '</div>'; } if ($atts['intro_text'] === 'yes' and isset($slide['introtext'])) { $intro_text = $slide['introtext']; if ($atts['intro_text_limit']) { $intro_text = su_char_limit($intro_text, $atts['intro_text_limit']); } $intro_text = '<div class="su-carousel-item-text">' . su_do_shortcode($intro_text) . '</div>'; } $return[] = '<div class="su-carousel-slide">'; if (isset($image_url) && $atts['image'] == 'yes') { $return[] = '<div class="su-carousel-image">'; if (isset($image_url)) { $return[] = '<div class="su-carousel-links"> <a class="su-lightbox-item" href="' . image_media($slide['image']) . '" title="' . strip_tags($title) . '"> <i class="fa fa-search"></i> </a>'; if ($source != 'media') { $return[] = '<a class="su-carousel-link" href="' . $slide['link'] . '" title="' . strip_tags($title) . '"> <i class="fa fa-link"></i> </a>'; } $return[] = '</div>'; } $return[] = '<img src="' . image_media($image_url['url']) . '" alt="' . strip_tags($title) . '" />'; $return[] = '</div>'; } if ($title or $intro_text) { $return[] = '<div class="su-carousel-caption">' . $title . '<div class="su-cmeta">' . $date . $category . '</div>' . $intro_text . '</div>'; } $return[] = '</div>'; if ($limit++ == $atts['limit']) { break; } } $return[] = '</div>'; $return[] = '</div>'; suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('js', 'magnific-popup.js'); suAsset::addFile('css', 'owl.carousel.css'); suAsset::addFile('js', 'owl.carousel.min.js'); suAsset::addFile('css', 'carousel.css', __FUNCTION__); suAsset::addFile('js', 'carousel.js', __FUNCTION__); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_CAROUSEL_INF'), 'warning'); } return implode("", $return); }
public static function member($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => '1', 'background' => '#ffffff', 'color' => '#333333', 'shadow' => '', 'border' => '1px solid #cccccc', 'radius' => '0', 'text_align' => 'left', 'photo' => BDT_SU_IMG . 'sample/member.svg', 'name' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_NAME_DEFAULT'), 'role' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_ROLE_DEFAULT'), 'icon_1' => '', 'icon_1_url' => '', 'icon_1_color' => '#444444', 'icon_1_title' => '', 'icon_2' => '', 'icon_2_url' => '', 'icon_2_color' => '#444444', 'icon_2_title' => '', 'icon_3' => '', 'icon_3_url' => '', 'icon_3_color' => '#444444', 'icon_3_title' => '', 'icon_4' => '', 'icon_4_url' => '', 'icon_4_color' => '#444444', 'icon_4_title' => '', 'icon_5' => '', 'icon_5_url' => '', 'icon_5_color' => '#444444', 'icon_5_title' => '', 'icon_6' => '', 'icon_6_url' => '', 'icon_6_color' => '#444444', 'icon_6_title' => '', 'url' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'member'); $id = uniqid('sum'); $icons = array(); $show_icons = ''; $css = array(); $member_photo = ''; $box_shadow = $atts['shadow'] ? 'box-shadow:' . $atts['shadow'] . '; -webkit-box-shadow:' . $atts['shadow'] . ';' : ''; $radius = $atts['radius'] ? 'border-radius:' . $atts['radius'] . ';' : ''; for ($i = 1; $i <= 6; $i++) { if (!$atts['icon_' . $i] || !$atts['icon_' . $i . '_url']) { continue; } if (strpos($atts['icon_' . $i], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon_' . $i])) . '" style="color:' . $atts['icon_' . $i . '_color'] . '"></i>'; } elseif (strpos($atts['icon_' . $i], 'icon:') !== false) { $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon_' . $i])) . '" style="color:' . $atts['icon_' . $i . '_color'] . '"></i>'; } else { $icon = '<img src="' . image_media($atts['icon_' . $i]) . '" width="16" height="16" alt="" />'; } $icons[] = '<a href="' . $atts['icon_' . $i . '_url'] . '" title="' . $atts['icon_' . $i . '_title'] . '" class="su-memeber-icon su-m-' . trim(str_replace('icon:', '', $atts['icon_' . $i])) . '" target="_blank">' . $icon . '</a>'; } if (count($icons)) { $show_icons = '<div class="su-member-icons" style="text-align:' . $atts['text_align'] . ';"><div class="su-member-ic">' . implode('', $icons) . '</div>'; $show_icons .= $atts['style'] == '5' ? '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="52px" height="52px" viewBox="0 0 52 52" enable-background="new 0 0 52 52" xml:space="preserve"><path d="M51.673,0H0v51.5c0.244-5.359,3.805-10.412,7.752-13.003l36.169-23.74c4.264-2.799,7.761-8.663,7.752-14.297V0L51.673,0z"/></svg>' : ''; $show_icons .= '</div>'; } if ($atts['photo'] != '') { $multi_photo = array(); $multi_photo = explode(',', $atts['photo'], 2); $member_photo = '<img src="' . image_media($multi_photo[0]) . '" alt="" />'; if (isset($multi_photo[1])) { $member_photo .= '<img src="' . image_media($multi_photo[1]) . '" alt="" />'; } } $title = '<span class="su-member-name">' . $atts['name'] . '</span><span class="su-member-role">' . $atts['role'] . '</span>'; $css[] = '#' . $id . '.su-member {background-color:' . $atts['background'] . '; color:' . $atts['color'] . '; border:' . $atts['border'] . ';' . $radius . $box_shadow . '}'; $css[] = $atts['style'] == '5' ? '#' . $id . '.su-member-style-5 .su-member-icons {background-color:' . $atts['background'] . ';} #' . $id . '.su-member-style-5 .su-member-icons svg path {fill:' . $atts['background'] . ';} #' . $id . '.su-member-style-5 .su-member-icons a i {color:' . $atts['color'] . '!important;} #' . $id . '.su-member-style-5 .su-member-icons a i:after {background-color:' . $atts['color'] . ';}' : ''; $click_able = $atts['url'] ? 'data-url="' . $atts['url'] . '"' : ''; $click_able_class = $atts['url'] ? 'su-member-clickable' : ''; // Adding asset suAsset::addFile('css', 'member.css', __FUNCTION__); suAsset::addFile('js', 'member.js', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); // HTML Layout $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-member ' . $click_able_class . ' su-member-style-' . $atts['style'] . " " . su_ecssc($atts) . '" ' . $click_able . '>'; $return .= '<div class="su-member-photo">' . $member_photo; if ($atts['style'] == '2' or $atts['style'] == '4') { $return .= $show_icons; } $return .= '</div>'; $return .= '<div class="su-member-info" style="text-align:' . $atts['text_align'] . '">'; $return .= $title; $return .= $content ? '<div class="su-member-desc su-content-wrap">' . su_do_shortcode($content) . '</div>' : ''; $return .= '</div>'; if ($atts['style'] != '2' and $atts['style'] != '4') { $return .= $show_icons; } $return .= '</div>'; return $return; }