Skip to content

Commit b613d56

Browse files
Only show CaptureMethod if there is more than 1 option
1 parent d1e8975 commit b613d56

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

web/skins/classic/views/monitor.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -654,21 +654,20 @@ class="nav-link<?php echo $tab == $name ? ' active' : '' ?>"
654654
<?php echo ($monitor->Device() and isset($devices[$monitor->Device()]) ) ? 'style="display: none;"' : '' ?>
655655
/>
656656
</li>
657-
<li>
658-
<label><?php echo translate('CaptureMethod') ?></label>
659-
<?php
657+
<?php
660658
$localMethods = array(
661659
'v4l2' => 'Video For Linux version 2',
662660
);
663661
if (!ZM_HAS_V4L2)
664662
unset($localMethods['v4l2']);
665-
if (!isset($localMethods[$monitor->Method()])) $monitor->Method('v4l2');
666-
echo htmlSelect('newMonitor[Method]', $localMethods,
667-
((count($localMethods)==1) ? array_keys($localMethods)[0] : $monitor->Method()),
668-
array('data-on-change'=>'submitTab', 'data-tab-name'=>$tab) );
669-
?>
670-
</li>
671-
<?php
663+
if (!isset($localMethods[$monitor->Method()])) $monitor->Method(array_keys($localMethods)[0]);
664+
if (count($localMethods)>1) {
665+
echo '<li><label>'.translate('CaptureMethod').'</label>';
666+
echo htmlSelect('newMonitor[Method]', $localMethods, $monitor->Method(), ['data-on-change'=>'submitTab', 'data-tab-name'=>$tab] );
667+
echo '</li>'.PHP_EOL;
668+
} else {
669+
echo '<input type="hidden" name="newMonitor[Method]" value="'.validHtmlStr($monitor->Method()).'"/>'.PHP_EOL;
670+
}
672671
if ( ZM_HAS_V4L2 && $monitor->Method() == 'v4l2' ) {
673672
?>
674673
<li>

0 commit comments

Comments
 (0)