-
Notifications
You must be signed in to change notification settings - Fork 23
/
ports.php
executable file
·835 lines (654 loc) · 41.3 KB
/
ports.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
<?php
// --------------------------------------------------------
// SESSION CHECK TO SEE IF USER IS LOGGED IN.
session_start();
if ((!isset($_SESSION['username'])) || (!isset($_SESSION['userID']))){
header('location: index.php'); // If they aren't logged in, send them to login page.
} elseif (!isset($_SESSION['callsign'])) {
header('location: wizard/index.php'); // If they are logged in, but they haven't set a callsign then send them to setup wizard.
} else { // If they are logged in and have set a callsign, show the page.
// --------------------------------------------------------
$customJS = 'page-ports.js'; // 'file1.js, file2.js, ... '
$customCSS = 'page-ports.css'; // 'file1.css, file2.css, ... '
include('includes/header.php');
$ports = $Database->get_ports();
$SVXLink = new SVXLink(null, null, null);
?>
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_full">
<h3><i class="fa fa-sitemap"></i> <?=_('Interface Settings')?></h3>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h4 class="navbar-left"><?=_('Ports')?></h4>
<ul class="nav nav-pills navbar-right" style="padding: 0;" role="tablist">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-plus"></i></a>
<ul class="dropdown-menu" role="menu">
<li role="presentation">
<a href="#" class="addPort"><?=_('Add a NEW Port')?></a>
</li>
<li role="presentation">
<a href="#" class="loadBoard"><?=_('Load a Board Preset')?></a>
</li>
</ul>
</li>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<!-- start accordion -->
<div class="accordion" id="portList" role="tablist" aria-multiselectable="true">
<!-- Template rows will be inserted here by jQuery -->
<!--
<div class="panel">
<a class="panel-heading collapsed" role="tab" id="accordionHeadingThree" data-toggle="collapse" data-parent="#accordion" href="#accordionCollapseThree" aria-expanded="false" aria-controls="accordionCollapseThree" style="background-color: aqua;">
<div class="col-md-6 col-sm-6 col-xs-6">
<h4 class="panel-title">Port #3 - VOIP Port</h4>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 right">
<span class="right">
<span class="label label-primary" data-toggle="tooltip" data-placement="top" title="<?=_('Half Duplex Port')?>">Simplex</span>
<span class="badge bg-green" data-toggle="tooltip" data-placement="top" title="<?=_('Belongs to Link Group')?> 1"><i class="fa fa-link"></i> 1</span>
</span>
</div>
<div class="clearfix"></div>
</a>
<div id="accordionCollapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="accordionHeadingThree">
<div class="panel-body">
<p>Demo Only</p>
</div>
</div>
</div>
-->
</div> <!-- end of accordion -->
</div>
</div>
<div class="x_panel">
<div class="x_title">
<div class="sectionStatus linkGroupStatus"><i class="fa"></i></div>
<h4><i class="fa fa-link"></i> <?=_('Link Group Settings')?></h4>
</div>
<form id="linkGroupForm" class="linkGroupForm">
<div class="x_content">
<div id='linkGroup1' data-port-count="0" style="display: none;">
<div class="lg_wrapper">
<div class="x_title"><h4><?=_('Link Group 1')?></h4></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Activate')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('When enabled, the link will be connected automatically during startup. With this setup the behavior of the timeout (if set) will be inverted. This means if a link is manually disconnected by a user, it will be automatically reconnected after the time specified by the timeout setting. If there is no timeout set, no automatic reactivation will be made.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG1_defaultActive" name="LG1_defaultActive" type="checkbox" class="js-switch LG_defaultActive" />
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Timeout')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The number of seconds after which the link will be automatically deactivated if there have been no activity.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG1_timeout" name="LG1_timeout" type="number" class="form-control" placeholder="0">
</div>
</div>
<div class="clearfix"></div>
<div class="lgCount col-md-12 col-sm-12 col-xs-12">
<p><?=_('Ports in Group')?>: <span id="LG1_count">0</span></p>
</div>
</div>
</div>
<div id='linkGroup2' data-port-count="0" style="display: none;">
<div class="lg_wrapper">
<div class="x_title"><h4><?=_('Link Group 2')?></h4></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Activate')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('When enabled, the link will be connected automatically during startup. With this setup the behavior of the timeout (if set) will be inverted. This means if a link is manually disconnected by a user, it will be automatically reconnected after the time specified by the timeout setting. If there is no timeout set, no automatic reactivation will be made.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG2_defaultActive" name="LG2_defaultActive" type="checkbox" class="js-switch LG_defaultActive" />
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Timeout')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The number of seconds after which the link will be automatically deactivated if there have been no activity.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG2_timeout" name="LG2_timeout" type="number" class="form-control" placeholder="0">
</div>
</div>
<div class="clearfix"></div>
<div class="lgCount col-md-12 col-sm-12 col-xs-12">
<p><?=_('Ports in Group')?>: <span id="LG2_count">0</span></p>
</div>
</div>
</div>
<div id='linkGroup3' data-port-count="0" style="display: none;">
<div class="lg_wrapper">
<div class="x_title"><h4><?=_('Link Group 3')?></h4></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Activate')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('When enabled, the link will be connected automatically during startup. With this setup the behavior of the timeout (if set) will be inverted. This means if a link is manually disconnected by a user, it will be automatically reconnected after the time specified by the timeout setting. If there is no timeout set, no automatic reactivation will be made.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG3_defaultActive" name="LG3_defaultActive" type="checkbox" class="js-switch LG_defaultActive" />
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Timeout')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The number of seconds after which the link will be automatically deactivated if there have been no activity.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG3_timeout" name="LG3_timeout" type="number" class="form-control" placeholder="0">
</div>
</div>
<div class="clearfix"></div>
<div class="lgCount col-md-12 col-sm-12 col-xs-12">
<p><?=_('Ports in Group')?>: <span id="LG3_count">0</span></p>
</div>
</div>
</div>
<div id='linkGroup4' data-port-count="0" style="display: none;">
<div class="lg_wrapper">
<div class="x_title"><h4><?=_('Link Group 4')?></h4></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Activate')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('When enabled, the link will be connected automatically during startup. With this setup the behavior of the timeout (if set) will be inverted. This means if a link is manually disconnected by a user, it will be automatically reconnected after the time specified by the timeout setting. If there is no timeout set, no automatic reactivation will be made.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG4_defaultActive" name="LG4_defaultActive" type="checkbox" class="js-switch LG_defaultActive" />
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-6"><?=_('Timeout')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The number of seconds after which the link will be automatically deactivated if there have been no activity.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-6">
<input id="LG4_timeout" name="LG4_timeout" type="number" class="form-control" placeholder="0">
</div>
</div>
<div class="clearfix"></div>
<div class="lgCount col-md-12 col-sm-12 col-xs-12">
<p><?=_('Ports in Group')?>: <span id="LG4_count">0</span></p>
</div>
</div>
</div>
<div id="no_lg_msg" class="col-md-12 col-sm-12 col-xs-12">
<h4><?=_('You must selected a link group under at least 2 ports to make them available.')?></h4>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
<? ### ROW TEMPLATE ######################################################## ?>
<script id="rowTemplateAnalog" type = "text/template">
<div id="portNum%%currPortNum%%" class="panel portSection">
<a class="panel-heading collapsed" role="tab" id="accordionHeading%%currPortNum%%" data-toggle="collapse" data-parent="#accordion" href="#accordionCollapse%%currPortNum%%" aria-expanded="false" aria-controls="accordionCollapse%%currPortNum%%">
<div class="col-md-6 col-sm-6 col-xs-6">
<h4 class="panel-title"><strong><?=_('Port')?> #%%currPortNum%%</strong>: <span>%%currPortLabel%%<span></h4>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 right">
<span class="right">
<span class="portLabelDuplexFull label label-danger" data-toggle="tooltip" data-placement="top" title="<?=_('Full Duplex Port')?>" style="display: none;"><?=_('Duplex')?></span>
<span class="portLabelDuplexHalf label label-primary" data-toggle="tooltip" data-placement="top" title="<?=_('Half Duplex Port')?>" style="display: none;"><?=_('Simplex')?></span>
<span class="portLabelLinkGrp 1 badge bg-green" data-toggle="tooltip" data-placement="top" title="<?=_('Belongs to Link Group')?> 1" style="display: none;"><i class="fa fa-link"></i> <span>1</span></span>
<span class="portLabelLinkGrp 2 badge bg-purple" data-toggle="tooltip" data-placement="top" title="<?=_('Belongs to Link Group')?> 2" style="display: none;"><i class="fa fa-link"></i> <span>2</span></span>
<span class="portLabelLinkGrp 3 badge bg-blue-sky" data-toggle="tooltip" data-placement="top" title="<?=_('Belongs to Link Group')?> 3" style="display: none;"><i class="fa fa-link"></i> <span>3</span></span>
<span class="portLabelLinkGrp 4 badge bg-orange" data-toggle="tooltip" data-placement="top" title="<?=_('Belongs to Link Group')?> 4" style="display: none;"><i class="fa fa-link"></i> <span>4</span></span>
</span>
<div class="sectionStatus portStatus"><i class="fa"></i></div>
</div>
<div class="clearfix"></div>
</a>
<div id="accordionCollapse%%currPortNum%%" class="panel-collapse collapse" role="tabpanel" aria-labelledby="accordionHeading%%currPortNum%%">
<form id="port%%currPortNum%%form" class="portForm" data-port-form="%%currPortNum%%">
<div class="panel-body">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs tabs" role="tablist">
<li role="presentation" class="tabGeneral active">
<a href="#tab_general%%currPortNum%%" id="general-tab%%currPortNum%%" role="tab" data-toggle="tab" aria-expanded="true"><i class="fa fa-gear"></i> <?=_('General')?></a>
</li>
<li role="presentation" class="tabAudio">
<a href="#tab_audio%%currPortNum%%" role="tab" id="audio-tab%%currPortNum%%" data-toggle="tab" aria-expanded="false"><i class="fa fa-volume-up"></i> <?=_('Audio')?></a>
</li>
<li role="presentation" id="tabGPIO%%currPortNum%%" class="tabGPIO" style="display: none;">
<a href="#tab_gpio%%currPortNum%%" role="tab" id="gpio-tab%%currPortNum%%" data-toggle="tab" aria-expanded="false"><i class="fa fa-exchange"></i> <?=_('GPIO')?></a>
</li>
<li role="presentation" id="tabHidraw%%currPortNum%%" class="tabHidraw" style="display: none;">
<a href="#tab_hidraw%%currPortNum%%" role="tab" id="hidraw-tab%%currPortNum%%" data-toggle="tab" aria-expanded="false"><i class="fa fa-exchange"></i> <?=_('Hidraw')?></a>
</li>
<li role="presentation" id="tabSerial%%currPortNum%%" class="tabSerial" style="display: none;">
<a href="#tab_serial%%currPortNum%%" role="tab" id="serial-tab%%currPortNum%%" data-toggle="tab" aria-expanded="false"><i class="fa fa-exchange"></i> <?=_('Serial')?></a>
</li>
<li role="presentation" class="tabModules">
<a href="#tab_modules%%currPortNum%%" role="tab" id="mdoules-tab%%currPortNum%%" data-toggle="tab" aria-expanded="false"><i class="fa fa-plug"></i> <?=_('Modules')?></a>
</li>
<li role="presentation" class="tabOverrides">
<a href="#tab_override%%currPortNum%%" role="tab" id="override-tab%%currPortNum%%" data-toggle="tab" aria-expanded="false"><i class="fa fa-wrench"></i> <?=_('Overrides')?></a>
</li>
</ul>
<div id="myTabContent" class="tab-content">
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade active in" id="tab_general%%currPortNum%%" aria-labelledby="general-tab%%currPortNum%%">
<div class="clearfix spacer height20"></div>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="hidden" name="portNum" value="%%currPortNum%%">
<div class="form-group">
<label class="control-label col-md-4 col-sm-4 col-xs-12">
<?=_('Port Label')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('A short description of the port. Good practice would be to label it after the port on the hardware interface or the band/frequency of the radio connected to it.')?>"></i>
</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<input class="form-control portLabel" type="text" id="portLabel%%currPortNum%%" name="portLabel" value="%%currPortLabel%%" placeholder="<?=_('Port 1')?>">
</div>
</div>
<div class="clearfix spacer height20"></div>
<div class="form-group">
<label class="control-label col-md-4 col-sm-4 col-xs-12">
<?=_('Triggering Type')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('This is the type of hardware that the interface is using for trigger pins for COS and PTT. These pins will be selectable on a different tab.')?>"></i>
</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<div class="btn-group portType" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" id="portType%%currPortNum%%GPIO" name="portType" value="GPIO"><?=_('GPIO')?>
</label>
<label class="btn btn-default">
<input type="radio" id="portType%%currPortNum%%HiDraw" name="portType" value="HiDraw"><?=_('Hidraw')?>
</label>
<label class="btn btn-default">
<input type="radio" id="portType%%currPortNum%%Serial" name="portType" value="Serial"><?=_('USB Serial')?>
</label>
</div>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="form-group">
<label class="control-label col-md-4 col-sm-4 col-xs-12">
<?=_('Logic Mode')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('This setting determines if the port will operate in full or half duplex mode. Some options may not be available in half duplex.')?>"></i>
</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<div class="btn-group portDuplex" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" id="portDuplex%%currPortNum%%Half" name="portDuplex" value="half"><?=_('Half Duplex')?>
</label>
<label class="btn btn-default">
<input type="radio" id="portDuplex%%currPortNum%%Full" name="portDuplex" value="full"><?=_('Full Duplex')?>
</label>
</div>
</div>
</div>
<div class="clearfix spacer height20"></div>
<div class="form-group">
<label class="control-label col-md-4 col-sm-4 col-xs-12">
<?=_('Link Groups')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('This allows you to add the port to one or more Link Groups. Ports in the same link group will be linked together. This is useful for linking two repeaters on different bands together or adding RF links to a repeater.')?>"></i>
</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<table class="lg_toggle_table">
<tbody>
<tr>
<td><input type="checkbox" id="linkGroup1_Port%%currPortNum%%" class="js-switch linkGroup" data-linkGroup-num="1"></td>
<td><input type="checkbox" id="linkGroup2_Port%%currPortNum%%" class="js-switch linkGroup" data-linkGroup-num="2"></td>
<td><input type="checkbox" id="linkGroup3_Port%%currPortNum%%" class="js-switch linkGroup" data-linkGroup-num="3"></td>
<td><input type="checkbox" id="linkGroup4_Port%%currPortNum%%" class="js-switch linkGroup" data-linkGroup-num="4"></td>
</tr>
<tr>
<td><?=_('1')?></td>
<td><?=_('2')?></td>
<td><?=_('3')?></td>
<td><?=_('4')?></td>
</tr>
</tbody>
</table>
<input type="hidden" id="linkGroup_Port%%currPortNum%%" name="linkGroup" class="linkGroup">
</div>
</div>
<div class="clearfix spacer height20"></div>
<div class="form-group portEnabledWrap">
<label class="control-label col-md-4 col-sm-4 col-xs-12">
<?=_('Enable Port')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('This allows the port to be disabled, but retain the current settings.')?>"></i>
</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<input type="hidden" name="portEnabled" value="0">
<input type="checkbox" id="portEnabled%%currPortNum%%" name="portEnabled" class="js-switch portEnabled" value="1">
<a href="#" id="deletePort%%currPortNum%%" class="deletePort"><i class="fa fa-trash-o"></i> Delete</a>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
</div>
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade" id="tab_audio%%currPortNum%%" aria-labelledby="audio-tab%%currPortNum%%">
<div class="clearfix spacer height20"></div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="form-group">
<label class="control-label col-md-5 col-sm-5 col-xs-12"><?=_('RX Audio (Input)')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('Audio coming out of the receiver into the controller.')?>"></i>
</label>
<div class="col-md-7 col-sm-7 col-xs-12">
<select id="rxAudioDev%%currPortNum%%" name="rxAudioDev" class="form-control rxAudioDev"></select>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="form-group">
<label class="control-label col-md-5 col-sm-5 col-xs-12"><?=_('TX Audio (Output)')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('Audio coming out of the controller going into the transmitter.')?>"></i>
</label>
<div class="col-md-7 col-sm-7 col-xs-12">
<select id="txAudioDev%%currPortNum%%" name="txAudioDev" class="form-control txAudioDev"></select>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
</div>
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade" id="tab_gpio%%currPortNum%%" aria-labelledby="gpio-tab%%currPortNum%%">
<div class="clearfix spacer height30"></div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="form-group">
<label class="control-label col-md-6 col-sm-6 col-xs-12">
<?=_('Receive Control Mode')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('This setting controls how this port is triggered by an incoming signal from the receiver. Carrier Operated Squelch (COS) is the recommended control method.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="rxMode%%currPortNum%%" name="rxMode" class="form-control rxMode">
<option value="cos">COS</option>
<option value="vox">VOX</option>
</select>
</div>
</div>
<div class="clearfix spacer height20"></div>
<div id="voxMsg%%currPortNum%%">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="alert alert-success alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<strong><?=_('WARNING:')?></strong> <?=_('The VOX receive mode is experimental. It may provide unpredictable results and keying of the system due to spurious noise and audio levels. It is strongly recommended that you use the COS Mode if at all possible.')?>
</div>
</div>
</div>
<div id="rxGPIO_Grp%%currPortNum%%" class="form-group">
<label class="control-label col-md-5 col-sm-4 col-xs-12">
<?=_('Receive COS Pin')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The pin that receives the COS signal from the receiver.')?>"></i>
</label>
<div class="col-md-3 col-sm-4 col-xs-6">
<input id="rxGPIO%%currPortNum%%" class="form-control" type="text" name="rxGPIO" placeholder="<?=_('GPIO')?>">
</div>
<div class="col-md-4 col-sm-4 col-xs-6">
<select id="rxGPIO_active%%currPortNum%%" name="rxGPIO_active" class="form-control rxGPIO_active">
<option value="high"><?=_('Active High')?></option>
<option value="low"><?=_('Active Low')?></option>
</select>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="form-group">
<label class="control-label col-md-5 col-sm-4 col-xs-12">
<?=_('Transmit PTT Pin')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The pin that sends the PTT signal to the transmitter.')?>"></i>
</label>
<div class="col-md-3 col-sm-4 col-xs-6">
<input id="txGPIO%%currPortNum%%" class="form-control" type="text" name="txGPIO" placeholder="<?=_('GPIO')?>">
</div>
<div class="col-md-4 col-sm-4 col-xs-6">
<select id="txGPIO_active%%currPortNum%%" name="txGPIO_active" class="form-control txGPIO_active">
<option value="high"><?=_('Active High')?></option>
<option value="low"><?=_('Active Low')?></option>
</select>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
</div>
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade" id="tab_hidraw%%currPortNum%%" aria-labelledby="hidraw-tab%%currPortNum%%">
<div class="clearfix spacer height30"></div>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"><?=_('Hidraw Device')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The HID device that you wish to toggle pins on.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="hidrawDev%%currPortNum%%" name="hidrawDev" class="form-control hidrawDev">
<option value="">---</option>
<option value="/dev/hidraw0">/dev/hidraw0</option>
<option value="/dev/hidraw1">/dev/hidraw1</option>
<option value="/dev/hidraw2">/dev/hidraw2</option>
<option value="/dev/hidraw3">/dev/hidraw3</option>
<option value="/dev/hidraw4">/dev/hidraw4</option>
<option value="/dev/hidraw5">/dev/hidraw5</option>
<option value="/dev/hidraw6">/dev/hidraw6</option>
<option value="/dev/hidraw7">/dev/hidraw7</option>
</select>
</div>
<div class="col-md-3 col-sm-3 col-xs-12"></div>
</div>
<div class="clearfix"></div>
<div class="clearfix ln_solid"></div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"><?=_('Receive COS Pin')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The pin that receives the COS signal from the receiver. You have the option of inverting the control logic of this pin.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="hidrawRX_cos%%currPortNum%%" name="hidrawRX_cos" class="form-control hidrawRX_cos">
<option value="">---</option>
<option value="VOL_UP">VOL_UP</option>
<option value="VOL_DN">VOL_DN</option>
<option value="MUTE_PLAY">MUTE_PLAY</option>
<option value="MUTE_REC">MUTE_REC</option>
</select>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<?php $hidrawRX_cos_invert = (isset($currPortSettings['hidrawRX_cos_invert'])) ? $currPortSettings['hidrawRX_cos_invert'] : 'false'; ?>
<input id="hidrawRX_cos_invert%%currPortNum%%" name="hidrawRX_cos_invert" type="checkbox" class="js-switch" value="true">
<label class="invertPinLabel"><?=_('Invert Pin')?></label>
</div>
</div>
<div class="clearfix spacer height20"></div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"><?=_('Transmit PTT Pin')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The pin that sends the PTT signal to the transmitter. You have the option of inverting the control logic of this pin.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="hidrawTX_ptt%%currPortNum%%" name="hidrawTX_ptt" class="form-control hidrawTX_ptt">
<option value="">---</option>
<option value="GPIO1">GPIO1</option>
<option value="GPIO2">GPIO2</option>
<option value="GPIO3">GPIO3</option>
<option value="GPIO4">GPIO4</option>
</select>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<input id="hidrawTX_ptt_invert%%currPortNum%%" name="hidrawTX_ptt_invert" type="checkbox" class="js-switch" value="true">
<label class="invertPinLabel"><?=_('Invert Pin')?></label>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
</div>
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade" id="tab_serial%%currPortNum%%" aria-labelledby="serial-tab%%currPortNum%%">
<div class="clearfix spacer height30"></div>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"><?=_('Serial Device')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The serial device that you wish to toggle pins on.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="serialDev%%currPortNum%%" name="serialDev" class="form-control serialDev">
<option value="">---</option>
<option value="/dev/ttyUSB0">/dev/ttyUSB0</option>
<option value="/dev/ttyUSB1">/dev/ttyUSB1</option>
<option value="/dev/ttyUSB2">/dev/ttyUSB2</option>
<option value="/dev/ttyUSB3">/dev/ttyUSB3</option>
<option value="/dev/ttyUSB4">/dev/ttyUSB4</option>
<option value="/dev/ttyUSB5">/dev/ttyUSB5</option>
<option value="/dev/ttyUSB6">/dev/ttyUSB6</option>
<option value="/dev/ttyUSB7">/dev/ttyUSB7</option>
</select>
</div>
<div class="col-md-3 col-sm-3 col-xs-12"></div>
</div>
<div class="clearfix"></div>
<div class="clearfix ln_solid"></div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"><?=_('Receive COS Pin')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The pin that receives the COS signal from the receiver. You have the option of inverting the control logic of this pin.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="serialRX_cos%%currPortNum%%" name="serialRX_cos" class="form-control serialRX_cos">
<option value="">---</option>
<option value="DCD"><?=_('DCD')?></option>
<option value="CTS"><?=_('CTS')?></option>
<option value="DSR"><?=_('DSR')?></option>
<option value="RI"><?=_('RI')?></option>
</select>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<input id="serialRX_cos_invert%%currPortNum%%" name="serialRX_cos_invert" type="checkbox" class="js-switch" value="true">
<label class="invertPinLabel"><?=_('Invert Pin')?></label>
</div>
</div>
<div class="clearfix spacer height20"></div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"><?=_('Transmit PTT Pin')?>
<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="<?=_('The pin that sends the PTT signal to the transmitter. You have the option of inverting the control logic of this pin.')?>"></i>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="serialTX_ptt%%currPortNum%%" name="serialTX_ptt" class="form-control serialTX_ptt">
<option value="">---</option>
<option value="RTS"><?=_('RTS')?></option>
<option value="DTR"><?=_('DTR')?></option>
</select>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<input id="serialTX_ptt_invert%%currPortNum%%" name="serialTX_ptt_invert" type="checkbox" class="js-switch" value="true">
<label class="invertPinLabel"><?=_('Invert Pin')?></label>
</div>
</div>
<div class="clearfix spacer height20"></div>
</div>
</div>
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade" id="tab_modules%%currPortNum%%" aria-labelledby="modules-tab%%currPortNum%%">
<div class="clearfix spacer height30"></div>
<div class="col-md-12 col-sm-12 col-xs-12">
WIP...
</div>
</div>
<!-- ******************************* -->
<div role="tabpanel" class="tab-pane fade" id="tab_override%%currPortNum%%" aria-labelledby="override-tab%%currPortNum%%">
<div class="clearfix spacer height10"></div>
<div class="col-md-4 col-sm-4 col-xs-12 advOptionGrp">
<div class="x_title">
<h4 class="navbar-left"><?=_('Logic Section')?></h4>
<div class="clearfix"></div>
</div>
<div class="input_fields_wrap advLocal_wrap" id="port%%currPortNum%%local" data-port-num="%%currPortNum%%" data-real-count="0" data-ceiling-count="0" data-section-type="local">
<div class="innerWrap"></div>
<button class="btn btn-success btn-xs add_field_button"><i class="fa fa-plus-circle"></i> <?=_('Add Field')?></button>
</div>
<div class="clearfix spacer height20"></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12 advOptionGrp">
<div class="x_title">
<h4 class="navbar-left"><?=_('RX Section')?></h4>
<div class="clearfix"></div>
</div>
<div class="input_fields_wrap advRX_wrap" id="port%%currPortNum%%rx" data-port-num="%%currPortNum%%" data-real-count="0" data-ceiling-count="0" data-section-type="rx">
<div class="innerWrap"></div>
<button class="btn btn-success btn-xs add_field_button"><i class="fa fa-plus-circle"></i> <?=_('Add Field')?></button>
</div>
<div class="clearfix spacer height20"></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12 advOptionGrp">
<div class="x_title">
<h4 class="navbar-left"><?=_('TX Section')?></h4>
<div class="clearfix"></div>
</div>
<div class="input_fields_wrap advTX_wrap" id="port%%currPortNum%%tx" data-port-num="%%currPortNum%%" data-real-count="0" data-ceiling-count="0" data-section-type="tx">
<div class="innerWrap"></div>
<button class="btn btn-success btn-xs add_field_button"><i class="fa fa-plus-circle"></i> <?=_('Add Field')?></button>
</div>
<div class="clearfix spacer height20"></div>
</div>
</div>
<!-- ******************************* -->
</div>
</div>
</div>
</form>
</div>
</div>
</script>
<? ######################################################################### ?>
<script id="advFieldsTemplate" type = "text/template">
<div>
<select id="adv_%%TYPE%%_%%PORT%%_%%ROW%%_name" class="form-control advOptionKey">%%OPTIONS%%</select>
<input class="form-control advOptionValue" type="text" id="adv_%%TYPE%%_%%PORT%%_%%ROW%%_value" placeholder="<?=_('Value')?>">
<button class="form-control remove_field">
<i class="fa fa-minus-circle" data-toggle="tooltip" data-placement="top" title="Delete Row"></i>
</button>
</div>
</script>
<?php
$lg_raw = $settings['LinkGroup_Settings'];
$lg_array = json_decode($lg_raw);
$lg_count = 0;
foreach ($lg_array as $value) { $lg_count++; }
?>
<script>
var portList = '<?= json_encode($ports) ?>';
if (<?=$lg_count ?> > 0) { var linkGroupSettings = '<?= $settings['LinkGroup_Settings'] ?>'; } else { var linkGroupSettings = '{}'; }
var max_fields = 10; //maximum input boxes allowed per section
var logicOptions = <?=$SVXLink->get_adv_svxlink_options('logic')?>;
var rxOptions = <?=$SVXLink->get_adv_svxlink_options('rx')?>;
var txOptions = <?=$SVXLink->get_adv_svxlink_options('tx')?>;
var modal_AddPortTitle = '<?=_('Add Port')?>';
var modal_AddPortBody = '<p><?=_('What type of port do you wish to add?')?></p><select id="addPortType" name="addPortType" class="form-control"><option value="local" selected><?=_('Local Analog Port')?></option></select>';
// <option value="voip"><?=_('Test VOIP')?></option>
var modal_DeletePortTitle = '<?= _('Delete Port') ?>';
var modal_DeletePortBody = '<?= _('Are you sure you want to delete this port?') ?>';
var modal_DeletePortBtnOK = '<?= _('Delete Forever') ?>';
var modal_DeletePortProgressTitle = '<?= _('Deleting Port') ?>';
var modal_DeletePortNotifyTitle = '<?= _('Port Deleted') ?>';
var modal_DeletePortNotifyDesc = '<?= _('The port has been successfully deleted.') ?>';
var modal_DeletePortErrorTitle = '<?= _('Error Deleting') ?>';
var modal_DeletePortErrorDesc = '<?= _('There was an error deleting the requested port. Please try again later.') ?>';
var modal_AudioScanWarningTitle = '<?= strtoupper( _('Warning') ) ?>';
var modal_AudioScanWarningBody = '<?= _('By proceeding, SVXLink will need to be briefly stopped in order to query the system for available sound devices. This will interrupt any active communications. Please ensure that there is no activity before proceeding.') ?>';
var modal_AudioScanWarningBtnOK = '<?= _('Proceed') ?>';
var modal_AudioScanWarningBtnCancel = '<?= _('Get Me Out of Here!') ?>';
var modal_LoadAudioTitle = '<?= _('Reading Sound Devices') ?>';
</script>
<?php include('includes/footer.php'); ?>
<?php
// --------------------------------------------------------
// SESSION CHECK TO SEE IF USER IS LOGGED IN.
} // close ELSE to end login check from top of page
// --------------------------------------------------------
?>