forked from FreePBX/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.astmodules.php
145 lines (144 loc) · 4.63 KB
/
page.astmodules.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
<?php
$mods = FreePBX::create()->ModulesConf();
$pc = $mods->ProcessedConfig['modules'];
$loadrows =
$noloadrows = '';
$preloadrows = '';
if (isset($pc['noload'])) {
$noloads = is_array($pc['noload']) ? $pc['noload'] : array($pc['noload']);
foreach($noloads as $mod){
$noloadrows .= <<<HERE
<tr id = "row$mod">
<td>$mod</td>
<td>
<a href="#" id="del$mod" data-mod="$mod">
<i class="fa fa-trash-o"></i></a></td>
</tr>
HERE;
}
}
if (isset($pc['load'])) {
$loads = is_array($pc['load']) ? $pc['load'] : array($pc['load']);
foreach($loads as $mod){
$loadrows .= <<<HERE
<tr id = "row$mod">
<td>$mod</td>
<td>
<a href="#" id="del$mod" data-mod="$mod">
<i class="fa fa-trash-o"></i></a></td>
</tr>
HERE;
}
}
if (isset($pc['preload'])) {
$preloads = is_array($pc['preload']) ? $pc['preload'] : array($pc['preload']);
foreach($preloads as $mod){
$preloadrows .= <<<HERE
<tr id = "row$mod">
<td>$mod</td>
<td>
<a href="#" id="del$mod" data-mod="$mod">
<i class="fa fa-trash-o"></i></a></td>
</tr>
HERE;
}
}
?>
<div class="container-fluid">
<h1><?php echo _("Asterisk Modules")?></h1>
<div class="well well-info">
<?php echo _("Note that this is for ASTERISK modules, not FreePBX Modules.")?>
<br/>
<?php echo _("It is unlikely you'll need to change anything here.")?>
<br/>
<?php echo _("Please be careful when adding or removing modules, as it is possible to stop Asterisk from starting with an incorrect configuration.")?>
<br/>
<?php echo _("Deleting the modules.conf file will reset this to defaults.")?>
</div>
<div class = "display full-border">
<div class="row">
<div class="col-sm-9">
<div class="fpbx-container">
<form class="fpbx-submit" name="frm_extensions" action="" method="post" data-fpbx-delete="" role="form">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" data-name="amodnoload" class="active">
<a href="#amodnoload" aria-controls="amodnoload" role="tab" data-toggle="tab">
<?php echo _("Excluded Modules")?>
</a>
</li>
<li role="presentation" data-name="amodload" class="change-tab">
<a href="#amodload" aria-controls="amodload" role="tab" data-toggle="tab">
<?php echo _("Manually Loaded Modules")?>
</a>
</li>
<li role="presentation" data-name="amodpreload" class="change-tab">
<a href="#amodpreload" aria-controls="amodpreload" role="tab" data-toggle="tab">
<?php echo _("Preloaded Modules")?>
</a>
</li>
</ul>
<div class="tab-content display">
<div role="tabpanel" id="amodnoload" class="tab-pane active">
<table id="modnoload"
data-toggle="table"
data-pagination="true"
data-search="true"
class="table table-striped">
<thead>
<tr>
<th data-sortable="true"><?php echo _("Module") ?></th>
<th class = "col-sm-2"><?php echo _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php echo $noloadrows ?>
</tbody>
</table>
</div>
<div role="tabpanel" id="amodload" class="tab-pane">
<table id="modload"
data-toggle="table"
data-pagination="true"
data-search="true"
class="table table-striped">
<thead>
<tr>
<th data-sortable="true"><?php echo _("Module") ?></th>
<th class = "col-sm-2"><?php echo _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php echo $loadrows ?>
</tbody>
</table>
</div>
<div role="tabpanel" id="amodpreload" class="tab-pane">
<table id="modpreload"
data-toggle="table"
data-pagination="true"
data-search="true"
class="table table-striped">
<thead>
<tr>
<th data-sortable="true"><?php echo _("Module") ?></th>
<th class = "col-sm-2"><?php echo _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php echo $preloadrows ?>
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
<div class="col-sm-3 hidden-xs bootnav" id='addform'>
<label class="control-label" for="module"><b><?php echo _("Add Module") ?></b></label>
<input type="text" class="form-control" id="module" name="module" value="">
<button class="btn btn-default" id="addmodule"><i class="fa fa-plus"></i> <?php echo _("Add")?></button>
</div>
</div>
</div>
</div>
</div>