Update content.php

- Use vertical align for short text and align top for larger amounts of text.
- Adjust values for a row spand of 1, 2, or 3 for height and max-height
This commit is contained in:
FusionPBX
2024-08-14 19:14:17 -06:00
committed by GitHub
parent f38a51d380
commit 193a03291c

View File

@@ -8,11 +8,17 @@
$language = new text;
$text = $language->get($_SESSION['domain']['language']['code'], 'core/dashboard');
//prepare the settings
$dashboard_content_length = strlen($dashboard_content);
$dashboard_content_text_vertical_align = 'top';
if ($dashboard_content_length < 30) { $dashboard_content_text_vertical_align = 'middle'; }
$dashboard_content_height = $dashboard_row_span * 120 . 'px';
//dashboard icon
echo "<div class='hud_box'>\n";
echo " <div class='hud_content' ".(!empty($row['dashboard_background_color']) ? "style='background: ".$row['dashboard_background_color'].";'" : null)." ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_content_details').slideToggle('fast'); toggle_grid_row_end('".trim(preg_replace("/[^a-z]/", '_', strtolower($row['dashboard_name'])),'_')."');\"" : null).">\n";
echo " <span class='hud_title' ".(!empty($row['dashboard_label_background_color']) ? "style='background: ".$row['dashboard_label_background_color'].";'" : null).">".escape($dashboard_name)."</span>";
echo " <span style='padding: 5%; height: 150px; max-height: 150px; text-align: ".$row['dashboard_content_text_align']."; vertical-align: middle; overflow: auto; ".(!empty($row['dashboard_number_text_color']) ? "color: ".$row['dashboard_number_text_color'].";" : null)."'>".str_replace("\r", '<br>', escape($dashboard_content))."</span>\n";
echo " <span style='padding: 7%; height: ".$dashboard_content_height."; max-height: ".$dashboard_content_height."; text-align: ".$row['dashboard_content_text_align']."; vertical-align: ".$dashboard_content_text_vertical_align."; overflow: auto; ".(!empty($row['dashboard_number_text_color']) ? "color: ".$row['dashboard_number_text_color'].";" : null)."'>".str_replace("\r", '<br>', escape($dashboard_content))."</span>\n";
echo " </div>\n";
if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") {
echo " <div class='hud_details hud_box' id='hud_content_details' style='padding: 20px; 10%; overflow: auto; ".(!empty($row['dashboard_detail_background_color']) ? "background: ".$row['dashboard_detail_background_color'].";" : null)."'>".str_replace("\r", '<br>', escape($dashboard_content_details))."</div>\n";