示例#1
0
 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;
 }
示例#2
0
 public static function fancy_text($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('type' => '1', 'tags' => 'Hello, Text', 'scroll_reveal' => '', 'class' => ''), $atts, 'fancy_tags');
     // Inistial Variables
     $id = uniqid("ft_");
     $tags = array();
     $tag = '';
     // class manage
     $classes = array('su-fancy-text', 'su-fteffect' . $atts['type'], su_ecssc($atts));
     // Fancy Text interchangeable tag spliting
     if ($atts['tags']) {
         $tags = explode(',', $atts['tags']);
         foreach ($tags as $word) {
             $tag .= '<b>' . $word . '</b>';
         }
         $tag = str_replace('<b>' . $tags['0'] . '</b>', '<b class="is-visible">' . $tags['0'] . '</b>', $tag);
     }
     // Manage class for different type of Fancy Text
     if ($atts['type'] == 1 or $atts['type'] == 2 or $atts['type'] == 4 or $atts['type'] == 5) {
         $classes[] = 'su-ft-letters';
     }
     // Add css file in head
     suAsset::addFile('css', 'fancy_text.css', __FUNCTION__);
     // Add javascript file in head
     suAsset::addFile('js', 'fancy_text.js', __FUNCTION__);
     // HTML Ourput
     $return = "\r\n            <span" . su_scroll_reveal($atts) . " id='" . $id . "' class='" . su_acssc($classes) . "'>\r\n                <span class='su-ft-wrap'>\r\n                    " . $tag . "\r\n                </span>\r\n            </span>";
     return $return;
 }
示例#3
0
 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;
 }
示例#4
0
 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>';
 }
示例#5
0
 public static function tabs($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('active' => 1, 'vertical' => 'no', 'align' => 'left', 'style' => 'default', 'scroll_reveal' => '', 'class' => ''), $atts, 'tabs');
     if ($atts['style'] === '3') {
         $atts['vertical'] = 'yes';
     }
     if (self::$tab_count = -1) {
         self::$tab_count = 0;
     }
     su_do_shortcode($content);
     $return = '';
     $tabs = $panes = array();
     if (is_array(self::$tabs)) {
         if (self::$tab_count < $atts['active']) {
             $atts['active'] = self::$tab_count;
         }
         foreach (self::$tabs as $tab) {
             $tabs[] = '<span class="' . su_ecssc($tab) . $tab['disabled'] . '"' . $tab['anchor'] . $tab['url'] . $tab['target'] . '>' . su_scattr($tab['icon']) . su_scattr($tab['title']) . '</span>';
             $panes[] = '<div class="su-tabs-pane su-clearfix' . su_ecssc($tab) . '">' . $tab['content'] . '</div>';
         }
         $atts['vertical'] = $atts['vertical'] === 'yes' ? ' su-tabs-vertical' : '';
         $return = '<div' . su_scroll_reveal($atts) . ' class="su-tabs  su-tabs-align-' . $atts['align'] . ' su-tabs-style-' . $atts['style'] . $atts['vertical'] . su_ecssc($atts) . '" data-active="' . (string) $atts['active'] . '"><div class="su-tabs-nav">' . implode('', $tabs) . '</div><div class="su-tabs-panes">' . implode("\n", $panes) . '</div></div>';
     }
     self::$tabs = array();
     self::$tab_count = 0;
     suAsset::addFile('css', 'tabs.css', __FUNCTION__);
     suAsset::addFile('js', 'tabs.js', __FUNCTION__);
     return $return;
 }
示例#6
0
    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;
    }
示例#7
0
 public static function frame($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('style' => 'default', 'align' => 'left', 'scroll_reveal' => '', 'class' => ''), $atts, 'frame');
     suAsset::addFile('css', 'frame.css', __FUNCTION__);
     suAsset::addFile('js', 'frame.js', __FUNCTION__);
     return '<span' . su_scroll_reveal($atts) . ' class="su-frame su-frame-align-' . $atts['align'] . ' su-frame-style-' . $atts['style'] . su_ecssc($atts) . '"><span class="su-frame-inner">' . su_do_shortcode($content) . '</span></span><div class="clear clearfix"></div>';
 }
