From 0b3776dbf089466c5f13b8658b2dc2505acf71e5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 3 Jan 2020 15:57:29 -0500 Subject: [PATCH] change text inputs to number inputs, cleanups --- web/skins/classic/views/controlcap.php | 197 +++++++++++-------------- 1 file changed, 86 insertions(+), 111 deletions(-) diff --git a/web/skins/classic/views/controlcap.php b/web/skins/classic/views/controlcap.php index bc48d05e4..20eb02ca3 100644 --- a/web/skins/classic/views/controlcap.php +++ b/web/skins/classic/views/controlcap.php @@ -18,40 +18,30 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // -if ( !canEdit( 'Control' ) ) -{ - $view = "error"; - return; +if ( !canEdit('Control') ) { + $view = 'error'; + return; } $tabs = array(); -$tabs["main"] = translate('Main'); -$tabs["move"] = translate('Move'); -$tabs["pan"] = translate('Pan'); -$tabs["tilt"] = translate('Tilt'); -$tabs["zoom"] = translate('Zoom'); -$tabs["focus"] = translate('Focus'); -$tabs["white"] = translate('White'); -$tabs["iris"] = translate('Iris'); -$tabs["presets"] = translate('Presets'); +$tabs['main'] = translate('Main'); +$tabs['move'] = translate('Move'); +$tabs['pan'] = translate('Pan'); +$tabs['tilt'] = translate('Tilt'); +$tabs['zoom'] = translate('Zoom'); +$tabs['focus'] = translate('Focus'); +$tabs['white'] = translate('White'); +$tabs['iris'] = translate('Iris'); +$tabs['presets'] = translate('Presets'); -if ( isset($_REQUEST['tab']) ) - $tab = validHtmlStr($_REQUEST['tab']); -else - $tab = "main"; +$tab = isset($_REQUEST['tab']) ? validHtmlStr($_REQUEST['tab']) :'main'; -if ( isset( $_REQUEST['newControl'] ) ) -{ +if ( isset($_REQUEST['newControl']) ) { $newControl = $_REQUEST['newControl']; -} -else -{ - if ( !empty($_REQUEST['cid']) ) - { - $control = dbFetchOne( 'SELECT * FROM Controls WHERE Id = ?', NULL, array($_REQUEST['cid'] ) ); - } - else - { +} else { + if ( !empty($_REQUEST['cid']) ) { + $control = dbFetchOne('SELECT * FROM Controls WHERE Id = ?', NULL, array($_REQUEST['cid'])); + } else { $control = array( 'Name' => translate('New'), 'Type' => "Local", @@ -166,16 +156,12 @@ xhtmlHeaders(__FILE__, translate('ControlCap')." - ".$newControl['Name'] );