From f45b6f40330b7f3443108beb6d10528178bbe2ba Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 19 Jul 2024 17:03:21 -0600 Subject: [PATCH] Add dashboard window size - Add window width and height --- core/dashboard/app_config.php | 2 +- core/dashboard/dashboard_edit.php | 40 ++++- core/dashboard/index.php | 10 +- .../dashboard/resources/dashboard/content.php | 15 +- core/dashboard/resources/dashboard/icon.php | 28 ++-- resources/app_languages.php | 150 ++++++++++++------ 6 files changed, 168 insertions(+), 77 deletions(-) diff --git a/core/dashboard/app_config.php b/core/dashboard/app_config.php index b94a46bbdd..70f98a2644 100644 --- a/core/dashboard/app_config.php +++ b/core/dashboard/app_config.php @@ -5,7 +5,7 @@ $apps[$x]['uuid'] = '55533bef-4f04-434a-92af-999c1e9927f7'; $apps[$x]['category'] = 'system'; $apps[$x]['subcategory'] = ''; - $apps[$x]['version'] = '1.0'; + $apps[$x]['version'] = '1.1'; $apps[$x]['license'] = 'Mozilla Public License 1.1'; $apps[$x]['url'] = 'http://www.fusionpbx.com'; $apps[$x]['description']['en-us'] = ''; diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 9f84c21420..081ef7b6ee 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -46,6 +46,8 @@ $dashboard_icon = ''; $dashboard_url = ''; $dashboard_target = 'self'; + $dashboard_width = ''; + $dashboard_height = ''; $dashboard_content = ''; $dashboard_content_details = ''; $dashboard_heading_text_color = ''; @@ -77,6 +79,8 @@ $dashboard_icon = $_POST["dashboard_icon"] ?? ''; $dashboard_url = $_POST["dashboard_url"] ?? ''; $dashboard_target = $_POST["dashboard_target"] ?? 'self'; + $dashboard_width = $_POST["dashboard_width"] ?? ''; + $dashboard_height = $_POST["dashboard_height"] ?? ''; $dashboard_content = $_POST["dashboard_content"] ?? ''; $dashboard_content_details = $_POST["dashboard_content_details"] ?? ''; $dashboard_groups = $_POST["dashboard_groups"] ?? ''; @@ -226,6 +230,8 @@ $array['dashboard'][0]['dashboard_path'] = $dashboard_path; $array['dashboard'][0]['dashboard_icon'] = $dashboard_icon; $array['dashboard'][0]['dashboard_url'] = $dashboard_url; + $array['dashboard'][0]['dashboard_width'] = $dashboard_width; + $array['dashboard'][0]['dashboard_height'] = $dashboard_height; $array['dashboard'][0]['dashboard_target'] = $dashboard_target; $array['dashboard'][0]['dashboard_content'] = $dashboard_content; $array['dashboard'][0]['dashboard_content_details'] = $dashboard_content_details; @@ -287,6 +293,8 @@ $sql .= " dashboard_path, "; $sql .= " dashboard_icon, "; $sql .= " dashboard_url, "; + $sql .= " dashboard_width, "; + $sql .= " dashboard_height, "; $sql .= " dashboard_target, "; $sql .= " dashboard_content, "; $sql .= " dashboard_content_details, "; @@ -316,6 +324,8 @@ $dashboard_path = $row["dashboard_path"]; $dashboard_icon = $row["dashboard_icon"]; $dashboard_url = $row["dashboard_url"]; + $dashboard_width = $row["dashboard_width"]; + $dashboard_height = $row["dashboard_height"]; $dashboard_target = $row["dashboard_target"]; $dashboard_content = $row["dashboard_content"]; $dashboard_content_details = $row["dashboard_content_details"]; @@ -558,14 +568,38 @@ echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-width']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-dashboard_width'] ?? ''; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-height']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-dashboard_height'] ?? ''; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo $text['label-target']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-dashboard_target']."\n"; @@ -942,4 +976,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/dashboard/index.php b/core/dashboard/index.php index e482f0f73b..8a44ee0cd5 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -75,6 +75,8 @@ $sql .= "dashboard_icon, "; $sql .= "dashboard_url, "; $sql .= "dashboard_target, "; + $sql .= "dashboard_width, "; + $sql .= "dashboard_height, "; $sql .= "dashboard_content, "; $sql .= "dashboard_content_details, "; $sql .= "dashboard_chart_type, "; @@ -123,6 +125,8 @@ $array['dashboard'][$x]['dashboard_content'] = $row['dashboard_content']; $array['dashboard'][$x]['dashboard_content_details'] = $row['dashboard_content_details']; $array['dashboard'][$x]['dashboard_target'] = $row['dashboard_target']; + $array['dashboard'][$x]['dashboard_width'] = $row['dashboard_width']; + $array['dashboard'][$x]['dashboard_height'] = $row['dashboard_height']; $array['dashboard'][$x]['dashboard_uuid'] = $row['dashboard_uuid']; $array['dashboard'][$x]['dashboard_order'] = $dashboard_order; $x++; @@ -170,7 +174,7 @@ echo " Chart.defaults.plugins.legend.display = false;\n"; echo "\n"; -// determine initial state all button to display +//determine initial state all button to display $expanded_all = true; if (is_array($dashboard) && @sizeof($dashboard) != 0) { foreach ($dashboard as $row) { @@ -435,6 +439,8 @@ function toggle_grid_row_end(dashboard_name) { $dashboard_icon = $row['dashboard_icon'] ?? ''; $dashboard_url = $row['dashboard_url'] ?? ''; $dashboard_target = $row['dashboard_target'] ?? ''; + $dashboard_width = $row['dashboard_width'] ?? ''; + $dashboard_height = $row['dashboard_height'] ?? ''; $dashboard_content = $row['dashboard_content'] ?? ''; $dashboard_content_details = $row['dashboard_content_details'] ?? ''; $dashboard_chart_type = $row['dashboard_chart_type'] ?? "doughnut"; @@ -552,4 +558,4 @@ function toggle_grid_row_end(dashboard_name) { //show the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/dashboard/resources/dashboard/content.php b/core/dashboard/resources/dashboard/content.php index bd5f9a9434..36800c6eae 100644 --- a/core/dashboard/resources/dashboard/content.php +++ b/core/dashboard/resources/dashboard/content.php @@ -10,17 +10,14 @@ //dashboard icon echo "
\n"; - - echo "
\n"; - echo " ".escape($dashboard_name).""; - echo " ".str_replace("\r", '
', escape($dashboard_content))."
\n"; - echo "
\n"; - + echo "
\n"; + echo " ".escape($dashboard_name).""; + echo " ".str_replace("\r", '
', escape($dashboard_content))."
\n"; + echo "
\n"; if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") { - echo "
".str_replace("\r", '
', escape($dashboard_content_details))."
\n"; + echo "
".str_replace("\r", '
', escape($dashboard_content_details))."
\n"; } - - echo ""; + echo " "; echo "
\n"; ?> \ No newline at end of file diff --git a/core/dashboard/resources/dashboard/icon.php b/core/dashboard/resources/dashboard/icon.php index 1f87dd2de4..1c731d1424 100644 --- a/core/dashboard/resources/dashboard/icon.php +++ b/core/dashboard/resources/dashboard/icon.php @@ -8,19 +8,23 @@ $language = new text; $text = $language->get($_SESSION['domain']['language']['code'], 'core/dashboard'); -//dashboard icon - echo "
\n"; - - echo "
\n"; - echo " ".escape($dashboard_name).""; - echo " \n"; - echo "
\n"; - - if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") { - echo "
".str_replace("\r", '
', escape($dashboard_content_details))."
\n"; +//prepare variables + $dashboard_target = ($dashboard_target == 'new') ? '_blank' : '_self'; + $window_parameters = 'aaa=bbb,'; + if (!empty($dashboard_width) && !empty($dashboard_height)) { + $window_parameters .= "width=".$dashboard_width.",height=".$dashboard_height; } - echo ""; +//dashboard icon + echo "
\n"; + echo "
\n"; + echo " ".escape($dashboard_name).""; + echo " \n"; + echo "
\n"; + if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") { + echo "
".str_replace("\r", '
', escape($dashboard_content_details))."
\n"; + } + echo " "; echo "
\n"; -?> +?> \ No newline at end of file diff --git a/resources/app_languages.php b/resources/app_languages.php index cddcd2adda..aa333e6bcf 100644 --- a/resources/app_languages.php +++ b/resources/app_languages.php @@ -5506,57 +5506,107 @@ $text['label-target']['zh-cn'] = "目标"; $text['label-target']['ja-jp'] = "目標"; $text['label-target']['ko-kr'] = "표적"; -$text['label-current_window_tab']['en-us'] = "Current Window/Tab"; -$text['label-current_window_tab']['en-gb'] = "Current Window/Tab"; -$text['label-current_window_tab']['ar-eg'] = "النافذة أو علامة التبويب الحالية"; -$text['label-current_window_tab']['de-at'] = "Aktuelles Fenster oder Tab"; -$text['label-current_window_tab']['de-ch'] = "Aktuelles Fenster oder Tab"; -$text['label-current_window_tab']['de-de'] = "Aktuelles Fenster oder Tab"; -$text['label-current_window_tab']['el-gr'] = "Τρέχον παράθυρο ή καρτέλα"; -$text['label-current_window_tab']['es-cl'] = "Ventana o pestaña actual"; -$text['label-current_window_tab']['es-mx'] = "Ventana o pestaña actual"; -$text['label-current_window_tab']['fr-ca'] = "Fenêtre ou onglet actuel"; -$text['label-current_window_tab']['fr-fr'] = "Fenêtre ou onglet actuel"; -$text['label-current_window_tab']['he-il'] = "חלון או כרטיסייה נוכחיים"; -$text['label-current_window_tab']['it-it'] = "Finestra o scheda corrente"; -$text['label-current_window_tab']['nl-nl'] = "Huidig ​​venster of tabblad"; -$text['label-current_window_tab']['pl-pl'] = "Bieżące okno lub karta"; -$text['label-current_window_tab']['pt-br'] = "Janela ou guia atual"; -$text['label-current_window_tab']['pt-pt'] = "Janela ou guia atual"; -$text['label-current_window_tab']['ro-ro'] = "Fereastra sau fila curentă"; -$text['label-current_window_tab']['ru-ru'] = "Текущее окно или вкладка"; -$text['label-current_window_tab']['sv-se'] = "Aktuellt fönster eller flik"; -$text['label-current_window_tab']['uk-ua'] = "Поточне вікно або вкладка"; -$text['label-current_window_tab']['tr-tr'] = "Geçerli Pencere veya Sekme"; -$text['label-current_window_tab']['zh-cn'] = "当前窗口或选项卡"; -$text['label-current_window_tab']['ja-jp'] = "現在のウィンドウまたはタブ"; -$text['label-current_window_tab']['ko-kr'] = "현재 창 또는 탭"; +$text['label-width']['en-us'] = "Width"; +$text['label-width']['en-gb'] = "Width"; +$text['label-width']['ar-eg'] = ""; +$text['label-width']['de-at'] = ""; +$text['label-width']['de-ch'] = ""; +$text['label-width']['de-de'] = ""; +$text['label-width']['el-gr'] = ""; +$text['label-width']['es-cl'] = ""; +$text['label-width']['es-mx'] = ""; +$text['label-width']['fr-ca'] = ""; +$text['label-width']['fr-fr'] = ""; +$text['label-width']['he-il'] = ""; +$text['label-width']['it-it'] = ""; +$text['label-width']['nl-nl'] = ""; +$text['label-width']['pl-pl'] = ""; +$text['label-width']['pt-br'] = ""; +$text['label-width']['pt-pt'] = ""; +$text['label-width']['ro-ro'] = ""; +$text['label-width']['ru-ru'] = ""; +$text['label-width']['sv-se'] = ""; +$text['label-width']['uk-ua'] = ""; +$text['label-width']['zh-cn'] = ""; +$text['label-width']['ja-jp'] = ""; +$text['label-width']['ko-kr'] = ""; -$text['label-new_window_tab']['en-us'] = "New Window/Tab"; -$text['label-new_window_tab']['en-gb'] = "New Window/Tab"; -$text['label-new_window_tab']['ar-eg'] = "نافذة أو علامة تبويب جديدة"; -$text['label-new_window_tab']['de-at'] = "Neues Fenster oder neuer Tab"; -$text['label-new_window_tab']['de-ch'] = "Neues Fenster oder neuer Tab"; -$text['label-new_window_tab']['de-de'] = "Neues Fenster oder neuer Tab"; -$text['label-new_window_tab']['el-gr'] = "Νέο παράθυρο ή καρτέλα"; -$text['label-new_window_tab']['es-cl'] = "Nueva ventana o pestaña"; -$text['label-new_window_tab']['es-mx'] = "Nueva ventana o pestaña"; -$text['label-new_window_tab']['fr-ca'] = "Nouvelle fenêtre ou onglet"; -$text['label-new_window_tab']['fr-fr'] = "Nouvelle fenêtre ou onglet"; -$text['label-new_window_tab']['he-il'] = "חלון חדש או כרטיסייה"; -$text['label-new_window_tab']['it-it'] = "Nuova finestra o scheda"; -$text['label-new_window_tab']['nl-nl'] = "Nieuw venster of tabblad"; -$text['label-new_window_tab']['pl-pl'] = "Nowe okno lub karta"; -$text['label-new_window_tab']['pt-br'] = "Nova janela ou guia"; -$text['label-new_window_tab']['pt-pt'] = "Nova janela ou guia"; -$text['label-new_window_tab']['ro-ro'] = "Fereastră sau filă nouă"; -$text['label-new_window_tab']['ru-ru'] = "Новое окно или вкладка"; -$text['label-new_window_tab']['sv-se'] = "Nytt fönster eller flik"; -$text['label-new_window_tab']['uk-ua'] = "Нове вікно або вкладка"; -$text['label-new_window_tab']['tr-tr'] = "Yeni Pencere veya Sekme"; -$text['label-new_window_tab']['zh-cn'] = "新窗口或标签页"; -$text['label-new_window_tab']['ja-jp'] = "新しいウィンドウまたはタブ"; -$text['label-new_window_tab']['ko-kr'] = "새 창 또는 탭"; +$text['label-height']['en-us'] = "Height"; +$text['label-height']['en-gb'] = "Height"; +$text['label-height']['ar-eg'] = ""; +$text['label-height']['de-at'] = ""; +$text['label-height']['de-ch'] = ""; +$text['label-height']['de-de'] = ""; +$text['label-height']['el-gr'] = ""; +$text['label-height']['es-cl'] = ""; +$text['label-height']['es-mx'] = ""; +$text['label-height']['fr-ca'] = ""; +$text['label-height']['fr-fr'] = ""; +$text['label-height']['he-il'] = ""; +$text['label-height']['it-it'] = ""; +$text['label-height']['nl-nl'] = ""; +$text['label-height']['pl-pl'] = ""; +$text['label-height']['pt-br'] = ""; +$text['label-height']['pt-pt'] = ""; +$text['label-height']['ro-ro'] = ""; +$text['label-height']['ru-ru'] = ""; +$text['label-height']['sv-se'] = ""; +$text['label-height']['uk-ua'] = ""; +$text['label-height']['zh-cn'] = ""; +$text['label-height']['ja-jp'] = ""; +$text['label-height']['ko-kr'] = ""; + +$text['label-current_window']['en-us'] = "Current Window"; +$text['label-current_window']['en-gb'] = "Current Window"; +$text['label-current_window']['ar-eg'] = "النافذة أو علامة التبويب الحالية"; +$text['label-current_window']['de-at'] = "Aktuelles Fenster oder Tab"; +$text['label-current_window']['de-ch'] = "Aktuelles Fenster oder Tab"; +$text['label-current_window']['de-de'] = "Aktuelles Fenster oder Tab"; +$text['label-current_window']['el-gr'] = "Τρέχον παράθυρο ή καρτέλα"; +$text['label-current_window']['es-cl'] = "Ventana o pestaña actual"; +$text['label-current_window']['es-mx'] = "Ventana o pestaña actual"; +$text['label-current_window']['fr-ca'] = "Fenêtre ou onglet actuel"; +$text['label-current_window']['fr-fr'] = "Fenêtre ou onglet actuel"; +$text['label-current_window']['he-il'] = "חלון או כרטיסייה נוכחיים"; +$text['label-current_window']['it-it'] = "Finestra o scheda corrente"; +$text['label-current_window']['nl-nl'] = "Huidig ​​venster of tabblad"; +$text['label-current_window']['pl-pl'] = "Bieżące okno lub karta"; +$text['label-current_window']['pt-br'] = "Janela ou guia atual"; +$text['label-current_window']['pt-pt'] = "Janela ou guia atual"; +$text['label-current_window']['ro-ro'] = "Fereastra sau fila curentă"; +$text['label-current_window']['ru-ru'] = "Текущее окно или вкладка"; +$text['label-current_window']['sv-se'] = "Aktuellt fönster eller flik"; +$text['label-current_window']['uk-ua'] = "Поточне вікно або вкладка"; +$text['label-current_window']['tr-tr'] = "Geçerli Pencere veya Sekme"; +$text['label-current_window']['zh-cn'] = "当前窗口或选项卡"; +$text['label-current_window']['ja-jp'] = "現在のウィンドウまたはタブ"; +$text['label-current_window']['ko-kr'] = "현재 창 또는 탭"; + +$text['label-new_window']['en-us'] = "New Window"; +$text['label-new_window']['en-gb'] = "New Window"; +$text['label-new_window']['ar-eg'] = "نافذة أو علامة تبويب جديدة"; +$text['label-new_window']['de-at'] = "Neues Fenster oder neuer Tab"; +$text['label-new_window']['de-ch'] = "Neues Fenster oder neuer Tab"; +$text['label-new_window']['de-de'] = "Neues Fenster oder neuer Tab"; +$text['label-new_window']['el-gr'] = "Νέο παράθυρο ή καρτέλα"; +$text['label-new_window']['es-cl'] = "Nueva ventana o pestaña"; +$text['label-new_window']['es-mx'] = "Nueva ventana o pestaña"; +$text['label-new_window']['fr-ca'] = "Nouvelle fenêtre ou onglet"; +$text['label-new_window']['fr-fr'] = "Nouvelle fenêtre ou onglet"; +$text['label-new_window']['he-il'] = "חלון חדש או כרטיסייה"; +$text['label-new_window']['it-it'] = "Nuova finestra o scheda"; +$text['label-new_window']['nl-nl'] = "Nieuw venster of tabblad"; +$text['label-new_window']['pl-pl'] = "Nowe okno lub karta"; +$text['label-new_window']['pt-br'] = "Nova janela ou guia"; +$text['label-new_window']['pt-pt'] = "Nova janela ou guia"; +$text['label-new_window']['ro-ro'] = "Fereastră sau filă nouă"; +$text['label-new_window']['ru-ru'] = "Новое окно или вкладка"; +$text['label-new_window']['sv-se'] = "Nytt fönster eller flik"; +$text['label-new_window']['uk-ua'] = "Нове вікно або вкладка"; +$text['label-new_window']['tr-tr'] = "Yeni Pencere veya Sekme"; +$text['label-new_window']['zh-cn'] = "新窗口或标签页"; +$text['label-new_window']['ja-jp'] = "新しいウィンドウまたはタブ"; +$text['label-new_window']['ko-kr'] = "새 창 또는 탭"; $text['label-icon']['en-us'] = "Icon"; $text['label-icon']['en-gb'] = "Icon";