Merge pull request #4022 from IgorA100/patch-106

Fix: Select layout on Montage page
pull/4029/head
Isaac Connor 2024-05-22 09:09:34 -04:00 committed by GitHub
commit d5368181a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 19 deletions

View File

@ -49,6 +49,7 @@ var defaultPresetRatio = 'auto';
var averageMonitorsRatio; var averageMonitorsRatio;
function isPresetLayout(name) { function isPresetLayout(name) {
name = (name == "Auto") ? "Freeform" : name;
return ((ZM_PRESET_LAYOUT_NAMES.indexOf(name) != -1) ? true : false); return ((ZM_PRESET_LAYOUT_NAMES.indexOf(name) != -1) ? true : false);
} }

View File

@ -202,27 +202,21 @@ foreach ($displayMonitors as &$row) {
} }
} # end foreach Monitor } # end foreach Monitor
if (!$layout_id || !is_numeric($layout_id) || !isset($layoutsById[$layout_id]) || $layout_id == $AutoLayoutName) { $default_layout = '';
$default_layout = ''; if (count($monitors) >= 6) {
if (count($monitors) >= 6) { $default_layout = '6 Wide';
$default_layout = '6 Wide'; } else if (count($monitors) >= 4) {
} else if (count($monitors) >= 4) { $default_layout = '4 Wide';
$default_layout = '4 Wide';
} else {
$default_layout = '2 Wide';
}
if ($layout_id != $AutoLayoutName) {
$layout_id = $arrNameId[$default_layout];
} else {
$AutoLayoutName = $default_layout;
}
}
if ( $layout_id and is_numeric($layout_id) and isset($layoutsById[$layout_id]) ) {
} else { } else {
ZM\Debug('Layout not found'); $default_layout = '2 Wide';
} }
if (!$layout_id || !is_numeric($layout_id) || !isset($layoutsById[$layout_id]) || $layout_id == $AutoLayoutName) {
$layout_id = $arrNameId["Freeform"];
} else if ($layout_id == $AutoLayoutName) {
$layout_id = $arrNameId[$default_layout];
}
$AutoLayoutName = $default_layout;
xhtmlHeaders(__FILE__, translate('Montage')); xhtmlHeaders(__FILE__, translate('Montage'));
getBodyTopHTML(); getBodyTopHTML();