示例#8
0
 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;
 }
示例#9
0
 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;
 }
示例#10
0
 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;
 }
示例#11
0
 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;
 }
示例#12
0
 public static function switcher($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('id' => uniqid('swt'), 'style' => 1, 'active' => 1, 'position' => 'top', 'align' => 'center', 'animation' => 'bounceLeft', 'scroll_reveal' => '', 'class' => ''), $atts, 'switcher');
     su_do_shortcode($content);
     $return = $panes = $css = $filter_item = array();
     if (is_array(self::$switcher)) {
         foreach (self::$switcher as $switcher_item) {
             $filter_data = su_title_class($switcher_item['title']);
             $filter_item[] = '<div data-filter=".' . $filter_data . '" class="cbp-filter-item ' . su_ecssc($switcher_item) . '"><div class="cbp-filter-item-inner">' . su_scattr($switcher_item['icon']) . '<span class="su-swt-title">' . su_scattr($switcher_item['title']) . '</span></div></div>';
             $panes[] = '<div class="' . $filter_data . ' cbp-item' . su_ecssc($switcher_item) . '">' . $switcher_item['content'] . '</div>';
         }
         $filters = '<div id="' . $atts['id'] . '_filter" class="su-swt-filter">' . implode('', $filter_item) . '</div>';
         if (is_int($atts['active']) && $atts['active'] > 0) {
             $active_tab = su_title_class(self::$switcher[$atts['active'] - 1]['title']);
         } else {
             $active_tab = su_title_class(self::$switcher[0]['title']);
         }
         $return[] = '<div id="' . $atts['id'] . '"' . su_scroll_reveal($atts) . ' data-animation="' . $atts['animation'] . '" class="su-switcher  su-switch-position-' . $atts['position'] . ' su-switch-align-' . $atts['align'] . ' su-switcher-style-' . $atts['style'] . su_ecssc($atts) . '" data-active_tab=".' . $active_tab . '" data-swtid="' . $atts['id'] . '">';
         $return[] = ($atts['position'] == 'top' or $atts['position'] == 'left') ? $filters : '';
         $return[] = '<div id="' . $atts['id'] . '_container" class="cbp cbp-l-grid-tabs">' . implode("\n", $panes) . '</div>';
         $return[] = ($atts['position'] == 'bottom' or $atts['position'] == 'right') ? $filters : '';
         $return[] = '<div class="su-clearfix"></div>';
         $return[] = '</div>';
     }
     self::$switcher = array();
     self::$switcher_item_count = 0;
     suAsset::addFile('css', 'cubeportfolio.min.css');
     suAsset::addFile('js', 'cubeportfolio.min.js');
     suAsset::addFile('css', 'switcher.css', __FUNCTION__);
     suAsset::addFile('js', 'switcher.js', __FUNCTION__);
     return implode("\n", $return);
 }
示例#13
0
 public static function dummy_text($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('amount' => 1, 'what' => 'paras', 'cache' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'dummy_text');
     $xml = simplexml_load_file('http://www.lipsum.com/feed/xml?amount=' . $atts['amount'] . '&what=' . $atts['what'] . '&start=0');
     $return = '<div' . su_scroll_reveal($atts) . ' class="su-dummy-text' . su_ecssc($atts) . '"><p>' . str_replace("\n", "</p><p>", $xml->lipsum) . '</p></div>';
     return $return;
 }
示例#14
0
 public static function column_inner($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('size' => '1/1', 'medium' => '', 'small' => '', 'visible' => '', 'hidden' => '', 'center' => 'no', 'scroll_reveal' => '', 'class' => ''), $atts, 'column_inner');
     $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['center'] === 'yes') {
         $classes[] = 'su-column-centered';
     }
     suAsset::addFile('css', 'row-column.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>';
 }
