diff options
Diffstat (limited to 'config/freeswitch/freeswitch_gateways.tmp')
-rw-r--r-- | config/freeswitch/freeswitch_gateways.tmp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp index 88be8fc4..6a0d6dd6 100644 --- a/config/freeswitch/freeswitch_gateways.tmp +++ b/config/freeswitch/freeswitch_gateways.tmp @@ -126,8 +126,22 @@ if ($config_change == 1) { </tr> - <?php - + <?php + //create a temporary id for the array + $i = 0; + if (count($a_gateways) > 0) { + foreach ($a_gateways as $ent) { + $a_gateways[$i]['id'] = $i; + $i++; + } + } + + //order the array + function cmp_string($a, $b) { + return strcmp($a["gateway"], $b["gateway"]); + } + usort($a_gateways, "cmp_string"); + $i = 0; if (count($a_gateways) > 0) { @@ -135,23 +149,23 @@ if ($config_change == 1) { ?> <tr> - <td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$ent['id'];?>';"> <?=$ent['gateway'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$ent['id'];?>';"> <?=$ent['context'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$ent['id'];?>';"> <?=$ent['enabled'];?> </td> - <td class="listbg" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';"> + <td class="listbg" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$ent['id'];?>';"> <font color="#FFFFFF"><?=htmlspecialchars($ent['description']);?> </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_gateways_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_gateways.php?type=gateways&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_gateways_edit.php?id=<?=$ent['id'];?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_gateways.php?type=gateways&act=del&id=<?=$ent['id'];?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> |