From 25cdd2dbdad9bbc1b32513c6a8f0255a7e5f116b Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Tue, 17 Jan 2023 13:50:44 -0700 Subject: [PATCH] Add details state dashboard widget setting (#6537) * Update index.php * Update dashboard_edit.php * Update app_config.php * Update app_languages.php --- core/dashboard/app_config.php | 5 ++++ core/dashboard/app_languages.php | 40 +++++++++++++++++++++++++++++++ core/dashboard/dashboard_edit.php | 39 ++++++++++++++++++++++++++++++ core/dashboard/index.php | 16 +++++++++++-- 4 files changed, 98 insertions(+), 2 deletions(-) diff --git a/core/dashboard/app_config.php b/core/dashboard/app_config.php index 3aa7e9dc99..a312990cb9 100644 --- a/core/dashboard/app_config.php +++ b/core/dashboard/app_config.php @@ -77,6 +77,11 @@ $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard column span.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_details_state'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['search_by'] = 'expanded'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Set the default state of the widget details.'; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_order'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; diff --git a/core/dashboard/app_languages.php b/core/dashboard/app_languages.php index 8a5f50ee2c..3c289628e5 100644 --- a/core/dashboard/app_languages.php +++ b/core/dashboard/app_languages.php @@ -245,6 +245,46 @@ $text['description-dashboard_column_span']['sv-se'] = ''; $text['description-dashboard_column_span']['uk-ua'] = ''; + $text['label-dashboard_details_state']['en-us'] = 'Details State'; + $text['label-dashboard_details_state']['ar-eg'] = ''; + $text['label-dashboard_details_state']['de-at'] = ''; + $text['label-dashboard_details_state']['de-ch'] = ''; + $text['label-dashboard_details_state']['de-de'] = ''; + $text['label-dashboard_details_state']['es-cl'] = ''; + $text['label-dashboard_details_state']['es-mx'] = ''; + $text['label-dashboard_details_state']['fr-ca'] = ""; + $text['label-dashboard_details_state']['fr-fr'] = ""; + $text['label-dashboard_details_state']['he-il'] = ''; + $text['label-dashboard_details_state']['it-it'] = ''; + $text['label-dashboard_details_state']['nl-nl'] = ''; + $text['label-dashboard_details_state']['pl-pl'] = ''; + $text['label-dashboard_details_state']['pt-br'] = ''; + $text['label-dashboard_details_state']['pt-pt'] = ''; + $text['label-dashboard_details_state']['ro-ro'] = ''; + $text['label-dashboard_details_state']['ru-ru'] = ''; + $text['label-dashboard_details_state']['sv-se'] = ''; + $text['label-dashboard_details_state']['uk-ua'] = ''; + + $text['description-dashboard_details_state']['en-us'] = 'Set the default state of the widget details.'; + $text['description-dashboard_details_state']['ar-eg'] = ''; + $text['description-dashboard_details_state']['de-at'] = ''; + $text['description-dashboard_details_state']['de-ch'] = ''; + $text['description-dashboard_details_state']['de-de'] = ''; + $text['description-dashboard_details_state']['es-cl'] = ''; + $text['description-dashboard_details_state']['es-mx'] = ''; + $text['description-dashboard_details_state']['fr-ca'] = ""; + $text['description-dashboard_details_state']['fr-fr'] = ""; + $text['description-dashboard_details_state']['he-il'] = ''; + $text['description-dashboard_details_state']['it-it'] = ''; + $text['description-dashboard_details_state']['nl-nl'] = ''; + $text['description-dashboard_details_state']['pl-pl'] = ''; + $text['description-dashboard_details_state']['pt-br'] = ''; + $text['description-dashboard_details_state']['pt-pt'] = ''; + $text['description-dashboard_details_state']['ro-ro'] = ''; + $text['description-dashboard_details_state']['ru-ru'] = ''; + $text['description-dashboard_details_state']['sv-se'] = ''; + $text['description-dashboard_details_state']['uk-ua'] = ''; + $text['label-dashboard_order']['en-us'] = 'Order'; $text['label-dashboard_order']['ar-eg'] = ''; $text['label-dashboard_order']['de-at'] = ''; diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index f7cdc9f54d..1fb5a659b7 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -59,6 +59,7 @@ $dashboard_path = $_POST["dashboard_path"]; $dashboard_groups = $_POST["dashboard_groups"]; $dashboard_column_span = $_POST["dashboard_column_span"]; + $dashboard_details_state = $_POST["dashboard_details_state"]; $dashboard_order = $_POST["dashboard_order"]; $dashboard_enabled = $_POST["dashboard_enabled"]; $dashboard_description = $_POST["dashboard_description"]; @@ -156,6 +157,7 @@ $array['dashboard'][0]['dashboard_name'] = $dashboard_name; $array['dashboard'][0]['dashboard_path'] = $dashboard_path; $array['dashboard'][0]['dashboard_column_span'] = $dashboard_column_span; + $array['dashboard'][0]['dashboard_details_state'] = $dashboard_details_state; $array['dashboard'][0]['dashboard_order'] = $dashboard_order; $array['dashboard'][0]['dashboard_enabled'] = $dashboard_enabled; $array['dashboard'][0]['dashboard_description'] = $dashboard_description; @@ -200,6 +202,7 @@ $sql .= " dashboard_name, "; $sql .= " dashboard_path, "; $sql .= " dashboard_column_span, "; + $sql .= " dashboard_details_state, "; $sql .= " dashboard_order, "; $sql .= " cast(dashboard_enabled as text), "; $sql .= " dashboard_description "; @@ -213,6 +216,7 @@ $dashboard_path = $row["dashboard_path"]; $dashboard_groups = $row["dashboard_groups"]; $dashboard_column_span = $row["dashboard_column_span"]; + $dashboard_details_state = $row["dashboard_details_state"]; $dashboard_order = $row["dashboard_order"]; $dashboard_enabled = $row["dashboard_enabled"]; $dashboard_description = $row["dashboard_description"]; @@ -238,6 +242,11 @@ $dashboard_group_uuid = uuid(); } +//add a default value to $dashboard_details_state + if (!isset($dashboard_details_state)) { + $dashboard_details_state = "expanded"; + } + //add an empty row $x = is_array($dashboard_groups) ? count($dashboard_groups) : 0; $dashboard_groups[$x]['dashboard_uuid'] = $dashboard_uuid; @@ -399,6 +408,36 @@ echo "\n"; echo "\n"; + echo "