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/smart-sl.../Nextend/SmartSli.../Slider/Feature
File: Responsive.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
namespace Nextend\SmartSlider3\Slider\Feature;
[3] Fix | Delete
[4] Fix | Delete
[5] Fix | Delete
use Nextend\Framework\Data\Data;
[6] Fix | Delete
use Nextend\SmartSlider3\Application\Admin\Settings\ViewSettingsGeneral;
[7] Fix | Delete
use Nextend\SmartSlider3\Settings;
[8] Fix | Delete
use Nextend\SmartSlider3\Slider\ResponsiveType\AbstractResponsiveTypeFrontend;
[9] Fix | Delete
use Nextend\SmartSlider3\Slider\ResponsiveType\ResponsiveTypeFactory;
[10] Fix | Delete
use Nextend\SmartSlider3\Slider\Slider;
[11] Fix | Delete
use Nextend\SmartSlider3\SmartSlider3Info;
[12] Fix | Delete
[13] Fix | Delete
class Responsive {
[14] Fix | Delete
[15] Fix | Delete
/** @var Slider */
[16] Fix | Delete
public $slider;
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* @var AbstractResponsiveTypeFrontend
[20] Fix | Delete
*/
[21] Fix | Delete
protected $responsivePlugin;
[22] Fix | Delete
[23] Fix | Delete
protected $hideOnDesktopLandscape = 1;
[24] Fix | Delete
protected $hideOnDesktopPortrait = 1;
[25] Fix | Delete
[26] Fix | Delete
protected $hideOnTabletLandscape = 1;
[27] Fix | Delete
protected $hideOnTabletPortrait = 1;
[28] Fix | Delete
[29] Fix | Delete
protected $hideOnMobileLandscape = 1;
[30] Fix | Delete
protected $hideOnMobilePortrait = 1;
[31] Fix | Delete
[32] Fix | Delete
public $onResizeEnabled = 1;
[33] Fix | Delete
[34] Fix | Delete
public $type = 'auto';
[35] Fix | Delete
[36] Fix | Delete
public $scaleDown = 1;
[37] Fix | Delete
[38] Fix | Delete
public $scaleUp = 1;
[39] Fix | Delete
[40] Fix | Delete
public $forceFull = 0;
[41] Fix | Delete
[42] Fix | Delete
public $forceFullOverflowX = 'body';
[43] Fix | Delete
[44] Fix | Delete
public $forceFullHorizontalSelector = '';
[45] Fix | Delete
[46] Fix | Delete
public $minimumHeight = -1;
[47] Fix | Delete
[48] Fix | Delete
public $maximumSlideWidthLandscape = -1;
[49] Fix | Delete
public $maximumSlideWidth = 10000;
[50] Fix | Delete
public $maximumSlideWidthTabletLandscape = -1;
[51] Fix | Delete
public $maximumSlideWidthTablet = -1;
[52] Fix | Delete
public $maximumSlideWidthMobileLandscape = -1;
[53] Fix | Delete
public $maximumSlideWidthMobile = -1;
[54] Fix | Delete
[55] Fix | Delete
public $sliderHeightBasedOn = 'real';
[56] Fix | Delete
public $responsiveDecreaseSliderHeight = 0;
[57] Fix | Delete
[58] Fix | Delete
public $focusUser = 1;
[59] Fix | Delete
[60] Fix | Delete
public $focusEdge = 'auto';
[61] Fix | Delete
[62] Fix | Delete
protected $enabledDevices = array(
[63] Fix | Delete
'desktopLandscape' => 0,
[64] Fix | Delete
'desktopPortrait' => 1,
[65] Fix | Delete
'tabletLandscape' => 0,
[66] Fix | Delete
'tabletPortrait' => 1,
[67] Fix | Delete
'mobileLandscape' => 0,
[68] Fix | Delete
'mobilePortrait' => 1
[69] Fix | Delete
);
[70] Fix | Delete
[71] Fix | Delete
protected $breakpoints = array();
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* @var array[]
[75] Fix | Delete
*/
[76] Fix | Delete
public $mediaQueries = array(
[77] Fix | Delete
'all' => false
[78] Fix | Delete
);
[79] Fix | Delete
[80] Fix | Delete
public $sizes = array(
[81] Fix | Delete
'desktopPortrait' => array(
[82] Fix | Delete
'width' => 800,
[83] Fix | Delete
'height' => 600
[84] Fix | Delete
),
[85] Fix | Delete
);
[86] Fix | Delete
[87] Fix | Delete
public static $translation = array(
[88] Fix | Delete
'desktoplandscape' => 'desktopLandscape',
[89] Fix | Delete
'desktopportrait' => 'desktopPortrait',
[90] Fix | Delete
'tabletlandscape' => 'tabletLandscape',
[91] Fix | Delete
'tabletportrait' => 'tabletPortrait',
[92] Fix | Delete
'mobilelandscape' => 'mobileLandscape',
[93] Fix | Delete
'mobileportrait' => 'mobilePortrait'
[94] Fix | Delete
);
[95] Fix | Delete
[96] Fix | Delete
public function __construct($slider, $features) {
[97] Fix | Delete
[98] Fix | Delete
$this->slider = $slider;
[99] Fix | Delete
[100] Fix | Delete
$this->hideOnDesktopLandscape = !intval($slider->params->get('desktoplandscape', 1));
[101] Fix | Delete
$this->hideOnDesktopPortrait = !intval($slider->params->get('desktopportrait', 1));
[102] Fix | Delete
[103] Fix | Delete
$this->hideOnTabletLandscape = !intval($slider->params->get('tabletlandscape', 1));
[104] Fix | Delete
$this->hideOnTabletPortrait = !intval($slider->params->get('tabletportrait', 1));
[105] Fix | Delete
[106] Fix | Delete
$this->hideOnMobileLandscape = !intval($slider->params->get('mobilelandscape', 1));
[107] Fix | Delete
$this->hideOnMobilePortrait = !intval($slider->params->get('mobileportrait', 1));
[108] Fix | Delete
[109] Fix | Delete
[110] Fix | Delete
$this->focusUser = intval($slider->params->get('responsiveFocusUser', 1));
[111] Fix | Delete
[112] Fix | Delete
$this->focusEdge = $slider->params->get('responsiveFocusEdge', 'auto');
[113] Fix | Delete
[114] Fix | Delete
$this->responsivePlugin = ResponsiveTypeFactory::createFrontend($slider->params->get('responsive-mode', 'auto'), $this);
[115] Fix | Delete
$this->type = $this->responsivePlugin->getType();
[116] Fix | Delete
$this->responsivePlugin->parse($slider->params, $this, $features);
[117] Fix | Delete
[118] Fix | Delete
$this->onResizeEnabled = !$slider->disableResponsive;
[119] Fix | Delete
[120] Fix | Delete
if (!$this->scaleDown && !$this->scaleUp) {
[121] Fix | Delete
$this->onResizeEnabled = 0;
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
$overrideSizeEnabled = !!$slider->params->get('slider-size-override', 0);
[125] Fix | Delete
[126] Fix | Delete
$this->sizes['desktopPortrait']['width'] = max(10, intval($slider->params->get('width', 1200)));
[127] Fix | Delete
$this->sizes['desktopPortrait']['height'] = max(10, intval($slider->params->get('height', 600)));
[128] Fix | Delete
[129] Fix | Delete
$heightHelperRatio = $this->sizes['desktopPortrait']['height'] / $this->sizes['desktopPortrait']['width'];
[130] Fix | Delete
[131] Fix | Delete
$this->enabledDevices['desktopLandscape'] = intval($slider->params->get('responsive-breakpoint-desktop-landscape-enabled', 0));
[132] Fix | Delete
$this->enabledDevices['tabletLandscape'] = intval($slider->params->get('responsive-breakpoint-tablet-landscape-enabled', 0));
[133] Fix | Delete
$this->enabledDevices['tabletPortrait'] = intval($slider->params->get('responsive-breakpoint-tablet-portrait-enabled', 1));
[134] Fix | Delete
$this->enabledDevices['mobileLandscape'] = intval($slider->params->get('responsive-breakpoint-mobile-landscape-enabled', 0));
[135] Fix | Delete
$this->enabledDevices['mobilePortrait'] = intval($slider->params->get('responsive-breakpoint-mobile-portrait-enabled', 1));
[136] Fix | Delete
[137] Fix | Delete
$useLocalBreakpoints = !$slider->params->get('responsive-breakpoint-global', 0);
[138] Fix | Delete
[139] Fix | Delete
$landscapePortraitWidth = $breakpointWidthLandscape = 3001;
[140] Fix | Delete
$previousSize = false;
[141] Fix | Delete
[142] Fix | Delete
if ($this->enabledDevices['desktopLandscape']) {
[143] Fix | Delete
[144] Fix | Delete
$landscapePortraitWidth = $breakpointWidthPortrait = intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-desktop-portrait', ViewSettingsGeneral::defaults['desktop-large-portrait']) : Settings::get('responsive-screen-width-desktop-portrait', ViewSettingsGeneral::defaults['desktop-large-portrait']));
[145] Fix | Delete
$breakpointWidthLandscape = max($landscapePortraitWidth, intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-desktop-portrait-landscape', ViewSettingsGeneral::defaults['desktop-large-landscape']) : Settings::get('responsive-screen-width-desktop-portrait-landscape', ViewSettingsGeneral::defaults['desktop-large-landscape'])));
[146] Fix | Delete
[147] Fix | Delete
$this->breakpoints[] = array(
[148] Fix | Delete
'device' => 'desktopLandscape',
[149] Fix | Delete
'type' => 'min-screen-width',
[150] Fix | Delete
'portraitWidth' => $breakpointWidthPortrait,
[151] Fix | Delete
'landscapeWidth' => $breakpointWidthLandscape
[152] Fix | Delete
);
[153] Fix | Delete
[154] Fix | Delete
$editorWidth = intval($slider->params->get('desktop-landscape-width', 1440));
[155] Fix | Delete
[156] Fix | Delete
if ($overrideSizeEnabled && $slider->params->get('slider-size-override-desktop-landscape', 0) && $editorWidth > 10) {
[157] Fix | Delete
[158] Fix | Delete
$customHeight = false;
[159] Fix | Delete
$editorHeight = intval($slider->params->get('desktop-landscape-height', 900));
[160] Fix | Delete
[161] Fix | Delete
if ($editorWidth < $breakpointWidthPortrait) {
[162] Fix | Delete
if ($editorHeight > 0) {
[163] Fix | Delete
$editorHeight = $breakpointWidthPortrait / $editorWidth * $editorHeight;
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
$editorWidth = $breakpointWidthPortrait;
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
if ($editorHeight <= 0) {
[170] Fix | Delete
switch ($this->slider->data->get('type', 'simple')) {
[171] Fix | Delete
case 'carousel':
[172] Fix | Delete
case 'showcase':
[173] Fix | Delete
$editorHeight = 0;
[174] Fix | Delete
break;
[175] Fix | Delete
default:
[176] Fix | Delete
$editorHeight = $editorWidth * $heightHelperRatio;
[177] Fix | Delete
}
[178] Fix | Delete
} else {
[179] Fix | Delete
$customHeight = true;
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
$this->sizes['desktopLandscape'] = array(
[183] Fix | Delete
'width' => $editorWidth,
[184] Fix | Delete
'height' => floor($editorHeight),
[185] Fix | Delete
'customHeight' => $customHeight
[186] Fix | Delete
);
[187] Fix | Delete
} else {
[188] Fix | Delete
[189] Fix | Delete
$this->sizes['desktopLandscape'] = array(
[190] Fix | Delete
'width' => $this->sizes['desktopPortrait']['width'],
[191] Fix | Delete
'height' => $this->sizes['desktopPortrait']['height'],
[192] Fix | Delete
'customHeight' => false
[193] Fix | Delete
);
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
$this->sizes['desktopLandscape']['max'] = 3000;
[197] Fix | Delete
$this->sizes['desktopLandscape']['min'] = $breakpointWidthPortrait;
[198] Fix | Delete
[199] Fix | Delete
$previousSize = &$this->sizes['desktopLandscape'];
[200] Fix | Delete
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
$this->sizes['desktopPortrait']['max'] = max($this->sizes['desktopPortrait']['width'], $landscapePortraitWidth - 1, $breakpointWidthLandscape - 1);
[204] Fix | Delete
[205] Fix | Delete
$previousSize = &$this->sizes['desktopPortrait'];
[206] Fix | Delete
[207] Fix | Delete
/**
[208] Fix | Delete
* Keep a copy of the current smallest width to be able to disable smaller devices
[209] Fix | Delete
*/
[210] Fix | Delete
$smallestWidth = $this->sizes['desktopPortrait']['width'];
[211] Fix | Delete
[212] Fix | Delete
if ($this->enabledDevices['tabletLandscape']) {
[213] Fix | Delete
[214] Fix | Delete
$breakpointWidthPortrait = intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-tablet-landscape', ViewSettingsGeneral::defaults['tablet-large-portrait']) : Settings::get('responsive-screen-width-tablet-landscape', ViewSettingsGeneral::defaults['tablet-large-portrait']));
[215] Fix | Delete
$breakpointWidthLandscape = max($breakpointWidthPortrait, intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-tablet-landscape-landscape', ViewSettingsGeneral::defaults['tablet-large-landscape']) : Settings::get('responsive-screen-width-tablet-landscape-landscape', ViewSettingsGeneral::defaults['tablet-large-landscape'])));
[216] Fix | Delete
[217] Fix | Delete
$this->breakpoints[] = array(
[218] Fix | Delete
'device' => 'tabletLandscape',
[219] Fix | Delete
'type' => 'max-screen-width',
[220] Fix | Delete
'portraitWidth' => $breakpointWidthPortrait,
[221] Fix | Delete
'landscapeWidth' => $breakpointWidthLandscape
[222] Fix | Delete
);
[223] Fix | Delete
[224] Fix | Delete
$editorWidth = intval($slider->params->get('tablet-landscape-width', 1024));
[225] Fix | Delete
[226] Fix | Delete
if ($overrideSizeEnabled && $slider->params->get('slider-size-override-tablet-landscape', 0) && $editorWidth > 10) {
[227] Fix | Delete
[228] Fix | Delete
$customHeight = false;
[229] Fix | Delete
$editorHeight = intval($slider->params->get('tablet-landscape-height', 768));
[230] Fix | Delete
[231] Fix | Delete
if ($editorWidth > $breakpointWidthPortrait) {
[232] Fix | Delete
if ($editorHeight > 0) {
[233] Fix | Delete
$editorHeight = $breakpointWidthPortrait / $editorWidth * $editorHeight;
[234] Fix | Delete
}
[235] Fix | Delete
[236] Fix | Delete
$editorWidth = $breakpointWidthPortrait;
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
if ($editorHeight <= 0) {
[240] Fix | Delete
$editorHeight = $editorWidth * $heightHelperRatio;
[241] Fix | Delete
} else {
[242] Fix | Delete
$customHeight = true;
[243] Fix | Delete
}
[244] Fix | Delete
[245] Fix | Delete
$this->sizes['tabletLandscape'] = array(
[246] Fix | Delete
'width' => $editorWidth,
[247] Fix | Delete
'height' => floor($editorHeight),
[248] Fix | Delete
'customHeight' => $customHeight
[249] Fix | Delete
);
[250] Fix | Delete
[251] Fix | Delete
$smallestWidth = min($smallestWidth, $editorWidth);
[252] Fix | Delete
} else {
[253] Fix | Delete
$width = min($smallestWidth, $breakpointWidthPortrait);
[254] Fix | Delete
[255] Fix | Delete
$this->sizes['tabletLandscape'] = array(
[256] Fix | Delete
'width' => $width,
[257] Fix | Delete
'height' => floor($width * $heightHelperRatio),
[258] Fix | Delete
'auto' => true,
[259] Fix | Delete
'customHeight' => false
[260] Fix | Delete
);
[261] Fix | Delete
[262] Fix | Delete
$smallestWidth = min($smallestWidth, $breakpointWidthPortrait);
[263] Fix | Delete
}
[264] Fix | Delete
[265] Fix | Delete
$this->sizes['tabletLandscape']['max'] = max($this->sizes['tabletLandscape']['width'], $breakpointWidthPortrait, $breakpointWidthLandscape);
[266] Fix | Delete
[267] Fix | Delete
$previousSize['min'] = min($previousSize['width'], $breakpointWidthPortrait + 1);
[268] Fix | Delete
[269] Fix | Delete
$previousSize = &$this->sizes['tabletLandscape'];
[270] Fix | Delete
[271] Fix | Delete
}
[272] Fix | Delete
[273] Fix | Delete
if ($this->enabledDevices['tabletPortrait']) {
[274] Fix | Delete
[275] Fix | Delete
$breakpointWidthPortrait = intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-tablet-portrait', ViewSettingsGeneral::defaults['tablet-portrait']) : Settings::get('responsive-screen-width-tablet-portrait', ViewSettingsGeneral::defaults['tablet-portrait']));
[276] Fix | Delete
$breakpointWidthLandscape = max($breakpointWidthPortrait, intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-tablet-portrait-landscape', ViewSettingsGeneral::defaults['tablet-landscape']) : Settings::get('responsive-screen-width-tablet-portrait-landscape', ViewSettingsGeneral::defaults['tablet-landscape'])));
[277] Fix | Delete
[278] Fix | Delete
$this->breakpoints[] = array(
[279] Fix | Delete
'device' => 'tabletPortrait',
[280] Fix | Delete
'type' => 'max-screen-width',
[281] Fix | Delete
'portraitWidth' => $breakpointWidthPortrait,
[282] Fix | Delete
'landscapeWidth' => $breakpointWidthLandscape
[283] Fix | Delete
);
[284] Fix | Delete
[285] Fix | Delete
$editorWidth = intval($slider->params->get('tablet-portrait-width', 768));
[286] Fix | Delete
[287] Fix | Delete
if ($overrideSizeEnabled && $slider->params->get('slider-size-override-tablet-portrait', 0) && $editorWidth > 10) {
[288] Fix | Delete
[289] Fix | Delete
$customHeight = false;
[290] Fix | Delete
$editorHeight = intval($slider->params->get('tablet-portrait-height', 1024));
[291] Fix | Delete
[292] Fix | Delete
if ($editorWidth > $breakpointWidthPortrait) {
[293] Fix | Delete
if ($editorHeight > 0) {
[294] Fix | Delete
$editorHeight = $breakpointWidthPortrait / $editorWidth * $editorHeight;
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
$editorWidth = $breakpointWidthPortrait;
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
if ($editorHeight <= 0) {
[301] Fix | Delete
$editorHeight = $editorWidth * $heightHelperRatio;
[302] Fix | Delete
} else {
[303] Fix | Delete
$customHeight = true;
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
$this->sizes['tabletPortrait'] = array(
[307] Fix | Delete
'width' => $editorWidth,
[308] Fix | Delete
'height' => floor($editorHeight),
[309] Fix | Delete
'customHeight' => $customHeight
[310] Fix | Delete
);
[311] Fix | Delete
[312] Fix | Delete
$smallestWidth = min($smallestWidth, $editorWidth);
[313] Fix | Delete
} else {
[314] Fix | Delete
$width = min($smallestWidth, $breakpointWidthPortrait);
[315] Fix | Delete
[316] Fix | Delete
$this->sizes['tabletPortrait'] = array(
[317] Fix | Delete
'width' => $width,
[318] Fix | Delete
'height' => floor($width * $heightHelperRatio),
[319] Fix | Delete
'auto' => true,
[320] Fix | Delete
'customHeight' => false
[321] Fix | Delete
);
[322] Fix | Delete
[323] Fix | Delete
$smallestWidth = min($smallestWidth, $breakpointWidthPortrait);
[324] Fix | Delete
}
[325] Fix | Delete
[326] Fix | Delete
$this->sizes['tabletPortrait']['max'] = max($this->sizes['tabletPortrait']['width'], $breakpointWidthPortrait, $breakpointWidthLandscape);
[327] Fix | Delete
[328] Fix | Delete
$previousSize['min'] = min($previousSize['width'], $breakpointWidthPortrait + 1);
[329] Fix | Delete
[330] Fix | Delete
$previousSize = &$this->sizes['tabletPortrait'];
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
if ($this->enabledDevices['mobileLandscape']) {
[334] Fix | Delete
[335] Fix | Delete
$breakpointWidthPortrait = intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-mobile-landscape', ViewSettingsGeneral::defaults['mobile-large-portrait']) : Settings::get('responsive-screen-width-mobile-landscape', ViewSettingsGeneral::defaults['mobile-large-portrait']));
[336] Fix | Delete
$breakpointWidthLandscape = max($breakpointWidthPortrait, intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-mobile-landscape-landscape', ViewSettingsGeneral::defaults['mobile-large-landscape']) : Settings::get('responsive-screen-width-mobile-landscape-landscape', ViewSettingsGeneral::defaults['mobile-large-landscape'])));
[337] Fix | Delete
[338] Fix | Delete
$this->breakpoints[] = array(
[339] Fix | Delete
'device' => 'mobileLandscape',
[340] Fix | Delete
'type' => 'max-screen-width',
[341] Fix | Delete
'portraitWidth' => $breakpointWidthPortrait,
[342] Fix | Delete
'landscapeWidth' => $breakpointWidthLandscape
[343] Fix | Delete
);
[344] Fix | Delete
[345] Fix | Delete
[346] Fix | Delete
$editorWidth = intval($slider->params->get('mobile-landscape-width', 568));
[347] Fix | Delete
[348] Fix | Delete
if ($overrideSizeEnabled && $slider->params->get('slider-size-override-mobile-landscape', 0) && $editorWidth > 10) {
[349] Fix | Delete
[350] Fix | Delete
$customHeight = false;
[351] Fix | Delete
$editorHeight = intval($slider->params->get('mobile-landscape-height', 320));
[352] Fix | Delete
[353] Fix | Delete
if ($editorWidth > $breakpointWidthPortrait) {
[354] Fix | Delete
if ($editorHeight > 0) {
[355] Fix | Delete
$editorHeight = $breakpointWidthPortrait / $editorWidth * $editorHeight;
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
$editorWidth = $breakpointWidthPortrait;
[359] Fix | Delete
}
[360] Fix | Delete
[361] Fix | Delete
if ($editorHeight <= 0) {
[362] Fix | Delete
$editorHeight = $editorWidth * $heightHelperRatio;
[363] Fix | Delete
} else {
[364] Fix | Delete
$customHeight = true;
[365] Fix | Delete
}
[366] Fix | Delete
[367] Fix | Delete
$this->sizes['mobileLandscape'] = array(
[368] Fix | Delete
'width' => $editorWidth,
[369] Fix | Delete
'height' => floor($editorHeight),
[370] Fix | Delete
'customHeight' => $customHeight
[371] Fix | Delete
);
[372] Fix | Delete
[373] Fix | Delete
$smallestWidth = min($smallestWidth, $editorWidth);
[374] Fix | Delete
} else {
[375] Fix | Delete
[376] Fix | Delete
$width = min($smallestWidth, $breakpointWidthPortrait);
[377] Fix | Delete
[378] Fix | Delete
$this->sizes['mobileLandscape'] = array(
[379] Fix | Delete
'width' => $width,
[380] Fix | Delete
'height' => floor($width * $heightHelperRatio),
[381] Fix | Delete
'auto' => true,
[382] Fix | Delete
'customHeight' => false
[383] Fix | Delete
);
[384] Fix | Delete
[385] Fix | Delete
$smallestWidth = min($smallestWidth, $breakpointWidthPortrait);
[386] Fix | Delete
}
[387] Fix | Delete
[388] Fix | Delete
$this->sizes['mobileLandscape']['max'] = max($this->sizes['mobileLandscape']['width'], $breakpointWidthPortrait, $breakpointWidthLandscape);
[389] Fix | Delete
[390] Fix | Delete
$previousSize['min'] = min($previousSize['width'], $breakpointWidthPortrait + 1);
[391] Fix | Delete
[392] Fix | Delete
$previousSize = &$this->sizes['mobileLandscape'];
[393] Fix | Delete
}
[394] Fix | Delete
[395] Fix | Delete
if ($this->enabledDevices['mobilePortrait']) {
[396] Fix | Delete
[397] Fix | Delete
$breakpointWidthPortrait = intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-mobile-portrait', ViewSettingsGeneral::defaults['mobile-portrait']) : Settings::get('responsive-screen-width-mobile-portrait', ViewSettingsGeneral::defaults['mobile-portrait']));
[398] Fix | Delete
$breakpointWidthLandscape = max($breakpointWidthPortrait, intval($useLocalBreakpoints ? $slider->params->get('responsive-breakpoint-mobile-portrait-landscape', ViewSettingsGeneral::defaults['mobile-landscape']) : Settings::get('responsive-screen-width-mobile-portrait-landscape', ViewSettingsGeneral::defaults['mobile-landscape'])));
[399] Fix | Delete
[400] Fix | Delete
$this->breakpoints[] = array(
[401] Fix | Delete
'device' => 'mobilePortrait',
[402] Fix | Delete
'type' => 'max-screen-width',
[403] Fix | Delete
'portraitWidth' => $breakpointWidthPortrait,
[404] Fix | Delete
'landscapeWidth' => $breakpointWidthLandscape
[405] Fix | Delete
);
[406] Fix | Delete
[407] Fix | Delete
[408] Fix | Delete
$editorWidth = intval($slider->params->get('mobile-portrait-width', 320));
[409] Fix | Delete
[410] Fix | Delete
if ($overrideSizeEnabled && $slider->params->get('slider-size-override-mobile-portrait', 0) && $editorWidth > 10) {
[411] Fix | Delete
[412] Fix | Delete
$customHeight = false;
[413] Fix | Delete
$editorHeight = intval($slider->params->get('mobile-portrait-height', 568));
[414] Fix | Delete
[415] Fix | Delete
if ($editorWidth > $breakpointWidthPortrait) {
[416] Fix | Delete
if ($editorHeight > 0) {
[417] Fix | Delete
$editorHeight = $breakpointWidthPortrait / $editorWidth * $editorHeight;
[418] Fix | Delete
}
[419] Fix | Delete
[420] Fix | Delete
$editorWidth = $breakpointWidthPortrait;
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
if ($editorHeight <= 0) {
[424] Fix | Delete
$editorHeight = $editorWidth * $heightHelperRatio;
[425] Fix | Delete
} else {
[426] Fix | Delete
$customHeight = true;
[427] Fix | Delete
}
[428] Fix | Delete
[429] Fix | Delete
$this->sizes['mobilePortrait'] = array(
[430] Fix | Delete
'width' => $editorWidth,
[431] Fix | Delete
'height' => floor($editorHeight),
[432] Fix | Delete
'customHeight' => $customHeight
[433] Fix | Delete
);
[434] Fix | Delete
} else {
[435] Fix | Delete
$width = min(320, $smallestWidth, $breakpointWidthPortrait);
[436] Fix | Delete
[437] Fix | Delete
$this->sizes['mobilePortrait'] = array(
[438] Fix | Delete
'width' => $width,
[439] Fix | Delete
'height' => floor($width * $heightHelperRatio),
[440] Fix | Delete
'customHeight' => false
[441] Fix | Delete
);
[442] Fix | Delete
}
[443] Fix | Delete
[444] Fix | Delete
$this->sizes['mobilePortrait']['max'] = max($this->sizes['mobilePortrait']['width'], $breakpointWidthPortrait, $breakpointWidthLandscape);
[445] Fix | Delete
[446] Fix | Delete
$previousSize['min'] = min($previousSize['width'], $breakpointWidthPortrait + 1);
[447] Fix | Delete
[448] Fix | Delete
$previousSize = &$this->sizes['mobilePortrait'];
[449] Fix | Delete
}
[450] Fix | Delete
[451] Fix | Delete
$previousSize['min'] = min(320, $previousSize['width']);
[452] Fix | Delete
[453] Fix | Delete
if (isset($this->sizes['mobileLandscape']['auto'])) {
[454] Fix | Delete
unset($this->sizes['mobileLandscape']['auto']);
[455] Fix | Delete
[456] Fix | Delete
$this->sizes['mobileLandscape']['width'] = $this->sizes['mobileLandscape']['min'];
[457] Fix | Delete
$this->sizes['mobileLandscape']['height'] = floor($this->sizes['mobileLandscape']['width'] * $heightHelperRatio);
[458] Fix | Delete
}
[459] Fix | Delete
[460] Fix | Delete
if (isset($this->sizes['tabletPortrait']['auto'])) {
[461] Fix | Delete
unset($this->sizes['tabletPortrait']['auto']);
[462] Fix | Delete
[463] Fix | Delete
$this->sizes['tabletPortrait']['width'] = $this->sizes['tabletPortrait']['min'];
[464] Fix | Delete
$this->sizes['tabletPortrait']['height'] = floor($this->sizes['tabletPortrait']['width'] * $heightHelperRatio);
[465] Fix | Delete
}
[466] Fix | Delete
[467] Fix | Delete
if (isset($this->sizes['tabletLandscape']['auto'])) {
[468] Fix | Delete
unset($this->sizes['tabletLandscape']['auto']);
[469] Fix | Delete
[470] Fix | Delete
$this->sizes['tabletLandscape']['width'] = $this->sizes['tabletLandscape']['min'];
[471] Fix | Delete
$this->sizes['tabletLandscape']['height'] = floor($this->sizes['tabletLandscape']['width'] * $heightHelperRatio);
[472] Fix | Delete
}
[473] Fix | Delete
[474] Fix | Delete
$this->parseLimitSlideWidth($slider->params);
[475] Fix | Delete
[476] Fix | Delete
$breakpointData = array();
[477] Fix | Delete
foreach ($this->breakpoints as $breakpoint) {
[478] Fix | Delete
$breakpointData[$breakpoint['device']] = $breakpoint;
[479] Fix | Delete
}
[480] Fix | Delete
[481] Fix | Delete
if (isset($breakpointData['desktopLandscape'])) {
[482] Fix | Delete
[483] Fix | Delete
$portraitMinWidth = $breakpointData['desktopLandscape']['portraitWidth'];
[484] Fix | Delete
$landscapeMinWidth = $breakpointData['desktopLandscape']['landscapeWidth'];
[485] Fix | Delete
[486] Fix | Delete
if ($portraitMinWidth == $landscapeMinWidth || $this->slider->isFrame) {
[487] Fix | Delete
$this->mediaQueries['desktoplandscape'] = array('(min-width: ' . $portraitMinWidth . 'px)');
[488] Fix | Delete
[489] Fix | Delete
} else {
[490] Fix | Delete
$this->mediaQueries['desktoplandscape'] = array(
[491] Fix | Delete
'(orientation: landscape) and (min-width: ' . $landscapeMinWidth . 'px)',
[492] Fix | Delete
'(orientation: portrait) and (min-width: ' . $portraitMinWidth . 'px)'
[493] Fix | Delete
);
[494] Fix | Delete
}
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
$nextSize = null;
[498] Fix | Delete
foreach (array(
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function