Ejemplo n.º 1
0
    }
}
$blog_types = array(__('Standard', 'swift-framework-plugin') => "standard", __('Timeline', 'swift-framework-plugin') => "timeline", __('Bold', 'swift-framework-plugin') => "bold", __('Mini', 'swift-framework-plugin') => "mini", __('Masonry', 'swift-framework-plugin') => "masonry");
if (spb_get_theme_name() == "atelier") {
    $blog_types = array(__('Standard', 'swift-framework-plugin') => "standard", __('Bold', 'swift-framework-plugin') => "bold", __('Mini', 'swift-framework-plugin') => "mini", __('Masonry', 'swift-framework-plugin') => "masonry");
}
if (spb_get_theme_name() == "uplift") {
    $blog_types = array(__('Standard', 'swift-framework-plugin') => "standard", __('Timeline', 'swift-framework-plugin') => "timeline", __('Masonry', 'swift-framework-plugin') => "masonry");
}
$blog_types = apply_filters('spb_blog_display_types', $blog_types);
/* PARAMS
   ================================================== */
$params = array(array("type" => "textfield", "heading" => __("Widget title", 'swift-framework-plugin'), "param_name" => "title", "value" => "", "description" => __("Heading text. Leave it empty if not needed.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Blog type", 'swift-framework-plugin'), "param_name" => "blog_type", "value" => $blog_types, "std" => "masonry", "description" => __("Select the display type for the blog.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Masonry gutters", 'swift-framework-plugin'), "param_name" => "gutters", "value" => array(__('Yes', 'swift-framework-plugin') => "yes", __('No', 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "required" => array("blog_type", "=", "masonry"), "description" => __("Select if you'd like spacing between the items, or not (Masonry type only).", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Masonry Columns", 'swift-framework-plugin'), "param_name" => "columns", "value" => array("5", "4", "3", "2", "1"), "std" => "4", "required" => array("blog_type", "=", "masonry"), "description" => __("How many blog masonry columns to display. NOTE: Only for the masonry blog type, and not when fullwidth mode is selected, as this is adaptive.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Full Width", 'swift-framework-plugin'), "param_name" => "fullwidth", "std" => "no", "value" => array(__('Yes', 'swift-framework-plugin') => "yes", __('No', 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "description" => __("Select if you'd like the asset to be full width (edge to edge). NOTE: only possible on pages without sidebars.", 'swift-framework-plugin')), array("type" => "textfield", "class" => "", "heading" => __("Number of items", 'swift-framework-plugin'), "param_name" => "item_count", "value" => "5", "description" => __("The number of blog items to show per page.", 'swift-framework-plugin')), array("type" => "select-multiple", "heading" => __("Blog category", 'swift-framework-plugin'), "param_name" => "category", "value" => sf_get_category_list('category'), "description" => __("Choose the category for the blog items.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Posts offset", 'swift-framework-plugin'), "param_name" => "offset", "value" => "0", "description" => __("The offset for the start of the posts that are displayed, e.g. enter 5 here to start from the 5th post.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Order by", 'swift-framework-plugin'), "param_name" => "order_by", "std" => "date", "value" => array(__('None', 'swift-framework-plugin') => "none", __('ID', 'swift-framework-plugin') => "ID", __('Title', 'swift-framework-plugin') => "title", __('Date', 'swift-framework-plugin') => "date", __('Random', 'swift-framework-plugin') => "rand"), "description" => __("Select how you'd like the items to be ordered.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Order", 'swift-framework-plugin'), "param_name" => "order", "std" => "DESC", "value" => array(__("Ascending", 'swift-framework-plugin') => "ASC", __("Descending", 'swift-framework-plugin') => "DESC"), "description" => __("Select if you'd like the items to be ordered in ascending or descending order.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Show title text", 'swift-framework-plugin'), "param_name" => "show_title", "std" => "yes", "value" => array(__("Yes", 'swift-framework-plugin') => "yes", __("No", 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "description" => __("Show the item title text.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Show item excerpt", 'swift-framework-plugin'), "param_name" => "show_excerpt", "std" => "yes", "value" => array(__("Yes", 'swift-framework-plugin') => "yes", __("No", 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "required" => array("blog_type", "!=", "bold"), "description" => __("Show the item excerpt text.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Show item details", 'swift-framework-plugin'), "param_name" => "show_details", "std" => "yes", "value" => array(__("Yes", 'swift-framework-plugin') => "yes", __("No", 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "description" => __("Show the item details.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Excerpt Length", 'swift-framework-plugin'), "param_name" => "excerpt_length", "value" => "20", "required" => array("blog_type", "!=", "bold"), "description" => __("The length of the excerpt for the posts.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Content Output", 'swift-framework-plugin'), "param_name" => "content_output", "value" => array(__("Excerpt", 'swift-framework-plugin') => "excerpt", __("Full Content", 'swift-framework-plugin') => "full_content"), "required" => array("blog_type", "!=", "bold"), "description" => __("Choose whether to display the excerpt or the full content for the post. Full content is not available for the masonry or bold view types.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Show read more link", 'swift-framework-plugin'), "param_name" => "show_read_more", "value" => array(__("Yes", 'swift-framework-plugin') => "yes", __("No", 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "description" => __("Show a read more link below the excerpt. NOTE: Not used in Bold or Masonry types.", 'swift-framework-plugin')), array("type" => "section_tab", "param_name" => "social_options_tab", "heading" => __("Social Integration", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Social Integration", 'swift-framework-plugin'), "param_name" => "social_integration", "std" => "no", "value" => array(__("Yes", 'swift-framework-plugin') => "yes", __("No", 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "description" => __("Enable social integration within the blog posts (only on Masonry blog types). NOTE: This will only integrate Twitter/Instagram posts to the first page of your blog, and won't be included in any further pages, or content loaded via infinite scroll or AJAX. It therefore works best when you show a high number of blog posts on a single page, and pagination MUST be set to none.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Twitter Username", 'swift-framework-plugin'), "param_name" => "twitter_username", "value" => "", "required" => array("social_integration", "=", "yes"), "description" => __("Enter your twitter username here to include tweets in the blog grid. Ensure you have the Twitter oAuth plugin installed and your details added.", 'swift-framework-plugin')), array("type" => "textfield", "class" => "", "heading" => __("Number of Instagram items", 'swift-framework-plugin'), "param_name" => "insta_item_count", "value" => "", "required" => array("social_integration", "=", "yes"), "description" => __("The number of instagram items to show. If you haven't already, you'll need to set up your Instagram account in Swift Framework > Instagram Auth.", 'swift-framework-plugin')), array("type" => "textfield", "class" => "", "heading" => __("Number of Tweets", 'swift-framework-plugin'), "param_name" => "tweet_item_count", "value" => "", "required" => array("social_integration", "=", "yes"), "description" => __("The number of tweets to show.", 'swift-framework-plugin')), array("type" => "section_tab", "param_name" => "aux_options_tab", "heading" => __("Aux", 'swift-framework-plugin')), $params[] = array("type" => "buttonset", "heading" => __("Filter", 'swift-framework-plugin'), "param_name" => "blog_filter", "std" => "yes", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "buttonset_on" => "yes", "description" => __("Show the blog category filter above the items.", 'swift-framework-plugin')));
if (spb_get_theme_name() == "uplift") {
    $params[] = array("type" => "buttonset", "heading" => __("Basic Filter", 'swift-framework-plugin'), "param_name" => "basic_blog_filter", "std" => "no", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "buttonset_on" => "yes", "required" => array("blog_filter", "=", "yes"), "description" => __("Set the blog filter to be basic, simply a category filter.", 'swift-framework-plugin'));
}
$params[] = array("type" => "dropdown", "heading" => __("Pagination", 'swift-framework-plugin'), "param_name" => "pagination", "value" => array(__("Infinite scroll", 'swift-framework-plugin') => "infinite-scroll", __("Load more (AJAX)", 'swift-framework-plugin') => "load-more", __("Standard", 'swift-framework-plugin') => "standard", __("None", 'swift-framework-plugin') => "none"), "description" => __("Show pagination.", 'swift-framework-plugin'));
if (spb_get_theme_name() == "atelier") {
    $params[] = array("type" => "section_tab", "param_name" => "styling_options_tab", "heading" => __("Styling", 'swift-framework-plugin'));
    $params[] = array("type" => "buttonset", "heading" => __("Alt Styling", 'swift-framework-plugin'), "param_name" => "alt_styling", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "buttonset_on" => "yes", "description" => __("Select 'Yes' if you'd like the standard blog item content to be boxed.", 'swift-framework-plugin'));
}
if (spb_get_theme_name() == "joyn") {
    $params[] = array("type" => "section_tab", "param_name" => "styling_options_tab", "heading" => __("Styling", 'swift-framework-plugin'));
    $params[] = array("type" => "dropdown", "heading" => __("Thumbnail Hover Style", 'swift-framework-plugin'), "param_name" => "hover_style", "value" => array(__('Default', 'swift-framework-plugin') => "default", __('Standard', 'swift-framework-plugin') => "gallery-standard", __('Gallery Alt', 'swift-framework-plugin') => "gallery-alt-one"), "description" => __("Choose the thumbnail hover style for the asset. If set to 'Default', then this uses the thumbnail type set in the theme options.", 'swift-framework-plugin'));
}
$params[] = array("type" => "section_tab", "param_name" => "advanced_options_tab", "heading" => __("Advanced", 'swift-framework-plugin'));
$params[] = array("type" => "dropdown", "heading" => __("Post Type Override", 'swift-framework-plugin'), "param_name" => "post_type", "value" => spb_get_post_types(), "description" => __("If you'd like to override the post type for which the content is of this asset is made up of, then you can select it here.", 'swift-framework-plugin'));
$params[] = array("type" => "textfield", "heading" => __("Extra class", 'swift-framework-plugin'), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin'));
/* SHORTCODE MAP
   ================================================== */
SPBMap::map('spb_blog', array("name" => __("Blog", 'swift-framework-plugin'), "base" => "spb_blog", "class" => "spb_blog spb_tab_media", "icon" => "icon-blog", "params" => $params));
Ejemplo n.º 2
0
        $title = $el_class = $text_color = $image_url = $image_object = $width = $el_position = '';
        extract(shortcode_atts(array('title' => '', 'icon' => '', 'character' => '', 'image' => '', 'svg_icon' => '', 'animate_svg' => '', 'box_type' => '', 'box_icon_type' => '', 'icon_color' => '', 'icon_bg_color' => '', 'text_color' => '', 'bg_color' => '', 'flip_text_color' => '', 'flip_bg_color' => '', 'animated_box_style' => '', 'animated_box_rounded' => '', 'animation' => '', 'animation_delay' => '', 'link' => '', 'target' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
        $output = '';
        if ($image != "") {
            $img_url = wp_get_attachment_url($image, 'full');
            $image_object = sf_aq_resize($img_url, 70, 70, true, false);
            $image_url = $image_object[0];
        }
        $icon_box_output = do_shortcode('[sf_iconbox icon="' . $icon . '" character="' . $character . '" image="' . $image_url . '" svg="' . $svg_icon . '" animate_svg="' . $animate_svg . '" type="' . $box_type . '" icon_type="' . $box_icon_type . '" title="' . $title . '" animation="' . $animation . '" animation_delay="' . $animation_delay . '" bg_color="' . $bg_color . '" text_color="' . $text_color . '" icon_color="' . $icon_color . '" icon_bg_color="' . $icon_bg_color . '" flip_text_color="' . $flip_text_color . '" flip_bg_color="' . $flip_bg_color . '" animated_box_style="' . $animated_box_style . '" animated_box_rounded="' . $animated_box_rounded . '" link="' . $link . '" target="' . $target . '"]' . $content . '[/sf_iconbox]');
        $el_class = $this->getExtraClass($el_class);
        $width = spb_translateColumnWidthToSpan($width);
        $output .= "\n\t" . '<div class="spb_icon_box ' . $width . $el_class . '">';
        $output .= "\n\t\t" . '<div class="spb-asset-content">';
        $output .= "\n\t\t" . $icon_box_output;
        $output .= "\n\t\t" . '</div>';
        $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
        $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
        global $sf_include_carousel;
        $sf_include_carousel = true;
        return $output;
    }
}
$target_arr = array(__("Same window", 'swift-framework-plugin') => "_self", __("New window", 'swift-framework-plugin') => "_blank");
$icon_box_icon_types = array('' => '', __("Icon", 'swift-framework-plugin') => "icon", __("Character", 'swift-framework-plugin') => "character", __("Image", 'swift-framework-plugin') => "image");
$icon_box_types = array(__('Standard', 'swift-framework-plugin') => "standard", __('Standard with Title Icon', 'swift-framework-plugin') => "standard-title", __('Bold', 'swift-framework-plugin') => "bold", __('Left Icon', 'swift-framework-plugin') => "left-icon", __('Left Icon Alt', 'swift-framework-plugin') => "left-icon-alt", __('Boxed One', 'swift-framework-plugin') => "boxed-one", __('Boxed Two', 'swift-framework-plugin') => "boxed-two", __('Boxed Three', 'swift-framework-plugin') => "boxed-three", __('Boxed Four', 'swift-framework-plugin') => "boxed-four", __('Animated', 'swift-framework-plugin') => "animated");
if (spb_get_theme_name() == "atelier") {
    $icon_box_types = array(__('Standard', 'swift-framework-plugin') => "standard", __('Standard with Title Icon', 'swift-framework-plugin') => "standard-title", __('Left Icon', 'swift-framework-plugin') => "left-icon", __('Left Icon Alt', 'swift-framework-plugin') => "left-icon-alt", __('Boxed One', 'swift-framework-plugin') => "boxed-one", __('Boxed Two', 'swift-framework-plugin') => "boxed-two", __('Boxed Three', 'swift-framework-plugin') => "boxed-three", __('Boxed Four', 'swift-framework-plugin') => "boxed-four", __('Animated', 'swift-framework-plugin') => "animated");
}
$icon_box_icon_types = apply_filters('spb_icon_box_icon_types', $icon_box_icon_types);
$icon_box_types = apply_filters('spb_icon_box_types', $icon_box_types);
SPBMap::map('spb_icon_box', array("name" => __("Icon Box", 'swift-framework-plugin'), "base" => "spb_icon_box", "class" => "spb_tab_ui", "icon" => "icon-icon-box", "wrapper_class" => "clearfix", "params" => array(array("type" => "textfield", "heading" => __("Icon Box title", 'swift-framework-plugin'), "param_name" => "title", "value" => "", "description" => __("Icon Box title text.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Icon Box Type", 'swift-framework-plugin'), "param_name" => "box_type", "value" => $icon_box_types, "description" => __("Choose the type of icon box.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Icon Box Icon Type", 'swift-framework-plugin'), "param_name" => "box_icon_type", "value" => $icon_box_icon_types, "description" => __("Choose the type of icon box.", 'swift-framework-plugin')), array("type" => "icon-picker", "heading" => __("Icon Box Icon", 'swift-framework-plugin'), "param_name" => "icon", "value" => "", "required" => array("box_icon_type", "=", "icon"), "description" => ''), array("type" => "textfield", "heading" => __("Icon Box Character", 'swift-framework-plugin'), "param_name" => "character", "value" => "", "required" => array("box_icon_type", "=", "character"), "description" => __("Instead of an icon, you can optionally provide a single letter/digit here. NOTE: This will override the icon selection.", 'swift-framework-plugin')), array("type" => "attach_image", "heading" => __("Icon Box Image", 'swift-framework-plugin'), "param_name" => "image", "value" => "", "required" => array("box_icon_type", "=", "image"), "description" => __("Instead of an icon, you can optionally upload an image here. This will be resized to 70px x 70px. NOTE: This will override the icon selection.", 'swift-framework-plugin')), array("type" => "icon-picker", "heading" => __("Icon Box SVG", 'swift-framework-plugin'), "param_name" => "svg_icon", "data" => spb_get_svg_icons(), "value" => "", "required" => array("box_icon_type", "=", "svg"), "description" => __("You can select an SVG icon here.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Animate SVG Icon", 'swift-framework-plugin'), "param_name" => "animate_svg", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "required" => array("box_icon_type", "=", "svg"), "description" => __("If you are using an outline svg icon, then you can enable/disable the drawing animation on appear here.", 'swift-framework-plugin')), array("type" => "textarea_html", "holder" => "div", "class" => "", "heading" => __("Text", 'swift-framework-plugin'), "param_name" => "content", "value" => __("click the edit button to change this text.", 'swift-framework-plugin'), "description" => __("Enter your content.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Icon Box Link", 'swift-framework-plugin'), "param_name" => "link", "value" => "", "description" => __("If you would like, you can set a link here for the icon and title to link through to.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Link Target", 'swift-framework-plugin'), "param_name" => "target", "value" => $target_arr), array("type" => "section", "param_name" => "ib_animation_options", "heading" => __("Animation Options", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Intro Animation", 'swift-framework-plugin'), "param_name" => "animation", "value" => spb_animations_list(), "description" => __("Select an intro animation for the icon box that will show it when it appears within the viewport.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Animation Delay", 'swift-framework-plugin'), "param_name" => "animation_delay", "value" => "0", "description" => __("If you wish to add a delay to the animation, then you can set it here (ms).", 'swift-framework-plugin')), array("type" => "section_tab", "param_name" => "design_tab", "heading" => __("Design Options", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Icon color", 'swift-framework-plugin'), "param_name" => "icon_color", "value" => "", "description" => __("Set the icon colour for the icon box, or leave blank to use the default colours.", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Icon Background color", 'swift-framework-plugin'), "param_name" => "icon_bg_color", "value" => "", "description" => __("Set the icon background colour for the icon box, or leave blank to use the default colours.", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Text color", 'swift-framework-plugin'), "param_name" => "text_color", "value" => "", "description" => __("Set the text colour for the icon box, or leave blank to use the default colours.", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Background color", 'swift-framework-plugin'), "param_name" => "bg_color", "value" => "", "description" => __("Set the background colour for the icon box, or leave blank to use the default colours.", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Flip Background color", 'swift-framework-plugin'), "param_name" => "flip_bg_color", "value" => "", "required" => array("box_type", "or", "animated,animated-alt"), "description" => __("Set the background colour for the back of the animated icon box, or leave blank to use the default colours.", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Flip Text color", 'swift-framework-plugin'), "param_name" => "flip_text_color", "value" => "", "required" => array("box_type", "or", "animated,animated-alt"), "description" => __("Set the text colour for the back of the animated icon box, or leave blank to use the default colours.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Animated Box Style", 'swift-framework-plugin'), "param_name" => "animated_box_style", "value" => array(__('Stroke', 'swift-framework-plugin') => "stroke", __('Coloured', 'swift-framework-plugin') => "coloured"), "std" => 'coloured', "required" => array("box_type", "=", "animated-alt"), "description" => __("If you are using the animated icon box option, you can choose the style here.", 'swift-framework-plugin')), array("type" => "buttonset", "heading" => __("Animated Box Rounded", 'swift-framework-plugin'), "param_name" => "animated_box_rounded", "value" => array(__('Yes', 'swift-framework-plugin') => "yes", __('No', 'swift-framework-plugin') => "no"), "std" => 'yes', "required" => array("box_type", "=", "animated-alt"), "description" => __("If you are using the animated icon box option, you can choose to set it to be rounded here.", 'swift-framework-plugin')), array("type" => "section_tab", "param_name" => "misc_tab", "heading" => __("Misc Options", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Extra class", 'swift-framework-plugin'), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin')))));
Ejemplo n.º 3
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $gallery_id = $output = $items = $hover_style = $masonry_gallery = $main_slider = $thumb_slider = $el_position = $gallery_images = $thumb_images = '';
     extract(shortcode_atts(array('title' => '', 'gallery_id' => '', 'display_type' => '', 'columns' => '', 'fullwidth' => '', 'gutters' => '', 'image_size' => '', 'show_thumbs' => '', 'show_captions' => '', 'autoplay' => 'no', 'hover_style' => 'default', 'enable_lightbox' => 'yes', 'slider_transition' => 'slide', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $search_icon = apply_filters('sf_search_icon', '<i class="ss-search"></i>');
     $view_icon_svg = apply_filters('sf_view_icon_svg', '');
     /* SIDEBAR CONFIG
        ================================================== */
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /* GALLERY
        ================================================== */
     $gallery_args = array('post_type' => 'galleries', 'post_status' => 'publish', 'p' => $gallery_id);
     $gallery_query = new WP_Query($gallery_args);
     while ($gallery_query->have_posts()) {
         $gallery_query->the_post();
         if ($display_type == "masonry") {
             /* WRAP VARIABLE CONFIG
                ================================================== */
             $list_class = "";
             if ($fullwidth == "yes") {
                 $list_class .= ' portfolio-full-width';
             }
             if ($gutters == "no") {
                 $list_class .= ' no-gutters';
             } else {
                 $list_class .= ' gutters';
             }
             // Thumb Type
             if ($hover_style == "default" && function_exists('sf_get_thumb_type')) {
                 $list_class .= ' ' . sf_get_thumb_type();
             } else {
                 $list_class .= ' thumbnail-' . $hover_style;
             }
             /* COLUMN VARIABLE CONFIG
                ================================================== */
             $item_class = "";
             $gallery_image_size = "gallery-image";
             if ($columns == "1") {
                 $item_class = "col-sm-12 ";
                 $gallery_image_size = "full";
             } else {
                 if ($columns == "2") {
                     $item_class = "col-sm-6 ";
                     $gallery_image_size = "gallery-image";
                 } else {
                     if ($columns == "3") {
                         $item_class = "col-sm-4 ";
                         $gallery_image_size = "gallery-image";
                     } else {
                         if ($columns == "4") {
                             $item_class = "col-sm-3 ";
                             $gallery_image_size = "thumb-image";
                         } else {
                             if ($columns == "5") {
                                 $item_class = "col-sm-sf-5 ";
                                 $gallery_image_size = "thumb-image";
                             }
                         }
                     }
                 }
             }
             if ($columns == "5" && $width != "1/1") {
                 $gallery_image_size = "thumb-square";
             }
             if ($image_size != "") {
                 $gallery_image_size = $image_size;
             }
             $gallery_images = rwmb_meta('sf_gallery_images', 'type=image&size=' . $gallery_image_size);
             $masonry_gallery .= '<div class="masonry-gallery filterable-items ' . $list_class . '">' . "\n";
             $lightbox_id = $gallery_id . '-' . rand();
             foreach ($gallery_images as $image) {
                 $masonry_gallery .= '<div class="gallery-image ' . $item_class . '">';
                 $masonry_gallery .= '<figure class="animated-overlay overlay-style">';
                 if ($enable_lightbox == "yes") {
                     $masonry_gallery .= '<a href="' . $image['full_url'] . '" class="lightbox" data-rel="ilightbox[' . $lightbox_id . ']" data-caption="' . $image['caption'] . '"></a>';
                 }
                 $masonry_gallery .= '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt="' . $image['alt'] . '" /></a>';
                 if ($show_captions == "yes") {
                     $masonry_gallery .= '<figcaption><div class="thumb-info">';
                     if ($image['caption'] != "") {
                         $masonry_gallery .= '<h3>' . $image['caption'] . '</h3>';
                     } else {
                         $masonry_gallery .= '<h3>' . $image['title'] . '</h3>';
                     }
                     $masonry_gallery .= '</figcaption>' . "\n";
                 } else {
                     if ($enable_lightbox == "yes") {
                         $masonry_gallery .= '<figcaption><div class="thumb-info thumb-info-alt">';
                         if ($view_icon_svg != "") {
                             $masonry_gallery .= $view_icon_svg;
                         } else {
                             $masonry_gallery .= $search_icon;
                         }
                         $masonry_gallery .= '</figcaption>' . "\n";
                     }
                 }
                 $masonry_gallery .= '</figure>' . "\n";
                 $masonry_gallery .= '</div>' . "\n";
             }
             $masonry_gallery .= '</div>' . "\n";
             $items .= $masonry_gallery;
         } else {
             if (spb_get_theme_name() == "atelier" || spb_get_theme_name() == "uplift" || spb_get_theme_name() == "nota") {
                 $gallery_images = rwmb_meta('sf_gallery_images', 'type=image&size=thumb-square');
                 $main_slider .= '<div class="flexslider gallery-slider" data-transition="' . $slider_transition . '" data-autoplay="' . $autoplay . '" data-thumbs="' . $show_thumbs . '"><ul class="slides">' . "\n";
                 $lightbox_id = $gallery_id . '-' . rand();
                 foreach ($gallery_images as $image) {
                     if ($show_thumbs == "yes") {
                         $main_slider .= '<li data-thumb="' . $image["url"] . '">';
                     } else {
                         $main_slider .= '<li>';
                     }
                     if ($enable_lightbox == "yes") {
                         $main_slider .= "<a href='{$image['full_url']}' class='lightbox zoom' data-rel='ilightbox[galleryid-" . $lightbox_id . "]' data-caption='{$image['caption']}'><i class='fa-search-plus'></i></a>";
                     }
                     if (isset($image['image_srcset'])) {
                         $main_slider .= $image['image_srcset'];
                     } else {
                         $main_slider .= "<img src='{$image['full_url']}' alt='{$image['alt']}' />";
                     }
                     if ($show_captions == "yes" && $image['caption'] != "") {
                         $main_slider .= '<p class="flex-caption">' . $image['caption'] . '</p>';
                     }
                     $main_slider .= "</li>" . "\n";
                 }
                 $main_slider .= '</ul></div>' . "\n";
                 $items .= $main_slider;
             } else {
                 $gallery_images = rwmb_meta('sf_gallery_images', 'type=image&size=blog-image');
                 $thumb_images = rwmb_meta('sf_gallery_images', 'type=image&size=thumb-square');
                 $main_slider .= '<div class="flexslider gallery-slider" data-transition="' . $slider_transition . '" data-autoplay="' . $autoplay . '"><ul class="slides">' . "\n";
                 $lightbox_id = $gallery_id . '-' . rand();
                 foreach ($gallery_images as $image) {
                     $main_slider .= "<li>";
                     if ($enable_lightbox == "yes") {
                         $main_slider .= "<a href='{$image['full_url']}' class='lightbox' data-rel='ilightbox[galleryid-" . $lightbox_id . "]' data-caption='{$image['caption']}'>";
                     }
                     if (isset($image['image_srcset'])) {
                         $main_slider .= $image['image_srcset'];
                     } else {
                         $main_slider .= "<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' />";
                     }
                     if ($enable_lightbox == "yes") {
                         $main_slider .= "</a>";
                     }
                     if ($show_captions == "yes" && $image['caption'] != "") {
                         $main_slider .= '<p class="flex-caption">' . $image['caption'] . '</p>';
                     }
                     $main_slider .= "</li>" . "\n";
                 }
                 $main_slider .= '</ul></div>' . "\n";
                 if ($show_thumbs == "yes") {
                     $thumb_slider .= '<div class="flexslider gallery-nav"><ul class="slides">' . "\n";
                     foreach ($thumb_images as $image) {
                         $thumb_slider .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>" . "\n";
                     }
                     $thumb_slider .= '</ul></div>' . "\n";
                 }
                 $items .= $main_slider;
                 $items .= $thumb_slider;
             }
         }
     }
     wp_reset_postdata();
     /* PAGE BUILDER OUTPUT
        ================================================== */
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $fullwidth = true;
     } else {
         $fullwidth = false;
     }
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_gallery_widget gallery-' . $display_type . ' spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '', $fullwidth) : '';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth) {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_has_gallery;
     $sf_has_gallery = true;
     return $output;
 }
Ejemplo n.º 4
0
        }
        // PAGINATION
        if ($pagination == "yes") {
            $items .= '<div class="pagination-wrap">';
            $items .= pagenavi($testimonials);
            $items .= '</div>';
        }
        $el_class = $this->getExtraClass($el_class);
        $width = spb_translateColumnWidthToSpan($width);
        $el_class .= ' testimonial';
        $output .= "\n\t" . '<div class="spb_content_element ' . $width . $el_class . '">';
        $output .= "\n\t\t" . '<div class="spb-asset-content testimonial-wrap ' . $text_size . '">';
        $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '') : '';
        $output .= "\n\t\t\t" . $items;
        $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
        $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
        $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
        return $output;
    }
}
/* PARAMS
   ================================================== */
$params = array(array("type" => "textfield", "heading" => __("Widget title", 'swift-framework-plugin'), "param_name" => "title", "value" => "", "description" => __("Heading text. Leave it empty if not needed.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Text size", 'swift-framework-plugin'), "param_name" => "text_size", "value" => array(__('Normal', 'swift-framework-plugin') => "normal", __('Large', 'swift-framework-plugin') => "large"), "description" => __("Choose the size of the text.", 'swift-framework-plugin')), array("type" => "textfield", "class" => "", "heading" => __("Number of items", 'swift-framework-plugin'), "param_name" => "item_count", "value" => "6", "description" => __("The number of testimonials to show per page. Leave blank to show ALL testimonials.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Testimonials Order", 'swift-framework-plugin'), "param_name" => "order", "value" => array(__('Random', 'swift-framework-plugin') => "rand", __('Latest', 'swift-framework-plugin') => "date"), "description" => __("Choose the order of the testimonials.", 'swift-framework-plugin')), array("type" => "select-multiple", "heading" => __("Testimonials category", 'swift-framework-plugin'), "param_name" => "category", "value" => sf_get_category_list('testimonials-category'), "description" => __("Choose the category for the testimonials.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Pagination", 'swift-framework-plugin'), "param_name" => "pagination", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "description" => __("Show testimonial pagination (1/1 width element only).", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Testimonials page link", 'swift-framework-plugin'), "param_name" => "page_link", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "description" => __("Include a link to the testimonials page (which you must choose in the theme options).", 'swift-framework-plugin')));
if (spb_get_theme_name() == "uplift") {
    $params[] = array("type" => "dropdown", "heading" => __("Display Type", 'swift-framework-plugin'), "param_name" => "display_type", "value" => array(__('Standard', 'swift-framework-plugin') => "standard", __('Masonry', 'swift-framework-plugin') => "masonry"), "std" => 'standard', "description" => __("Choose the display type for the asset.", 'swift-framework-plugin'));
    $params[] = array("type" => "dropdown", "heading" => __("Column count", 'swift-framework-plugin'), "param_name" => "columns", "value" => array("5", "4", "3", "2", "1"), "required" => array("display_type", "=", "masonry"), "std" => '3', "description" => __("How many columns to display.", 'swift-framework-plugin'));
}
$params[] = array("type" => "textfield", "heading" => __("Extra class", 'swift-framework-plugin'), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin'));
/* SPBMap
   ================================================== */
SPBMap::map('spb_testimonial', array("name" => __("Testimonials", 'swift-framework-plugin'), "base" => "spb_testimonial", "class" => "", "icon" => "icon-testimonials", "wrapper_class" => "clearfix", "controls" => "full", "params" => $params));
Ejemplo n.º 5
0
 protected function content($atts, $content = null)
 {
     global $sf_options;
     $title = $width = $wrap_class = $title_class = $excerpt_length = $item_class = $offset = $el_class = $output = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_columns' => '3', 'display_type' => 'standard', 'carousel' => 'no', "item_count" => '4', "category" => '', "offset" => 0, "posts_order" => 'ASC', "excerpt_length" => '20', 'fullwidth' => 'no', 'gutters' => 'yes', 'button_enabled' => 'no', 'pagination' => 'no', 'post_type' => 'post', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $view_all_icon = apply_filters('sf_view_all_icon', '<i class="ss-layergroup"></i>');
     $pagination_view_icon = apply_filters('sf_pagination_view_icon', '<i class="sf-icon-quickview"></i>');
     /* CATEGORY SLUG MODIFICATION
        ================================================== */
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     /* SIDEBAR CONFIG
        ================================================== */
     global $sf_sidebar_config;
     $sidebars = '';
     if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sf_sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /* BLOG QUERY SETUP
        ================================================== */
     global $post, $wp_query;
     if (get_query_var('paged')) {
         $paged = get_query_var('paged');
     } elseif (get_query_var('page')) {
         $paged = get_query_var('page');
     } else {
         $paged = 1;
     }
     $recent_post_args = array('post_type' => $post_type, 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $recent_posts = new WP_Query($recent_post_args);
     $count = 0;
     $image_width = 270;
     $image_height = 270;
     if ($item_columns == "1") {
         $image_width = 720;
         $image_height = 720;
         $item_class = 'col-sm-12';
     } else {
         if ($item_columns == "2") {
             $image_width = 540;
             $image_height = 540;
             $item_class = 'col-sm-6';
         } else {
             if ($item_columns == "3") {
                 $image_width = 360;
                 $image_height = 360;
                 $item_class = 'col-sm-4';
             } else {
                 if ($item_columns == "5") {
                     $image_width = 360;
                     $image_height = 360;
                     $item_class = 'col-sm-sf-5';
                 } else {
                     $item_class = 'col-sm-3';
                 }
             }
         }
     }
     if ($display_type == "standard-row") {
         $item_class = 'col-sm-12';
     }
     $list_class = 'posts-type-' . $display_type;
     if ($display_type == "standard" || $display_type == "standard-row" && $carousel == "no") {
         $list_class .= ' row';
     }
     if ($gutters == "no") {
         $list_class .= ' no-gutters';
     }
     if ($display_type == "showcase") {
         $carousel = "yes";
         $list_class .= ' staged-carousel';
         if ($pagination == "yes") {
             $wrap_class = "has-pagination ";
         }
         $title_class = "center-title";
         if ($sidebars == "no-sidebars") {
             $fullwidth = "yes";
         }
     }
     if ($display_type == "list") {
         $carousel = "no";
     }
     if ($carousel == "yes") {
         global $sf_carouselID;
         if ($sf_carouselID == "") {
             $sf_carouselID = 1;
         } else {
             $sf_carouselID++;
         }
         $item_class = 'carousel-item';
     }
     if ($display_type == "bold") {
         $item_class .= ' vr-standard';
     }
     if ($carousel == "yes") {
         $items .= '<div class="posts-carousel carousel-wrap">';
         if ($display_type == "showcase") {
             $items .= spb_carousel_arrows(true);
         }
         $items .= '<div id="carousel-' . $sf_carouselID . '" class="recent-posts carousel-items ' . $list_class . ' clearfix" data-columns="' . $item_columns . '" data-auto="false" data-pagination="' . $pagination . '">';
     } else {
         $items .= '<div class="recent-posts ' . $list_class . ' clearfix">';
     }
     while ($recent_posts->have_posts()) {
         $recent_posts->the_post();
         $count++;
         if ($count > $item_count) {
             break;
         }
         $items .= sf_get_recent_post_item($post, $display_type, $excerpt_length, $item_class);
     }
     wp_reset_postdata();
     if ($carousel == "yes") {
         $items .= '</div></div>';
     } else {
         $items .= '</div>';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $has_button = false;
     $page_button = $title_wrap_class = $view_all = "";
     $blog_page = __($sf_options['blog_page'], 'swift-framework-plugin');
     if ($category_slug != "") {
         $has_button = true;
         $category_id = get_cat_ID($category_slug);
         $category_link = get_category_link($category_id);
         $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . esc_url($category_link) . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL ARTICLES", 'swift-framework-plugin') . '</span></a>';
         $view_all = '<a class="view-all hidden" href="' . esc_url($category_link) . '">' . $pagination_view_icon . '</a>';
     } else {
         if ($blog_page != "") {
             $has_button = true;
             $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . get_permalink($blog_page) . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL ARTICLES", 'swift-framework-plugin') . '</span></a>';
             $view_all = '<a class="view-all hidden" href="' . get_permalink($blog_page) . '">' . $pagination_view_icon . '</a>';
         }
     }
     if ($has_button && $button_enabled == "yes") {
         $title_wrap_class .= 'has-button ';
     }
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $title_wrap_class .= 'container ';
     }
     $output .= "\n\t" . '<div class="spb_recent_posts_widget spb_content_element ' . $wrap_class . $width . $el_class . '">';
     if ($display_type == "showcase" && $pagination == "yes") {
         $output .= "\n\t\t" . $view_all;
     }
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     if (spb_get_theme_name() == "joyn") {
         if ($title != '') {
             $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
             $output .= '<h3 class="spb-heading ' . $title_class . '"><span>' . $title . '</span></h3>';
             $output .= '</div>';
         }
     } else {
         $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
         if ($title != '') {
             $output .= '<h3 class="spb-heading ' . $title_class . '"><span>' . $title . '</span></h3>';
         }
         if ($carousel == "yes" && $display_type != "showcase") {
             $output .= spb_carousel_arrows();
         }
         if ($has_button && $button_enabled == "yes") {
             $output .= $page_button;
         }
         $output .= '</div>';
     }
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_isotope, $sf_include_carousel;
     $sf_include_isotope = true;
     if ($carousel == "yes") {
         $sf_include_carousel = true;
     }
     return $output;
 }