예제 #1
0
function sp_accordion_addon($atts, $content)
{
    global $sppbAccordionStyle;
    extract(spAddonAtts(array("title" => '', "heading_selector" => 'h3', "title_fontsize" => '', "title_fontweight" => '', "title_text_color" => '', "title_margin_top" => '', "title_margin_bottom" => '', "style" => 'panel-default', "class" => ''), $atts));
    $sppbAccordionStyle = $style;
    $output = '<div class="sppb-addon sppb-addon-accordion ' . $class . '">';
    if ($title) {
        $title_style = '';
        if ($title_margin_top != '') {
            $title_style .= 'margin-top:' . (int) $title_margin_top . 'px;';
        }
        if ($title_margin_bottom != '') {
            $title_style .= 'margin-bottom:' . (int) $title_margin_bottom . 'px;';
        }
        if ($title_text_color) {
            $title_style .= 'color:' . $title_text_color . ';';
        }
        if ($title_fontsize) {
            $title_style .= 'font-size:' . $title_fontsize . 'px;line-height:' . $title_fontsize . 'px;';
        }
        if ($title_fontweight) {
            $title_style .= 'font-weight:' . $title_fontweight . ';';
        }
        $output .= '<' . $heading_selector . ' class="sppb-addon-title" style="' . $title_style . '">' . $title . '</' . $heading_selector . '>';
    }
    $output .= '<div class="sppb-addon-content">';
    $output .= '<div class="sppb-panel-group ' . $class . '">';
    $output .= AddonParser::spDoAddon($content);
    $output .= '</div>';
    $output .= '</div>';
    $output .= '</div>';
    $sppbAccordionStyle = '';
    return $output;
}
예제 #2
0
파일: site.php 프로젝트: naka211/myloyal
function sp_carousel_addon($atts, $content)
{
    extract(spAddonAtts(array('autoplay' => '', 'controllers' => '', 'arrows' => '', 'background' => '', 'color' => '', 'alignment' => '', "class" => ''), $atts));
    if ($background) {
        $background = 'background-color:' . $background . ';';
    }
    if ($color) {
        $color = 'color:' . $color . ';';
    }
    $carousel_autoplay = $autoplay ? 'data-sppb-ride="sppb-carousel"' : '';
    $output = '<div style="' . $background . $color . '" class="sppb-carousel sppb-slide ' . $class . '" ' . $carousel_autoplay . '>';
    if ($controllers) {
        $output .= '<ol class="sppb-carousel-indicators">';
        $output .= '</ol>';
    }
    $output .= '<div class="sppb-carousel-inner ' . $alignment . '">';
    $output .= AddonParser::spDoAddon($content);
    $output .= '</div>';
    if ($arrows) {
        $output .= '<a style="' . $color . '" class="sppb-carousel-arrow left sppb-carousel-control" role="button" data-slide="prev"><i class="fa fa-chevron-left"></i></a>';
        $output .= '<a style="' . $color . '" class="sppb-carousel-arrow right sppb-carousel-control" role="button" data-slide="next"><i class="fa fa-chevron-right"></i></a>';
    }
    $output .= '</div>';
    return $output;
}
예제 #3
0
파일: site.php 프로젝트: naka211/myloyal
function sp_clients_addon($atts, $content)
{
    global $sppbClientsParam;
    extract(spAddonAtts(array('title' => '', "heading_selector" => 'h3', "title_fontsize" => '', "title_fontweight" => '', "title_text_color" => '', "title_margin_top" => '', "title_margin_bottom" => '', 'count' => '', 'alignment' => '', "class" => ''), $atts));
    $sppbClientsParam['col'] = $count;
    $output = '<div class="sppb-addon sppb-addon-clients ' . $alignment . ' ' . $class . '">';
    if ($title) {
        $title_style = '';
        if ($title_margin_top != '') {
            $title_style .= 'margin-top:' . (int) $title_margin_top . 'px;';
        }
        if ($title_margin_bottom != '') {
            $title_style .= 'margin-bottom:' . (int) $title_margin_bottom . 'px;';
        }
        if ($title_text_color) {
            $title_style .= 'color:' . $title_text_color . ';';
        }
        if ($title_fontsize) {
            $title_style .= 'font-size:' . $title_fontsize . 'px;line-height:' . $title_fontsize . 'px;';
        }
        if ($title_fontweight) {
            $title_style .= 'font-weight:' . $title_fontweight . ';';
        }
        $output .= '<' . $heading_selector . ' class="sppb-addon-title" style="' . $title_style . '">' . $title . '</' . $heading_selector . '>';
    }
    $output .= '<div class="sppb-addon-content">';
    $output .= '<div class="sppb-row">';
    $output .= AddonParser::spDoAddon($content);
    $output .= '</div>';
    $output .= '</div>';
    $output .= '</div>';
    $sppbClientsParam = array();
    return $output;
}
예제 #4
0
파일: site.php 프로젝트: naka211/myloyal
function sp_gallery_addon($atts, $content)
{
    global $sppbGalleryParam;
    $doc = JFactory::getDocument();
    $doc->addStylesheet(JURI::base(true) . '/components/com_sppagebuilder/assets/css/prettyPhoto.css');
    $doc->addStylesheet(JURI::base(true) . '/components/com_sppagebuilder/assets/css/sppb-prettyPhoto.css');
    $doc->addScript(JURI::base(true) . '/components/com_sppagebuilder/assets/js/jquery.prettyPhoto.js');
    $doc->addScriptdeclaration('jQuery(function($){
		$(document).ready(function(){
    		$("a[rel^=\'prettyPhoto\']").prettyPhoto({
    			social_tools: false,
    			theme: "sppb_prettyphoto",
				horizontal_padding: 20,
				overlay_gallery: false
    		});
  		});
	})');
    extract(spAddonAtts(array('title' => '', "heading_selector" => 'h3', "title_fontsize" => '', "title_fontweight" => '', "title_text_color" => '', "title_margin_top" => '', "title_margin_bottom" => '', 'width' => '', 'height' => '', "class" => ''), $atts));
    if ($width == '') {
        $width = 200;
    }
    if ($height == '') {
        $height = 200;
    }
    $sppbGalleryParam['width'] = (int) $width;
    $sppbGalleryParam['height'] = (int) $height;
    $output = '<div class="sppb-addon sppb-addon-gallery ' . $class . '">';
    if ($title) {
        $title_style = '';
        if ($title_margin_top != '') {
            $title_style .= 'margin-top:' . (int) $title_margin_top . 'px;';
        }
        if ($title_margin_bottom != '') {
            $title_style .= 'margin-bottom:' . (int) $title_margin_bottom . 'px;';
        }
        if ($title_text_color) {
            $title_style .= 'color:' . $title_text_color . ';';
        }
        if ($title_fontsize) {
            $title_style .= 'font-size:' . $title_fontsize . 'px;line-height:' . $title_fontsize . 'px;';
        }
        if ($title_fontweight) {
            $title_style .= 'font-weight:' . $title_fontweight . ';';
        }
        $output .= '<' . $heading_selector . ' class="sppb-addon-title" style="' . $title_style . '">' . $title . '</' . $heading_selector . '>';
    }
    $output .= '<div class="sppb-addon-content">';
    $output .= '<ul class="sppb-gallery clearfix">';
    $output .= AddonParser::spDoAddon($content);
    $output .= '</ul>';
    $output .= '</div>';
    $output .= '</div>';
    $sppbGalleryParam = array();
    return $output;
}
예제 #5
0
파일: site.php 프로젝트: naka211/myloyal
function sp_button_group_addon($atts, $content)
{
    global $sppbButtonGroup_margin;
    extract(spAddonAtts(array('alignment' => '', 'margin' => '', 'class' => ''), $atts));
    $sppbButtonGroup_margin = $margin;
    $output = '<div class="sppb-addon sppb-addon-button-group ' . $alignment . ' ' . $class . '">';
    $output .= '<div class="sppb-addon-content" style="margin:-' . (int) $margin . 'px;">';
    $output .= AddonParser::spDoAddon($content);
    $output .= '</div>';
    $output .= '</div>';
    $sppbButtonGroup_margin = '';
    return $output;
}
예제 #6
0
function sp_testimonialpro_addon($atts, $content)
{
    extract(spAddonAtts(array('autoplay' => '', 'arrows' => '', "class" => ''), $atts));
    $carousel_autoplay = $autoplay ? 'data-sppb-ride="sppb-carousel"' : '';
    $output = '<div class="sppb-carousel sppb-testimonial-pro sppb-slide ' . $class . ' sppb-text-center" ' . $carousel_autoplay . '>';
    $output .= '<div class="sppb-carousel-inner">';
    $output .= AddonParser::spDoAddon($content);
    $output .= '</div>';
    if ($arrows) {
        $output .= '<a class="left sppb-carousel-control" role="button" data-slide="prev"><i class="fa fa-angle-left"></i></a>';
        $output .= '<a class="right sppb-carousel-control" role="button" data-slide="next"><i class="fa fa-angle-right"></i></a>';
    }
    $output .= '</div>';
    return $output;
}
예제 #7
0
파일: site.php 프로젝트: naka211/myloyal
function sp_tab_addon($atts, $content)
{
    global $sppbTabArray;
    extract(spAddonAtts(array("title" => '', "heading_selector" => 'h3', "title_fontsize" => '', "title_fontweight" => '', "title_text_color" => '', "title_margin_top" => '', "title_margin_bottom" => '', "style" => '', "class" => ''), $atts));
    AddonParser::spDoAddon($content);
    $output = '<div class="sppb-addon sppb-addon-tab ' . $class . '">';
    if ($title) {
        $title_style = '';
        if ($title_margin_top != '') {
            $title_style .= 'margin-top:' . (int) $title_margin_top . 'px;';
        }
        if ($title_margin_bottom != '') {
            $title_style .= 'margin-bottom:' . (int) $title_margin_bottom . 'px;';
        }
        if ($title_text_color) {
            $title_style .= 'color:' . $title_text_color . ';';
        }
        if ($title_fontsize) {
            $title_style .= 'font-size:' . $title_fontsize . 'px;line-height:' . $title_fontsize . 'px;';
        }
        if ($title_fontweight) {
            $title_style .= 'font-weight:' . $title_fontweight . ';';
        }
        $output .= '<' . $heading_selector . ' class="sppb-addon-title" style="' . $title_style . '">' . $title . '</' . $heading_selector . '>';
    }
    $output .= '<div class="sppb-addon-content sppb-tab">';
    //Tab Title
    $output .= '<ul class="sppb-nav sppb-nav-' . $style . '">';
    foreach ($sppbTabArray as $key => $tab) {
        $output .= '<li class="' . ($key == 0 ? "active" : "") . '"><a role="tab" data-toggle="sppb-tab">' . $tab['icon'] . ' ' . $tab['title'] . '</a></li>';
    }
    $output .= '</ul>';
    //Tab Contnet
    $output .= '<div class="sppb-tab-content">';
    foreach ($sppbTabArray as $key => $tab) {
        $output .= '<div class="sppb-tab-pane sppb-fade' . ($key == 0 ? " active in" : "") . '">' . $tab['content'] . '</div>';
    }
    $output .= '</div>';
    $output .= '</div>';
    $output .= '</div>';
    $sppbTabArray = array();
    return $output;
}
예제 #8
0
 public static function viewAddons($content, $fullwidth = 0)
 {
     if (is_array($content)) {
         $output = '';
         foreach ($content as $key => $row) {
             $fullscreen = 0;
             if (isset($settings->fullscreen) && $settings->fullscreen) {
                 $fullscreen = 1;
             }
             $settings = $row->settings;
             $row_class = isset($settings->class) ? $settings->class : '';
             $row_id = isset($settings->id) ? $settings->id : '';
             $style = 'style="';
             if (isset($settings->margin) && $settings->margin) {
                 $style .= 'margin:' . $settings->margin . ';';
             }
             if (isset($settings->padding) && $settings->padding) {
                 $style .= 'padding:' . $settings->padding . ';';
             }
             if (isset($settings->color) && $settings->color) {
                 $style .= 'color:' . $settings->color . ';';
             }
             if (isset($settings->background_color) && $settings->background_color) {
                 $style .= 'background-color:' . $settings->background_color . ';';
             }
             if (isset($settings->background_image) && $settings->background_image) {
                 $style .= 'background-image:url(' . JURI::base(true) . '/' . $settings->background_image . ');';
                 if (isset($settings->background_repeat) && $settings->background_repeat) {
                     $style .= 'background-repeat:' . $settings->background_repeat . ';';
                 }
                 if (isset($settings->background_size) && $settings->background_size) {
                     $style .= 'background-size:' . $settings->background_size . ';';
                 }
                 if (isset($settings->background_attachment) && $settings->background_attachment) {
                     $style .= 'background-attachment:' . $settings->background_attachment . ';';
                 }
                 if (isset($settings->background_position) && $settings->background_position) {
                     $style .= 'background-position:' . $settings->background_position . ';';
                 }
             }
             $style .= '"';
             if (isset($settings->fullscreen)) {
                 $fullscreen = $settings->fullscreen;
             }
             if (isset($settings->background_video) && $settings->background_video) {
                 $video = JPATH_ROOT . '/' . $settings->background_video;
                 $video_param = '';
                 if (isset($settings->background_image) && $settings->background_image) {
                     $video_param .= ' data-vide-image="' . JURI::base(true) . '/' . $settings->background_image . '"';
                 }
                 if (isset($settings->background_video_mp4) && $settings->background_video_mp4) {
                     $video_param .= ' data-vide-mp4="' . $settings->background_video_mp4 . '"';
                 }
                 if (isset($settings->background_video_ogv) && $settings->background_video_ogv) {
                     $video_param .= ' data-vide-ogv="' . $settings->background_video_ogv . '"';
                 }
                 $output .= '<section ' . ($row_id ? 'id="' . $row_id . '"' : '') . ' class="sppb-section ' . $row_class . '" ' . $style . $video_param . ' data-vide-bg>';
             } else {
                 $output .= '<section ' . ($row_id ? 'id="' . $row_id . '"' : '') . ' class="sppb-section ' . $row_class . '" ' . $style . '>';
             }
             if (!$fullscreen) {
                 if ($fullwidth) {
                     //$output .= '<div class="sppb-row">';
                     $output .= '<div class="sppb-container">';
                 }
             }
             //Title
             if (isset($settings->title) && $settings->title || isset($settings->subtitle) && $settings->subtitle) {
                 $title_position = '';
                 if (isset($settings->title_position) && $settings->title_position) {
                     $title_position = $settings->title_position;
                 }
                 if ($fullscreen) {
                     // Add container to full width row
                     $output .= '<div class="sppb-container">';
                 }
                 $output .= '<div class="sppb-section-title ' . $title_position . '">';
                 if ($settings->title) {
                     $heading_selector = 'h2';
                     $title_style = 'style="';
                     if (isset($settings->heading_selector)) {
                         if ($settings->heading_selector == '') {
                             $heading_selector = 'h2';
                         } else {
                             $heading_selector = $settings->heading_selector;
                         }
                     }
                     //Title Font Size
                     if (isset($settings->title_fontsize)) {
                         if ($settings->title_fontsize != '') {
                             $title_style .= 'font-size:' . $settings->title_fontsize . 'px;line-height: ' . $settings->title_fontsize . 'px;';
                         }
                     }
                     //Title Font Weight
                     if (isset($settings->title_fontweight)) {
                         if ($settings->title_fontweight != '') {
                             $title_style .= 'font-weight:' . $settings->title_fontweight . ';';
                         }
                     }
                     //Title Text Color
                     if (isset($settings->title_text_color)) {
                         if ($settings->title_text_color != '') {
                             $title_style .= 'color:' . $settings->title_text_color . ';';
                         }
                     }
                     //Title Margin Top
                     if (isset($settings->title_margin_top)) {
                         if ($settings->title_margin_top != '') {
                             $title_style .= 'margin-top:' . $settings->title_margin_top . 'px;';
                         }
                     }
                     //Title Margin Bottom
                     if (isset($settings->title_margin_bottom)) {
                         if ($settings->title_margin_bottom != '') {
                             $title_style .= 'margin-bottom:' . $settings->title_margin_bottom . 'px;';
                         }
                     }
                     $title_style .= '"';
                     $output .= '<' . $heading_selector . ' class="sppb-title-heading" ' . $title_style . '>' . $settings->title . '</' . $heading_selector . '>';
                 }
                 if ($settings->subtitle) {
                     $subtitle_fontsize = '';
                     //Style
                     if (isset($settings->title_fontsize)) {
                         if ($settings->title_fontsize != '') {
                             $subtitle_fontsize = 'style="font-size:' . $settings->subtitle_fontsize . 'px;"';
                         }
                     }
                     $output .= '<p class="sppb-title-subheading" ' . $subtitle_fontsize . '>' . $settings->subtitle . '</p>';
                 }
                 $output .= '</div>';
                 if ($fullscreen) {
                     // Add container to full width row
                     $output .= '</div>';
                 }
             }
             $output .= '<div class="sppb-row">';
             foreach ($row->attr as $key => $column) {
                 $col_settings = $column->settings;
                 $col_class = isset($col_settings->class) ? $col_settings->class : '';
                 $col_style = 'style="';
                 if (isset($col_settings->color) && $col_settings->color) {
                     $col_style .= 'color:' . $col_settings->color . ';';
                 }
                 if (isset($col_settings->background) && $col_settings->background) {
                     $col_style .= 'background-color:' . $col_settings->background . ';';
                 }
                 if (isset($col_settings->padding) && $col_settings->padding) {
                     $col_style .= 'padding:' . $col_settings->padding . ';';
                 }
                 $col_style .= '"';
                 $data_attr = '';
                 if (isset($col_settings->animation) && $col_settings->animation) {
                     $col_class .= ' sppb-wow ' . $col_settings->animation;
                 }
                 if (isset($col_settings->animationduration) && $col_settings->animationduration) {
                     $data_attr .= ' data-sppb-wow-duration="' . $col_settings->animationduration . 'ms"';
                 }
                 if (isset($col_settings->animationdelay) && $col_settings->animationdelay) {
                     $data_attr .= ' data-sppb-wow-delay="' . $col_settings->animationdelay . 'ms"';
                 }
                 $column_name = str_replace('column-parent ', '', $column->class_name);
                 $output .= '<div class="sppb-' . str_replace('active-column-parent', '', $column_name) . '">';
                 $output .= '<div class="sppb-addon-container' . $col_class . '" ' . $col_style . $data_attr . '>';
                 foreach ($column->attr as $key => $spcode) {
                     $output .= '[sp_' . $spcode->name;
                     if (!empty($spcode->atts)) {
                         foreach ($spcode->atts as $key => $value) {
                             $output .= ' ' . $key . '="' . htmlspecialchars($value) . '"';
                         }
                     }
                     $output .= ']';
                     if (is_array($spcode->scontent)) {
                         foreach ($spcode->scontent as $key => $spcode_inner) {
                             $output .= '[' . $spcode_inner->name;
                             foreach ($spcode_inner->atts as $key => $value) {
                                 $output .= ' ' . $key . '="' . htmlspecialchars($value) . '"';
                             }
                             $output .= ']';
                         }
                     } else {
                         $output .= $spcode->scontent;
                     }
                     $output .= '[/sp_' . $spcode->name . ']';
                 }
                 $output .= '</div>';
                 //end column
                 $output .= '</div>';
                 //end column
             }
             $output .= '</div>';
             if (!$fullscreen) {
                 if ($fullwidth) {
                     $output .= '</div>';
                     //end sppb-contaniner
                     //$output .= '</div>';//end spppb-row
                 }
             }
             $output .= '</section>';
         }
         return htmlspecialchars_decode(AddonParser::spDoAddon($output));
     } else {
         return '<p>' . $content . '</p>';
     }
 }