示例#15
0
 public static function youtube_advanced($atts = null, $content = null)
 {
     $return = array();
     $params = array();
     $atts = su_shortcode_atts(array('url' => false, 'playlist' => '', 'width' => 600, 'height' => 400, 'responsive' => 'yes', 'autohide' => 'alt', 'autoplay' => 'no', 'controls' => 'yes', 'loop' => 'no', 'fs' => 'yes', 'modestbranding' => 'no', 'rel' => 'yes', 'theme' => 'dark', 'wmode' => '', 'showinfo' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'youtube_advanced');
     if (!$atts['url']) {
         return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_YOUTUBE_CU'), 'warning');
     }
     $atts['url'] = su_scattr($atts['url']);
     $id = preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $atts['url'], $match) ? $match[1] : false;
     if (!$id) {
         return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_YOUTUBE_CI'), 'warning');
     }
     // Prepare params
     foreach (array('autohide', 'autoplay', 'controls', 'fs', 'loop', 'modestbranding', 'playlist', 'rel', 'showinfo', 'theme', 'wmode') as $param) {
         $params[$param] = str_replace(array('no', 'yes', 'alt'), array('0', '1', '2'), $atts[$param]);
     }
     // Correct loop
     if ($params['loop'] === '1' && $params['playlist'] === '') {
         $params['playlist'] = $id;
     }
     // Prepare protocol
     $protocol = preg_match('/^(https?:\\/\\/)/i', $atts['url'], $match) ? $match[1] : "http://";
     // Prepare player parameters
     $params = http_build_query($params);
     // Create player
     $return[] = '<div' . su_scroll_reveal($atts) . ' class="su-youtube su-responsive-media-' . $atts['responsive'] . su_ecssc($atts) . '">';
     $return[] = '<iframe width="' . $atts['width'] . '" height="' . $atts['height'] . '" src="' . $protocol . 'www.youtube.com/embed/' . $id . '?' . $params . '" allowfullscreen></iframe>';
     $return[] = '</div>';
     suAsset::addFile('css', 'youtube_advanced.css', __FUNCTION__);
     return implode('', $return);
 }
