//$start_wp_theme_tmp
//wp_tmp
//$end_wp_theme_tmp
?>
/**
* Gallery
*
* Shortcode that allows to create a gallery based on images selected from the media library
*/
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
if ( !class_exists( 'avia_sc_gallery' ) )
{
class avia_sc_gallery extends aviaShortcodeTemplate
{
static $gallery = 0;
var $extra_style = "";
var $non_ajax_style = "";
/**
* Create the config array for the shortcode button
*/
function shortcode_insert_button()
{
$this->config['self_closing'] = 'yes';
$this->config['name'] = __('Gallery', 'avia_framework' );
$this->config['tab'] = __('Media Elements', 'avia_framework' );
$this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-gallery.png";
$this->config['order'] = 6;
$this->config['target'] = 'avia-target-insert';
$this->config['shortcode'] = 'av_gallery';
$this->config['modal_data'] = array('modal_class' => 'mediumscreen');
$this->config['tooltip'] = __('Creates a custom gallery', 'avia_framework' );
$this->config['preview'] = 1;
$this->config['disabling_allowed'] = 'manually'; //only allowed manually since the default [gallery shortcode] is also affected
}
function extra_assets()
{
//load css
wp_enqueue_style( 'avia-module-gallery' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/gallery/gallery.css' , array('avia-layout'), false );
wp_enqueue_script( 'avia-module-gallery' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/gallery/gallery.js' , array('avia-shortcodes'), false, TRUE );
}
/**
* Popup Elements
*
* If this function is defined in a child class the element automatically gets an edit button, that, when pressed
* opens a modal window that allows to edit the element properties
*
* @return void
*/
function popup_elements()
{
$this->elements = array(
array(
"type" => "tab_container", 'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Content" , 'avia_framework'),
'nodescription' => true
),
array(
"name" => __("Edit Gallery",'avia_framework' ),
"desc" => __("Create a new Gallery by selecting existing or uploading new images",'avia_framework' ),
"id" => "ids",
"type" => "gallery",
"title" => __("Add/Edit Gallery",'avia_framework' ),
"button" => __("Insert Images",'avia_framework' ),
"std" => ""),
array(
"name" => __("Gallery Style", 'avia_framework' ),
"desc" => __("Choose the layout of your Gallery", 'avia_framework' ),
"id" => "style",
"type" => "select",
"std" => "thumbnails",
"subtype" => array(
__('Small Thumbnails', 'avia_framework' ) =>'thumbnails',
__('Big image with thumbnails below', 'avia_framework' ) =>'big_thumb',
__('Big image only, other images can be accessed via lightbox', 'avia_framework' ) =>'big_thumb lightbox_gallery',
)
),
array(
"name" => __("Gallery Big Preview Image Size", 'avia_framework' ),
"desc" => __("Choose image size for the Big Preview Image", 'avia_framework' ),
"id" => "preview_size",
"type" => "select",
"std" => "portfolio",
"required" => array('style','contains','big_thumb'),
"subtype" => AviaHelper::get_registered_image_sizes(array('logo'))
),
array(
"name" => __("Force same size for all big preview images?", 'avia_framework' ),
"desc" => __("Depending on the size you selected above, preview images might differ in size. Should the theme force them to display at exactly the same size?", 'avia_framework' ),
"id" => "crop_big_preview_thumbnail",
"type" => "select",
"std" => "yes",
"required" => array('style','equals','big_thumb'),
"subtype" => array(__('Yes, force same size on all Big Preview images, even if they use a different aspect ratio', 'avia_framework') => 'avia-gallery-big-crop-thumb', __('No, do not force the same size', 'avia_framework') => 'avia-gallery-big-no-crop-thumb')),
array(
"name" => __("Gallery Preview Image Size", 'avia_framework' ),
"desc" => __("Choose image size for the small preview thumbnails", 'avia_framework' ),
"id" => "thumb_size",
"type" => "select",
"std" => "portfolio",
"required" => array('style','not','big_thumb lightbox_gallery'),
"subtype" => AviaHelper::get_registered_image_sizes(array('logo'))
),
array(
"name" => __("Thumbnail Columns", 'avia_framework' ),
"desc" => __("Choose the column count of your Gallery", 'avia_framework' ),
"id" => "columns",
"type" => "select",
"std" => "5",
"required" => array('style','not','big_thumb lightbox_gallery'),
"subtype" => AviaHtmlHelper::number_array(1,12,1)
),
array(
"name" => __("Use Lighbox", 'avia_framework' ),
"desc" => __("Do you want to activate the lightbox", 'avia_framework' ),
"id" => "imagelink",
"type" => "select",
"std" => "5",
"required" => array('style','not','big_thumb lightbox_gallery'),
"subtype" => array(
__('Yes', 'avia_framework' ) =>'lightbox',
__('No, open the images in the browser window', 'avia_framework' ) =>'aviaopeninbrowser noLightbox',
__('No, open the images in a new browser window/tab', 'avia_framework' ) =>'aviaopeninbrowser aviablank noLightbox',
__('No, don\'t add a link to the images at all', 'avia_framework' ) =>'avianolink noLightbox')
),
array(
"name" => __("Thumbnail fade in effect", 'avia_framework' ),
"desc" => __("You can set when the gallery thumbnail animation starts", 'avia_framework' ),
"id" => "lazyload",
"type" => "select",
"std" => "avia_lazyload",
"required" => array('style','not','big_thumb lightbox_gallery'),
"subtype" => array(
__('Disable all animations', 'avia_framework' ) =>'animations_off',
__('Show the animation when user scrolls to the gallery', 'avia_framework' ) =>'avia_lazyload',
__('Activate animation on page load (might be preferable on large galleries)', 'avia_framework' ) =>'deactivate_avia_lazyload')
),
array(
"type" => "close_div",
'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Screen Options",'avia_framework' ),
'nodescription' => true
),
array(
"name" => __("Element Visibility",'avia_framework' ),
"desc" => __("Set the visibility for this element, based on the device screensize.", 'avia_framework' ),
"type" => "heading",
"description_class" => "av-builder-note av-neutral",
),
array(
"desc" => __("Hide on large screens (wider than 990px - eg: Desktop)", 'avia_framework'),
"id" => "av-desktop-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework'),
"id" => "av-medium-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework'),
"id" => "av-small-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework'),
"id" => "av-mini-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"type" => "close_div",
'nodescription' => true
),
array(
"type" => "close_div",
'nodescription' => true
),
);
}
/**
* Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
* Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
* Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
*
*
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
function editor_element($params)
{
$params['innerHtml'] = "";
$params['innerHtml'].= "