2012-06-18 17:26:22 +02:00
|
|
|
<?php
|
2023-06-08 13:19:01 +02:00
|
|
|
// Pandora FMS - https://pandorafms.com
|
2012-06-18 17:26:22 +02:00
|
|
|
// ==================================================
|
2023-06-08 11:53:13 +02:00
|
|
|
// Copyright (c) 2005-2023 Pandora FMS
|
2023-06-08 13:19:01 +02:00
|
|
|
// Please see https://pandorafms.com/community/ for full contribution list
|
2012-06-18 17:26:22 +02: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 for version 2.
|
|
|
|
// 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.
|
|
|
|
$get_sec_pages = get_parameter('get_sec_pages');
|
2015-10-19 15:08:44 +02:00
|
|
|
$get_sec_pages2 = get_parameter('get_sec_pages2');
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once 'include/functions_menu.php';
|
|
|
|
require_once 'include/functions_html.php';
|
2012-06-18 17:26:22 +02:00
|
|
|
|
|
|
|
if ($get_sec_pages) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$sec = get_parameter('sec');
|
|
|
|
$menu_hash = get_parameter('menu_hash');
|
|
|
|
|
|
|
|
// WARNING: 'mobile' is a very special section
|
|
|
|
if ($sec === 'mobile') {
|
|
|
|
global $config;
|
|
|
|
include_once $config['homedir'].'/mobile/operation/home.php';
|
|
|
|
|
|
|
|
$home = new Home();
|
|
|
|
$pagesItems = $home->getPagesItems();
|
|
|
|
|
|
|
|
if (empty($pagesItems)) {
|
|
|
|
$pagesItems = [];
|
|
|
|
} else {
|
|
|
|
ksort($pagesItems);
|
|
|
|
}
|
|
|
|
|
|
|
|
$pages = [];
|
|
|
|
foreach ($pagesItems as $page => $data) {
|
|
|
|
$pages[$page] = $data['name'];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$pages = menu_get_sec_pages($sec, $menu_hash);
|
|
|
|
}
|
|
|
|
|
2021-07-30 13:49:22 +02:00
|
|
|
$pages = menu_pepare_acl_select_data($pages, $sec);
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
echo json_encode($pages);
|
|
|
|
return;
|
2012-06-18 17:26:22 +02:00
|
|
|
}
|
|
|
|
|
2015-10-19 15:08:44 +02:00
|
|
|
if ($get_sec_pages2) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$sec2 = get_parameter('sec2');
|
|
|
|
$sec = get_parameter('sec');
|
|
|
|
$menu_hash = get_parameter('menu_hash');
|
2015-10-19 15:08:44 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$pages = menu_get_sec2_pages($sec, $sec2, $menu_hash);
|
|
|
|
|
|
|
|
echo json_encode($pages);
|
|
|
|
return;
|
|
|
|
}
|