: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
api.ModuleGallery = class extends api.Module {
const tcols = {'': '', '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9},
const imgPhp = !!themifyBuilder.imgphp,
wrap_class: 'tb_compact_radios',
slider : { hide : 'items_per_slide' }
wrap_class: 'tb_group_element_grid'
wrap_class: 'tb_group_element_lightboxed'
id: 'gallery_pagination',
wrap_class: 'tb_group_element_grid'
wrap_class: 'tb_group_element_grid tb_checkbox_element_pagination'
wrap_class: 'tb_group_element_slider'
id: 'gallery_image_title',
id: 'gallery_exclude_caption',
wrap_class: 'tb_group_element_showcase tb_group_element_slider'
wrap_class: 'tb_group_element_showcase tb_group_element_slider'
id: 's_image_size_gallery',
id: 'image_size_gallery',
wrap_class: 'tb_group_element_grid'
wrap_class: 'tb_group_element_grid',
wrap_class: 'tb_group_element_grid',
wrap_class: 'tb_group_element_grid tb_group_element_slider',
id: 'appearance_gallery',
wrap_class: 'tb_group_element_slider'
custom_css: 'css_gallery'
for (let i = opts.length - 1; i > -1; --i) {
if (opts[i].hide === true) {
auto_scroll_opt_slider: '4',
if((!type || type==='setting') && !this.get('mod_settings').shortcode_gallery){
ThemifyConstructor.afterRun.push(() => {
Themify.triggerEvent(ThemifyConstructor.getEl('shortcode_gallery').parentNode.tfClass('builder_button')[0], _CLICK_);
static builderSave(settings) {
image_size_gallery: 'thumbnail',
s_image_size_gallery: 'full',
layout = settings.layout_gallery|| def.layout_gallery;
delete settings.items_per_slide;
if (settings[key] === def[key]) {
delete settings.gallery_pagination;
delete settings.layout_masonry;
delete settings.gallery_columns;
delete settings.t_columns;
delete settings.m_columns;
if (layout !== 'slider') {
delete settings.link_opt;
if(settings.m_columns && settings.t_columns && ~~settings.m_columns===~~settings.t_columns){
delete settings.m_columns;
if(settings.gallery_columns && settings.t_columns && ~~settings.gallery_columns===~~settings.t_columns){
delete settings.t_columns;
if(layout !== 'slider' && layout !== 'showcase'){
delete settings.s_image_w_gallery;
delete settings.s_image_h_gallery;
delete settings.s_image_size_gallery;
if(layout !== 'lightboxed'){
delete settings.thumbnail_gallery;
if (!settings.gallery_pagination) {
delete settings.gallery_per_page;
else if(!settings.gallery_per_page){
delete settings.gallery_pagination;
if (settings.link_opt !== 'file') {
delete settings.lightbox;
delete settings.link_image_size;
delete settings.lightbox_title;
if(settings.appearance_gallery==='|' || settings.appearance_gallery==='false'){
delete settings.appearance_gallery;
this.clearSliderOptions(settings,layout !== 'slider');
for(let bps=api.breakpointsReverse,i=bps.length-1;i>-1;--i){
this.clearImageGradient('background_image','background_color','background_repeat','background_position',bp,settings);
this.clearImageGradient('b_i_h','bg_c_h','b_r_h','b_p_h',bp,settings);
this.clearFontColor('font_color_type','font_color','font_gradient_color',bp,settings);
this.clearFontColor('f_c_t_h','f_c_h','f_g_c_h',bp,settings);
this.clearShadow('text-shadow',0,bp,settings);
this.clearShadow('t_sh_h',0,bp,settings);
this.clearShadow('t_sh_m_t',0,bp,settings);
this.clearShadow('t_sh_m_t_h',0,bp,settings);
this.clearPadding('padding',bp,settings);
this.clearPadding('p_h',bp,settings);
this.clearPadding('g_i_p',bp,settings);
this.clearPadding('g_i_p_h',bp,settings);
this.clearPadding('margin',bp,settings);
this.clearPadding('m_h',bp,settings);
this.clearPadding('g_i_m',bp,settings);
this.clearPadding('g_i_m_h',bp,settings);
this.clearPadding('b_ra',bp,settings);
this.clearPadding('r_c_h',bp,settings);
this.clearPadding('g_i_r_c',bp,settings);
this.clearPadding('g_i_r_c_h',bp,settings);
this.clearBorder('border',bp,settings);
this.clearBorder('b_h',bp,settings);
this.clearBorder('g_i_b',bp,settings);
this.clearBorder('g_i_b_h',bp,settings);
this.clearFilter('bl_m','css_f',bp,settings);
this.clearFilter('_h','css_f_h',bp,settings);
this.clearWidth('w',bp,settings);
this.clearWidth('ht',bp,settings,1);
this.clearWidth('w_ctrl',bp,settings);
this.clearWidth('h_ctrl',bp,settings,1,'mi_h_ctrl','mx_h_ctrl');
this.clearShadow('b_sh',1,bp,settings);
this.clearShadow('sh_h',1,bp,settings);
this.clearShadow('g_i_b_sh',1,bp,settings);
this.clearShadow('g_i_b_sh_h',1,bp,settings);
this.clearTransform('tr',bp,settings);
this.clearTransform('tr-h',bp,settings);
super.builderSave(settings);
async imageEditEnd(activeEl,imgObj,w,h){
if(this.el.tfClass('gallery-masonry')[0]){
return api.Utils.runJs(this.el,'module');
else if(activeEl.dataset.w==='s_image_w_gallery'){
const thumbs=this.el.querySelectorAll('.layout-showcase [data-image]'),
for(let i=thumbs.length-1;i>-1;--i){
let p=ThemifyImageResize.toBlob(thumbs[i], w, h);
thumbs[i].dataset.image = url;
return Promise.all(prms);
const module = createElement(),
layout=data.layout_gallery|| 'grid',
classes=['module','gallery','module-gallery','layout-'+layout],
shortcode=data.shortcode_gallery;
if (data.appearance_gallery) {
classes.push(data.appearance_gallery.split('|').join(' '));
classes.push(data.css_gallery);
if (data.mod_title_gallery) {
module.appendChild(this.constructor.getModuleTitle(data.mod_title_gallery,'mod_title_gallery'));
module.className=classes.join(' ');
ThemifyConstructor.gallery.getImages(shortcode).then(async images=>{
const el=await this[layout].call(this,images,data);