2017-05-03 16:51:01 -05:00
|
|
|
<?php
|
|
|
|
/**
|
2018-03-14 20:25:19 +00:00
|
|
|
* devices_groups.inc.php
|
2017-05-03 16:51:01 -05:00
|
|
|
*
|
2018-03-14 20:25:19 +00:00
|
|
|
* List devices and groups in one
|
2017-05-03 16:51:01 -05: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 3 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
|
2021-02-09 00:29:04 +01:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2017-05-03 16:51:01 -05:00
|
|
|
*
|
2021-02-09 00:29:04 +01:00
|
|
|
* @link https://www.librenms.org
|
2021-09-10 20:09:53 +02:00
|
|
|
*
|
2018-03-14 20:25:19 +00:00
|
|
|
* @copyright 2018 Tony Murray
|
2017-05-03 16:51:01 -05:00
|
|
|
* @author Tony Murray <murraytony@gmail.com>
|
|
|
|
*/
|
2018-03-14 20:25:19 +00:00
|
|
|
[$devices, $d_more] = include 'devices.inc.php';
|
|
|
|
[$groups, $g_more] = include 'groups.inc.php';
|
2017-05-03 16:51:01 -05:00
|
|
|
|
2018-03-14 20:25:19 +00:00
|
|
|
$groups = array_map(function ($group) {
|
|
|
|
$group['id'] = 'g' . $group['id'];
|
2020-09-21 15:40:17 +02:00
|
|
|
|
2018-03-14 20:25:19 +00:00
|
|
|
return $group;
|
|
|
|
}, $groups);
|
|
|
|
|
|
|
|
$data = [
|
2020-02-13 12:50:18 +01:00
|
|
|
['text' => 'Groups', 'children' => $groups],
|
|
|
|
['text' => 'Devices', 'children' => $devices],
|
2018-03-14 20:25:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
return [$data, $d_more || $g_more];
|