示例#16
0
文件: single.php 项目: jhener79/vlakc
function item_single($atts = null)
{
    $atts = su_shortcode_atts(array('source' => isset($_REQUEST["source"]) ? $_REQUEST["source"] : null, 'id' => isset($_REQUEST["id"]) ? $_REQUEST["id"] : null, 'include_article_image' => isset($_REQUEST["include_article_image"]) ? $_REQUEST["include_article_image"] : null, 'popup_category' => isset($_REQUEST["popup_category"]) ? $_REQUEST["popup_category"] : null, 'popup_date' => isset($_REQUEST["popup_date"]) ? $_REQUEST["popup_date"] : null, 'popup_image' => isset($_REQUEST["popup_image"]) ? $_REQUEST["popup_image"] : null), $atts);
    $data = new bdthemes_shortcodesHelperItem();
    if ($atts['source'] === 'k2') {
        $slides = $data->getDataK2($_REQUEST["id"]);
    } elseif ($atts['source'] === 'article') {
        $slides = $data->getData($_REQUEST["id"]);
    } else {
        $slides = '';
    }
    $return = '';
    foreach ((array) $slides as $slide) {
        $category = $atts['popup_category'] ? '<div class="cpb-category">' . $slide['category'] . '</div>' : '';
        $date = $atts['popup_date'] ? '<div class="cpb-date">' . JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')) . '</div>' : '';
        $textImg = $atts['include_article_image'] === 'yes' ? su_all_images(@$slide['fulltext']) : null;
        $return .= '
	        <div class="su-sc-single-item">
				<div class="cbp-l-project-title">' . $slide['title'] . '</div>
				<div class="cbp-l-project-subtitle">' . $category . $date . '</div>';
        if ($atts['popup_image'] === 'yes' and $textImg != null) {
            $return .= '
				        <div class="cbp-slider">
				            <ul class="cbp-slider-wrap">
				                <li class="cbp-slider-item"><img src="' . image_media($slide['image']) . '" alt="' . $slide['title'] . '"></li>';
            foreach ($textImg as $img) {
                $return .= '<li class="cbp-slider-item"><img src="' . image_media($img) . '" alt="' . $slide['title'] . '"></li>';
            }
            $return .= '</ul>
				    </div>';
        } elseif ($atts['popup_image'] === 'yes') {
            $return .= '<img src="' . image_media($slide['image']) . '" alt="' . $slide['title'] . '">';
        }
        $return .= '<div class="cbp-l-project-container">
							     <div class="cbp-project-desc">
							         <div class="cbp-l-project-desc-title"><span>' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_PD') . '</span></div>
							         <div class="cbp-l-project-desc-text">
											' . su_do_shortcode($slide['introtext']) . '
							         </div>';
        $return .= '	         <br>
							         <div class="cbp-l-project-social-wrapper">
							             <iframe src="http://www.facebook.com/plugins/like.php?href=' . JUri::root() . $slide['link'] . '&amp;layout=button_count&amp;show_faces=false&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" height="25"></iframe>
							         </div>
							         
							         <div class="cbp-l-project-social-wrapper">
							             <iframe src="https://platform.twitter.com/widgets/tweet_button.html?url=' . JUri::root() . $slide['link'] . '&text=Check%20out%20this%20site" height="25" title="Twitter Tweet Button" style="border: 0; overflow: hidden;"></iframe>
							         </div>
							         
							         <div class="cbp-l-project-social-wrapper" style="width: 71px">
							             <iframe src="https://plusone.google.com/_/+1/fastbutton?bsv&amp;size=medium&amp;hl=en-US&amp;url=' . JUri::root() . $slide['link'] . '" allowtransparency="true" frameborder="0" scrolling="no" title="+1" height="25" style="border: 0; overflow: hidden;"></iframe>
							         </div>';
        $return .= '			<a href="' . $slide['link'] . '" class="cbp-l-project-details-visit">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_VIEWDETAILS') . '</a>';
        $return .= '		<hr class="su-horizontal-line"><br><br><br>         
					    </div>
					</div>';
        $return .= '</div>';
    }
    return $return;
}
示例#17
0
 public static function gmap($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('width' => 600, 'height' => 400, 'responsive' => 'yes', 'address' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'gmap');
     suAsset::addFile('css', 'gmap.css', __FUNCTION__);
     // Prepare protocol
     $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? "https://" : "http://";
     return '<div' . su_scroll_reveal($atts) . ' class="su-gmap su-responsive-media-' . $atts['responsive'] . su_ecssc($atts) . '"><iframe width="' . $atts['width'] . '" height="' . $atts['height'] . '" src="' . $protocol . 'maps.google.com/maps?q=' . urlencode(su_scattr($atts['address'])) . '&amp;output=embed"></iframe></div>';
 }
示例#18
0
 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>';
 }
示例#19
0
 public static function highlight($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('background' => '#ddff99', 'bg' => null, 'color' => '#000000', 'scroll_reveal' => '', 'class' => ''), $atts, 'highlight');
     if ($atts['bg'] !== null) {
         $atts['background'] = $atts['bg'];
     }
     suAsset::addFile('css', 'highlight.css', __FUNCTION__);
     return '<span ' . su_scroll_reveal($atts) . 'class="su-highlight' . su_ecssc($atts) . '" style="background:' . $atts['background'] . ';color:' . $atts['color'] . '">&nbsp;' . su_do_shortcode($content) . '&nbsp;</span>';
 }
示例#20
0
 public static function dummy_image($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('width' => 500, 'height' => 300, 'theme' => 'any', 'scroll_reveal' => '', 'class' => ''), $atts, 'dummy_image');
     $url = 'http://lorempixel.com/' . $atts['width'] . '/' . $atts['height'] . '/';
     if ($atts['theme'] !== 'any') {
         $url .= $atts['theme'] . '/' . rand(0, 10) . '/';
     }
     return '<img' . su_scroll_reveal($atts) . ' src="' . $url . '" alt="' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_DUMMY_IMAGE') . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" class="su-dummy-image' . su_ecssc($atts) . '" />';
 }
