Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/themify-.../includes/componen...
File: row.php
<?php
[0] Fix | Delete
defined('ABSPATH') || exit;
[1] Fix | Delete
[2] Fix | Delete
class Themify_Builder_Component_Row{
[3] Fix | Delete
[4] Fix | Delete
public static $isFirstRow = false;
[5] Fix | Delete
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Computes and returns data for Builder row or column video background.
[9] Fix | Delete
*
[10] Fix | Delete
* @since 2.3.3
[11] Fix | Delete
*
[12] Fix | Delete
* @param array $styling The row's or column's styling array.
[13] Fix | Delete
*
[14] Fix | Delete
* @return string Return video data if row/col has a background video, else return false.
[15] Fix | Delete
*/
[16] Fix | Delete
public static function get_video_background(array $styling):string {
[17] Fix | Delete
if (!( isset($styling['background_type']) && 'video' === $styling['background_type'] && !empty($styling['background_video']) )) {
[18] Fix | Delete
return '';
[19] Fix | Delete
}
[20] Fix | Delete
$video_data = 'data-tbfullwidthvideo="' . esc_url(themify_https_esc($styling['background_video'])) . '"';
[21] Fix | Delete
[22] Fix | Delete
// Will only be written if they exist, for backwards compatibility with global JS variable tbLocalScript.backgroundVideoLoop
[23] Fix | Delete
[24] Fix | Delete
[25] Fix | Delete
if (!empty($styling['background_video_options'])) {
[26] Fix | Delete
if (is_array($styling['background_video_options'])) {
[27] Fix | Delete
$video_data .= in_array('mute', $styling['background_video_options'], true) ? '' : ' data-mutevideo="unmute"';
[28] Fix | Delete
$video_data .= in_array('unloop', $styling['background_video_options'], true) ? ' data-unloopvideo="unloop"' : '';
[29] Fix | Delete
$video_data .= in_array('playonmobile', $styling['background_video_options'], true) ? ' data-playonmobile="play"' : '';
[30] Fix | Delete
} else {
[31] Fix | Delete
$video_data .= ( false !== stripos($styling['background_video_options'], 'mute') ) ? '' : ' data-mutevideo="unmute"';
[32] Fix | Delete
$video_data .= ( false !== stripos($styling['background_video_options'], 'unloop') ) ? ' data-unloopvideo="unloop"' : '';
[33] Fix | Delete
$video_data .= ( false !== stripos($styling['background_video_options'], 'playonmobile') ) ? ' data-playonmobile="play"' : '';
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
return apply_filters('themify_builder_row_video_background', $video_data, $styling);
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Computes and returns the HTML a color overlay.
[41] Fix | Delete
*
[42] Fix | Delete
* @since 2.3.3
[43] Fix | Delete
*
[44] Fix | Delete
* @param array $styling The row's or column's styling array.
[45] Fix | Delete
*
[46] Fix | Delete
* @return bool Returns false if $styling doesn't have a color overlay. Otherwise outputs the HTML;
[47] Fix | Delete
*/
[48] Fix | Delete
private static function do_color_overlay(array $styling):bool {
[49] Fix | Delete
[50] Fix | Delete
$type = !isset($styling['cover_color-type']) || $styling['cover_color-type'] === 'color' ? 'color' : 'gradient';
[51] Fix | Delete
$is_empty = $type === 'color' ? empty($styling['cover_color']) : empty($styling['cover_gradient-gradient']);
[52] Fix | Delete
[53] Fix | Delete
if ($is_empty === true) {
[54] Fix | Delete
$hover_type = !isset($styling['cover_color_hover-type']) || $styling['cover_color_hover-type'] === 'hover_color' ? 'color' : 'gradient';
[55] Fix | Delete
$is_empty_hover = $hover_type === 'color' ? empty($styling['cover_color_hover']) : empty($styling['cover_gradient_hover-gradient']);
[56] Fix | Delete
}
[57] Fix | Delete
if ($is_empty === false || $is_empty_hover === false) {
[58] Fix | Delete
echo '<span class="builder_row_cover tf_abs"></span>';
[59] Fix | Delete
return true;
[60] Fix | Delete
}
[61] Fix | Delete
return false;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* Get the frame type
[68] Fix | Delete
*/
[69] Fix | Delete
private static function get_frame(array $settings, string $side):string {
[70] Fix | Delete
if ((!isset($settings["{$side}-frame_type"]) || $settings["{$side}-frame_type"] === $side . '-presets') && !empty($settings["{$side}-frame_layout"])) {
[71] Fix | Delete
return $settings["{$side}-frame_layout"] !== 'none' ? 'presets' : '';
[72] Fix | Delete
}
[73] Fix | Delete
if (isset($settings["{$side}-frame_type"]) && $settings["{$side}-frame_type"] === $side . '-custom' && !empty($settings["{$side}-frame_custom"])) {
[74] Fix | Delete
return 'custom';
[75] Fix | Delete
}
[76] Fix | Delete
return '';
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
private static function show_frame(array $styles, $printed = array()) {
[80] Fix | Delete
$breakpoints = array('desktop' => '') + themify_get_breakpoints();
[81] Fix | Delete
$sides = array('top', 'bottom', 'left', 'right');
[82] Fix | Delete
$output = '';
[83] Fix | Delete
foreach ($sides as $side) {
[84] Fix | Delete
if (!isset($printed[$side])) {
[85] Fix | Delete
foreach ($breakpoints as $bp => $v) {
[86] Fix | Delete
$settings = 'desktop' === $bp ? $styles : (!empty($styles['breakpoint_' . $bp]) ? $styles['breakpoint_' . $bp] : array() );
[87] Fix | Delete
if (!empty($settings) && self::get_frame($settings, $side)) {
[88] Fix | Delete
$printed[$side] = true;
[89] Fix | Delete
$frame_location = ( isset($settings["{$side}-frame_location"]) && $settings["{$side}-frame_location"] === 'in_front' ) ? $settings["{$side}-frame_location"] : '';
[90] Fix | Delete
$cl = $side === 'left' || $side === 'right' ? 'tf_h' : 'tf_w';
[91] Fix | Delete
$output .= '<span class="tb_row_frame tb_row_frame_' . $side . ' ' . $frame_location . ' tf_abs tf_hide tf_overflow ' . $cl . '"></span>';
[92] Fix | Delete
break;
[93] Fix | Delete
}
[94] Fix | Delete
}
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
if (!empty($output)) {
[98] Fix | Delete
Themify_Builder_Model::loadCssModules('fr', THEMIFY_BUILDER_CSS_MODULES . 'frames.css', THEMIFY_VERSION);
[99] Fix | Delete
echo '<span class="tb_row_frame_wrap tf_overflow tf_abs" data-lazy="1">', $output, '</span>';
[100] Fix | Delete
}
[101] Fix | Delete
return $printed;
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
public static function background_styling(array $row, string $type, $builder_id) {
[105] Fix | Delete
// Background cover color
[106] Fix | Delete
if (!empty($row['styling'])) {
[107] Fix | Delete
$hasOverlay = false;
[108] Fix | Delete
if (!self::do_color_overlay($row['styling'])) {
[109] Fix | Delete
$breakpoints = themify_get_breakpoints();
[110] Fix | Delete
foreach ($breakpoints as $bp => $v) {
[111] Fix | Delete
if (!empty($row['styling']['breakpoint_' . $bp]) && self::do_color_overlay($row['styling']['breakpoint_' . $bp])) {
[112] Fix | Delete
$hasOverlay = true;
[113] Fix | Delete
break;
[114] Fix | Delete
}
[115] Fix | Delete
}
[116] Fix | Delete
} else {
[117] Fix | Delete
$hasOverlay = true;
[118] Fix | Delete
}
[119] Fix | Delete
// Background Slider
[120] Fix | Delete
self::do_slider_background($row, $type);
[121] Fix | Delete
$frames = array();
[122] Fix | Delete
$framesCount = 0;
[123] Fix | Delete
if (!empty($row['styling']['global_styles'])) {
[124] Fix | Delete
$used_gs = Themify_Global_Styles::get_used_gs($builder_id);
[125] Fix | Delete
if (!empty($used_gs)) {
[126] Fix | Delete
$global_styles = explode(' ', $row['styling']['global_styles']);
[127] Fix | Delete
if ($hasOverlay === false) {
[128] Fix | Delete
$breakpoints = array('desktop' => '') + themify_get_breakpoints();
[129] Fix | Delete
}
[130] Fix | Delete
foreach ($global_styles as $cl) {
[131] Fix | Delete
if (isset($used_gs[$cl])) {
[132] Fix | Delete
if ($hasOverlay === false) {
[133] Fix | Delete
foreach ($breakpoints as $bp => $v) {
[134] Fix | Delete
[135] Fix | Delete
if (($bp === 'desktop' && self::do_color_overlay($used_gs[$cl])) || ($bp !== 'desktop' && !empty($used_gs[$cl]['breakpoint_' . $bp]) && self::do_color_overlay($used_gs[$cl]['breakpoint_' . $bp]))) {
[136] Fix | Delete
$hasOverlay = true;
[137] Fix | Delete
break;
[138] Fix | Delete
}
[139] Fix | Delete
}
[140] Fix | Delete
}
[141] Fix | Delete
if ($framesCount !== 4) {
[142] Fix | Delete
$frames = self::show_frame($used_gs[$cl], $frames);
[143] Fix | Delete
$framesCount = count($frames);
[144] Fix | Delete
}
[145] Fix | Delete
}
[146] Fix | Delete
if ($hasOverlay === true && $framesCount === 4) {
[147] Fix | Delete
break;
[148] Fix | Delete
}
[149] Fix | Delete
}
[150] Fix | Delete
}
[151] Fix | Delete
}
[152] Fix | Delete
if ($framesCount !== 4) {
[153] Fix | Delete
self::show_frame($row['styling'], $frames);
[154] Fix | Delete
}
[155] Fix | Delete
if ($hasOverlay === true) {
[156] Fix | Delete
Themify_Builder_Model::loadCssModules('cover', THEMIFY_BUILDER_CSS_MODULES . 'cover.css', THEMIFY_VERSION);
[157] Fix | Delete
}
[158] Fix | Delete
}
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
public static function clickable_component(array &$attr, array $settings) {
[162] Fix | Delete
if (!empty($settings['_link'])) {
[163] Fix | Delete
$attr['data-tb_link'] = esc_url($settings['_link']);
[164] Fix | Delete
if ( isset( $settings['_link_n'] ) && $settings['_link_n'] === 'yes' ) {
[165] Fix | Delete
$attr['data-tb_link_new'] = '1';
[166] Fix | Delete
}
[167] Fix | Delete
if ( ! isset( $settings['_link_o'] ) || $settings['_link_o'] === 'no' ) {
[168] Fix | Delete
if (!isset($attr['class'])) {
[169] Fix | Delete
$attr['class'] = '';
[170] Fix | Delete
}
[171] Fix | Delete
$attr['class'] .= ' tb_link_outline';
[172] Fix | Delete
}
[173] Fix | Delete
themify_enque_style('tf_clickablecomponent', THEMIFY_BUILDER_CSS_MODULES . 'clickable-component.css', null, THEMIFY_VERSION);
[174] Fix | Delete
}
[175] Fix | Delete
}
[176] Fix | Delete
[177] Fix | Delete
public static function set_bg_mode(array &$attr, array $styling) {
[178] Fix | Delete
$breakpoints = array('desktop' => '') + themify_get_breakpoints();
[179] Fix | Delete
foreach ($breakpoints as $bp => $v) {
[180] Fix | Delete
$bg = '';
[181] Fix | Delete
if ($bp === 'desktop') {
[182] Fix | Delete
if (isset($styling['background_repeat'])) {
[183] Fix | Delete
$bg = $styling['background_repeat'];
[184] Fix | Delete
}
[185] Fix | Delete
} elseif (isset($styling['breakpoint_' . $bp]['background_repeat'])) {
[186] Fix | Delete
$bg = $styling['breakpoint_' . $bp]['background_repeat'];
[187] Fix | Delete
}
[188] Fix | Delete
if ($bg === 'builder-parallax-scrolling' || $bg === 'builder-zoom-scrolling' || $bg === 'builder-zooming') {
[189] Fix | Delete
$bg = explode('-', $bg);
[190] Fix | Delete
$attr['data-' . $bg[1] . '-bg'] = $bp;
[191] Fix | Delete
}
[192] Fix | Delete
}
[193] Fix | Delete
return $attr;
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
public static function get_responsive_cols(array $row) {
[197] Fix | Delete
$cl = array();
[198] Fix | Delete
$isFullpage = function_exists('themify_theme_is_fullpage_scroll') && themify_theme_is_fullpage_scroll();
[199] Fix | Delete
if (!empty($row['sizes'])) {
[200] Fix | Delete
$_arr = array('align', 'gutter', 'auto_h', 'dir');
[201] Fix | Delete
foreach ($_arr as $k) {
[202] Fix | Delete
if (!empty($row['sizes']['desktop_' . $k])) {
[203] Fix | Delete
$v = $row['sizes']['desktop_' . $k];
[204] Fix | Delete
if ($k === 'align') {
[205] Fix | Delete
if ($v === 'center') {
[206] Fix | Delete
$v = 'col_align_middle';
[207] Fix | Delete
} elseif ($v === 'end') {
[208] Fix | Delete
$v = 'col_align_bottom';
[209] Fix | Delete
} else {
[210] Fix | Delete
$v = 'col_align_top';
[211] Fix | Delete
}
[212] Fix | Delete
} elseif ($k === 'gutter') {
[213] Fix | Delete
$v = $v === 'narrow' || $v === 'none' ? 'gutter-' . $v : '';
[214] Fix | Delete
} elseif ($k === 'auto_h') {
[215] Fix | Delete
$v = $v == '1' ? 'col_auto_height' : '';
[216] Fix | Delete
} elseif ($k === 'dir') {
[217] Fix | Delete
$v = $v === 'rtl' ? 'direction_rtl' : '';
[218] Fix | Delete
}
[219] Fix | Delete
if ($v !== '') {
[220] Fix | Delete
$cl[] = $v;
[221] Fix | Delete
}
[222] Fix | Delete
} elseif ($k === 'align') {
[223] Fix | Delete
$cl[] = $isFullpage === true ? 'col_align_middle' : 'col_align_top';
[224] Fix | Delete
}
[225] Fix | Delete
}
[226] Fix | Delete
} else {
[227] Fix | Delete
if (!empty($row['column_h'])) {
[228] Fix | Delete
$cl[] = 'col_auto_height';
[229] Fix | Delete
}
[230] Fix | Delete
if (!empty($row['gutter']) && $row['gutter'] !== 'gutter-default') {
[231] Fix | Delete
$cl[] = $row['gutter'];
[232] Fix | Delete
}
[233] Fix | Delete
if (isset($row['desktop_dir']) && $row['desktop_dir'] === 'rtl') {
[234] Fix | Delete
$cl[] = 'direction_rtl';
[235] Fix | Delete
}
[236] Fix | Delete
$cl[] = !empty($row['column_alignment']) ? $row['column_alignment'] : ($isFullpage === true ? 'col_align_middle' : 'col_align_top');
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
$cl[] = 'tb_col_count_' . count($row['cols']);
[240] Fix | Delete
[241] Fix | Delete
return $cl;
[242] Fix | Delete
}
[243] Fix | Delete
[244] Fix | Delete
/**
[245] Fix | Delete
* Computes and returns the HTML for a background slider.
[246] Fix | Delete
*
[247] Fix | Delete
* @since 2.3.3
[248] Fix | Delete
*
[249] Fix | Delete
* @param array $row_or_col Row or column definition.
[250] Fix | Delete
* @param string $order Order of row/column (e.g. 0 or 0-1-0-1 for sub columns)
[251] Fix | Delete
* @param string $type Accepts 'row', 'col', 'sub-col'
[252] Fix | Delete
*
[253] Fix | Delete
* @return bool Returns false if $row_or_col doesn't have a bg slider. Otherwise outputs the HTML for the slider.
[254] Fix | Delete
*/
[255] Fix | Delete
public static function do_slider_background(array $row_or_col, $type = 'row'):bool {
[256] Fix | Delete
if (!isset($row_or_col['styling']['background_type']) || 'slider' !== $row_or_col['styling']['background_type'] || empty($row_or_col['styling']['background_slider'])) {
[257] Fix | Delete
return false;
[258] Fix | Delete
}
[259] Fix | Delete
$images = themify_get_gallery_shortcode($row_or_col['styling']['background_slider']);
[260] Fix | Delete
if (!empty($images)) :
[261] Fix | Delete
[262] Fix | Delete
$size = isset($row_or_col['styling']['background_slider_size']) ? $row_or_col['styling']['background_slider_size'] : false;
[263] Fix | Delete
if (!$size) {
[264] Fix | Delete
$size = themify_get_gallery_shortcode_params($row_or_col['styling']['background_slider'], 'size');
[265] Fix | Delete
if (!$size) {
[266] Fix | Delete
$size = 'large';
[267] Fix | Delete
}
[268] Fix | Delete
}
[269] Fix | Delete
$bgmode = !empty($row_or_col['styling']['background_slider_mode']) ? $row_or_col['styling']['background_slider_mode'] : 'fullcover';
[270] Fix | Delete
$slider_speed = !empty($row_or_col['styling']['background_slider_speed']) ? $row_or_col['styling']['background_slider_speed'] : '2000';
[271] Fix | Delete
?>
[272] Fix | Delete
<span class="tf_hide <?php echo $type; ?>-slider tb_slider tf_abs" data-bgmode="<?php echo $bgmode; ?>" data-sliderspeed="<?php echo $slider_speed ?>">
[273] Fix | Delete
<span class="tf_abs row-slider-slides tf_w tf_hidden tf_clearfix">
[274] Fix | Delete
<?php
[275] Fix | Delete
foreach ($images as $i => $img) {
[276] Fix | Delete
$img_data = wp_get_attachment_image_src($img->ID, $size);
[277] Fix | Delete
if (empty($img_data)) {
[278] Fix | Delete
continue;
[279] Fix | Delete
}
[280] Fix | Delete
$alt = get_post_meta($img->ID, '_wp_attachment_image_alt', TRUE);
[281] Fix | Delete
?>
[282] Fix | Delete
<span data-bg="<?php echo esc_url(themify_https_esc($img_data[0])); ?>"<?php if (!empty($alt)): ?> data-bg-alt="<?php esc_attr_e($alt); ?>"<?php endif; ?>>
[283] Fix | Delete
<a href="javascript:;" rel="nofollow" class="row-slider-dot" data-index="<?php echo $i; ?>"><span class="screen-reader-text">&bull;</span></a>
[284] Fix | Delete
</span>
[285] Fix | Delete
<?php
[286] Fix | Delete
}
[287] Fix | Delete
?>
[288] Fix | Delete
</span>
[289] Fix | Delete
<span class="row-slider-nav tf_abs_t tf_w">
[290] Fix | Delete
<a href="javascript:;" rel="nofollow" class="row-slider-arrow row-slider-prev tf_hidden tf_abs_t"><span class="screen-reader-text">&larr;</span></a>
[291] Fix | Delete
<a href="javascript:;" rel="nofollow" class="row-slider-arrow row-slider-next tf_hidden tf_abs_t"><span class="screen-reader-text">&rarr;</span></a>
[292] Fix | Delete
</span>
[293] Fix | Delete
</span>
[294] Fix | Delete
<?php
[295] Fix | Delete
return true;
[296] Fix | Delete
endif; // images
[297] Fix | Delete
return false;
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
/**
[301] Fix | Delete
* Get template row
[302] Fix | Delete
*
[303] Fix | Delete
* @param array $row
[304] Fix | Delete
* @param string $builder_id
[305] Fix | Delete
* @param bool $echo
[306] Fix | Delete
*
[307] Fix | Delete
* @return string
[308] Fix | Delete
*/
[309] Fix | Delete
public static function template(&$row, $builder_id, $echo = true, $tmp = -1) {//4 argument isn't used need for backward to avoid fatal error
[310] Fix | Delete
if ($tmp === true || $tmp === false) {//map old data arguments
[311] Fix | Delete
$row = $builder_id;
[312] Fix | Delete
$builder_id = $echo;
[313] Fix | Delete
$echo = $tmp;
[314] Fix | Delete
}
[315] Fix | Delete
$row = apply_filters('tf_builder_row', $row, $builder_id);
[316] Fix | Delete
// prevent empty rows from being rendered
[317] Fix | Delete
if (Themify_Builder::$frontedit_active === false || Themify_Builder::$is_loop === true) {
[318] Fix | Delete
$count = isset($row['cols']) ? count($row['cols']) : 0;
[319] Fix | Delete
if (($count === 0 && !isset($row['styling']) ) || ($count === 1 && empty($row['cols'][0]['modules']) && empty($row['cols'][0]['styling']) && empty($row['styling']) ) // there's only one column and it's empty
[320] Fix | Delete
) {
[321] Fix | Delete
return '';
[322] Fix | Delete
}
[323] Fix | Delete
/* allow addons to control the display of the rows */
[324] Fix | Delete
$display = apply_filters('themify_builder_row_display', true, $row, $builder_id);
[325] Fix | Delete
if (false === $display || (isset($row['styling']['visibility_all']) && $row['styling']['visibility_all'] === 'hide_all' )) {
[326] Fix | Delete
return '';
[327] Fix | Delete
}
[328] Fix | Delete
} else {
[329] Fix | Delete
$count = 0;
[330] Fix | Delete
}
[331] Fix | Delete
$row_classes = array('module_row themify_builder_row');
[332] Fix | Delete
$row_attributes = array();
[333] Fix | Delete
$is_styling = !empty($row['styling']);
[334] Fix | Delete
$video_data = '';
[335] Fix | Delete
if ($is_styling === true) {
[336] Fix | Delete
if (!isset($row['styling']['background_type']) && !empty($row['styling']['background_video'])) {
[337] Fix | Delete
$row['styling']['background_type'] = 'video';
[338] Fix | Delete
} elseif ((!isset($row['styling']['background_type']) || $row['styling']['background_type'] === 'image' ) && isset($row['styling']['background_zoom']) && $row['styling']['background_zoom'] === 'zoom' && $row['styling']['background_repeat'] === 'repeat-none') {
[339] Fix | Delete
$row_classes[] = 'themify-bg-zoom';
[340] Fix | Delete
}
[341] Fix | Delete
$class_fields = array('custom_css_row', 'row_height');
[342] Fix | Delete
foreach ($class_fields as $field) {
[343] Fix | Delete
if (!empty($row['styling'][$field])) {
[344] Fix | Delete
$row_classes[] = $row['styling'][$field];
[345] Fix | Delete
}
[346] Fix | Delete
}
[347] Fix | Delete
unset($class_fields);
[348] Fix | Delete
/**
[349] Fix | Delete
* Row Width class
[350] Fix | Delete
* To provide backward compatibility, the CSS classname and the option label do not match. See #5284
[351] Fix | Delete
*/
[352] Fix | Delete
if (isset($row['styling']['row_width'])) {
[353] Fix | Delete
if ('fullwidth' === $row['styling']['row_width']) {
[354] Fix | Delete
$row_classes[] = 'fullwidth_row_container';
[355] Fix | Delete
} elseif ('fullwidth-content' === $row['styling']['row_width']) {
[356] Fix | Delete
$row_classes[] = 'fullwidth';
[357] Fix | Delete
}
[358] Fix | Delete
$breakpoints = themify_get_breakpoints('', true);
[359] Fix | Delete
$breakpoints['desktop'] = 1;
[360] Fix | Delete
$prop = 'fullwidth' === $row['styling']['row_width'] ? 'padding' : 'margin';
[361] Fix | Delete
foreach ($breakpoints as $k => $v) {
[362] Fix | Delete
$styles = $k === 'desktop' ? $row['styling'] : (!empty($row['styling']['breakpoint_' . $k]) ? $row['styling']['breakpoint_' . $k] : false);
[363] Fix | Delete
if ($styles) {
[364] Fix | Delete
$val = self::getDataValue($styles, $prop);
[365] Fix | Delete
if ($val) {
[366] Fix | Delete
$row_attributes['data-' . $k . '-' . $prop] = $val;
[367] Fix | Delete
}
[368] Fix | Delete
}
[369] Fix | Delete
}
[370] Fix | Delete
$breakpoints = null;
[371] Fix | Delete
}
[372] Fix | Delete
// background video
[373] Fix | Delete
$video_data = self::get_video_background($row['styling']);
[374] Fix | Delete
if ($video_data) {
[375] Fix | Delete
$video_data = ' ' . $video_data;
[376] Fix | Delete
} else {
[377] Fix | Delete
self::set_bg_mode($row_attributes, $row['styling']);
[378] Fix | Delete
}
[379] Fix | Delete
// Class for Scroll Highlight
[380] Fix | Delete
if (!empty($row['styling']['row_anchor']) && $row['styling']['row_anchor'] !== '#') {
[381] Fix | Delete
$row_classes[] = 'tb_has_section';
[382] Fix | Delete
$row_classes[] = 'tb_section-' . $row['styling']['row_anchor'];
[383] Fix | Delete
$row_attributes['data-anchor'] = $row['styling']['row_anchor'];
[384] Fix | Delete
}
[385] Fix | Delete
// Disable change hashtag in URL
[386] Fix | Delete
if (!empty($row['styling']['hide_anchor'])) {
[387] Fix | Delete
$row_attributes['data-hide-anchor'] = $row['styling']['hide_anchor'];
[388] Fix | Delete
}
[389] Fix | Delete
if (!empty($row['styling']['global_styles'])) {
[390] Fix | Delete
Themify_Global_Styles::add_class_to_components($row_classes, $row['styling'], $builder_id);
[391] Fix | Delete
}
[392] Fix | Delete
} else {
[393] Fix | Delete
$row['styling'] = array();
[394] Fix | Delete
}
[395] Fix | Delete
if ($echo === false) {
[396] Fix | Delete
$output = PHP_EOL; // add line break
[397] Fix | Delete
ob_start();
[398] Fix | Delete
}
[399] Fix | Delete
if (Themify_Builder::$frontedit_active === false) {
[400] Fix | Delete
$row_content_classes = $count > 0 ? self::get_responsive_cols($row) : array();
[401] Fix | Delete
$row_content_classes = implode(' ', $row_content_classes);
[402] Fix | Delete
if (isset($row['styling']['row_width']) && ('fullwidth' === $row['styling']['row_width'] || 'fullwidth-content' === $row['styling']['row_width'])) {
[403] Fix | Delete
$row_attributes['data-css_id'] = $row['element_id'];
[404] Fix | Delete
}
[405] Fix | Delete
$row_classes[] = 'tb_' . $row['element_id'];
[406] Fix | Delete
if ($is_styling === true) {
[407] Fix | Delete
Themify_Builder_Component_Module::sticky_element_props($row_attributes, $row['styling']);
[408] Fix | Delete
}
[409] Fix | Delete
$row_attributes['data-lazy'] = 1;
[410] Fix | Delete
if (self::$isFirstRow === false) {
[411] Fix | Delete
self::$isFirstRow = true;
[412] Fix | Delete
$row_classes[] = 'tb_first'; //need for lazy loadd, load first row bg image
[413] Fix | Delete
} else {
[414] Fix | Delete
self::$isFirstRow = null;
[415] Fix | Delete
}
[416] Fix | Delete
}
[417] Fix | Delete
do_action('themify_builder_row_start', $builder_id, $row, '');
[418] Fix | Delete
$row_classes[] = 'tf_w';
[419] Fix | Delete
$row_attributes['class'] = implode(' ', apply_filters('themify_builder_row_classes', $row_classes, $row, $builder_id));
[420] Fix | Delete
$row_classes = null;
[421] Fix | Delete
self::clickable_component($row_attributes, $row['styling']);
[422] Fix | Delete
$row_attributes = apply_filters('themify_builder_row_attributes', Themify_Builder_Component_Module::parse_animation_effect($row['styling'], $row_attributes), $row['styling'], $builder_id);
[423] Fix | Delete
?>
[424] Fix | Delete
<?php if (strpos($row_attributes['class'], 'tb-page-break') !== false): ?>
[425] Fix | Delete
<!-- tb_page_break -->
[426] Fix | Delete
<?php endif; ?>
[427] Fix | Delete
<div <?php echo themify_get_element_attributes($row_attributes), $video_data; ?>>
[428] Fix | Delete
<?php
[429] Fix | Delete
$row_attributes = $video_data = null;
[430] Fix | Delete
if ($is_styling === true) {
[431] Fix | Delete
do_action('themify_builder_background_styling', $builder_id, $row, 'row', '');
[432] Fix | Delete
self::background_styling($row, 'row', $builder_id);
[433] Fix | Delete
}
[434] Fix | Delete
?>
[435] Fix | Delete
<div class="row_inner<?php if (Themify_Builder::$frontedit_active === false): ?> <?php echo $row_content_classes ?><?php endif; ?> tf_box tf_rel">
[436] Fix | Delete
<?php
[437] Fix | Delete
unset($row_content_classes);
[438] Fix | Delete
if ($count > 0) {
[439] Fix | Delete
if (isset($row['desktop_dir']) && $row['desktop_dir'] === 'rtl') {//backward compatibility
[440] Fix | Delete
$row['cols'] = array_reverse($row['cols']);
[441] Fix | Delete
}
[442] Fix | Delete
foreach ($row['cols'] as $i => &$col) {
[443] Fix | Delete
$cl = $i === 0 ? 'first' : ($i === ($count - 1) ? 'last' : null); //backward compatibility
[444] Fix | Delete
Themify_Builder_Component_Column::template($col, $builder_id, true, false, $cl);
[445] Fix | Delete
}
[446] Fix | Delete
unset($col);
[447] Fix | Delete
}
[448] Fix | Delete
?>
[449] Fix | Delete
</div>
[450] Fix | Delete
</div>
[451] Fix | Delete
<?php
[452] Fix | Delete
do_action('themify_builder_row_end', $builder_id, $row, '');
[453] Fix | Delete
if ($echo === false) {
[454] Fix | Delete
return PHP_EOL . ob_get_clean() . PHP_EOL;
[455] Fix | Delete
}
[456] Fix | Delete
}
[457] Fix | Delete
[458] Fix | Delete
private static function getDataValue(array $styles,string $type = 'padding'):string {
[459] Fix | Delete
$value = '';
[460] Fix | Delete
if (!empty($styles['checkbox_' . $type . '_apply_all']) && !empty($styles[$type . '_top'])) {
[461] Fix | Delete
$value = $styles[$type . '_top'];
[462] Fix | Delete
$value .= isset($styles[$type . '_top_unit']) ? $styles[$type . '_top_unit'] : 'px';
[463] Fix | Delete
$value = $value . ',' . $value;
[464] Fix | Delete
} elseif (!empty($styles[$type . '_left']) || !empty($styles[$type . '_right'])) {
[465] Fix | Delete
if (!empty($styles[$type . '_left'])) {
[466] Fix | Delete
$value = $styles[$type . '_left'];
[467] Fix | Delete
$value .= isset($styles[$type . '_left_unit']) ? $styles[$type . '_left_unit'] : 'px';
[468] Fix | Delete
}
[469] Fix | Delete
if (!empty($styles[$type . '_right'])) {
[470] Fix | Delete
$value .= ',' . $styles[$type . '_right'];
[471] Fix | Delete
$value .= isset($styles[$type . '_right_unit']) ? $styles[$type . '_right_unit'] : 'px';
[472] Fix | Delete
}
[473] Fix | Delete
}
[474] Fix | Delete
return $value;
[475] Fix | Delete
}
[476] Fix | Delete
}
[477] Fix | Delete
[478] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function