Files
urfd/dashboard/json/views/modulesinuse.php
T
mfiscus 72a0a337f6 json api
Ported (go/gin) json api from gomrefdash (https://github.com/kc1awv/gomrefdash) to (php/apache) urfd dashboard. This provides consistency between mrefd and urfd reflector dashboards and is intended to accelerate integration with dvref.com for an official URFD reflector registry.

Updated dashboard version to 2.5.0 to help reflector admins determine compatibility with eventual dvref.com integration (>= 2.5.0).

It has been extensively tested and is currently running on https://urf847.kk7mnz.com/json/reflector

dvref.com integration has been tested at https://dvref.com/mrefd/m17-847
2023-11-26 13:50:16 -07:00

30 lines
498 B
PHP

<?php
$Modules = $Reflector->GetModules();
sort($Modules, SORT_STRING);
/*** Add modules to payload ***/
for ($i=0;$i<count($Modules);$i++) {
$payload[$i] = array(
'name' => $Modules[$i]
);
$Users = $Reflector->GetNodesInModulesByID($Modules[$i]);
for ($j=0;$j<count($Users);$j++) {
$payload[$i]['callsigns'][$j] = $Reflector->GetCallsignAndSuffixByID($Users[$j]);
}
}
// json encode payload array
$records = json_encode($payload);
echo $records;
?>