示例#21
0
 public static function document($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('url' => '', 'file' => null, 'width' => 600, 'height' => 600, 'responsive' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'document');
     if ($atts['file'] !== null) {
         $atts['url'] = $atts['file'];
     }
     suAsset::addFile('css', 'document.css', __FUNCTION__);
     return '<div' . su_scroll_reveal($atts) . ' class="su-document su-responsive-media-' . $atts['responsive'] . '"><iframe src="//docs.google.com/viewer?embedded=true&amp;url=' . image_media($atts['url']) . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" class="su-document' . su_ecssc($atts) . '"></iframe></div>';
 }
示例#22
0
 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);
 }
示例#23
0
 public static function device_slider($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('source' => '', 'limit' => 5, 'device' => 'imac', 'arrows' => 'no', 'pagination' => 'no', 'autoplay' => 'yes', 'autoheight' => 'no', 'delay' => 4, 'speed' => 0.6, 'hoverpause' => 'yes', 'lazyload' => 'no', 'loop' => 'yes', 'lightbox' => 'no', 'margin' => 0, 'scroll_reveal' => '', 'class' => ''), $atts, 'device_slider');
     $id = uniqid('suds');
     $return = array();
     $classes = array('su-device-slider');
     if ($atts['lightbox'] === 'yes') {
         $classes[] = 'has-lightbox';
     }
     // if ($atts['transitionin'] === 'slide')
     //     $atts['transitionin'] = 'false';
     $slides = (array) Su_Tools::get_slides($atts);
     $device = file_exists(BDT_SU_ROOT . DIRECTORY_SEPARATOR . 'shortcodes' . DIRECTORY_SEPARATOR . 'device_slider' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . $atts['device'] . '.png');
     if (count($slides)) {
         $return[] = '<div' . su_scroll_reveal($atts) . ' class="su-device-slider-wrapper su-device-' . $atts['device'] . '">';
         $return[] = '<img class="su-device-slider-device" src="' . BDT_SU_URI . '/shortcodes/device_slider/images/' . $atts['device'] . '.png" alt="' . $atts['device'] . '">';
         $return[] = '<div id="' . $id . '" class="' . su_acssc($classes) . '" 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-loop="' . $atts['loop'] . '" data-hoverpause="' . $atts['hoverpause'] . '">';
         $limit = 0;
         foreach ($slides as $slide) {
             if ($slide['image']) {
                 if ($limit++ == $atts['limit']) {
                     break;
                 }
                 if ($atts['device'] == 'imac' or $atts['device'] == 'macbook') {
                     $image = su_image_resize($slide['image'], 944, 590);
                 } elseif ($atts['device'] == 'ipad') {
                     $image = su_image_resize($slide['image'], 596, 771);
                 } elseif ($atts['device'] == 'iphone' or $atts['device'] == 'galaxys6') {
                     $image = su_image_resize($slide['image'], 447, 762);
                 }
                 $return[] = '<div class="su-device-slide-item">';
                 if ($atts['lightbox'] === 'yes') {
                     $return[] = '
                                     <div class="su-device-links">
                                         <a class="su-lightbox-item" href="' . image_media($slide['image']) . '" title="' . strip_tags($slide['title']) . '"><i class="fa fa-search"></i></a>
                                     </div>';
                 }
                 $return[] = '<img src="' . image_media($image['url']) . '" alt="' . esc_attr($slide['title']) . '" />';
                 $return[] = '</div>';
             }
         }
         $return[] = '</div>';
         $return[] = '</div>';
         suAsset::addFile('css', 'owl.carousel.css');
         suAsset::addFile('css', 'device_slider.css', __FUNCTION__);
         suAsset::addFile('js', 'owl.carousel.min.js');
         suAsset::addFile('js', 'device_slider.js', __FUNCTION__);
         if ($atts['lightbox'] === 'yes') {
             suAsset::addFile('css', 'magnific-popup.css');
             suAsset::addFile('js', 'magnific-popup.js');
         }
         return implode('', $return);
     } else {
         return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_DEVICE_SLIDER_ERROR'), 'warning');
     }
 }
