2021-11-10 02:42:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2025-02-25 20:48:50 +01:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2021-2025
|
2021-11-10 02:42:14 +01:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2022-10-11 00:35:14 +02:00
|
|
|
//includes files
|
2023-06-15 19:28:23 +02:00
|
|
|
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
2021-11-10 02:42:14 +01:00
|
|
|
require_once "resources/check_auth.php";
|
|
|
|
|
|
|
|
|
|
//check permissions
|
|
|
|
|
if (permission_exists('dashboard_add') || permission_exists('dashboard_edit')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-21 07:37:32 +02:00
|
|
|
//initialize the database
|
|
|
|
|
$database = new database;
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//add multi-lingual support
|
|
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
|
|
|
|
|
2023-06-03 01:01:15 +02:00
|
|
|
//set the defaults
|
|
|
|
|
$dashboard_name = '';
|
2024-08-22 00:58:44 +02:00
|
|
|
$dashboard_path = 'dashboard/icon';
|
2024-07-25 03:57:59 +02:00
|
|
|
//$dashboard_path = '';
|
2024-04-25 03:58:14 +02:00
|
|
|
$dashboard_icon = '';
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_icon_color = '';
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_url = '';
|
|
|
|
|
$dashboard_target = 'self';
|
2024-07-20 01:03:21 +02:00
|
|
|
$dashboard_width = '';
|
|
|
|
|
$dashboard_height = '';
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_content = '';
|
2024-07-21 07:37:32 +02:00
|
|
|
$dashboard_content_text_align = '';
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_content_details = '';
|
2024-08-16 18:11:24 +02:00
|
|
|
$dashboard_label_enabled = 'true';
|
2024-08-15 01:44:11 +02:00
|
|
|
$dashboard_label_text_color = '';
|
|
|
|
|
$dashboard_label_background_color = '';
|
2024-05-13 22:20:33 +02:00
|
|
|
$dashboard_number_text_color = '';
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_number_background_color = '';
|
2023-06-03 01:01:15 +02:00
|
|
|
$dashboard_groups = [];
|
|
|
|
|
$dashboard_column_span = '';
|
2024-06-13 00:49:34 +02:00
|
|
|
$dashboard_row_span = '';
|
2023-06-03 01:01:15 +02:00
|
|
|
$dashboard_details_state = '';
|
2024-08-04 18:33:19 +02:00
|
|
|
$dashboard_parent_uuid = '';
|
2023-06-03 01:01:15 +02:00
|
|
|
$dashboard_order = '';
|
2024-08-16 18:11:24 +02:00
|
|
|
$dashboard_enabled = 'true';
|
2023-06-03 01:01:15 +02:00
|
|
|
$dashboard_description = '';
|
|
|
|
|
$dashboard_uuid = '';
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//action add or update
|
2023-05-13 00:57:07 +02:00
|
|
|
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
$action = "update";
|
|
|
|
|
$dashboard_uuid = $_REQUEST["id"];
|
|
|
|
|
$id = $_REQUEST["id"];
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$action = "add";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get http post variables and set them to php variables
|
2023-05-13 00:57:07 +02:00
|
|
|
if (!empty($_POST)) {
|
|
|
|
|
$dashboard_name = $_POST["dashboard_name"] ?? '';
|
|
|
|
|
$dashboard_path = $_POST["dashboard_path"] ?? '';
|
2024-04-25 03:58:14 +02:00
|
|
|
$dashboard_icon = $_POST["dashboard_icon"] ?? '';
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_icon_color = $_POST["dashboard_icon_color"] ?? '';
|
2024-04-25 03:58:14 +02:00
|
|
|
$dashboard_url = $_POST["dashboard_url"] ?? '';
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_target = $_POST["dashboard_target"] ?? 'self';
|
2024-07-20 01:03:21 +02:00
|
|
|
$dashboard_width = $_POST["dashboard_width"] ?? '';
|
|
|
|
|
$dashboard_height = $_POST["dashboard_height"] ?? '';
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_content = $_POST["dashboard_content"] ?? '';
|
2024-07-21 07:37:32 +02:00
|
|
|
$dashboard_content_text_align = $_POST["dashboard_content_text_align"] ?? '';
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_content_details = $_POST["dashboard_content_details"] ?? '';
|
2023-05-13 00:57:07 +02:00
|
|
|
$dashboard_groups = $_POST["dashboard_groups"] ?? '';
|
2024-04-19 00:57:45 +02:00
|
|
|
$dashboard_chart_type = $_POST["dashboard_chart_type"] ?? '';
|
2024-08-16 18:11:24 +02:00
|
|
|
$dashboard_label_enabled = $_POST["dashboard_label_enabled"] ?? 'false';
|
2024-08-15 01:44:11 +02:00
|
|
|
$dashboard_label_text_color = $_POST["dashboard_label_text_color"] ?? '';
|
|
|
|
|
$dashboard_label_text_color_hover = $_POST["dashboard_label_text_color_hover"] ?? '';
|
|
|
|
|
$dashboard_label_background_color = $_POST["dashboard_label_background_color"] ?? '';
|
|
|
|
|
$dashboard_label_background_color_hover = $_POST["dashboard_label_background_color_hover"] ?? '';
|
2024-04-18 00:01:54 +02:00
|
|
|
$dashboard_number_text_color = $_POST["dashboard_number_text_color"] ?? '';
|
2024-06-22 00:44:31 +02:00
|
|
|
$dashboard_number_text_color_hover = $_POST["dashboard_number_text_color_hover"] ?? '';
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_number_background_color = $_POST["dashboard_number_background_color"] ?? '';
|
2024-05-08 17:54:18 +02:00
|
|
|
$dashboard_background_color = $_POST["dashboard_background_color"] ?? '';
|
2024-06-22 00:44:31 +02:00
|
|
|
$dashboard_background_color_hover = $_POST["dashboard_background_color_hover"] ?? '';
|
2024-05-08 17:54:18 +02:00
|
|
|
$dashboard_detail_background_color = $_POST["dashboard_detail_background_color"] ?? '';
|
2024-08-27 21:58:11 +02:00
|
|
|
$dashboard_background_gradient_style = $_POST["dashboard_background_gradient_style"] ?? 'mirror';
|
|
|
|
|
$dashboard_background_gradient_angle = $_POST["dashboard_background_gradient_angle"] ?? '90';
|
2023-05-13 00:57:07 +02:00
|
|
|
$dashboard_column_span = $_POST["dashboard_column_span"] ?? '';
|
2024-06-13 00:49:34 +02:00
|
|
|
$dashboard_row_span = $_POST["dashboard_row_span"] ?? '';
|
2023-05-13 00:57:07 +02:00
|
|
|
$dashboard_details_state = $_POST["dashboard_details_state"] ?? '';
|
2024-08-04 18:33:19 +02:00
|
|
|
$dashboard_parent_uuid = $_POST["dashboard_parent_uuid"] ?? '';
|
2023-05-13 00:57:07 +02:00
|
|
|
$dashboard_order = $_POST["dashboard_order"] ?? '';
|
2023-05-17 02:00:40 +02:00
|
|
|
$dashboard_enabled = $_POST["dashboard_enabled"] ?? 'false';
|
2023-05-13 00:57:07 +02:00
|
|
|
$dashboard_description = $_POST["dashboard_description"] ?? '';
|
2024-08-28 20:17:22 +02:00
|
|
|
|
|
|
|
|
//define the regex patterns
|
|
|
|
|
$uuid_pattern = '/[^-A-Fa-f0-9]/';
|
|
|
|
|
$number_pattern = '/[^-A-Za-z0-9()*#]/';
|
2024-09-04 04:59:30 +02:00
|
|
|
$text_pattern = '/[^a-zA-Z0-9 _\-\/.\?:\=#\n]/';
|
2024-08-28 20:17:22 +02:00
|
|
|
|
|
|
|
|
//sanitize the data
|
|
|
|
|
$dashboard_name = trim(preg_replace('/[^a-zA-Z0-9 _\-\/.#]/', '', $dashboard_name));
|
|
|
|
|
$dashboard_path = preg_replace($text_pattern, '', strtolower($dashboard_path));
|
|
|
|
|
$dashboard_icon = preg_replace($text_pattern, '', $dashboard_icon);
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_icon_color = preg_replace($text_pattern, '', $dashboard_icon_color);
|
2024-08-28 20:17:22 +02:00
|
|
|
$dashboard_url = trim(preg_replace($text_pattern, '', $dashboard_url));
|
|
|
|
|
$dashboard_target = trim(preg_replace($text_pattern, '', $dashboard_target));
|
|
|
|
|
$dashboard_width = trim(preg_replace($text_pattern, '', $dashboard_width));
|
|
|
|
|
$dashboard_height = trim(preg_replace($text_pattern, '', $dashboard_height));
|
|
|
|
|
$dashboard_content = trim(preg_replace($text_pattern, '', $dashboard_content));
|
|
|
|
|
$dashboard_content_text_align = trim(preg_replace($text_pattern, '', $dashboard_content_text_align));
|
|
|
|
|
$dashboard_content_details = trim(preg_replace($text_pattern, '', $dashboard_content_details));
|
|
|
|
|
$dashboard_chart_type = preg_replace($text_pattern, '', $dashboard_chart_type);
|
|
|
|
|
$dashboard_label_enabled = preg_replace($text_pattern, '', $dashboard_label_enabled);
|
|
|
|
|
$dashboard_label_text_color = preg_replace($text_pattern, '', $dashboard_label_text_color);
|
2024-09-03 18:50:45 +02:00
|
|
|
$dashboard_label_text_color_hover = preg_replace($text_pattern, '', $dashboard_label_text_color_hover);
|
2024-08-28 20:17:22 +02:00
|
|
|
$dashboard_label_background_color = preg_replace($text_pattern, '', $dashboard_label_background_color);
|
|
|
|
|
$dashboard_label_background_color_hover = preg_replace($text_pattern, '', $dashboard_label_background_color_hover);
|
|
|
|
|
$dashboard_number_text_color = preg_replace($text_pattern, '', $dashboard_number_text_color);
|
|
|
|
|
$dashboard_number_text_color_hover = preg_replace($text_pattern, '', $dashboard_number_text_color_hover);
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_number_background_color = preg_replace($text_pattern, '', $dashboard_number_background_color);
|
2024-08-28 20:17:22 +02:00
|
|
|
$dashboard_background_color = preg_replace($text_pattern, '', $dashboard_background_color);
|
|
|
|
|
$dashboard_background_color_hover = preg_replace($text_pattern, '', $dashboard_background_color_hover);
|
|
|
|
|
$dashboard_detail_background_color = preg_replace($text_pattern, '', $dashboard_detail_background_color);
|
|
|
|
|
$dashboard_background_gradient_style = preg_replace($text_pattern, '', $dashboard_background_gradient_style);
|
|
|
|
|
$dashboard_background_gradient_angle = preg_replace($text_pattern, '', $dashboard_background_gradient_angle);
|
|
|
|
|
$dashboard_column_span = preg_replace($number_pattern, '', $dashboard_column_span);
|
|
|
|
|
$dashboard_row_span = preg_replace($number_pattern, '', $dashboard_row_span);
|
|
|
|
|
$dashboard_details_state = preg_replace($text_pattern, '', $dashboard_details_state);
|
|
|
|
|
$dashboard_parent_uuid = preg_replace($uuid_pattern, '', $dashboard_parent_uuid);
|
|
|
|
|
$dashboard_order = preg_replace($number_pattern, '', $dashboard_order);
|
|
|
|
|
$dashboard_enabled = preg_replace($text_pattern, '', $dashboard_enabled);
|
|
|
|
|
$dashboard_description = preg_replace($text_pattern, '', $dashboard_description);
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//delete the group from the sub table
|
2023-05-13 00:57:07 +02:00
|
|
|
if (isset($_REQUEST["a"]) && $_REQUEST["a"] == "delete" && permission_exists("dashboard_group_delete") && is_uuid($_GET["dashboard_group_uuid"]) && is_uuid($_GET["dashboard_uuid"])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
//get the uuid
|
|
|
|
|
$dashboard_group_uuid = $_GET["dashboard_group_uuid"];
|
|
|
|
|
$dashboard_uuid = $_GET["dashboard_uuid"];
|
|
|
|
|
//delete the group from the users
|
|
|
|
|
$array['dashboard_groups'][0]['dashboard_group_uuid'] = $dashboard_group_uuid;
|
|
|
|
|
$database->app_name = 'dashboard';
|
|
|
|
|
$database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7';
|
|
|
|
|
$database->delete($array);
|
|
|
|
|
unset($array);
|
|
|
|
|
//redirect the user
|
|
|
|
|
message::add($text['message-delete']);
|
|
|
|
|
header("Location: dashboard_edit.php?id=".urlencode($dashboard_uuid));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//process the user data and save it to the database
|
2023-05-05 18:46:37 +02:00
|
|
|
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
//validate the token
|
|
|
|
|
$token = new token;
|
|
|
|
|
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
|
|
|
|
message::add($text['message-invalid_token'],'negative');
|
|
|
|
|
header('Location: dashboard.php');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//process the http post data by submitted action
|
2023-05-16 22:51:02 +02:00
|
|
|
if (!empty($_POST['action'])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
|
|
|
|
|
//prepare the array(s)
|
|
|
|
|
//send the array to the database class
|
|
|
|
|
switch ($_POST['action']) {
|
|
|
|
|
case 'copy':
|
|
|
|
|
if (permission_exists('dashboard_add')) {
|
2024-07-21 07:37:32 +02:00
|
|
|
$database->copy($array);
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'delete':
|
|
|
|
|
if (permission_exists('dashboard_delete')) {
|
2024-07-21 07:37:32 +02:00
|
|
|
$database->delete($array);
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'toggle':
|
|
|
|
|
if (permission_exists('dashboard_update')) {
|
2024-07-21 07:37:32 +02:00
|
|
|
$database->toggle($array);
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//redirect the user
|
|
|
|
|
if (in_array($_POST['action'], array('copy', 'delete', 'toggle'))) {
|
|
|
|
|
header('Location: dashboard_edit.php?id='.$id);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//check for all required data
|
|
|
|
|
$msg = '';
|
2023-05-05 18:46:37 +02:00
|
|
|
//if (empty($dashboard_name)) { $msg .= $text['message-required']." ".$text['label-dashboard_name']."<br>\n"; }
|
|
|
|
|
//if (empty($dashboard_path)) { $msg .= $text['message-required']." ".$text['label-dashboard_path']."<br>\n"; }
|
|
|
|
|
//if (empty($dashboard_groups)) { $msg .= $text['message-required']." ".$text['label-dashboard_groups']."<br>\n"; }
|
|
|
|
|
//if (empty($dashboard_order)) { $msg .= $text['message-required']." ".$text['label-dashboard_order']."<br>\n"; }
|
|
|
|
|
//if (empty($dashboard_enabled)) { $msg .= $text['message-required']." ".$text['label-dashboard_enabled']."<br>\n"; }
|
|
|
|
|
//if (empty($dashboard_description)) { $msg .= $text['message-required']." ".$text['label-dashboard_description']."<br>\n"; }
|
|
|
|
|
if (!empty($msg) && empty($_POST["persistformvar"])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
require_once "resources/header.php";
|
|
|
|
|
require_once "resources/persist_form_var.php";
|
|
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table><tr><td>\n";
|
|
|
|
|
echo $msg."<br />";
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
|
persistformvar($_POST);
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
require_once "resources/footer.php";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add the dashboard_uuid
|
|
|
|
|
if (!is_uuid($_POST["dashboard_uuid"])) {
|
|
|
|
|
$dashboard_uuid = uuid();
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-04 19:51:53 +02:00
|
|
|
//remove empty values and convert to json
|
2024-05-08 17:54:18 +02:00
|
|
|
if (!empty($dashboard_background_color)) {
|
|
|
|
|
if (is_array($dashboard_background_color)) {
|
|
|
|
|
$dashboard_background_color = array_filter($dashboard_background_color);
|
|
|
|
|
if (count($dashboard_background_color) > 0) {
|
|
|
|
|
$dashboard_background_color = json_encode($dashboard_background_color);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$dashboard_background_color = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-22 00:44:31 +02:00
|
|
|
if (!empty($dashboard_background_color_hover)) {
|
|
|
|
|
if (is_array($dashboard_background_color_hover)) {
|
|
|
|
|
$dashboard_background_color_hover = array_filter($dashboard_background_color_hover);
|
|
|
|
|
if (count($dashboard_background_color_hover) > 0) {
|
|
|
|
|
$dashboard_background_color_hover = json_encode($dashboard_background_color_hover);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$dashboard_background_color_hover = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-08 17:54:18 +02:00
|
|
|
if (!empty($dashboard_detail_background_color)) {
|
|
|
|
|
if (is_array($dashboard_detail_background_color)) {
|
|
|
|
|
$dashboard_detail_background_color = array_filter($dashboard_detail_background_color);
|
|
|
|
|
if (count($dashboard_detail_background_color) > 0) {
|
|
|
|
|
$dashboard_detail_background_color = json_encode($dashboard_detail_background_color);
|
2024-05-04 19:51:53 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2024-05-08 17:54:18 +02:00
|
|
|
$dashboard_detail_background_color = '';
|
2024-05-04 19:51:53 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//prepare the array
|
|
|
|
|
$array['dashboard'][0]['dashboard_uuid'] = $dashboard_uuid;
|
|
|
|
|
$array['dashboard'][0]['dashboard_name'] = $dashboard_name;
|
|
|
|
|
$array['dashboard'][0]['dashboard_path'] = $dashboard_path;
|
2024-04-25 03:58:14 +02:00
|
|
|
$array['dashboard'][0]['dashboard_icon'] = $dashboard_icon;
|
2024-12-12 05:28:45 +01:00
|
|
|
$array['dashboard'][0]['dashboard_icon_color'] = $dashboard_icon_color;
|
2024-04-25 03:58:14 +02:00
|
|
|
$array['dashboard'][0]['dashboard_url'] = $dashboard_url;
|
2024-07-20 01:03:21 +02:00
|
|
|
$array['dashboard'][0]['dashboard_width'] = $dashboard_width;
|
|
|
|
|
$array['dashboard'][0]['dashboard_height'] = $dashboard_height;
|
2024-06-13 18:48:24 +02:00
|
|
|
$array['dashboard'][0]['dashboard_target'] = $dashboard_target;
|
|
|
|
|
$array['dashboard'][0]['dashboard_content'] = $dashboard_content;
|
2024-07-21 07:37:32 +02:00
|
|
|
$array['dashboard'][0]['dashboard_content_text_align'] = $dashboard_content_text_align;
|
2024-06-13 18:48:24 +02:00
|
|
|
$array['dashboard'][0]['dashboard_content_details'] = $dashboard_content_details;
|
2024-04-19 00:57:45 +02:00
|
|
|
$array['dashboard'][0]['dashboard_chart_type'] = $dashboard_chart_type;
|
2024-08-15 01:44:11 +02:00
|
|
|
$array['dashboard'][0]['dashboard_label_enabled'] = $dashboard_label_enabled;
|
|
|
|
|
$array['dashboard'][0]['dashboard_label_text_color'] = $dashboard_label_text_color;
|
|
|
|
|
$array['dashboard'][0]['dashboard_label_text_color_hover'] = $dashboard_label_text_color_hover;
|
|
|
|
|
$array['dashboard'][0]['dashboard_label_background_color'] = $dashboard_label_background_color;
|
|
|
|
|
$array['dashboard'][0]['dashboard_label_background_color_hover'] = $dashboard_label_background_color_hover;
|
2024-04-18 00:01:54 +02:00
|
|
|
$array['dashboard'][0]['dashboard_number_text_color'] = $dashboard_number_text_color;
|
2024-06-22 00:44:31 +02:00
|
|
|
$array['dashboard'][0]['dashboard_number_text_color_hover'] = $dashboard_number_text_color_hover;
|
2024-12-12 05:28:45 +01:00
|
|
|
$array['dashboard'][0]['dashboard_number_background_color'] = $dashboard_number_background_color;
|
2024-05-08 17:54:18 +02:00
|
|
|
$array['dashboard'][0]['dashboard_background_color'] = $dashboard_background_color;
|
2024-06-22 00:44:31 +02:00
|
|
|
$array['dashboard'][0]['dashboard_background_color_hover'] = $dashboard_background_color_hover;
|
2024-05-08 17:54:18 +02:00
|
|
|
$array['dashboard'][0]['dashboard_detail_background_color'] = $dashboard_detail_background_color;
|
2024-08-27 21:58:11 +02:00
|
|
|
$array['dashboard'][0]['dashboard_background_gradient_style'] = $dashboard_background_gradient_style;
|
|
|
|
|
$array['dashboard'][0]['dashboard_background_gradient_angle'] = $dashboard_background_gradient_angle;
|
2021-12-23 19:44:57 +01:00
|
|
|
$array['dashboard'][0]['dashboard_column_span'] = $dashboard_column_span;
|
2024-06-13 00:49:34 +02:00
|
|
|
$array['dashboard'][0]['dashboard_row_span'] = $dashboard_row_span;
|
2023-01-17 21:50:44 +01:00
|
|
|
$array['dashboard'][0]['dashboard_details_state'] = $dashboard_details_state;
|
2024-08-04 18:33:19 +02:00
|
|
|
$array['dashboard'][0]['dashboard_parent_uuid'] = $dashboard_parent_uuid;
|
2021-11-10 02:42:14 +01:00
|
|
|
$array['dashboard'][0]['dashboard_order'] = $dashboard_order;
|
|
|
|
|
$array['dashboard'][0]['dashboard_enabled'] = $dashboard_enabled;
|
|
|
|
|
$array['dashboard'][0]['dashboard_description'] = $dashboard_description;
|
|
|
|
|
$y = 0;
|
|
|
|
|
if (is_array($dashboard_groups)) {
|
|
|
|
|
foreach ($dashboard_groups as $row) {
|
2024-08-28 20:17:22 +02:00
|
|
|
if (isset($row['group_uuid']) && is_uuid($row['group_uuid'])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
$array['dashboard'][0]['dashboard_groups'][$y]['dashboard_group_uuid'] = uuid();
|
|
|
|
|
$array['dashboard'][0]['dashboard_groups'][$y]['group_uuid'] = $row["group_uuid"];
|
|
|
|
|
$y++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-13 18:48:24 +02:00
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//save the data
|
|
|
|
|
$database->app_name = 'dashboard';
|
|
|
|
|
$database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7';
|
2024-07-21 07:37:32 +02:00
|
|
|
$result = $database->save($array);
|
2021-11-10 02:42:14 +01:00
|
|
|
//view_array($result);
|
|
|
|
|
|
|
|
|
|
//redirect the user
|
|
|
|
|
if (isset($action)) {
|
|
|
|
|
if ($action == "add") {
|
|
|
|
|
$_SESSION["message"] = $text['message-add'];
|
|
|
|
|
}
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
$_SESSION["message"] = $text['message-update'];
|
|
|
|
|
}
|
|
|
|
|
//header('Location: dashboard.php');
|
|
|
|
|
header('Location: dashboard_edit.php?id='.urlencode($dashboard_uuid));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//pre-populate the form
|
2023-05-13 00:57:07 +02:00
|
|
|
if (empty($_POST["persistformvar"])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
$sql = "select ";
|
|
|
|
|
$sql .= " dashboard_uuid, ";
|
|
|
|
|
$sql .= " dashboard_name, ";
|
|
|
|
|
$sql .= " dashboard_path, ";
|
2024-04-25 03:58:14 +02:00
|
|
|
$sql .= " dashboard_icon, ";
|
2024-12-12 05:28:45 +01:00
|
|
|
$sql .= " dashboard_icon_color, ";
|
2024-04-25 03:58:14 +02:00
|
|
|
$sql .= " dashboard_url, ";
|
2024-07-20 01:03:21 +02:00
|
|
|
$sql .= " dashboard_width, ";
|
|
|
|
|
$sql .= " dashboard_height, ";
|
2024-06-13 18:48:24 +02:00
|
|
|
$sql .= " dashboard_target, ";
|
|
|
|
|
$sql .= " dashboard_content, ";
|
2024-07-21 07:37:32 +02:00
|
|
|
$sql .= " dashboard_content_text_align, ";
|
2024-06-13 18:48:24 +02:00
|
|
|
$sql .= " dashboard_content_details, ";
|
2024-04-19 00:57:45 +02:00
|
|
|
$sql .= " dashboard_chart_type, ";
|
2024-09-03 18:50:45 +02:00
|
|
|
$sql .= " cast(dashboard_label_enabled as text), ";
|
2024-08-15 01:44:11 +02:00
|
|
|
$sql .= " dashboard_label_text_color, ";
|
|
|
|
|
$sql .= " dashboard_label_text_color_hover, ";
|
|
|
|
|
$sql .= " dashboard_label_background_color, ";
|
|
|
|
|
$sql .= " dashboard_label_background_color_hover, ";
|
2024-04-18 00:01:54 +02:00
|
|
|
$sql .= " dashboard_number_text_color, ";
|
2024-06-22 00:44:31 +02:00
|
|
|
$sql .= " dashboard_number_text_color_hover, ";
|
2024-12-12 05:28:45 +01:00
|
|
|
$sql .= " dashboard_number_background_color, ";
|
2024-05-08 17:54:18 +02:00
|
|
|
$sql .= " dashboard_background_color, ";
|
2024-06-22 00:44:31 +02:00
|
|
|
$sql .= " dashboard_background_color_hover, ";
|
2024-05-08 17:54:18 +02:00
|
|
|
$sql .= " dashboard_detail_background_color, ";
|
2024-08-27 21:58:11 +02:00
|
|
|
$sql .= " dashboard_background_gradient_style, ";
|
|
|
|
|
$sql .= " dashboard_background_gradient_angle, ";
|
2021-12-23 19:44:57 +01:00
|
|
|
$sql .= " dashboard_column_span, ";
|
2024-06-13 00:49:34 +02:00
|
|
|
$sql .= " dashboard_row_span, ";
|
2023-01-17 21:50:44 +01:00
|
|
|
$sql .= " dashboard_details_state, ";
|
2024-08-04 18:33:19 +02:00
|
|
|
$sql .= " dashboard_parent_uuid, ";
|
2021-11-10 02:42:14 +01:00
|
|
|
$sql .= " dashboard_order, ";
|
2023-02-10 19:14:43 +01:00
|
|
|
$sql .= " dashboard_enabled, ";
|
2021-11-10 02:42:14 +01:00
|
|
|
$sql .= " dashboard_description ";
|
|
|
|
|
$sql .= "from v_dashboard ";
|
|
|
|
|
$sql .= "where dashboard_uuid = :dashboard_uuid ";
|
|
|
|
|
$parameters['dashboard_uuid'] = $dashboard_uuid;
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
|
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
|
|
|
|
$dashboard_name = $row["dashboard_name"];
|
|
|
|
|
$dashboard_path = $row["dashboard_path"];
|
2024-04-25 03:49:16 +02:00
|
|
|
$dashboard_icon = $row["dashboard_icon"];
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_icon_color = $row["dashboard_icon_color"];
|
2024-04-25 03:49:16 +02:00
|
|
|
$dashboard_url = $row["dashboard_url"];
|
2024-07-20 01:03:21 +02:00
|
|
|
$dashboard_width = $row["dashboard_width"];
|
|
|
|
|
$dashboard_height = $row["dashboard_height"];
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_target = $row["dashboard_target"];
|
|
|
|
|
$dashboard_content = $row["dashboard_content"];
|
2024-07-21 07:37:32 +02:00
|
|
|
$dashboard_content_text_align = $row["dashboard_content_text_align"];
|
2024-06-13 18:48:24 +02:00
|
|
|
$dashboard_content_details = $row["dashboard_content_details"];
|
2024-04-19 00:57:45 +02:00
|
|
|
$dashboard_chart_type = $row["dashboard_chart_type"];
|
2024-08-15 01:44:11 +02:00
|
|
|
$dashboard_label_enabled = $row["dashboard_label_enabled"];
|
|
|
|
|
$dashboard_label_text_color = $row["dashboard_label_text_color"];
|
|
|
|
|
$dashboard_label_text_color_hover = $row["dashboard_label_text_color_hover"];
|
|
|
|
|
$dashboard_label_background_color = $row["dashboard_label_background_color"];
|
|
|
|
|
$dashboard_label_background_color_hover = $row["dashboard_label_background_color_hover"];
|
2024-04-18 00:01:54 +02:00
|
|
|
$dashboard_number_text_color = $row["dashboard_number_text_color"];
|
2024-06-22 00:44:31 +02:00
|
|
|
$dashboard_number_text_color_hover = $row["dashboard_number_text_color_hover"];
|
2024-12-12 05:28:45 +01:00
|
|
|
$dashboard_number_background_color = $row["dashboard_number_background_color"];
|
2024-05-08 17:54:18 +02:00
|
|
|
$dashboard_background_color = $row["dashboard_background_color"];
|
2024-06-22 00:44:31 +02:00
|
|
|
$dashboard_background_color_hover = $row["dashboard_background_color_hover"];
|
2024-05-08 17:54:18 +02:00
|
|
|
$dashboard_detail_background_color = $row["dashboard_detail_background_color"];
|
2024-08-27 21:58:11 +02:00
|
|
|
$dashboard_background_gradient_style = $row["dashboard_background_gradient_style"];
|
|
|
|
|
$dashboard_background_gradient_angle = $row["dashboard_background_gradient_angle"];
|
2021-12-23 19:44:57 +01:00
|
|
|
$dashboard_column_span = $row["dashboard_column_span"];
|
2024-06-13 00:49:34 +02:00
|
|
|
$dashboard_row_span = $row["dashboard_row_span"];
|
2023-01-17 21:50:44 +01:00
|
|
|
$dashboard_details_state = $row["dashboard_details_state"];
|
2024-08-04 18:33:19 +02:00
|
|
|
$dashboard_parent_uuid = $row["dashboard_parent_uuid"];
|
2021-11-10 02:42:14 +01:00
|
|
|
$dashboard_order = $row["dashboard_order"];
|
2023-06-07 00:05:05 +02:00
|
|
|
$dashboard_enabled = $row["dashboard_enabled"] ?? 'false';
|
2021-11-10 02:42:14 +01:00
|
|
|
$dashboard_description = $row["dashboard_description"];
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $row);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get the child data
|
2023-06-03 01:01:15 +02:00
|
|
|
if (!empty($dashboard_uuid) && is_uuid($dashboard_uuid)) {
|
2021-11-10 02:42:14 +01:00
|
|
|
$sql = "select ";
|
|
|
|
|
$sql .= " dashboard_group_uuid, ";
|
|
|
|
|
$sql .= " group_uuid ";
|
|
|
|
|
$sql .= "from v_dashboard_groups ";
|
|
|
|
|
$sql .= "where dashboard_uuid = :dashboard_uuid ";
|
|
|
|
|
$parameters['dashboard_uuid'] = $dashboard_uuid;
|
|
|
|
|
$dashboard_groups = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset ($sql, $parameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add the $dashboard_group_uuid
|
2023-05-13 00:57:07 +02:00
|
|
|
if (empty($dashboard_group_uuid) || !empty($dashboard_group_uuid) && !is_uuid($dashboard_group_uuid)) {
|
2021-11-10 02:42:14 +01:00
|
|
|
$dashboard_group_uuid = uuid();
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-04 19:51:53 +02:00
|
|
|
//convert the json to an array
|
2024-05-08 17:54:18 +02:00
|
|
|
if (!empty($dashboard_background_color) && is_json($dashboard_background_color)) {
|
|
|
|
|
$dashboard_background_color = json_decode($dashboard_background_color, true);
|
|
|
|
|
}
|
2024-06-22 00:44:31 +02:00
|
|
|
if (!empty($dashboard_background_color_hover) && is_json($dashboard_background_color_hover)) {
|
|
|
|
|
$dashboard_background_color_hover = json_decode($dashboard_background_color_hover, true);
|
|
|
|
|
}
|
2024-05-08 17:54:18 +02:00
|
|
|
if (!empty($dashboard_detail_background_color) && is_json($dashboard_detail_background_color)) {
|
|
|
|
|
$dashboard_detail_background_color = json_decode($dashboard_detail_background_color, true);
|
2024-05-04 19:51:53 +02:00
|
|
|
}
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//add an empty row
|
|
|
|
|
$x = is_array($dashboard_groups) ? count($dashboard_groups) : 0;
|
|
|
|
|
$dashboard_groups[$x]['dashboard_uuid'] = $dashboard_uuid;
|
|
|
|
|
$dashboard_groups[$x]['dashboard_group_uuid'] = uuid();
|
|
|
|
|
$dashboard_groups[$x]['group_uuid'] = '';
|
|
|
|
|
|
|
|
|
|
//create token
|
|
|
|
|
$object = new token;
|
|
|
|
|
$token = $object->create($_SERVER['PHP_SELF']);
|
|
|
|
|
|
|
|
|
|
//show the header
|
|
|
|
|
$document['title'] = $text['title-dashboard'];
|
|
|
|
|
require_once "resources/header.php";
|
|
|
|
|
|
2025-03-07 00:17:53 +01:00
|
|
|
//get the dashboard groups
|
2024-08-04 18:33:19 +02:00
|
|
|
$sql = "SELECT * FROM v_dashboard_groups as x, v_groups as g ";
|
|
|
|
|
$sql .= "WHERE x.dashboard_uuid = :dashboard_uuid ";
|
|
|
|
|
$sql .= "AND x.group_uuid = g.group_uuid ";
|
2023-06-03 01:01:15 +02:00
|
|
|
$parameters['dashboard_uuid'] = $dashboard_uuid ?? '';
|
2021-11-10 02:42:14 +01:00
|
|
|
$dashboard_groups = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset ($sql, $parameters);
|
|
|
|
|
|
|
|
|
|
//get the groups
|
2025-03-07 00:17:53 +01:00
|
|
|
$sql = "SELECT group_uuid, domain_uuid, group_name FROM v_groups ";
|
2021-11-10 02:42:14 +01:00
|
|
|
$sql .= "WHERE (domain_uuid = :domain_uuid or domain_uuid is null)";
|
2025-03-07 00:17:53 +01:00
|
|
|
$sql .= "ORDER BY domain_uuid desc, group_name asc ";
|
2021-11-10 02:42:14 +01:00
|
|
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$groups = $database->execute($sql, $parameters, 'all');
|
|
|
|
|
unset ($sql, $parameters);
|
|
|
|
|
|
2024-08-04 18:33:19 +02:00
|
|
|
//get the dashboards
|
|
|
|
|
$sql = "SELECT dashboard_uuid, dashboard_name FROM v_dashboard ";
|
|
|
|
|
$sql .= "WHERE dashboard_parent_uuid is null ";
|
|
|
|
|
$sql .= "ORDER by dashboard_order, dashboard_name asc ";
|
|
|
|
|
$parameters = null;
|
|
|
|
|
$dashboard_parents = $database->execute($sql, $parameters, 'all');
|
|
|
|
|
unset ($sql, $parameters);
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//set the assigned_groups array
|
|
|
|
|
if (is_array($dashboard_groups) && sizeof($dashboard_groups) != 0) {
|
|
|
|
|
$assigned_groups = array();
|
|
|
|
|
foreach ($dashboard_groups as $field) {
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($field['group_name'])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
if (is_uuid($field['group_uuid'])) {
|
|
|
|
|
$assigned_groups[] = $field['group_uuid'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 03:57:59 +02:00
|
|
|
//build the $dashboard_tools array
|
|
|
|
|
$i = 0;
|
|
|
|
|
foreach(glob($_SERVER["DOCUMENT_ROOT"].'/*/*/resources/dashboard/*.php') as $value) {
|
|
|
|
|
|
|
|
|
|
//skip adding config.php to the array
|
|
|
|
|
if (basename($value) === 'config.php') {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ensure the slashes are consistent
|
|
|
|
|
$value = str_replace('\\', '/', $value);
|
|
|
|
|
|
|
|
|
|
//prepare the key
|
|
|
|
|
$key_replace[] = $_SERVER["DOCUMENT_ROOT"].'/core/';
|
|
|
|
|
$key_replace[] = $_SERVER["DOCUMENT_ROOT"].'/app/';
|
|
|
|
|
$key_replace[] = 'resources/dashboard/';
|
|
|
|
|
$key_replace[] = '.php';
|
|
|
|
|
$key = str_replace($key_replace, '', $value);
|
|
|
|
|
|
|
|
|
|
//prepare the value
|
|
|
|
|
$value_replace[] = $_SERVER["DOCUMENT_ROOT"].'/';
|
|
|
|
|
$value = str_replace($value_replace, '', $value);
|
|
|
|
|
|
|
|
|
|
//build the array
|
|
|
|
|
$dashboard_tools[$key] = $value;
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//adjust form by type entered
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<script>\n";
|
|
|
|
|
echo " function adjust_form() {\n";
|
2024-08-22 00:58:44 +02:00
|
|
|
echo " if ($('#dashboard_path').val() == 'dashboard/icon') {\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo " $('.type_content').hide();\n";
|
|
|
|
|
echo " $('.type_icon').show();\n";
|
|
|
|
|
echo " }\n";
|
2024-08-22 00:58:44 +02:00
|
|
|
echo " else if ($('#dashboard_path').val() == 'dashboard/content') {\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo " $('.type_icon').hide();\n";
|
|
|
|
|
echo " $('.type_content').show();\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo " else {\n";
|
|
|
|
|
echo " $('.type_icon, .type_content').hide();\n";
|
|
|
|
|
echo " $('.type_chart').show();\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo "</script>\n";
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
//show the content
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<form name='frm' id='frm' method='post'>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<input class='formfld' type='hidden' name='dashboard_uuid' value='".escape($dashboard_uuid)."'>\n";
|
|
|
|
|
|
|
|
|
|
echo "<div class='action_bar' id='action_bar'>\n";
|
|
|
|
|
echo " <div class='heading'><b>".$text['title-dashboard']."</b></div>\n";
|
|
|
|
|
echo " <div class='actions'>\n";
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'dashboard.php']);
|
|
|
|
|
if ($action == 'update') {
|
|
|
|
|
if (permission_exists('dashboard_group_add')) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('dashboard_group_delete')) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']);
|
|
|
|
|
echo " </div>\n";
|
|
|
|
|
echo " <div style='clear: both;'></div>\n";
|
|
|
|
|
echo "</div>\n";
|
2023-05-13 00:57:07 +02:00
|
|
|
//echo $text['title_description-dashboard']."\n";
|
2024-09-14 11:56:45 +02:00
|
|
|
//echo "<br /><br />\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
|
2023-05-13 00:57:07 +02:00
|
|
|
if (!empty($action) && $action == 'update') {
|
2021-11-10 02:42:14 +01:00
|
|
|
if (permission_exists('dashboard_add')) {
|
|
|
|
|
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('dashboard_delete')) {
|
|
|
|
|
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-09 23:25:24 +02:00
|
|
|
echo "<div class='card'>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
echo $text['label-dashboard_name'] ?? '';
|
|
|
|
|
echo "\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "</td>\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<td width='70%' class='vtable' style='position: relative;' align='left'>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo " <input class='formfld' type='text' name='dashboard_name' maxlength='255' value='".escape($dashboard_name)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_name']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_path']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-07-25 20:27:43 +02:00
|
|
|
echo " <select name='dashboard_path' class='formfld' id='dashboard_path' onchange=\"adjust_form();\">\n";
|
2024-07-25 03:57:59 +02:00
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
foreach($dashboard_tools as $key => $value) {
|
2024-08-22 00:58:44 +02:00
|
|
|
echo " <option value='$key' ".($key == $dashboard_path ? "selected='selected'" : null).">".$key."</option>\n";
|
2024-07-25 03:57:59 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_path']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
|
2024-09-14 11:10:55 +02:00
|
|
|
if ($action == "add" || $dashboard_path == "dashboard/icon" || $dashboard_chart_type == "icon") {
|
|
|
|
|
echo " <tr class='type_icon'>"; // ".(($dashboard_path != 'dashboard/icon' || $dashboard_chart_type == "icon") ? "style='display: none;'" : null)."
|
2024-06-13 18:48:24 +02:00
|
|
|
echo " <td class='vncell'>".$text['label-icon']."</td>";
|
|
|
|
|
echo " <td class='vtable' style='vertical-align: bottom;'>";
|
2024-08-10 02:14:52 +02:00
|
|
|
if (file_exists($_SERVER["PROJECT_ROOT"].'/resources/fontawesome/fa_icons.php')) {
|
|
|
|
|
include $_SERVER["PROJECT_ROOT"].'/resources/fontawesome/fa_icons.php';
|
2024-08-13 00:25:21 +02:00
|
|
|
}
|
|
|
|
|
if (!empty($font_awesome_icons) && is_array($font_awesome_icons)) {
|
|
|
|
|
echo "<table cellpadding='0' cellspacing='0' border='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <select class='formfld' name='dashboard_icon' id='selected_icon' onchange=\"$('#icons').slideUp(200); $('#icon_search').fadeOut(200, function() { $('#grid_icon').fadeIn(); });\">\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
foreach ($font_awesome_icons as $icon) {
|
|
|
|
|
$selected = $dashboard_icon == implode(' ', $icon['classes']) ? "selected" : null;
|
|
|
|
|
echo " <option value='".escape(implode(' ', $icon['classes']))."' ".$selected.">".escape($icon['label'])."</option>\n";
|
2024-04-25 03:58:14 +02:00
|
|
|
}
|
2024-08-13 00:25:21 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td style='padding: 0 0 0 5px;'>\n";
|
|
|
|
|
echo " <button id='grid_icon' type='button' class='btn btn-default list_control_icon' style='font-size: 15px; padding-top: 1px; padding-left: 3px;' onclick=\"load_icons(); $(this).fadeOut(200, function() { $('#icons').fadeIn(200); $('#icon_search').fadeIn(200).focus(); });\"><span class='fa-solid fa-th'></span></button>";
|
|
|
|
|
echo " <input id='icon_search' type='text' class='formfld' style='display: none;' onkeyup=\"if (this.value.length >= 3) { delay_submit(this.value); } else if (this.value == '') { load_icons(); } else { $('#icons').html(''); }\" placeholder=\"".$text['label-search']."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<div id='icons' style='clear: both; display: none; margin-top: 8px; padding-top: 10px; color: #000; max-height: 400px; overflow: auto;'></div>";
|
|
|
|
|
|
|
|
|
|
echo "<script>\n";
|
|
|
|
|
//load icons by search
|
|
|
|
|
echo "function load_icons(search) {\n";
|
|
|
|
|
echo " xhttp = new XMLHttpRequest();\n";
|
|
|
|
|
echo " xhttp.open('GET', '".PROJECT_PATH."/resources/fontawesome/fa_icons.php?output=icons' + (search ? '&search=' + search : ''), false);\n";
|
|
|
|
|
echo " xhttp.send();\n";
|
|
|
|
|
echo " document.getElementById('icons').innerHTML = xhttp.responseText;\n";
|
|
|
|
|
echo "}\n";
|
2024-08-13 00:33:52 +02:00
|
|
|
//delay kepress action for 1/2 second
|
2024-08-13 00:25:21 +02:00
|
|
|
echo "var keypress_timer;\n";
|
|
|
|
|
echo "function delay_submit(search) {\n";
|
|
|
|
|
echo " clearTimeout(keypress_timer);\n";
|
|
|
|
|
echo " keypress_timer = setTimeout(function(){\n";
|
|
|
|
|
echo " load_icons(search);\n";
|
|
|
|
|
echo " }, 500);\n";
|
|
|
|
|
echo "}\n";
|
|
|
|
|
echo "</script>\n";
|
2024-04-25 03:49:16 +02:00
|
|
|
}
|
2024-06-13 18:48:24 +02:00
|
|
|
else {
|
|
|
|
|
echo " <input type='text' class='formfld' name='dashboard_icon' value='".escape($dashboard_icon)."'>";
|
|
|
|
|
}
|
2024-12-12 05:28:45 +01:00
|
|
|
echo $text['description-dashboard_icon']."\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
|
2024-12-12 05:28:45 +01:00
|
|
|
echo "<tr class='type_icon'>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_icon_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_icon_color' value='".escape($dashboard_icon_color)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_icon_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_icon' ".($dashboard_path != 'dashboard/icon' ? "style='display: none;'" : null).">\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-link']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='dashboard_url' maxlength='255' value='".escape($dashboard_url)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_url'] ?? '';
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_icon' ".($dashboard_path != 'dashboard/icon' ? "style='display: none;'" : null).">\n";
|
2024-07-20 01:03:21 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-width']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='dashboard_width' maxlength='255' value='".escape($dashboard_width)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_width'] ?? '';
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_icon' ".($dashboard_path != 'dashboard/icon' ? "style='display: none;'" : null).">\n";
|
2024-07-20 01:03:21 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-height']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='dashboard_height' maxlength='255' value='".escape($dashboard_height)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_height'] ?? '';
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_icon' ".($dashboard_path != 'dashboard/icon' ? "class='type_icon' style='display: none;'" : null).">\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-target']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_target' class='formfld'>\n";
|
2024-07-20 01:03:21 +02:00
|
|
|
echo " <option value='self'>".$text['label-current_window']."</option>\n";
|
|
|
|
|
echo " <option value='new' ".(!empty($dashboard_target) && $dashboard_target == 'new' ? "selected='selected'" : null).">".$text['label-new_window']."</option>\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_target']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-04-25 03:49:16 +02:00
|
|
|
}
|
2024-06-13 18:48:24 +02:00
|
|
|
|
2024-12-12 05:28:45 +01:00
|
|
|
if ($action == "add" || $dashboard_path == "dashboard/content") {
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_content' ".($dashboard_path != 'dashboard/content' ? "style='display: none;'" : null).">\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-content']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <textarea class='formfld' style='height: 100px;' name='dashboard_content'>".$dashboard_content."</textarea>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_content']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-07-21 07:37:32 +02:00
|
|
|
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_content' ".($dashboard_path != 'dashboard/content' ? "style='display: none;'" : null).">\n";
|
2024-07-21 07:37:32 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_content_text_align']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_content_text_align' class='formfld'>\n";
|
|
|
|
|
echo " <option value='left' ".(!empty($dashboard_content_text_align) && $dashboard_content_text_align == 'left' ? "selected='selected'" : null).">".$text['label-left']."</option>\n";
|
|
|
|
|
echo " <option value='right' ".(!empty($dashboard_content_text_align) && $dashboard_content_text_align == 'right' ? "selected='selected'" : null).">".$text['label-right']."</option>\n";
|
2024-07-23 15:46:45 +02:00
|
|
|
echo " <option value='center' ".(!empty($dashboard_content_text_align) && $dashboard_content_text_align == 'center' ? "selected='selected'" : null).">".$text['label-center']."</option>\n";
|
2024-07-21 07:37:32 +02:00
|
|
|
echo " </select>\n"; echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_content_text_align']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
}
|
|
|
|
|
|
2024-12-12 05:28:45 +01:00
|
|
|
if ($action == "add" || $dashboard_path == "dashboard/content" || $dashboard_path == "dashboard/icon") {
|
2024-08-22 00:58:44 +02:00
|
|
|
echo "<tr class='type_icon type_content' ".($dashboard_path != 'dashboard/content' && $dashboard_path != 'dashboard/icon' ? "style='display: none;'" : null).">\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-details']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <textarea class='formfld' style='height: 100px;' name='dashboard_content_details'>".$dashboard_content_details."</textarea>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_content_details']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-04-25 03:58:14 +02:00
|
|
|
}
|
2024-04-25 03:49:16 +02:00
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_groups']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
if (is_array($dashboard_groups) && sizeof($dashboard_groups) != 0) {
|
|
|
|
|
echo "<table cellpadding='0' cellspacing='0' border='0'>\n";
|
|
|
|
|
foreach($dashboard_groups as $field) {
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($field['group_name'])) {
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo " <td class='vtable' style='white-space: nowrap; padding-right: 30px;' nowrap='nowrap'>\n";
|
2025-03-07 00:17:53 +01:00
|
|
|
echo $field['group_name'].((!empty($field['domain_uuid'])) ? "@".$_SESSION['domains'][$field['domain_uuid']]['domain_name'] : null);
|
2021-11-10 02:42:14 +01:00
|
|
|
echo " </td>\n";
|
|
|
|
|
if (permission_exists('dashboard_group_delete') || if_group("superadmin")) {
|
|
|
|
|
echo " <td class='list_control_icons' style='width: 25px;'>\n";
|
|
|
|
|
echo "<a href='dashboard_edit.php?id=".escape($field['dashboard_group_uuid'])."&dashboard_group_uuid=".escape($field['dashboard_group_uuid'])."&dashboard_uuid=".escape($dashboard_uuid)."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
}
|
2023-05-17 02:00:40 +02:00
|
|
|
if (!empty($groups) && is_array($groups)) {
|
|
|
|
|
if (!empty($dashboard_groups)) { echo "<br />\n"; }
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<select name='dashboard_groups[0][group_uuid]' class='formfld' style='width: auto; margin-right: 3px;'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
2023-05-17 02:00:40 +02:00
|
|
|
foreach ($groups as $row) {
|
|
|
|
|
if ((!empty($field['group_level']) && $field['group_level'] <= $_SESSION['user']['group_level']) || empty($field['group_level'])) {
|
|
|
|
|
if (empty($assigned_groups) || !in_array($row["group_uuid"], $assigned_groups)) {
|
2023-05-16 22:51:02 +02:00
|
|
|
echo " <option value='".$row['group_uuid']."'>".$row['group_name'].(!empty($row['domain_uuid']) ? "@".$_SESSION['domains'][$row['domain_uuid']]['domain_name'] : null)."</option>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo "</select>\n";
|
|
|
|
|
echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add']]);
|
|
|
|
|
}
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_groups']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2025-03-27 22:41:38 +01:00
|
|
|
if (!empty($dashboard_chart_type)) {
|
|
|
|
|
echo "<tr class='type_chart'>\n";
|
2024-04-24 22:14:24 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_chart_type']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_chart_type' class='formfld'>\n";
|
2024-06-13 18:48:24 +02:00
|
|
|
echo " <option value='doughnut'>".$text['label-doughnut']."</option>\n";
|
2025-03-27 22:41:38 +01:00
|
|
|
if ($dashboard_chart_type == "icon" || in_array($dashboard_path, ['domains/domains', 'xml_cdr/missed_calls', 'voicemails/voicemails', 'xml_cdr/recent_calls', 'registrations/registrations'])) {
|
|
|
|
|
echo " <option value='icon' ".($dashboard_chart_type == "icon" ? "selected='selected'" : null).">".$text['label-icon']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " <option value='number' ".($dashboard_chart_type == "number" ? "selected='selected'" : null).">".$text['label-number']."</option>\n";
|
|
|
|
|
if ($dashboard_chart_type == "progress_bar" || $dashboard_path == "system/system_status") {
|
|
|
|
|
echo " <option value='progress_bar' ".($dashboard_chart_type == "progress_bar" ? "selected='selected'" : null).">".$text['label-progress_bar']."</option>\n";
|
2024-09-14 01:00:21 +02:00
|
|
|
}
|
2024-04-24 22:14:24 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_chart_type']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
}
|
2024-04-24 22:14:24 +02:00
|
|
|
|
2024-08-15 01:44:11 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_label_enabled'] ?? '';
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
|
|
|
|
|
echo " <label class='switch'>\n";
|
2024-09-03 18:50:45 +02:00
|
|
|
echo " <input type='checkbox' id='dashboard_label_enabled' name='dashboard_label_enabled' value='true' ".(empty($dashboard_label_enabled) || $dashboard_label_enabled == 'true' ? "checked='checked'" : null)." onclick=\"$('.type_label').toggle();\">\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " <span class='slider'></span>\n";
|
|
|
|
|
echo " </label>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
2024-08-15 22:09:24 +02:00
|
|
|
echo " <select class='formfld' id='dashboard_label_enabled' name='dashboard_label_enabled' onchange=\"$('.type_label').toggle();\">\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " <option value='false'>".$text['option-false']."</option>\n";
|
2024-09-03 18:50:45 +02:00
|
|
|
echo " <option value='true' ".(empty($dashboard_label_enabled) || $dashboard_label_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_label_enabled']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-09-03 18:50:45 +02:00
|
|
|
echo "<tr class='type_label' ".($dashboard_label_enabled == 'false' ? "style='display: none;'" : null).">\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['label-dashboard_label_text_color']."\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_label_text_color' value='".escape($dashboard_label_text_color)."'>\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
echo "<br />\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['description-dashboard_label_text_color']."\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-08-22 00:58:44 +02:00
|
|
|
if ($action == "add" || $dashboard_path == "dashboard/icon") {
|
2024-09-03 18:50:45 +02:00
|
|
|
echo "<tr class='type_icon type_label' ".($dashboard_path != 'dashboard/icon' || $dashboard_label_enabled == 'false' ? "style='display: none;'" : null).">\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['label-dashboard_label_text_color_hover']."\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_label_text_color_hover' value='".escape($dashboard_label_text_color_hover)."'>\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "<br />\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['description-dashboard_label_text_color_hover']."\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-03 18:50:45 +02:00
|
|
|
echo "<tr class='type_label' ".($dashboard_label_enabled == 'false' ? "style='display: none;'" : null).">\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['label-dashboard_label_background_color']."\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_label_background_color' value='".escape($dashboard_label_background_color)."'>\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "<br />\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['description-dashboard_label_background_color']."\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-04-24 22:14:24 +02:00
|
|
|
|
2024-08-23 02:12:43 +02:00
|
|
|
if ($action == "add" || $dashboard_path == "dashboard/icon") {
|
2024-09-03 18:50:45 +02:00
|
|
|
echo "<tr class='type_icon type_label' ".($dashboard_path != 'dashboard/icon' || $dashboard_label_enabled == 'false' ? "style='display: none;'" : null).">\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['label-dashboard_label_background_color_hover']."\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_label_background_color_hover' value='".escape($dashboard_label_background_color_hover)."'>\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "<br />\n";
|
2024-08-15 01:44:11 +02:00
|
|
|
echo $text['description-dashboard_label_background_color_hover']."\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-27 22:41:38 +01:00
|
|
|
if (!empty($dashboard_chart_type)) {
|
2024-12-12 05:28:45 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_number_text_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_number_text_color' value='".escape($dashboard_number_text_color)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_number_text_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2025-03-27 22:41:38 +01:00
|
|
|
}
|
2024-04-24 22:14:24 +02:00
|
|
|
|
2025-03-27 22:41:38 +01:00
|
|
|
if ($dashboard_chart_type == "icon" || in_array($dashboard_path, ['domains/domains', 'xml_cdr/missed_calls', 'voicemails/voicemails', 'xml_cdr/recent_calls', 'registrations/registrations'])) {
|
|
|
|
|
echo "<tr class='type_icon'>\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_number_text_color_hover']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_number_text_color_hover' value='".escape($dashboard_number_text_color_hover)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_number_text_color_hover']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2025-02-25 20:48:50 +01:00
|
|
|
|
2025-03-27 22:41:38 +01:00
|
|
|
echo "<tr>\n";
|
2024-12-12 05:28:45 +01:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_number_background_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_number_background_color' value='".escape($dashboard_number_background_color)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_number_background_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
}
|
|
|
|
|
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
echo $text['label-dashboard_background_color']."\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-07-30 05:25:05 +02:00
|
|
|
if (!empty($dashboard_background_color) && is_array($dashboard_background_color)) {
|
2024-08-27 21:58:11 +02:00
|
|
|
foreach ($dashboard_background_color as $c => $background_color) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' id='dashboard_background_color_".$c."' name='dashboard_background_color[]' value='".escape($background_color)."'>\n";
|
|
|
|
|
if ($c < sizeof($dashboard_background_color) - 1) { echo "<br />\n"; }
|
|
|
|
|
}
|
|
|
|
|
//swap button
|
|
|
|
|
if (!empty($dashboard_background_color) && is_array($dashboard_background_color) && sizeof($dashboard_background_color) > 1) {
|
|
|
|
|
echo " <input type='hidden' id='dashboard_background_color_temp'>\n";
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-swap'],'icon'=>'fa-solid fa-arrow-right-arrow-left fa-rotate-90','style'=>"z-index: 0; position: absolute; display: inline-block; margin: -14px 0 0 7px;",'onclick'=>"document.getElementById('dashboard_background_color_temp').value = document.getElementById('dashboard_background_color_0').value; document.getElementById('dashboard_background_color_0').value = document.getElementById('dashboard_background_color_1').value; document.getElementById('dashboard_background_color_1').value = document.getElementById('dashboard_background_color_temp').value; this.blur();"])."<br>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "<br />\n";
|
2024-05-04 19:51:53 +02:00
|
|
|
}
|
|
|
|
|
}
|
2024-06-17 23:23:38 +02:00
|
|
|
if (empty($dashboard_background_color) || (is_array($dashboard_background_color) && count($dashboard_background_color) < 2)) {
|
2025-03-27 22:41:38 +01:00
|
|
|
echo " <input type='text' class='formfld colorpicker' style='display: block;' name='dashboard_background_color[]' value='' onclick=\"document.getElementById('background_color_gradient').style.display = 'block';\">\n";
|
2024-05-16 17:27:00 +02:00
|
|
|
if (empty($dashboard_background_color)) {
|
2024-08-23 01:59:12 +02:00
|
|
|
echo " <input id='background_color_gradient' style='display: none;' type='text' class='formfld colorpicker' name='dashboard_background_color[]'>\n";
|
2024-05-16 17:27:00 +02:00
|
|
|
}
|
2025-03-27 22:41:38 +01:00
|
|
|
}
|
|
|
|
|
if (!empty($dashboard_background_color) && !is_array($dashboard_background_color)) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_background_color[]' value='".escape([$dashboard_background_color])."'><br />\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_background_color[]' value=''><br />\n";
|
2024-05-04 19:51:53 +02:00
|
|
|
}
|
2024-05-08 17:54:18 +02:00
|
|
|
echo $text['description-dashboard_background_color']."\n";
|
2024-04-25 03:52:39 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-04-24 22:14:24 +02:00
|
|
|
|
2024-08-23 02:12:43 +02:00
|
|
|
if ($action == "add" || $dashboard_path == "dashboard/icon") {
|
|
|
|
|
echo "<tr class='type_icon' ".($dashboard_path != 'dashboard/icon' ? "style='display: none;'" : null).">\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_background_color_hover']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2024-07-30 05:25:05 +02:00
|
|
|
if (!empty($dashboard_background_color_hover) && is_array($dashboard_background_color_hover)) {
|
2024-08-27 21:58:11 +02:00
|
|
|
foreach ($dashboard_background_color_hover as $c => $background_color) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' id='dashboard_background_color_hover_".$c."' name='dashboard_background_color_hover[]' value='".escape($background_color)."'>\n";
|
|
|
|
|
if ($c < sizeof($dashboard_background_color_hover) - 1) { echo "<br />\n"; }
|
|
|
|
|
}
|
|
|
|
|
//swap button
|
|
|
|
|
if (!empty($dashboard_background_color_hover) && is_array($dashboard_background_color_hover) && sizeof($dashboard_background_color_hover) > 1) {
|
|
|
|
|
echo " <input type='hidden' id='dashboard_background_color_hover_temp'>\n";
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-swap'],'icon'=>'fa-solid fa-arrow-right-arrow-left fa-rotate-90','style'=>"z-index: 0; position: absolute; display: inline-block; margin: -14px 0 0 7px;",'onclick'=>"document.getElementById('dashboard_background_color_hover_temp').value = document.getElementById('dashboard_background_color_hover_0').value; document.getElementById('dashboard_background_color_hover_0').value = document.getElementById('dashboard_background_color_hover_1').value; document.getElementById('dashboard_background_color_hover_1').value = document.getElementById('dashboard_background_color_hover_temp').value; this.blur();"])."<br>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "<br />\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (empty($dashboard_background_color_hover) || (is_array($dashboard_background_color_hover) && count($dashboard_background_color_hover) < 2)) {
|
2025-03-27 22:41:38 +01:00
|
|
|
echo " <input type='text' class='formfld colorpicker' style='display: block;' name='dashboard_background_color_hover[]' value='' onclick=\"document.getElementById('background_color_hover_gradient').style.display = 'block';\">\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
if (empty($dashboard_background_color_hover)) {
|
2024-08-23 01:59:12 +02:00
|
|
|
echo " <input id='background_color_hover_gradient' style='display: none;' type='text' class='formfld colorpicker' name='dashboard_background_color_hover[]'>\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
}
|
2025-03-27 22:41:38 +01:00
|
|
|
}
|
|
|
|
|
if (!empty($dashboard_background_color_hover) && !is_array($dashboard_background_color_hover)) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_background_color_hover[]' value='".escape([$dashboard_background_color_hover])."'><br />\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_background_color_hover[]' value=''><br />\n";
|
2024-06-22 00:44:31 +02:00
|
|
|
}
|
|
|
|
|
echo $text['description-dashboard_background_color_hover']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-27 22:41:38 +01:00
|
|
|
if ($dashboard_details_state != "none") {
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_detail_background_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
if (!empty($dashboard_detail_background_color) && is_array($dashboard_detail_background_color)) {
|
|
|
|
|
foreach ($dashboard_detail_background_color as $c => $detail_background_color) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' id='dashboard_detail_background_color_".$c."' name='dashboard_detail_background_color[]' value='".escape($detail_background_color)."'>\n";
|
|
|
|
|
if ($c < sizeof($dashboard_detail_background_color) - 1) { echo "<br />\n"; }
|
|
|
|
|
}
|
|
|
|
|
//swap button
|
|
|
|
|
if (!empty($dashboard_detail_background_color) && is_array($dashboard_detail_background_color) && sizeof($dashboard_detail_background_color) > 1) {
|
|
|
|
|
echo " <input type='hidden' id='dashboard_detail_background_color_temp'>\n";
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-swap'],'icon'=>'fa-solid fa-arrow-right-arrow-left fa-rotate-90','style'=>"z-index: 0; position: absolute; display: inline-block; margin: -14px 0 0 7px;",'onclick'=>"document.getElementById('dashboard_detail_background_color_temp').value = document.getElementById('dashboard_detail_background_color_0').value; document.getElementById('dashboard_detail_background_color_0').value = document.getElementById('dashboard_detail_background_color_1').value; document.getElementById('dashboard_detail_background_color_1').value = document.getElementById('dashboard_detail_background_color_temp').value; this.blur();"])."<br>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
}
|
2024-08-27 21:58:11 +02:00
|
|
|
}
|
2025-03-27 22:41:38 +01:00
|
|
|
if (empty($dashboard_detail_background_color) || (is_array($dashboard_detail_background_color) && count($dashboard_detail_background_color) < 2)) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' style='display: block;' name='dashboard_detail_background_color[]' value='' onclick=\"document.getElementById('detail_background_color_gradient').style.display = 'block';\">\n";
|
|
|
|
|
if (empty($dashboard_detail_background_color)) {
|
|
|
|
|
echo " <input id='detail_background_color_gradient' style='display: none;' type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]'>\n";
|
|
|
|
|
}
|
2024-05-08 17:54:18 +02:00
|
|
|
}
|
2025-03-27 22:41:38 +01:00
|
|
|
if (!empty($dashboard_detail_background_color) && !is_array($dashboard_detail_background_color)) {
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]' value='".escape([$dashboard_detail_background_color])."'><br />\n";
|
|
|
|
|
echo " <input type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]' value=''><br />\n";
|
2024-05-16 17:27:00 +02:00
|
|
|
}
|
2025-03-27 22:41:38 +01:00
|
|
|
echo $text['description-dashboard_detail_background_color']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2024-05-08 17:54:18 +02:00
|
|
|
}
|
2024-04-18 00:01:54 +02:00
|
|
|
|
2024-09-03 18:50:45 +02:00
|
|
|
echo "<tr>\n";
|
2024-08-27 21:58:11 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_background_gradient_style']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable'>\n";
|
|
|
|
|
echo " <select name='dashboard_background_gradient_style' class='formfld'>\n";
|
|
|
|
|
echo " <option value='mirror'>".$text['option-dashboard_background_gradient_style_option_mirror']."</option>\n";
|
|
|
|
|
echo " <option value='simple' ".($dashboard_background_gradient_style == 'simple' ? "selected='selected'" : null).">".$text['option-dashboard_background_gradient_style_option_simple']."</option>\n";
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_background_gradient_style']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-09-03 18:50:45 +02:00
|
|
|
echo "<tr>\n";
|
2024-08-27 21:58:11 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo $text['label-dashboard_background_gradient_angle']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable'>\n";
|
|
|
|
|
echo " <div style='overflow: auto;'>\n";
|
|
|
|
|
echo " <select name='dashboard_background_gradient_angle' class='formfld' style='float: left;' onchange=\"document.getElementById('angle').style.transform = 'rotate(' + ($(this).val() - 90) + 'deg)';\">\n";
|
|
|
|
|
for ($a = 0; $a <= 180; $a += 5) {
|
|
|
|
|
echo " <option value='".($a + 90)."' ".($dashboard_background_gradient_angle == ($a + 90) ? "selected='selected'" : null).">".$a."°</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " <span id='angle' style='display: inline-block; font-size: 15px; margin-left: 15px; margin-top: 3px; transform: rotate(".(isset($dashboard_background_gradient_angle) ? ($dashboard_background_gradient_angle - 90) : 0)."deg);'>―</span>\n";
|
|
|
|
|
echo " </div>\n";
|
|
|
|
|
echo $text['description-dashboard_background_gradient_angle']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2021-12-23 19:44:57 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_column_span']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_column_span' class='formfld'>\n";
|
|
|
|
|
$i=1;
|
2024-06-13 18:48:24 +02:00
|
|
|
while ($i <= 3) {
|
2021-12-23 19:44:57 +01:00
|
|
|
$selected = ($i == $dashboard_column_span) ? "selected" : null;
|
|
|
|
|
echo " <option value='$i' ".$selected.">$i</option>\n";
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_column_span']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-06-13 00:49:34 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_row_span']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_row_span' class='formfld'>\n";
|
|
|
|
|
$i=1;
|
2024-06-13 18:48:24 +02:00
|
|
|
while ($i <= 3) {
|
2024-06-13 00:49:34 +02:00
|
|
|
$selected = ($i == $dashboard_row_span) ? "selected" : null;
|
|
|
|
|
echo " <option value='$i' ".$selected.">$i</option>\n";
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_row_span']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2025-03-27 22:41:38 +01:00
|
|
|
if ($dashboard_details_state != "none") {
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_details_state']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_details_state' class='formfld'>\n";
|
|
|
|
|
echo " <option value='expanded'>".$text['option-expanded']."</option>\n";
|
|
|
|
|
echo " <option value='contracted' ".($dashboard_details_state == "contracted" ? "selected='selected'" : null).">".$text['option-contracted']."</option>\n";
|
|
|
|
|
echo " <option value='hidden' ".($dashboard_details_state == "hidden" ? "selected='selected'" : null).">".$text['option-hidden']."</option>\n";
|
|
|
|
|
echo " <option value='disabled' ".($dashboard_details_state == "disabled" || empty($dashboard_details_state) ? "selected='selected'" : null).">".$text['label-disabled']."</option>\n";
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_details_state']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
2023-01-17 21:50:44 +01:00
|
|
|
|
2024-08-04 18:33:19 +02:00
|
|
|
if (permission_exists('dashboard_parent_uuid')) {
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-dashboard_parent_uuid']."</td>";
|
|
|
|
|
echo " <td class='vtable'>";
|
|
|
|
|
echo " <select name=\"dashboard_parent_uuid\" class='formfld'>\n";
|
|
|
|
|
echo " <option value=\"\"></option>\n";
|
|
|
|
|
foreach ($dashboard_parents as $field) {
|
|
|
|
|
if ($field['dashboard_uuid'] == $dashboard_parent_uuid) {
|
|
|
|
|
echo " <option value='".escape($field['dashboard_uuid'])."' selected>".escape($field['dashboard_name'])."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='".escape($field['dashboard_uuid'])."'>".escape($field['dashboard_name'])."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " </select>";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_parent_uuid']."\n";
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_order']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <select name='dashboard_order' class='formfld'>\n";
|
|
|
|
|
$i=0;
|
|
|
|
|
while ($i<=999) {
|
|
|
|
|
$selected = ($i == $dashboard_order) ? "selected" : null;
|
|
|
|
|
if (strlen($i) == 1) {
|
|
|
|
|
echo " <option value='00$i' ".$selected.">00$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($i) == 2) {
|
|
|
|
|
echo " <option value='0$i' ".$selected.">0$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($i) == 3) {
|
|
|
|
|
echo " <option value='$i' ".$selected.">$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_order']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2025-02-25 20:48:50 +01:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo " ".$text['label-dashboard_enabled']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
2023-02-10 19:14:43 +01:00
|
|
|
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
|
|
|
|
|
echo " <label class='switch'>\n";
|
2023-02-18 00:53:08 +01:00
|
|
|
echo " <input type='checkbox' id='dashboard_enabled' name='dashboard_enabled' value='true' ".($dashboard_enabled == 'true' ? "checked='checked'" : null).">\n";
|
2023-02-10 19:14:43 +01:00
|
|
|
echo " <span class='slider'></span>\n";
|
|
|
|
|
echo " </label>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
else {
|
2023-02-10 19:14:43 +01:00
|
|
|
echo " <select class='formfld' id='dashboard_enabled' name='dashboard_enabled'>\n";
|
2023-02-18 00:53:08 +01:00
|
|
|
echo " <option value='false'>".$text['option-false']."</option>\n";
|
|
|
|
|
echo " <option value='true' ".($dashboard_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
|
2023-02-10 19:14:43 +01:00
|
|
|
echo " </select>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
}
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_enabled']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-dashboard_description']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='dashboard_description' maxlength='255' value='".escape($dashboard_description)."'>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-dashboard_description']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "</table>";
|
2024-09-09 23:25:24 +02:00
|
|
|
echo "</div>\n";
|
2021-11-10 02:42:14 +01:00
|
|
|
echo "<br /><br />";
|
|
|
|
|
|
|
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
//include the footer
|
|
|
|
|
require_once "resources/footer.php";
|
|
|
|
|
|
2024-09-04 04:59:30 +02:00
|
|
|
?>
|