add ZM_BANDWIDTH_DEFAULT

pull/2077/head
Isaac Connor 2017-10-12 12:09:05 -04:00
parent ad97023732
commit e6c0add17e
6 changed files with 21 additions and 9 deletions

View File

@ -193,6 +193,16 @@ our @options = (
type => $types{string},
category => 'system',
},
{
name => 'ZM_BANDWIDTH_DEFAULT',
default => 'high',
description => 'Default setting for bandwidth profile used by web interface',
help => q`The classic skin for ZoneMinder has different
profiles to use for low medium or high bandwidth connections.
`,
type => $types{string},
category => 'system',
},
{
name => 'ZM_LANG_DEFAULT',
default => 'en_gb',

View File

@ -44,7 +44,7 @@ $scales = array(
'12.5' => '1/8x',
);
$bwArray = array(
$bandwidth_options = array(
'high' => translate('High'),
'medium' => translate('Medium'),
'low' => translate('Low')

View File

@ -18,6 +18,8 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
if ( empty($_COOKIE['zmBandwidth']) )
$_COOKIE['zmBandwidth'] = ZM_BANDWIDTH_DEFAULT;
if ( empty($_COOKIE['zmBandwidth']) )
$_COOKIE['zmBandwidth'] = "low";

View File

@ -24,12 +24,12 @@ if ( $user && !empty($user['MaxBandwidth']) )
{
if ( $user['MaxBandwidth'] == "low" )
{
unset( $bwArray['high'] );
unset( $bwArray['medium'] );
unset( $bandwidth_options['high'] );
unset( $bandwidth_options['medium'] );
}
elseif ( $user['MaxBandwidth'] == "medium" )
{
unset( $bwArray['high'] );
unset( $bandwidth_options['high'] );
}
}
@ -47,7 +47,7 @@ xhtmlHeaders(__FILE__, translate('Bandwidth') );
<input type="hidden" name="view" value="none"/>
<input type="hidden" name="action" value="bandwidth"/>
<p><?php echo translate('SetNewBandwidth') ?></p>
<p><?php echo buildSelect( "newBandwidth", $bwArray ) ?></p>
<p><?php echo buildSelect( "newBandwidth", $bandwidth_options ) ?></p>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Save') ?>"/><input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow();"/>
</div>

View File

@ -178,7 +178,7 @@ foreach( array_map( 'basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDI
<td class="colMonitors"><?php echo validHtmlStr($row['Monitors']) ?></td>
<td class="colGroups"><?php echo validHtmlStr($row['Groups']) ?></td>
<td class="colSystem"><?php echo validHtmlStr($row['System']) ?></td>
<td class="colBandwidth"><?php echo $row['MaxBandwidth']?$bwArray[$row['MaxBandwidth']]:'&nbsp;' ?></td>
<td class="colBandwidth"><?php echo $row['MaxBandwidth']?$bandwidth_options[$row['MaxBandwidth']]:'&nbsp;' ?></td>
<td class="colMonitor"><?php echo $row['MonitorIds']?(join( ", ", $userMonitors )):"&nbsp;" ?></td>
<td class="colMark"><input type="checkbox" name="markUids[]" value="<?php echo $row['Id'] ?>" onclick="configureDeleteButton( this );"<?php if ( !$canEdit ) { ?> disabled="disabled"<?php } ?>/></td>
</tr>
@ -257,11 +257,11 @@ foreach( array_map( 'basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDI
</form>
<?php
} else {
if ( $tab == "system" ) {
if ( $tab == 'system' ) {
$configCats[$tab]['ZM_LANG_DEFAULT']['Hint'] = join( '|', getLanguages() );
$configCats[$tab]['ZM_SKIN_DEFAULT']['Hint'] = join( '|', $skin_options );
$configCats[$tab]['ZM_CSS_DEFAULT']['Hint'] = join( '|', array_map ( 'basename', glob('skins/'.ZM_SKIN_DEFAULT.'/css/*',GLOB_ONLYDIR) ) );
$configCats[$tab]['ZM_BANDWIDTH_DEFAULT']['Hint'] = join( '|', $bandwidth_options );
}
?>
<form name="optionsForm" class="form-horizontal" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">

View File

@ -43,7 +43,7 @@ $monitorIds = array_flip(explode( ',', $newUser['MonitorIds'] ));
$yesno = array( 0=>translate('No'), 1=>translate('Yes') );
$nv = array( 'None'=>translate('None'), 'View'=>translate('View') );
$nve = array( 'None'=>translate('None'), 'View'=>translate('View'), 'Edit'=>translate('Edit') );
$bandwidths = array_merge( array( ""=>"" ), $bwArray );
$bandwidths = array_merge( array( ""=>"" ), $bandwidth_options );
$langs = array_merge( array( ""=>"" ), getLanguages() );
$sql = "select Id,Name from Monitors order by Sequence asc";