2008-07-14 21:54:50 +08:00
< ? php
//
// ZoneMinder web controls file, $Date$, $Revision$
2008-07-25 17:48:16 +08:00
// Copyright (C) 2001-2008 Philip Coombes
2008-07-14 21:54:50 +08:00
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
2016-12-26 23:23:16 +08:00
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2008-07-14 21:54:50 +08:00
//
2019-10-04 05:30:31 +08:00
if ( ! canView ( 'Control' ) ) {
$view = 'error' ;
2008-07-14 21:54:50 +08:00
return ;
}
2019-10-04 05:30:31 +08:00
$controls = dbFetchAll ( 'SELECT * FROM Controls ORDER BY Name' );
2008-07-14 21:54:50 +08:00
$focusWindow = true ;
2019-10-04 05:30:31 +08:00
xhtmlHeaders ( __FILE__ , translate ( 'ControlCaps' ));
2008-07-14 21:54:50 +08:00
?>
< body >
2020-09-26 05:05:16 +08:00
< ? php echo getNavBarHTML () ?>
2008-07-14 21:54:50 +08:00
< div id = " page " >
2020-09-26 05:05:16 +08:00
< div class = " w-100 py-1 " >
< div class = " float-left pl-3 " >
< button type = " button " id = " backBtn " class = " btn btn-normal " data - toggle = " tooltip " data - placement = " top " title = " <?php echo translate('Back') ?> " disabled >< i class = " fa fa-arrow-left " ></ i ></ button >
< button type = " button " id = " refreshBtn " class = " btn btn-normal " data - toggle = " tooltip " data - placement = " top " title = " <?php echo translate('Refresh') ?> " >< i class = " fa fa-refresh " ></ i ></ button >
</ div >
< div class = " w-100 pt-2 " >
< h2 >< ? php echo translate ( 'ControlCaps' ) ?> </h2>
2008-07-14 21:54:50 +08:00
</ div >
</ div >
< div id = " content " >
2019-02-10 13:39:19 +08:00
< form name = " contentForm " id = " contentForm " method = " get " action = " ? " onsubmit = " return( confirmDelete( 'Warning, deleting a control will reset all monitors that use it to be uncontrollable. \n Are you sure you wish to delete?' ) ); " >
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " view " value = " <?php echo $view ?> " />
2008-07-14 21:54:50 +08:00
< input type = " hidden " name = " action " value = " delete " />
2019-10-04 05:30:31 +08:00
< table id = " contentTable " class = " major " >
2008-07-14 21:54:50 +08:00
< thead >
< tr >
2015-05-10 21:10:30 +08:00
< th class = " colName " >< ? php echo translate ( 'Name' ) ?> </th>
< th class = " colType " >< ? php echo translate ( 'Type' ) ?> </th>
< th class = " colProtocol " >< ? php echo translate ( 'Protocol' ) ?> </th>
< th class = " colCanMove " >< ? php echo translate ( 'CanMove' ) ?> </th>
< th class = " colCanZoom " >< ? php echo translate ( 'CanZoom' ) ?> </th>
< th class = " colCanFocus " >< ? php echo translate ( 'CanFocus' ) ?> </th>
< th class = " colCanIris " >< ? php echo translate ( 'CanIris' ) ?> </th>
< th class = " colCanWhiteBal " >< ? php echo translate ( 'CanWhiteBal' ) ?> </th>
< th class = " colHasPresets " >< ? php echo translate ( 'HasPresets' ) ?> </th>
< th class = " colMark " >< ? php echo translate ( 'Mark' ) ?> </th>
2008-07-14 21:54:50 +08:00
</ tr >
</ thead >
< tbody >
< ? php
2019-10-04 05:30:31 +08:00
foreach ( $controls as $control ) {
2008-07-14 21:54:50 +08:00
?>
< tr >
2020-09-26 05:12:05 +08:00
< td class = " colName " >< ? php echo makeLink ( '?view=controlcap&cid=' . $control [ 'Id' ], validHtmlStr ( $control [ 'Name' ]), canView ( 'Control' ) ) ?> </td>
2014-12-05 07:44:23 +08:00
< td class = " colType " >< ? php echo $control [ 'Type' ] ?> </td>
2019-01-25 21:35:07 +08:00
< td class = " colProtocol " >< ? php echo validHtmlStr ( $control [ 'Protocol' ]) ?> </td>
2015-05-10 21:10:30 +08:00
< td class = " colCanMove " >< ? php echo $control [ 'CanMove' ] ? translate ( 'Yes' ) : translate ( 'No' ) ?> </td>
< td class = " colCanZoom " >< ? php echo $control [ 'CanZoom' ] ? translate ( 'Yes' ) : translate ( 'No' ) ?> </td>
< td class = " colCanFocus " >< ? php echo $control [ 'CanFocus' ] ? translate ( 'Yes' ) : translate ( 'No' ) ?> </td>
< td class = " colCanIris " >< ? php echo $control [ 'CanIris' ] ? translate ( 'Yes' ) : translate ( 'No' ) ?> </td>
< td class = " colCanWhiteBal " >< ? php echo $control [ 'CanWhite' ] ? translate ( 'Yes' ) : translate ( 'No' ) ?> </td>
2014-12-05 07:44:23 +08:00
< td class = " colHasPresets " >< ? php echo $control [ 'HasHomePreset' ] ? 'H' : '' ?> <?php echo $control['HasPresets']?$control['NumPresets']:'0' ?></td>
2019-01-16 22:59:58 +08:00
< td class = " colMark " >< input type = " checkbox " name = " markCids[] " value = " <?php echo $control['Id'] ?> " data - on - click - this = " configureDeleteButton " < ? php if ( ! canEdit ( 'Control' ) ) { ?> disabled="disabled"<?php } ?>/></td>
2008-07-14 21:54:50 +08:00
</ tr >
< ? php
}
?>
</ tbody >
</ table >
< div id = " contentButtons " >
2020-09-26 05:12:05 +08:00
< ? php echo makeButton ( '?view=controlcap' , 'AddNewControl' , canEdit ( 'Control' )); ?>
2019-01-15 22:01:58 +08:00
< input type = " submit " name = " deleteBtn " value = " <?php echo translate('Delete') ?> " disabled = " disabled " />
2008-07-14 21:54:50 +08:00
</ div >
</ form >
</ div >
</ div >
2020-09-03 05:33:09 +08:00
< ? php xhtmlFooter () ?>