upgrade to bootstrap 4.5

This commit is contained in:
Andrew Bauer 2020-07-25 13:18:09 -05:00
parent fe9db4cfa2
commit c48fa83c6d
9 changed files with 11358 additions and 2259 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -256,25 +256,25 @@ function getNavBarHTML($reload = null) {
$status = $running ? ($state ? $state : translate('Running')) : translate('Stopped'); $status = $running ? ($state ? $state : translate('Running')) : translate('Stopped');
?> ?>
<div class="navbar navbar-inverse navbar-static-top"> <div class="fixed-top container-fluid p-0 p-0">
<div class="container-fluid"> <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-center flex-row">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-header-nav" aria-expanded="false"> <div class="navbar-brand justify-content-start">
<?php echo getNavBrandHTML() ?>
</div>
<!-- the Navigation Bar Hamburger Button -->
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#main-header-nav" aria-expanded="false">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="navbar-toggler-icon"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> </button>
<div class="navbar-brand">
<?php echo getNavBrandHTML(); ?>
</div>
</div>
<div class="collapse navbar-collapse" id="main-header-nav"> <div class="collapse navbar-collapse" id="main-header-nav">
<ul class="nav navbar-nav">
<?php <?php
// *** Build the navigation bar menu items *** // *** Build the navigation bar menu items ***
if ( $user and $user['Username'] ) { if ( $user and $user['Username'] ) {
echo '<ul class="navbar-nav justify-content-center">';
echo getConsoleHTML(); echo getConsoleHTML();
echo getOptionsHTML(); echo getOptionsHTML();
echo getLogHTML(); echo getLogHTML();
@ -286,22 +286,19 @@ function getNavBarHTML($reload = null) {
echo getMontageReviewHTML(); echo getMontageReviewHTML();
echo getRprtEvntAuditHTML(); echo getRprtEvntAuditHTML();
echo getHeaderFlipHTML(); echo getHeaderFlipHTML();
echo '</ul>'; echo '</ul>';
echo '<div class="navbar-right">'; echo '<ul class="nav navbar-nav justify-content-end">';
echo getAcctCircleHTML($user); echo getAcctCircleHTML($user);
echo getStatusBtnHTML($status); echo getStatusBtnHTML($status);
echo '</div>';
} else { # end if $user and $user['Username']
echo '</ul>'; echo '</ul>';
} # end if $user and $user['Username'] }
?> ?>
</div><!-- End .navbar-collapse --> </div>
</div> <!-- End .container-fluid --> </nav><!-- End First Navbar -->
<div id="panel"<?php echo ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'down' ) ? 'style="display:none;"' : '' ?>>
<nav class="navbar navbar-expand-md bg-dark justify-content-center p-0">
<div class="container-fluid" id="panel"<?php echo ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'down' ) ? 'style="display:none;"' : '' ?>>
<?php <?php
} //end reload null. Runs on full page load } //end reload null. Runs on full page load
@ -311,14 +308,13 @@ if ( (!ZM_OPT_USE_AUTH) or $user ) {
// *** Build the statistics shown on the navigation bar *** // *** Build the statistics shown on the navigation bar ***
?> ?>
<div id="reload" class="container-fluid reduced-text"> <div id="reload" class="container-fluid">
<div id="Bandwidth" class="pull-left">
<ul id="Bandwidth" class="navbar-nav justify-content-start">
<?php echo getBandwidthHTML($bandwidth_options,$user) ?> <?php echo getBandwidthHTML($bandwidth_options,$user) ?>
</div> </ul>
<div id="Version" class="pull-right">
<?php echo getZMVersionHTML($versionClass) ?> <ul class="navbar-nav justify-content-center">
</div>
<ul class="list-inline">
<?php <?php
echo getSysLoadHTML(); echo getSysLoadHTML();
echo getDbConHTML(); echo getDbConHTML();
@ -326,25 +322,33 @@ if ( (!ZM_OPT_USE_AUTH) or $user ) {
echo getShmHTML(); echo getShmHTML();
?> ?>
</ul> </ul>
<ul id="Version" class="nav navbar-nav justify-content-end">
<?php echo getZMVersionHTML($versionClass) ?>
</ul>
</div>
<?php echo getConsoleBannerHTML() ?> <?php echo getConsoleBannerHTML() ?>
</div><!-- End .footer/reload -->
</div>
</nav><!-- End Second Navbar -->
</div>
<?php <?php
if ($reload == 'reload') return ob_get_clean(); if ($reload == 'reload') return ob_get_clean();
} // end if (!ZM_OPT_USE_AUTH) or $user ) } // end if (!ZM_OPT_USE_AUTH) or $user )
?>
</div>
</div><!-- End .navbar .navbar-default -->
<?php
return ob_get_clean(); return ob_get_clean();
} // end function getNavBarHTML() } // end function getNavBarHTML()
// Returns the html representing the current unix style system load // Returns the html representing the current unix style system load
function getSysLoadHTML() { function getSysLoadHTML() {
echo '<li class="Load">'; echo '<li class="Load nav-item mx-2">';
echo '<i class="material-icons md-18">trending_up</i>'; echo '<i class="material-icons md-18">trending_up</i>';
echo '&nbsp;'.translate('Load').':'.getLoad(); echo '&nbsp;'.translate('Load').': '.getLoad();
echo '</li>'; echo '</li>';
} }
@ -355,8 +359,10 @@ function getDbConHTML() {
$percent_used = $max_connections ? 100 * $connections / $max_connections : 100; $percent_used = $max_connections ? 100 * $connections / $max_connections : 100;
$class = $percent_used > 90 ? 'warning' : ''; $class = $percent_used > 90 ? 'warning' : '';
echo '<i class="material-icons md-18">storage</i>'; echo '<li class="'. $class .' nav-item mx-2">';
echo '<li class="'. $class .'">'.translate('DB').':'.$connections.'/'.$max_connections.'</li>'; echo '<i class="material-icons md-18 mr-1">storage</i>';
echo translate('DB').': '.$connections.'/'.$max_connections;
echo '</li>';
} }
// Returns the html representing up to 4 storage areas and their current capacity // Returns the html representing up to 4 storage areas and their current capacity
@ -371,7 +377,7 @@ function getStorageHTML() {
} }
$title = human_filesize($S->disk_used_space()) . ' of ' . human_filesize($S->disk_total_space()). $title = human_filesize($S->disk_used_space()) . ' of ' . human_filesize($S->disk_total_space()).
( ( $S->disk_used_space() != $S->event_disk_space() ) ? ' ' .human_filesize($S->event_disk_space()) . ' used by events' : '' ); ( ( $S->disk_used_space() != $S->event_disk_space() ) ? ' ' .human_filesize($S->event_disk_space()) . ' used by events' : '' );
return '<span class="'.$class.'" title="'.$title.'">'.$S->Name() . ': ' . $S->disk_usage_percent().'%' . '</span>'; return '<span class="ml-1'.$class.'" title="'.$title.'">'.$S->Name() . ': ' . $S->disk_usage_percent().'%' . '</span>';
}; };
$storage_areas = ZM\Storage::find(array('Enabled'=>true)); $storage_areas = ZM\Storage::find(array('Enabled'=>true));
@ -385,7 +391,7 @@ function getStorageHTML() {
} }
} }
echo '<li>'.translate('Storage').':'; echo '<li class="nav-item mx-2">'.translate('Storage').':';
if ( $num_storage_areas > 4 ) { if ( $num_storage_areas > 4 ) {
$storage_areas = $storage_areas_with_no_server_id; $storage_areas = $storage_areas_with_no_server_id;
@ -407,7 +413,7 @@ function getShmHTML() {
} else if ( $shm_percent > 90 ) { } else if ( $shm_percent > 90 ) {
$class = 'warning'; $class = 'warning';
} }
echo ' <span class="'.$class.'" title="' . human_filesize($shm_used).' of '.human_filesize($shm_total_space).'">'.ZM_PATH_MAP.': '.$shm_percent.'%</span>'; echo ' <li class="'.$class.' nav-item" title="' . human_filesize($shm_used).' of '.human_filesize($shm_total_space).'">'.ZM_PATH_MAP.': '.$shm_percent.'%</li>';
} }
// Returns the html representing the optional web console banner text // Returns the html representing the optional web console banner text
@ -420,12 +426,12 @@ function getConsoleBannerHTML() {
// Returns the html representing the current high,medium,low bandwidth setting // Returns the html representing the current high,medium,low bandwidth setting
function getBandwidthHTML($bandwidth_options,$user) { function getBandwidthHTML($bandwidth_options,$user) {
echo makePopupLink( '?view=bandwidth', 'zmBandwidth', 'bandwidth', "<i class='material-icons md-18'>network_check</i>&nbsp;".$bandwidth_options[$_COOKIE['zmBandwidth']] . ' ', ($user && $user['MaxBandwidth'] != 'low' )); echo '<li class="nav-item">'.makePopupLink( '?view=bandwidth', 'zmBandwidth', 'bandwidth', "<i class='material-icons md-18'>network_check</i>&nbsp;".$bandwidth_options[$_COOKIE['zmBandwidth']] . ' ', ($user && $user['MaxBandwidth'] != 'low' )).'</li>';
} }
// Returns the html representing the version of ZoneMinder // Returns the html representing the version of ZoneMinder
function getZMVersionHTML($versionClass) { function getZMVersionHTML($versionClass) {
echo makePopupLink( '?view=version', 'zmVersion', 'version', '<span class="version '.$versionClass.'">v'.ZM_VERSION.'</span>', canEdit('System') ); echo '<li class="nav-item">'.makePopupLink( '?view=version', 'zmVersion', 'version', '<span class="version '.$versionClass.'">v'.ZM_VERSION.'</span>', canEdit('System') ).'</li>';
} }
// Returns the html representing the ZoneMinder logo // Returns the html representing the ZoneMinder logo
@ -436,14 +442,14 @@ function getNavBrandHTML() {
// Returns the html representing the Console menu item // Returns the html representing the Console menu item
function getConsoleHTML() { function getConsoleHTML() {
if ( canView('Monitors') ) { if ( canView('Monitors') ) {
echo '<li><a href="?view=console">'.translate('Console').'</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=console">'.translate('Console').'</a></li>';
} }
} }
// Returns the html representing the Options menu item // Returns the html representing the Options menu item
function getOptionsHTML() { function getOptionsHTML() {
if ( canView('System') ) { if ( canView('System') ) {
echo '<li><a href="?view=options">'.translate('Options').'</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=options">'.translate('Options').'</a></li>';
} }
} }
@ -465,7 +471,7 @@ function getLogHTML() {
ZM\Error('Potentially invalid value for ZM_LOG_DATABASE_LIMIT: ' . ZM_LOG_DATABASE_LIMIT); ZM\Error('Potentially invalid value for ZM_LOG_DATABASE_LIMIT: ' . ZM_LOG_DATABASE_LIMIT);
} }
} }
echo '<li>'.makePopupLink('?view=log', 'zmLog', 'log', '<span class="'.logState().'">'.translate('Log').'</span></li>'); echo '<li class="nav-item">'.makePopupLink('?view=log', 'zmLog', 'log', '<span class="nav-link '.logState().'">'.translate('Log').'</span></li>');
} }
} }
} }
@ -473,27 +479,27 @@ function getLogHTML() {
// Returns the html representing the X10 Devices menu item // Returns the html representing the X10 Devices menu item
function getDevicesHTML() { function getDevicesHTML() {
if ( ZM_OPT_X10 && canView('Devices') ) { if ( ZM_OPT_X10 && canView('Devices') ) {
echo '<li><a href="?view=devices">Devices</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=devices">Devices</a></li>';
} }
} }
// Returns the html representing the Groups menu item // Returns the html representing the Groups menu item
function getGroupsHTML() { function getGroupsHTML() {
$class = $view == 'groups' ? 'selected' : ''; $class = $view == 'groups' ? 'selected' : '';
echo '<li><a href="?view=groups" class="' .$class. '">'. translate('Groups') .'</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=groups" class="' .$class. '">'. translate('Groups') .'</a></li>';
} }
// Returns the html representing the Filter menu item // Returns the html representing the Filter menu item
function getFilterHTML() { function getFilterHTML() {
$class = $view == 'filter' ? 'selected' : ''; $class = $view == 'filter' ? 'selected' : '';
echo '<li><a href="?view=filter'.$filterQuery.$sortQuery.$limitQuery.'" class="'.$class.'">'.translate('Filters').'</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=filter'.$filterQuery.$sortQuery.$limitQuery.'" class="'.$class.'">'.translate('Filters').'</a></li>';
} }
// Returns the html representing the Cycle menu item // Returns the html representing the Cycle menu item
function getCycleHTML() { function getCycleHTML() {
if ( canView('Stream') ) { if ( canView('Stream') ) {
$class = $view == 'cycle' ? 'selected' : ''; $class = $view == 'cycle' ? 'selected' : '';
echo '<li><a href="?view=cycle" class="' .$class. '">' .translate('Cycle'). '</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=cycle" class="' .$class. '">' .translate('Cycle'). '</a></li>';
} }
} }
@ -501,7 +507,7 @@ function getCycleHTML() {
function getMontageHTML() { function getMontageHTML() {
if ( canView('Stream') ) { if ( canView('Stream') ) {
$class = $view == 'cycle' ? 'selected' : ''; $class = $view == 'cycle' ? 'selected' : '';
echo '<li><a href="?view=montage" class="' .$class. '">' .translate('Montage'). '</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=montage" class="' .$class. '">' .translate('Montage'). '</a></li>';
} }
} }
@ -524,7 +530,7 @@ function getMontageReviewHTML() {
} }
$live = isset($montageReviewQuery) ? '&fit=1'.$montageReviewQuery.'&live=0' : ''; $live = isset($montageReviewQuery) ? '&fit=1'.$montageReviewQuery.'&live=0' : '';
$class = $view == 'montagereview' ? 'selected' : ''; $class = $view == 'montagereview' ? 'selected' : '';
echo '<li><a href="?view=montagereview' .$live. '" class="' .$class. '">' .translate('MontageReview'). '</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=montagereview' .$live. '" class="' .$class. '">' .translate('MontageReview'). '</a></li>';
} }
} }
@ -532,14 +538,14 @@ function getMontageReviewHTML() {
function getRprtEvntAuditHTML() { function getRprtEvntAuditHTML() {
if ( canView('Events') ) { if ( canView('Events') ) {
$class = $view == 'report_event_audit' ? 'selected' : ''; $class = $view == 'report_event_audit' ? 'selected' : '';
echo '<li><a href="?view=report_event_audit class="' .$class. '">' .translate('ReportEventAudit'). '</a></li>'; echo '<li class="nav-item"><a class="nav-link" href="?view=report_event_audit" class="' .$class. '">' .translate('ReportEventAudit'). '</a></li>';
} }
} }
// Returns the html representing the header collapse toggle menu item // Returns the html representing the header collapse toggle menu item
function getHeaderFlipHTML() { function getHeaderFlipHTML() {
$header = ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'down') ? 'down' : 'up'; $header = ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'down') ? 'down' : 'up';
echo '<li><a href="#"><i id="flip" class="material-icons md-18 pull-right">keyboard_arrow_' .$header. '</i></a></li>'; echo '<li class="nav-item"><a class="nav-link" href="#"><i id="flip" class="material-icons md-18">keyboard_arrow_' .$header. '</i></a></li>';
} }
// Returns the html representing the logged in user name and avatar // Returns the html representing the logged in user name and avatar
@ -555,7 +561,11 @@ function getAcctCircleHTML($user=null) {
// Returns the html representing the runtime status button // Returns the html representing the runtime status button
function getStatusBtnHTML($status) { function getStatusBtnHTML($status) {
if ( canEdit('System') ) { if ( canEdit('System') ) {
echo '<button type="button" class="btn btn-default navbar-btn" data-toggle="modal" data-target="#modalState">' .$status. '</button>'; echo '<li class="nav-item">';
echo '<form class="form-inline">';
echo '<button type="button" class="mx-3 btn btn-default navbar-btn" data-toggle="modal" data-target="#modalState">' .$status. '</button>';
echo '</form>';
echo '</li>';
if ( ZM_SYSTEM_SHUTDOWN ) { if ( ZM_SYSTEM_SHUTDOWN ) {
echo '<p class="navbar-text">'; echo '<p class="navbar-text">';

View File

@ -0,0 +1 @@
bootstrap.min.js

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
https://github.com/twbs/bootstrap/releases/download/v3.3.6/bootstrap-3.3.6-dist.zip https://github.com/twbs/bootstrap/releases/download/v4.5.0/bootstrap-4.5.0-dist.zip

File diff suppressed because one or more lines are too long

View File

@ -58,28 +58,28 @@ xhtmlHeaders(__FILE__, translate('Options'));
<?php echo getNavBarHTML(); ?> <?php echo getNavBarHTML(); ?>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-2 sidebar"> <nav id="sidebar" style="background-color:#f5f5f5">
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills flex-sm-column blockquote">
<?php <?php
foreach ( $tabs as $name=>$value ) { foreach ( $tabs as $name=>$value ) {
?> ?>
<li<?php echo $tab == $name ? ' class="active"' : '' ?>><a href="?view=<?php echo $view ?>&amp;tab=<?php echo $name ?>"><?php echo $value ?></a></li> <li class="nav-item"><a <?php echo $tab == $name ? ' class="nav-link active"' : ' class="nav-link"' ?> href="?view=<?php echo $view ?>&amp;tab=<?php echo $name ?>"><?php echo $value ?></a></li>
<?php <?php
} }
?> ?>
</ul> </ul>
</div> </nav>
<div class="col-sm-10 col-sm-offset-2"> <div class="col-sm-10 col-sm-offset-2">
<br/> <br/>
<div id="options"> <div id="options">
<?php <?php
if ( $tab == 'skins' ) { if ( $tab == 'skins' ) {
?> ?>
<form name="optionsForm" class="form-horizontal" method="get" action="?"> <form name="optionsForm" class="" method="get" action="?">
<input type="hidden" name="view" value="<?php echo $view ?>"/> <input type="hidden" name="view" value="<?php echo $view ?>"/>
<input type="hidden" name="tab" value="<?php echo $tab ?>"/> <input type="hidden" name="tab" value="<?php echo $tab ?>"/>
<div class="form-group"> <div class="form-group row">
<label for="skin" class="col-sm-3 control-label"><?php echo translate('Skin')?></label> <label for="skin" class="col-sm-3 col-form-label"><?php echo translate('Skin')?></label>
<div class="col-sm-6"> <div class="col-sm-6">
<select name="skin" class="form-control chosen"> <select name="skin" class="form-control chosen">
<?php <?php
@ -90,11 +90,11 @@ foreach ( $skin_options as $dir ) {
} }
?> ?>
</select> </select>
<span class="help-block"><?php echo translate('SkinDescription'); ?></span> <span class="form-text"><?php echo translate('SkinDescription'); ?></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group row">
<label for="css" class="col-sm-3 control-label">CSS</label> <label for="css" class="col-sm-3 col-form-label">CSS</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select name="css" class="form-control chosen"> <select name="css" class="form-control chosen">
<?php <?php
@ -103,7 +103,7 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
} }
?> ?>
</select> </select>
<span class="help-block"><?php echo translate('CSSDescription'); ?></span> <span class="form-text"><?php echo translate('CSSDescription'); ?></span>
</div> </div>
</div> </div>
<div id="contentButtons"> <div id="contentButtons">
@ -302,8 +302,8 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
?> ?>
<form name="userForm" method="post" action="?"> <form name="userForm" method="post" action="?">
<button class="pull-left" type="submit" name="updateSelected" id="updateSelected"><?php echo translate('Update')?></button> <button class="float-left" type="submit" name="updateSelected" id="updateSelected"><?php echo translate('Update')?></button>
<button class="btn-danger pull-right" type="submit" name="revokeAllTokens" id="revokeAllTokens"><?php echo translate('RevokeAllTokens')?></button> <button class="btn-danger float-right" type="submit" name="revokeAllTokens" id="revokeAllTokens"><?php echo translate('RevokeAllTokens')?></button>
<br/> <br/>
<?php <?php
function revokeAllTokens() { function revokeAllTokens() {
@ -429,7 +429,7 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
$configCats[$tab]['ZM_TIMEZONE']['Hint'] = array(''=> translate('TZUnset')) + timezone_list(); $configCats[$tab]['ZM_TIMEZONE']['Hint'] = array(''=> translate('TZUnset')) + timezone_list();
} # end if tab == system } # end if tab == system
?> ?>
<form name="optionsForm" class="form-horizontal" method="post" action="?"> <form name="optionsForm" class="" method="post" action="?">
<input type="hidden" name="view" value="<?php echo $view ?>"/> <input type="hidden" name="view" value="<?php echo $view ?>"/>
<input type="hidden" name="tab" value="<?php echo $tab ?>"/> <input type="hidden" name="tab" value="<?php echo $tab ?>"/>
<input type="hidden" name="action" value="options"/> <input type="hidden" name="action" value="options"/>
@ -439,8 +439,8 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
$shortName = preg_replace( '/^ZM_/', '', $name ); $shortName = preg_replace( '/^ZM_/', '', $name );
$optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]['Prompt']:$value['Prompt']; $optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]['Prompt']:$value['Prompt'];
?> ?>
<div class="form-group"> <div class="form-group form-row">
<label for="<?php echo $name ?>" class="col-sm-3 control-label"><?php echo $shortName ?></label> <label for="<?php echo $name ?>" class="col-sm-3 control-label form-control-sm font-weight-bold text-right"><?php echo $shortName ?></label>
<div class="col-sm-6"> <div class="col-sm-6">
<?php <?php
if ( $value['Type'] == 'boolean' ) { if ( $value['Type'] == 'boolean' ) {
@ -456,7 +456,7 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
$options = explode('|', $value['Hint']); $options = explode('|', $value['Hint']);
if ( count($options) > 3 ) { if ( count($options) > 3 ) {
?> ?>
<select class="form-control" name="newConfig[<?php echo $name ?>]"<?php echo $canEdit?'':' disabled="disabled"' ?>> <select class="form-control form-control-lg" name="newConfig[<?php echo $name ?>]"<?php echo $canEdit?'':' disabled="disabled"' ?>>
<?php <?php
foreach ( $options as $option ) { foreach ( $options as $option ) {
if ( preg_match('/^([^=]+)=(.+)$/', $option, $matches) ) { if ( preg_match('/^([^=]+)=(.+)$/', $option, $matches) ) {
@ -481,7 +481,7 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
$optionLabel = $optionValue = $option; $optionLabel = $optionValue = $option;
} }
?> ?>
<label> <label class="font-weight-bold form-control-sm">
<input type="radio" id="<?php echo $name.'_'.preg_replace('/[^a-zA-Z0-9]/', '', $optionValue) ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?php echo $canEdit?'':' disabled="disabled"' ?>/> <input type="radio" id="<?php echo $name.'_'.preg_replace('/[^a-zA-Z0-9]/', '', $optionValue) ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?php echo $canEdit?'':' disabled="disabled"' ?>/>
<?php echo htmlspecialchars($optionLabel) ?> <?php echo htmlspecialchars($optionLabel) ?>
</label> </label>
@ -492,27 +492,27 @@ foreach ( array_map('basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR)) as $
<?php <?php
} else if ( $value['Type'] == 'text' ) { } else if ( $value['Type'] == 'text' ) {
?> ?>
<textarea class="form-control" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" rows="5" cols="40"<?php echo $canEdit?'':' disabled="disabled"' ?>><?php echo validHtmlStr($value['Value']) ?></textarea> <textarea class="form-control-sm" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" rows="5" cols="40"<?php echo $canEdit?'':' disabled="disabled"' ?>><?php echo validHtmlStr($value['Value']) ?></textarea>
<?php <?php
} else if ( $value['Type'] == 'integer' ) { } else if ( $value['Type'] == 'integer' ) {
?> ?>
<input type="number" class="form-control small" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/> <input type="number" class="form-control form-control-sm" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/>
<?php <?php
} else if ( $value['Type'] == 'hexadecimal' ) { } else if ( $value['Type'] == 'hexadecimal' ) {
?> ?>
<input type="text" class="form-control medium" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/> <input type="text" class="form-control form-control-sm" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/>
<?php <?php
} else if ( $value['Type'] == 'decimal' ) { } else if ( $value['Type'] == 'decimal' ) {
?> ?>
<input type="text" class="form-control small" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/> <input type="text" class="form-control form-control-sm" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/>
<?php <?php
} else { } else {
?> ?>
<input type="text" class="form-control large" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/> <input type="text" class="form-control form-control-sm" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" <?php echo $canEdit?'':' disabled="disabled"' ?>/>
<?php <?php
} }
?> ?>
<span class="help-block"><?php echo validHtmlStr($optionPromptText) ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option='.$name, 'zmOptionHelp', 'optionhelp', '?' ) ?>)</span> <span class="form-text form-control-sm"><?php echo validHtmlStr($optionPromptText) ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option='.$name, 'zmOptionHelp', 'optionhelp', '?' ) ?>)</span>
</div><!-- End .col-sm-9 --> </div><!-- End .col-sm-9 -->
</div><!-- End .form-group --> </div><!-- End .form-group -->
<?php <?php

View File

@ -23,23 +23,26 @@ if ( !canEdit('System') ) {
return; return;
} }
?> ?>
<div id="modalState" class="modal fade"> <div id="modalState" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="ModalCenterTitle" aria-hidden="true">
<form class="form-horizontal" name="contentForm" method="get" action="?view=state"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="btn" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h5 class="modal-title w-100 text-center" id="ModalCenterTitle"><?php echo translate('RunState') ?></h5>
</div>
<div class="modal-body">
<form class="" name="contentForm" method="get" action="?view=state">
<input type="hidden" name="view" value="state"/> <input type="hidden" name="view" value="state"/>
<input type="hidden" name="action" value="state"/> <input type="hidden" name="action" value="state"/>
<input type="hidden" name="apply" value="1"/> <input type="hidden" name="apply" value="1"/>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h2 class="modal-title"><?php echo translate('RunState') ?></h2>
</div>
<div class="modal-body">
<div class="form-group"> <div class="form-group">
<label for="runState" class="col-sm-3 control-label">Change State</label> <label for="runState" class="col-md-3 col-form-label float-left">Change State</label>
<div class="col-sm-9"> <div class="col-md-9">
<select id="runState" name="runState" class="form-control"> <select id="runState" name="runState" class="form-control">
<?php <?php
if ( $running ) { if ( $running ) {
@ -62,14 +65,15 @@ foreach ( $states as $state ) {
} }
?> ?>
</select> </select>
</div><!--col-sm-9--> </div><!--col-md-9-->
</div><!--form-group--> </div><!--form-group-->
<div class="form-group"> <div class="form-group">
<label for="newState" class="col-sm-3 control-label"><?php echo translate('NewState') ?></label> <label for="newState" class="col-md-3 col-form-label float-left"><?php echo translate('NewState') ?></label>
<div class="col-sm-9"> <div class="col-md-9">
<input class="form-control" type="text" id="newState"/> <input class="form-control" type="text" id="newState"/>
</div> </div>
</div> </div>
</form>
</div> <!-- modal-body --> </div> <!-- modal-body -->
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-primary" type="button" id="btnApply"><?php echo translate('Apply') ?></button> <button class="btn btn-primary" type="button" id="btnApply"><?php echo translate('Apply') ?></button>
@ -79,5 +83,4 @@ foreach ( $states as $state ) {
</div><!-- footer --> </div><!-- footer -->
</div> <!-- content --> </div> <!-- content -->
</div> <!-- dialog --> </div> <!-- dialog -->
</form>
</div> <!-- state --> </div> <!-- state -->