function sectionYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('background' => '#ffffff', 'image' => '', 'repeat' => 'repeat', 'parallax' => 'yes', 'speed' => '10', 'max_width' => '960', 'margin' => '0px 0px 0px 0px', 'padding' => '30px 0px 30px 0px', 'border' => 'none', 'color' => '#333333', 'text_align' => 'inharit', 'text_shadow' => 'none', 'url_youtube' => '', 'url_webm' => '', 'url_vimeo' => '', 'font_size' => '12px', 'class' => ''), $atts, 'section'); $id_section = uniqid('sec_') . rand() . time(); $id_video = uniqid('svb_sec_') . rand() . time(); $background = $atts['image'] ? sprintf('%s %s url(\'%s\') repeat %s', $atts['background'], '50% 0', yt_image_media($atts['image']), $atts['parallax'] === 'yes' ? 'fixed' : 'scroll') : $atts['background']; if ($atts['image'] && $atts['parallax'] === 'yes') { $atts['class'] .= ' yt-section-parallax'; } if ($atts['url_youtube']) { $atts['class'] .= ' yt-panel-clickable'; } JHtml::_('jquery.framework'); if ($atts['image'] && $atts['parallax'] === 'yes' or $atts['url_youtube']) { JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/section.js"); } JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/modernizr.video.js"); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/swfobject.js"); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/video_background.js"); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/css/section.css", 'text/css'); $atts['text_align'] = $atts['text_align'] != 'inherit' ? 'text-align:' . $atts['text_align'] . ';' : ''; $atts['text_shadow'] = $atts['text_shadow'] ? ' -webkit-text-shadow:' . $atts['text_shadow'] . ';-moz-text-shadow:' . $atts['text_shadow'] . ';text-shadow:' . $atts['text_shadow'] . ';' : ''; if ($atts['url_youtube'] != '') { return '<div class="yt-section-forcefullwidth"><div id="' . $id_section . '" class="yt-section-wrapper" data-id="' . $id_section . '"><div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div><div class="yt-section-overlay"></div><div class="yt-section-video" id="' . $id_video . '" data-id="' . $id_video . '" data-loop="true" data-muted="true" data-autoplay="true" data-ratio="1.77" data-overlay="" data-swfpath="" data-youtube="' . $atts['url_youtube'] . '"><div id="video_background_video_1" style="z-index: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: hidden;"></div></div></div></div></div>'; } else { if ($atts['url_webm'] != '') { return '<div class="yt-section-forcefullwidth"><div id="' . $id_section . '" class="yt-section-wrapper" data-id="' . $id_section . '"><div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />"), " ", $content)) . '</div><div class="yt-section-overlay"></div><div class="yt-section-video" id="' . $id_video . '" data-id="' . $id_video . '" data-loop="true" data-muted="true" data-autoplay="true" data-ratio="1.77" data-overlay="" data-swfpath="" data-webm="' . $atts['url_webm'] . '"><div id="video_background_video_1" style="z-index: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: hidden;"><video autoplay="" loop="" onended="this.play()"><source src="' . $atts['url_webm'] . '" type="video/webm"></video></div></div></div></div></div>'; } else { return '<div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div></div>'; } } }
function accordion_itemYTShortcode($atts, $content = null) { global $style_acc; extract(ytshortcode_atts(array("title" => '', "icon" => 'plus', 'background' => '#fff', "color_title" => '#333', "color_desc" => '#333', "width" => '100', "height" => '100%', "active" => '', "border_color" => '', "icon_color" => '#ccc', "icon_size" => '16', "background_active" => '#fff', "color_active" => '#4e9e31'), $atts)); $id = uniqid('yt_acc_item_') . rand() . time(); $css = ''; $icon_color = $icon_color ? 'color:' . $icon_color . ';' : ''; $icon_size_ = $icon_size ? 'font-size: ' . intval($icon_size) . 'px;' : ''; $style = $style_acc == 'border' ? 'border:1px solid ' . $border_color : ''; $acc_item = "<li class='yt-accordion-group' id='" . $id . "' style='" . $style . "'>"; $active = $active == "yes" ? 'enable' : 'disable'; $acc_item .= "<h3 class='accordion-heading " . $active . "'"; $acc_item .= " style='background:" . $background . "; box-shadow: 0px 1px 0px " . $background . " inset ; color:" . $color_title . ";font-size:" . $icon_size . "px'>"; if ($icon != '') { if (strpos($icon, 'icon:') !== false) { $acc_item .= "<i class='icon_accordion fa fa-" . trim(str_replace('icon:', '', $icon)) . "'></i> "; if ($icon_color or $icon_size) { $css .= '#' . $id . ' .icon_accordion {' . $icon_color . $icon_size_ . '}'; } } else { $acc_item .= '<img src="' . yt_image_media($icon) . '" style="width:' . $icon_size . 'px" alt="" /> '; } } $acc_item .= ' ' . $title . "</h3>"; $acc_item .= "<div class='yt-accordion-inner' style='background:" . $background . ";color:" . $color_desc . ";border-color:" . $color_title . "'>" . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . "</div>"; $acc_item .= "</li>"; $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); return $acc_item; }
function notificationYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('effect' => 1, 'button_text' => 'Open notification', 'button_class' => '', 'close_button' => '', 'title' => 'notification Title', 'title_background' => 'rgba(0,0,0,0.1)', 'title_color' => '#222222', 'background' => '#ffffff', 'color' => '#666666', 'border' => 'none', 'shadow' => '0 solid #000000', 'width' => '640px', 'height' => 'auto', 'overlay_background' => '#000', 'class' => ''), $atts, 'notification'); $id = uniqid('ytmodal_') . rand() . time(); $id_over = uniqid() . rand() . time(); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/notification/css/notification.css", 'text/css'); JHtml::_('jquery.framework'); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/notification/js/notification.js"); $css = ' #' . $id . ' .yt-modal-content-wrapper { height: ' . $atts['height'] . '; width: ' . $atts['width'] . '; background: ' . $atts['background'] . '; color: ' . $atts['color'] . '; border: ' . $atts['border'] . '; box-shadow: ' . $atts['shadow'] . '; } #' . $id . ' .yt-modal-title-wrapper { background: ' . $atts['title_background'] . '; } #' . $id . ' .yt-modal-title-wrapper h3 { color: ' . $atts['title_color'] . '; } '; $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); $overlay_style = 'style=" background-color: ' . $atts['overlay_background'] . ';"'; $close_button = $atts['close_button'] === 'yes' ? '<a href="javascript:void(0);" class="yt-modal-close"><i class="fa fa-remove"></i></a>' : ''; $return = '<div class="yt-modal-wrapper">'; $return .= '<a href="javascript:void(0);" class="yt-modal-trigger ' . $atts['button_class'] . '" data-modal="' . $id . '">' . $atts['button_text'] . '</a>'; $return .= '<div class="yt-modal yt-modal-effect-' . $atts['effect'] . '" id="' . $id . '"> <div class="yt-modal-content-wrapper">'; $return .= '<div class="yt-modal-title-wrapper">'; $return .= '<h3>' . $atts['title'] . '</h3>'; $return .= $close_button; $return .= '</div>'; $return .= '<div class="yt-content">'; $return .= parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)); $return .= '</div> </div> </div> <div class="yt-modal-overlay ' . $id . '" ' . $overlay_style . '></div>'; $return .= '</div>'; return $return; }
function masonryYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('id_masonry' => '', 'gutter' => null, 'rtl' => 'no'), $atts, 'yt_masonry'); global $intense_masonry_gutter; $intense_masonry_gutter = $atts['gutter']; if (empty($intense_masonry_gutter)) { $intense_masonry_gutter = '0'; } if (empty($id_masonry)) { $id_masonry = rand(); } // intense_add_script( 'packery' ); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/masonry/js/masonry.js"); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/masonry/css/masonry.css", 'text/css'); $init_script = '<script> function intenseInitMasonry() { var $ = jQuery; var $container = $(".intense.masonry"); $container.packery({ itemSelector: ".item", gutter: 0, isOriginLeft: ' . ($atts['rtl'] == "no" ? 'false' : 'true') . ' }); return $container; } jQuery(function($){ $(window).load(function() { setTimeout(intenseInitMasonry, 250); intenseInitMasonry(); }); });</script>'; return $init_script . '<div id="' . $id_masonry . '" class="intense masonry' . (!empty($class) ? ' ' . $class : '') . '" style="position: relative;">' . parse_shortcode(str_replace(array("<br/>", "<br />"), " ", $content)) . '</div><div class="clearfix"></div>'; }
function blockquoteYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("title" => '', "align" => 'none', 'border' => '#666', 'color' => '#fff', 'width' => 'auto'), $atts)); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/blockquote/css/blockquote.css"); $source_title = $title != '' ? "<small>" . $title . "</small>" : ''; return '<blockquote class="yt-clearfix yt-boxquote pull-' . $align . '" style="width:' . $width . '%;border-color:' . $border . ';color:' . $color . '">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . $source_title . '</blockquote>'; }
function animationYTShortcode($atts, $content = null) { $atts = ytshortcode_atts(array('type' => 'bounceIn', 'duration' => 1, 'delay' => 0, 'inline_block' => 'no', 'class' => ''), $atts, 'animation'); $id = uniqid('yta') . rand() . time(); $inline = $atts['inline_block'] === '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 $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); // Add CSS file in head JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/assets/css/animate.css"); JHtml::_('jquery.framework'); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.appear.js"); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/animation/js/animate.js"); // Output HTML $output = '<div id="' . $id . '" class="yt-clearfix yt-animate " data-animation="' . $atts['type'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div>'; return $output; }
function columnsYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("grid" => 'no'), $atts)); $show_grid = $grid == 'yes' ? 'show-grid' : ''; JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/columns/css/columns.css"); return '<div class="yt-clearfix yt-show-grid ' . $show_grid . ' ">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>'; }
function frameYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('style' => 'default', 'align' => 'left', 'class' => ''), $atts, 'yt_frame'); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/frame/css/frame.css", 'text/css'); JHtml::script("plugins/system/ytshortcodes/shortcodes/frame/js/frame.js"); return '<span class="yt-frame yt-frame-align-' . $atts['align'] . ' yt-frame-style-' . $atts['style'] . '"><span class="yt-frame-inner">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</span></span><div class="clear clearfix"></div>'; }
function tabsYTShortcode($atts, $content = null) { global $tab_array; global $index_tab; extract(ytshortcode_atts(array("style" => '', "type" => 'basic', "width" => '', "align" => '', "height" => ''), $atts)); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/tabs/css/tabs.css"); parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)); $tabs_style = $style != '' ? "style-" . $style : ""; $num = count($tab_array); $tab = "<p><div class='yt-tabs " . $type . " " . $tabs_style . " pull-" . $align . "' style='width:" . $width . "; height:" . $height . "'><ul class='nav-tabs clearfix'>"; for ($i = 0; $i < $num; $i++) { $active = $i == 0 ? 'active' : ''; $tab_id = str_replace(' ', '-', $tab_array[$i]["title"]); $tab .= '<li class="' . $active . '"><a href="#' . $tab_id . $index_tab . '" class="'; //$icon = ($tab_array[$i]["icon"] !='fa fa-' ? '<i class="'.$tab_array[$i]["icon"].'"></i><br/>' : ''); $tab .= $active . '" >' . $tab_array[$i]["icon"] . '' . $tab_array[$i]["title"] . '</a></li>'; } $tab .= "</ul>"; $tab .= "<div class='tab-content'>"; for ($i = 0; $i < $num; $i++) { $active = $i == 0 ? 'active' : ''; $tab_id = str_replace(' ', '-', $tab_array[$i]["title"]); $tab = $tab . '<div id="' . $tab_id . $index_tab . '" class="clearfix '; $tab = $tab . $active . '" >' . $tab_array[$i]["content"] . '</div>'; } $index_tab++; $tab .= "</div></div></p>"; $tab_array = array(); return $tab; }
function countdownYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('count_date' => '2020/12/25', 'count_time' => '', 'count_size' => '32', 'count_color' => '', 'background' => '#FFFFFF', 'text_align' => 'default', 'text_size' => '14', 'text_color' => '#666666', 'align' => 'left', 'padding' => '', 'margin' => '', 'border' => '0px solid #DDD', 'radius' => '', 'divider' => 'none', 'divider_color' => 'rgba(100,100,100,.1)', 'class' => ''), $atts, 'countdown'); $id = uniqid('yt_countdown_') . rand() . time(); $css = ''; $js = ''; $divider_style = ''; if ($atts['divider'] == 'colon') { $divider_style = '#' . $id . ' .yt-countdown-content .yt-cd-timer > span:after { font-size: ' . round($atts['count_size'] / 2) . 'px;line-height: ' . round($atts['count_size'] / 2) . 'px; color: ' . $atts['divider_color'] . ';}'; } if ($atts['divider'] == 'vertical_line' || $atts['divider'] == 'horizontal_line') { $divider_style = '#' . $id . ' .yt-countdown-content .yt-cd-timer > span:after {background-color: ' . $atts['divider_color'] . ';}'; } else { $divider_style = '#' . $id . ' .yt-countdown-content .yt-cd-timer > span:after { font-size: ' . $atts['count_size'] . 'px;line-height: ' . $atts['count_size'] . 'px; color: ' . $atts['divider_color'] . ';}'; } if ($atts['margin'] or $atts['padding'] or $atts['radius'] or $atts['border'] or $atts['background']) { $margin = $atts['margin'] ? 'margin: ' . $atts['margin'] . ';' : ''; $padding = $atts['padding'] ? 'padding: ' . $atts['padding'] . ';' : ''; $radius = $atts['radius'] ? 'border-radius: ' . $atts['radius'] . ';' : ''; $border = $atts['border'] ? 'border: ' . $atts['border'] . ';' : ''; $background = $atts['background'] ? 'background-color: ' . $atts['background'] . ';' : ''; $css .= '#' . $id . ' {' . $margin . $padding . $radius . $border . $background . '}'; } $count_color = $atts['count_color'] ? 'color: ' . $atts['count_color'] . ';' : ''; $css .= '#' . $id . ' .yt-cd-timer > span span[class*="text"] { color: ' . $atts['text_color'] . '; font-size: ' . $atts['text_size'] . 'px; } #' . $id . ' .yt-cd-timer span > span { font-size: ' . $atts['count_size'] . 'px; line-height: ' . $atts['count_size'] . 'px; ' . $count_color . '} ' . $divider_style . ' '; $message = ''; $countdown = $atts['count_date']; $countdown .= $atts['count_time'] ? ' ' . $atts['count_time'] : ''; if (isset($content)) { $message = '.on("finish.countdown", function(event) { $(this).parent() .addClass("disabled") .html("' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '"); })'; } $js .= ' jQuery(document).ready(function ($) { $("#' . $id . ' .yt-cd-timer").countdown("' . $countdown . '").on("update.countdown", function(event) { var $this = $(this).html(event.strftime( "<span class=\'yt-cd-day\'><span class=\'yt-cd-day-data\'>%-D</span> <span class=\'yt-cd-day-text\'>DAY</span></span> " + "<span class=\'yt-cd-hour\'><span class=\'yt-cd-hour-data\'>%H</span> <span class=\'yt-cd-hour-text\'>HOUR</span></span> " + "<span class=\'yt-cd-minute\'><span class=\'yt-cd-minute-data\'>%M</span> <span class=\'yt-cd-minute-text\'>MIN</span></span> " + "<span class=\'yt-cd-second\'><span class=\'yt-cd-second-data\'>%S</span> <span class=\'yt-cd-second-text\'>SEC</span></span>")); })' . $message . '; }); '; JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/countdown/css/countdown.css", 'text/css'); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/countdown/js/jquery.countdown.js"); $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); $doc->addScriptDeclaration($js); return '<div id="' . $id . '" class="yt-countdown-wrapper clearfix yt-countdown-' . $atts['align'] . ' yt-cd-divider-' . $atts['divider'] . ' yt-countdown-text-' . $atts['text_align'] . '"> <div class="yt-countdown-content"> <div class="yt-cd-timer"></div> </div> </div>'; }
function galleryYTShortcode($atts, $content = null) { global $gwidth, $gheight, $gcolumns, $galleryArray, $cation_gallery, $border_gallery, $padding_item, $id_uniq, $hover_gallery; $gwidth = 100; $gheight = 100; JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.prettyPhoto.js"); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/gallery/css/gallery.css"); extract(ytshortcode_atts(array("title" => '', "width" => 100, "height" => 100, "columns" => 3, "align" => 'center', "caption" => '0', "border" => '0px solid #4e9e41', "border_size" => '0px', "border_color" => '#4e9e41', "border_style" => 'solid', "padding" => '0px', "hover" => '1'), $atts)); //$border_gallery = ($border_size =='0px') ? '' : "border:".$border_size." ".$border_style." #4e9e41;"; $border_gallery = "border: " . $border . ""; switch ($caption) { case '1': $cation_gallery = 'caption_gallery_1'; break; case '2': $cation_gallery = 'caption_gallery_2'; break; default: $cation_gallery = ''; break; } $hover_gallery = $hover; $padding_item = $padding == '0px' ? '' : "padding:" . $padding . ""; $id_uniq = uniqid("yt") . rand() . time(); $gwidth = $width; $gheight = $height; $gcolumns = $columns; $gallery = ''; $galleryArray = array(); parse_shortcode($content); $tags = array(); $tags = ''; foreach ($galleryArray as $key => $item) { $tags .= ',' . strtolower($item['tag']); } $tags = ltrim($tags, ','); $tags = explode(',', $tags); $newtags = array(); foreach ($tags as $tag) { $newtags[] = trim($tag); } $tags = array_values(array_unique($newtags)); if ($align != '') { $align = 'pull-' . $align; } else { $align = ''; } $gallery .= '<div class="yt-gallery clearfix ' . $align . '" style="margin:0 auto">'; $gallery .= '<div class = "yt-gallery-tabbed" style="display:table; margin-bottom:10px;">'; $gallery .= '<ul class="tabnav">'; $gallery .= '<li class="showall active ' . $id_uniq . '"><span >Show all</span></li>'; foreach ($tags as $tag) { $gallery .= '<li id=' . trim($tag) . $id_uniq . ' class="' . $id_uniq . '"><span>' . ucfirst(trim($tag)) . '</span></li>'; } $gallery .= '</ul>'; $gallery .= '</div>'; $gallery .= '<ul class="gallery-list clearfix">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '</ul>'; $gallery .= '</div>'; return $gallery; }
function BoxYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('style' => 'default', 'title' => 'Box Title', 'title_color' => '#FFFFFF', 'box_color' => '#333333', 'color' => null, 'radius' => '', 'class' => ''), $atts, 'box'); // Initioal Variables $id = uniqid('yt_box_') . rand() . time(); $radius = ''; $css = ''; // 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 . ' .yt-box-title { background-color:' . $atts['box_color'] . ';color:' . $atts['title_color'] . ';}'; // Add CSS in head $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/box/css/box.css"); // Output HTML $return = '<div id="' . $id . '" class="yt-clearfix yt-box yt-box-style-' . $atts['style'] . '"> <div class="yt-box-title">' . $atts['title'] . ' </div> <div class="yt-box-content yt-clearfix">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '</div> </div>'; return $return; }
function toggle_boxYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("width" => '', "align" => '', "height" => ''), $atts)); $toggle_box = "<ul class='yt-toggle-box pull-" . $align . "' style='width:" . $width . "' >"; $toggle_box = $toggle_box . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)); $toggle_box = $toggle_box . "</ul>"; JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/toggle_box/css/toggle_box.css"); return $toggle_box; }
function pricing_tablesYTShortcode($atts, $content = null) { global $pcolumns, $type; extract(ytshortcode_atts(array("columns" => '3', "width" => '100%', "style" => '', "type" => ''), $atts)); $pcolumns = $columns; $class = 'yt-pricing block col-' . $columns . ' pricing-' . $style; JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/pricing_tables/css/pricingtable.css", 'text/css', "screen"); return '<div class="' . $class . '" style="width:' . $width . ';" >' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>'; }
function highlightYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('background' => '#ddff99', 'bg' => null, 'color' => '#000000', 'size' => '14', 'class' => ''), $atts, 'highlight'); if ($atts['bg'] !== null) { $atts['background'] = $atts['bg']; } JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/highlight/css/highlight.css", 'text/css'); return '<span class="yt-highlight' . trim($atts['class']) . '" style="background:' . $atts['background'] . ';color:' . $atts['color'] . '; font-size:' . $atts['size'] . 'px; line-height:' . $atts['size'] . 'px"> ' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . ' </span>'; }
function skillsYTShortcode($atts, $content = null) { global $no_number; extract(ytshortcode_atts(array("width" => '', 'no_number' => ''), $atts)); $skills = '<div class="yt-skills" style="width:' . $width . '">'; $skills .= parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)); $skills .= '</div>'; JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/skills/css/skills.css"); return $skills; }
function blurYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("blur" => '1', "hover_blur" => '0.1'), $atts)); $class = uniqid('yt_blur_') . rand() . time(); $css = '.' . $class . ' {-webkit-filter: blur(' . $blur . 'px); -moz-filter: blur(' . $blur . 'px); -o-filter: blur(' . $blur . 'px); -ms-filter: blur(' . $blur . 'px); filter: blur(' . $blur . 'px);} .' . $class . ':hover{-webkit-filter: blur(' . $hover_blur . 'px); -moz-filter: blur(' . $hover_blur . 'px); -o-filter: blur(' . $hover_blur . 'px); -ms-filter: blur(' . $hover_blur . 'px); filter: blur(' . $hover_blur . 'px);}'; $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); return '<div class="yt-clearfix ' . $class . '" > ' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div> '; }
function content_slider_itemYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array('class' => '', 'src' => '', 'caption' => 'no'), $atts)); $image = $src != '' ? '<img src=' . JURI::base() . $src . ' alt=' . uniqid("title_") . rand() . time() . '>' : ''; if ($caption == "yes") { return '<div class="yt-content-slide yt-clearfix yt-content-wrap' . $class . '"> ' . $image . ' <p class="caption">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</p></div>'; } else { return '<div class="yt-content-slide yt-clearfix yt-content-wrap' . $class . '"> ' . $image . ' ' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>'; } }
function list_styleYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("type" => 'check', "color" => ''), $atts)); if ($color != '') { global $list_color; $list_color = $color; } $color = $color != '' ? 'color:' . $color : ""; JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/list_style/css/list_style.css"); return '<ul class="yt-list type-' . $type . '" style="' . $color . '">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</ul>'; }
function flip_boxYTShortcode($atts, $content = null) { $atts = ytshortcode_atts(array('animation_style' => 'horizontal_flip_left', 'width' => '100', 'class' => '', 'radius' => ''), $atts, 'flip_box'); // Add style JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/flip_box/css/flip-box.css", 'text/css', "screen"); $return = ' <div class="flip-box-wrap' . $atts['class'] . '" style="width:' . $atts['width'] . '%; border-radius:' . $atts['radius'] . 'px"><div class="yt-flip-box ' . $atts['animation_style'] . '"> ' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '<div style="clear:both;height:0"></div> </div></div>'; return $return; }
function message_boxYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("title" => '', "type" => 'error', "close" => "Yes"), $atts)); $message_box = '<div class="alert alert-' . $type . ' fade in">'; $message_box .= $close == "Yes" || $close == "yes" ? '<button data-dismiss="alert" class="close" type="button"><i class="fa fa-times"></i></button>' : ""; $message_title = !empty($title) && $title != null ? '<h3 class="alert-heading">' . $title . '</h3>' : ""; $message_box = $message_box . $message_title; $message_box = $message_box . '<div class="alert-content">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>'; $message_box = $message_box . '</div>'; return $message_box; }
function points_itemYTShortcode($atts, $content = null) { global $no_number; //set these positions of interest points according to your product image extract(ytshortcode_atts(array("x" => '', "y" => '', "position" => ''), $atts)); $points_item = "<li class='yt-single-point' style='top:" . $y . "%; left: " . $x . "%; list-style:none'>"; $points_item .= "<a class='yt-img-replace' href='#0'>More</a>"; $points_item .= "<div class='yt-more-info yt-" . $position . "'>"; $points_item .= parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)); $points_item .= "<a href='#0' class='yt-close-info yt-img-replace'>Close</a></div> </li>"; return $points_item; }
public function onContentPrepare($context, &$article, &$params, $page = 0) { $param = new stdClass(); $param->api_key = $this->params->get('google_map_api_key'); $param->width = $this->params->get('google_map_width', '400'); $param->height = $this->params->get('google_map_height', '400'); $param->zoom = $this->params->get('google_map_zoom', '15'); $is_mod = 1; $plugin = new Plugin_googleMaps($article, $param, $is_mod); $article->text = parse_shortcode($article->text); return true; }
function url_underlineYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("href" => '#', "border" => '', "background" => '#fff', "color" => '#000', "font_size" => '14px', "align" => 'none', "padding" => '0px', "color_hover" => ''), $atts)); $id = uniqid() . rand() . time(); $css = '.url_underline:hover{text-decoration:underline; border-bottom:none !important; color:' . $color . '} .url_underline.pull-none{ margin:0 auto; display:inline-block} .url_underline.pull-left{ margin:0 0 0 0px} .url_underline.pull-right{ margin:0 0px} '; $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); return "<a class='url_underline pull-" . $align . "' id='" . $id . "' href='" . $href . "' style='border-bottom:" . $border . "; background:" . $background . "; padding-bottom:" . $padding . "; color:" . $color . "; font-size:" . $font_size . ";'> " . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . " </a> "; }
function content_slider_itemYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array('class' => '', 'src' => '', 'caption' => 'no', 'link' => ''), $atts)); $image = $src != '' ? '<img src=' . JURI::base() . $src . ' alt=' . uniqid("title_") . rand() . time() . '>' : 'plugins/system/ytshortcodes/assets/images/URL_IMAGES.png'; if ($link != '') { $image = '<a href="' . $link . '" title="" target="brank">' . $image . '</a>'; } if ($caption == "yes") { return '<div class="yt-content-slide yt-clearfix yt-content-wrap' . $class . '"> ' . $image . ' <div class="caption">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div></div>'; } else { return '<div class="yt-content-slide yt-clearfix yt-content-wrap' . $class . '"> ' . $image . ' ' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>'; } }
function tabs_itemYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array("title" => '', "icon" => ''), $atts)); global $tab_array; if ($icon != '') { if (strpos($icon, 'icon:') !== false) { $icon = "<i class='fa fa-" . trim(str_replace('icon:', '', $icon)) . "'></i> "; } else { $icon = '<img src="' . yt_image_media($icon) . '" style="width:16px" alt="" /> '; } } $tab_array[] = array("title" => $title, "icon" => $icon, "content" => parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content))); }
function flip_backYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('background' => '#4e9e41', 'color' => '#fff', 'border' => 'none', 'shadow' => 'none', 'radius' => '0px', 'text_align' => 'center', 'padding' => '15px', 'class' => ''), $atts, 'flip_back'); return '<div class="back-flip_box ' . trim($atts['class']) . '" style="background-color:' . $atts['background'] . '; color:' . $atts['color'] . '; border:' . $atts['border'] . '; box-shadow:' . $atts['shadow'] . '; border-radius:' . $atts['radius'] . '; text-align:' . $atts['text_align'] . '; padding:' . $atts['padding'] . '; ">' . parse_shortcode(str_replace(array("<br/>", "<br />"), " ", $content)) . '</div>'; }
function memberYTShortcode($atts = null, $content = null) { $atts = ytshortcode_atts(array('style' => '1', 'background' => '#ffffff', 'color' => '#333333', 'shadow' => '', 'border' => '1px solid #cccccc', 'radius' => '0', 'text_align' => 'left', 'photo' => '', 'name' => 'John Doe', 'role' => 'Designer', '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' => '', 'class' => ''), $atts, 'yt_member'); $icons = array(); $id = uniqid('ytm') . rand() . time(); $css = ''; $box_shadow = $atts['shadow'] ? 'box-shadow:' . $atts['shadow'] . '; -webkit-box-shadow:' . $atts['shadow'] . ';' : ''; $radius = $atts['radius'] ? 'border-radius:' . $atts['radius'] . ';' : ''; $css .= '#' . $id . '.yt-member {background-color:' . $atts['background'] . '; color:' . $atts['color'] . '; border:' . $atts['border'] . ';' . $radius . $box_shadow . '}'; for ($i = 1; $i <= 6; $i++) { if (!$atts['icon_' . $i] || !$atts['icon_' . $i . '_url']) { continue; } if (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="' . yt_image_media($atts['icon_' . $i]) . '" width="16" height="16" alt="" />'; } $icons[] = '<a href="' . $atts['icon_' . $i . '_url'] . '" title="' . $atts['icon_' . $i . '_title'] . '" class="yt-memeber-icon yt-m-' . trim(str_replace('icon:', '', $atts['icon_' . $i])) . '" target="_blank" style="text-align:center"> ' . $icon . ' </a>'; } $icons = count($icons) ? '<div class="yt-member-icons" style="text-align:' . $atts['text_align'] . ';"><div class="yt-member-ic">' . implode('', $icons) . '</div></div>' : ''; $multi_photo = array(); $multi_photo = explode(',', $atts['photo'], 2); $member_photo = ''; $member_photo = '<a href="' . $atts['url'] . '" title="' . $atts['name'] . '"><img src="' . yt_image_media($multi_photo[0]) . '" alt="" /></a>'; if (isset($multi_photo[1])) { $member_photo .= '<a href="' . $atts['url'] . '" title="' . $atts['name'] . '"><img src="' . yt_image_media($multi_photo[1]) . '" alt="" /></a>'; } $title = '<span class="yt-member-name">' . $atts['name'] . '</span><span class="yt-member-role">' . $atts['role'] . '</span>'; // Adding asse $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/member/css/membar.css", 'text/css'); // HTML Layout $return = '<div id="' . $id . '" class="yt-member yt-member-style-' . $atts['style'] . '" data-url="' . $atts['url'] . '">'; $return .= '<div class="yt-member-photo">' . $member_photo; if ($atts['style'] == '2' or $atts['style'] == '4') { $return .= $icons; } $return .= '</div>'; $return .= '<div class="yt-member-info" style="text-align:' . $atts['text_align'] . '">'; $return .= $title; $return .= '<div class="yt-member-desc yt-content-wrap">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div>'; $return .= '</div>'; if ($atts['style'] != '2' and $atts['style'] != '4') { $return .= $icons; } $return .= '</div>'; return $return; }
function content_sliderYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array('style' => 'default', 'transitionin' => 'fadeIn', 'transitionout' => 'fadeOut', 'arrows' => 'yes', 'arrow_position' => 'arrow-default', 'pagination' => 'no', 'autoplay' => 'yes', 'autoheight' => 'yes', 'delay' => 4, 'speed' => 0.6, 'hoverpause' => 'no', 'lazyload' => 'no', 'loop' => 'yes', 'margin' => 10, 'class' => ''), $atts)); $id = uniqid('ytcs') . rand() . time(); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/assets/css/animate.css", 'text/css', "screen"); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/assets/css/owl.carousel.css", 'text/css', "screen"); JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/content_slider/css/content_slider.css"); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/owl.carousel.min.js"); JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/content_slider/js/content_slider.js"); if ($transitionin === 'slide') { $transitionin = 'false'; } return '<div id="' . $id . '" class="yt-content-slider owl-theme yt-content-slider-style-' . $style . ' ' . $arrow_position . '" data-transitionin="' . $transitionin . '" data-transitionout="' . $transitionout . '" data-autoplay="' . $autoplay . '" data-autoheight="' . $autoheight . '" data-delay="' . $delay . '" data-speed="' . $speed . '" data-margin="' . $margin . '" data-arrows="' . $arrows . '" data-pagination="' . $pagination . '" data-lazyload="' . $lazyload . '" data-loop="' . $loop . '" data-hoverpause="' . $hoverpause . '">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>'; }
function promotion_boxYTShortcode($atts, $content = null) { extract(ytshortcode_atts(array('type' => '', 'title' => 'This is Call To Action Title', 'title_color' => '#ffffff', 'button_text' => 'Click Here', 'align' => 'default', 'button_link' => '#', 'target' => '_self', 'promotion_color' => '#ddd', 'promotion_background' => '#2D89EF', 'promotion_radius' => '0px', 'border' => '1', 'border_color' => '', 'button_color' => '#fff', 'button_background' => '#165194', 'button_background_hover' => '', 'arrow_height' => '52px', 'width' => '', 'button_radius' => '0px', 'desc' => '', 'class' => ''), $atts)); $id = uniqid('yt_') . rand() . time(); $css = ''; $padding = ''; $title = $title ? "<h3>" . $title . "</h3>" : ''; //$target = ( $target === 'yes' || $target === 'blank' ) ? ' target="_blank"' : ''; $bdt_hbg = $button_background_hover ? $button_background_hover : ''; $width = $type == "arrow-box" ? "100%" : $width; if (intval($promotion_radius) > 40 && intval($button_radius) > 40) { $padding = "padding: 20px 20px 20px 40px;"; } if ($type == "border") { $background = 'border:' . $promotion_background . ' ' . $border . 'px solid; background:#fff;'; $css .= '#' . $id . ' .border{' . $background . '}'; } else { if ($type == "background-border") { $background = 'border:' . $border_color . ' ' . $border . 'px solid; background:' . $promotion_background . ';'; $css .= '#' . $id . ' .background-border{ ' . $background . '}'; } else { $background = 'background-color:' . $promotion_background; $css .= '#' . $id . ' { ' . $background . '}'; } } $css .= '#' . $id . ' {' . $padding . '; border-radius:' . $promotion_radius . '; margin-bottom:15px; ' . $background . ' }'; $css .= '#' . $id . ' a.cta-dbtn { border-radius:' . $button_radius . '; color:' . $button_color . '; background:' . $button_background . ';}'; $css .= '#' . $id . ' a.cta-dbtn:hover { background:' . $bdt_hbg . ';}'; $css .= '#' . $id . ' .cta-content > h3 { color: ' . $title_color . ';}'; $css .= '#' . $id . ' .cta-content div { color:' . $promotion_color . ';}'; $css .= '#' . $id . ' .cta-content h3 { color:' . $promotion_color . ';}'; if ($type == "arrow-box") { $css .= '@media only screen and (min-width: 980px){'; $css .= '#' . $id . '.arrow-box {position: relative;padding-right:' . $arrow_height . ';}'; $css .= '#' . $id . '.arrow-box:before{content: "";width: 0px;height: 0px;position: absolute;border-style: solid;border-color:transparent transparent transparent #FFF ;border-width: ' . $arrow_height . '; top:0px;left: 0;z-index: 1;}'; $css .= '#' . $id . '.arrow-box:after{content: ""; width: 0px; height: 0px;position: absolute; border-style: solid;border-color: #FFF #FFF #FFF transparent ;border-width: ' . $arrow_height . ' ; top:0px;right: 0;z-index: 1;}'; $css .= '#' . $id . '.arrow-box .cta-content {margin:0 ' . $arrow_height . '}'; $css .= '#' . $id . '.arrow-box a.cta-dbtn {margin-right:' . $arrow_height . '}'; $css .= '}'; } JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/promotion_box/css/promotion.css", 'text/css', "screen"); $doc = JFactory::getDocument(); $doc->addStyleDeclaration($css); $return = '<div style="width:' . $width . ';"><section id="' . $id . '" class="promotion cta-align-' . $align . ' ' . $type . '">'; $return .= "<a class='cta-dbtn hidden-phone' target='" . $target . "' href='" . $button_link . "'>" . $button_text . "</a>"; $return .= "<div class='cta-content'>" . $title . "<div>" . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div></div>'; $return .= "<a class='cta-dbtn visible-phone' target='" . $target . "' href='" . $button_link . "'>" . $button_text . "</a>"; $return .= '<div class="clear"></div></section></div>'; return $return; }