示例#24
0
 public static function table($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('url' => false, 'scroll_reveal' => '', 'class' => ''), $atts, 'table');
     $return = '<div' . su_scroll_reveal($atts) . ' class="su-table' . su_ecssc($atts) . '">';
     $return .= $atts['url'] ? su_parse_csv($atts['url']) : su_do_shortcode($content);
     $return .= '</div>';
     suAsset::addFile('css', 'table.css', __FUNCTION__);
     suAsset::addFile('js', 'table.js', __FUNCTION__);
     return $return;
 }
示例#25
0
 public static function guests($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('scroll_reveal' => '', 'class' => ''), $atts, 'guests');
     $guest = JFactory::getUser();
     $return = '';
     if ($guest->guest && !is_null($content)) {
         $return = '<div' . su_scroll_reveal($atts) . ' class="su-guests' . su_ecssc($atts) . '">' . su_do_shortcode($content) . '</div>';
     }
     return $return;
 }
示例#26
0
 public static function flip_box($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('animation_style' => 'horizontal_flip_left', 'scroll_reveal' => '', 'class' => ''), $atts, 'flip_box');
     suAsset::addFile('css', 'flip-box.css', __FUNCTION__);
     $return = '
     <div' . su_scroll_reveal($atts) . ' class="flip-box-wrap' . $atts['class'] . '"><div class="su-flip-box ' . $atts['animation_style'] . '">
         ' . su_do_shortcode($content) . '<div style="clear:both;height:0"></div>
     </div></div>';
     return $return;
 }
示例#27
0
    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>';
    }
示例#28
0
 public static function dropcap($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('style' => 'default', 'size' => 3, 'scroll_reveal' => '', 'class' => ''), $atts, 'dropcap');
     if ($atts['style'] == 'simple') {
         $em = $atts['size'] * 0.5 + 2 . 'em';
     } else {
         $em = $atts['size'] * 0.5 . 'em';
     }
     suAsset::addFile('css', 'dropcap.css', __FUNCTION__);
     return '<span' . su_scroll_reveal($atts) . ' class="su-dropcap su-dropcap-style-' . $atts['style'] . su_ecssc($atts) . '" style="font-size:' . $em . '">' . su_do_shortcode($content) . '</span>';
 }
示例#29
0
 public static function user_content($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('message' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_USER_CONTENT_DEFAULT_MESSAGE'), 'color' => '#ffcc00', 'login_text' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_LOGIN'), 'login_url' => JRoute::_('index.php?option=com_users&view=login'), 'scroll_reveal' => '', 'class' => ''), $atts, 'user_content');
     $user = JFactory::getUser();
     if ($user->guest) {
         suAsset::addFile('css', 'user_content.css', __FUNCTION__);
         $login = '******' . esc_attr($atts['login_url']) . '">' . $atts['login_text'] . '</a>';
         return '<div' . su_scroll_reveal($atts) . ' class="su-user_content' . su_ecssc($atts) . '" style="background-color:' . su_color::lighten($atts['color']) . ';border-color:' . su_color::darken($atts['color'], '10%') . ';color:' . su_color::darken($atts['color'], '40%') . '">' . str_replace('%login%', $login, su_scattr($atts['message'])) . '</div>';
     } else {
         return su_do_shortcode($content);
     }
 }
示例#30
0
 public static function row($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('gutter' => '', 'divider' => 'no', 'divider_color' => '', 'margin_bottom' => 'yes', 'margin_top' => 'no', 'equal_height' => 'no', 'scroll_reveal' => '', 'class' => ''), $atts);
     $id = uniqid('surow');
     $divider = $atts['divider'] === 'yes' ? 'has-divider' : '';
     $margin_top = $atts['margin_top'] === 'yes' ? 'margin-top-yes' : '';
     $margin_bottom = $atts['margin_bottom'] === 'yes' ? 'margin-bottom-yes' : '';
     $gutter = $atts['gutter'] ? 'su-gutter-' . $atts['gutter'] : '';
     $classes = array('su-row', $margin_top, $margin_bottom, $divider, $gutter, su_ecssc($atts));
     $classes[] = $atts['equal_height'] === 'yes' ? 'su-row-match' : '';
     return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '">' . su_do_shortcode($content) . '</div>';
 }