Add details state dashboard widget setting (#6537)

* Update index.php

* Update dashboard_edit.php

* Update app_config.php

* Update app_languages.php
This commit is contained in:
Alex
2023-01-17 13:50:44 -07:00
committed by GitHub
parent dc3b95da36
commit 25cdd2dbda
4 changed files with 98 additions and 2 deletions

View File

@@ -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'] = '';

View File

@@ -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'] = '';

View File

@@ -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 "</td>\n";
echo "</tr>\n";
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";
if ($dashboard_details_state == "expanded") {
echo " <option value='expanded' selected='selected'>".$text['option-expanded']."</option>\n";
}
else {
echo " <option value='expanded'>".$text['option-expanded']."</option>\n";
}
if ($dashboard_details_state == "contracted") {
echo " <option value='contracted' selected='selected'>".$text['option-contracted']."</option>\n";
}
else {
echo " <option value='contracted'>".$text['option-contracted']."</option>\n";
}
if ($dashboard_details_state == "hidden") {
echo " <option value='hidden' selected='selected'>".$text['option-hidden']."</option>\n";
}
else {
echo " <option value='hidden'>".$text['option-hidden']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-dashboard_details_state']."\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_order']."\n";

View File

@@ -72,6 +72,7 @@
$sql .= "dashboard_name, \n";
$sql .= "dashboard_path, \n";
$sql .= "dashboard_column_span, \n";
$sql .= "dashboard_details_state, \n";
$sql .= "dashboard_order, \n";
$sql .= "cast(dashboard_enabled as text), \n";
$sql .= "dashboard_description \n";
@@ -222,7 +223,7 @@
grid-column: auto;
}
/* Screen smaller than 550px? 1 columns */
/* Screen smaller than 575px? 1 columns */
@media (max-width: 575px) {
.widgets { grid-template-columns: repeat(1, minmax(100px, 1fr)); }
.col-num { grid-column: span 1; }
@@ -239,7 +240,7 @@
?>
}
/* Screen larger than 550px? 2 columns */
/* Screen larger than 575px? 2 columns */
@media (min-width: 575px) {
.widgets { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
.col-num { grid-column: span 2; }
@@ -256,6 +257,17 @@
echo " grid-column: span ".$dashboard_column_span.";\n";
echo "}\n";
}
if ($row['dashboard_details_state'] == "contracted") {
echo "#".$dashboard_name." .hud_box .hud_details {\n";
echo " display: none;\n";
echo "}\n";
}
if ($row['dashboard_details_state'] == "hidden") {
echo "#".$dashboard_name." .hud_box .hud_expander, \n";
echo "#".$dashboard_name." .hud_box .hud_details {\n";
echo " display: none;\n";
echo "}\n";
}
}
?>
}