Fix widget name setting not being used on some widget labels (#7582)
* Fix widget name setting not being used on some widget labels * Update app_languages.php * Add translations for active calls labels and titles * Update active_calls.php * Update call_forward.php * Update device_keys.php * Add multi-lingual support for widget labels Updated widget label to support multi-lingual text. * Update caller_id.php * Add multilingual support and update widget label * Update switch_status.php * Update system_counts.php * Replace static title with localized widget label Updated widget title to use localized label. * Add multilingual support for disk usage widget * Add translations for system disk usage labels * Update system_status.php * Update system_network_status.php * Add multi-lingual support for CPU status widget * Update app_languages.php * Update app_languages.php * Update voicemails.php * Add multi-lingual support for missed calls widget * Update recent_calls.php * Simplify widget label assignment using null coalescing * Update call_center_agents.php * Update app_languages.php
This commit is contained in:
@@ -13,10 +13,16 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//convert to a key
|
||||
$widget_key = str_replace(' ', '_', strtolower($widget_name));
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings');
|
||||
|
||||
//get the dashboard label
|
||||
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
||||
|
||||
//system counts
|
||||
//domains
|
||||
if (permission_exists('domain_view')) {
|
||||
@@ -291,7 +297,7 @@
|
||||
if ($show_stat) {
|
||||
|
||||
echo "<div class='hud_content' ".($widget_details_state == "disabled" ?: "onclick=\"$('#hud_system_counts_details').slideToggle('fast');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_counts']."</a></span>\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".escape($widget_label)."</a></span>\n";
|
||||
|
||||
if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") {
|
||||
//add doughnut chart
|
||||
|
||||
@@ -13,10 +13,16 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//convert to a key
|
||||
$widget_key = str_replace(' ', '_', strtolower($widget_name));
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/system');
|
||||
|
||||
//get the dashboard label
|
||||
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
||||
|
||||
//system cpu status
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
@@ -52,7 +58,7 @@
|
||||
|
||||
//show the content
|
||||
echo "<div class='hud_content' ".($widget_details_state == "disabled" ?: "onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-cpu_usage']."</a></span>\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".escape($widget_label)."</a></span>\n";
|
||||
|
||||
$token = (new token())->create($_SERVER['PHP_SELF']);
|
||||
|
||||
|
||||
@@ -13,10 +13,16 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//convert to a key
|
||||
$widget_key = str_replace(' ', '_', strtolower($widget_name));
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings');
|
||||
|
||||
//get the dashboard label
|
||||
$widget_label = $text['label-'.$widget_key];
|
||||
|
||||
//system status
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
@@ -38,7 +44,7 @@
|
||||
|
||||
//add half doughnut chart
|
||||
echo " <div class='hud_content' ".($widget_details_state == "disabled" ?: "onclick=\"$('#hud_system_disk_usage_details').slideToggle('fast');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-disk_usage']."</a></span>\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".escape($widget_label)."</a></span>\n";
|
||||
|
||||
if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") {
|
||||
?>
|
||||
|
||||
@@ -11,10 +11,16 @@ if (permission_exists('system_view_network')) {
|
||||
return;
|
||||
}
|
||||
|
||||
//convert to a key
|
||||
$widget_key = str_replace(' ', '_', strtolower($widget_name));
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/system');
|
||||
|
||||
//get the dashboard label
|
||||
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
||||
|
||||
//set the row style class names
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
@@ -42,7 +48,7 @@ echo "<div class='hud_box'>\n";
|
||||
echo "<input id='token' type='hidden' name='" . $token['name'] . "' value='" . $token['hash'] . "'>\n";
|
||||
echo "<div class='hud_content'>\n";
|
||||
echo "<span class='hud_title'>\n";
|
||||
echo "<a onclick=\"document.location.href='" . PROJECT_PATH . "/app/system/system.php'\">" . $text['label-network_usage'] . "</a>\n";
|
||||
echo "<a onclick=\"document.location.href='" . PROJECT_PATH . "/app/system/system.php'\">" . escape($widget_label) . "</a>\n";
|
||||
echo "</span>\n";
|
||||
//if ($dashboard_chart_type === 'line') { ?>
|
||||
<div class='hud_chart' style='width: 100%; height: 85%'>
|
||||
|
||||
@@ -154,13 +154,19 @@
|
||||
//track total installed services for charts
|
||||
$total_services = count($services);
|
||||
|
||||
//convert to a key
|
||||
$widget_key = str_replace(' ', '_', strtolower($widget_name));
|
||||
|
||||
//add multi-lingual support
|
||||
$text = (new text())->get($settings->get('domain','language','en-us'), 'core/user_settings');
|
||||
|
||||
//get the dashboard label
|
||||
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
||||
|
||||
//show the results
|
||||
echo "<div class='hud_box'>\n";
|
||||
echo " <div class='hud_content' ".($widget_details_state == 'disabled' ?: "onclick=\"$('#hud_system_services_details').slideToggle('fast');\""). ">\n";
|
||||
echo " <span class='hud_title'>System Services</span>\n";
|
||||
echo " <span class='hud_title'>".escape($widget_label)."</span>\n";
|
||||
|
||||
//doughnut chart
|
||||
if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") {
|
||||
|
||||
@@ -13,10 +13,16 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//convert to a key
|
||||
$widget_key = str_replace(' ', '_', strtolower($widget_name));
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings');
|
||||
|
||||
//get the dashboard label
|
||||
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
||||
|
||||
//system status
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
@@ -121,7 +127,7 @@
|
||||
|
||||
//show the results
|
||||
echo " <div class='hud_content' ".($widget_details_state == "disabled" ?: "onclick=\"$('#hud_system_status_details').slideToggle('fast');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_status']."</a></span>\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".escape($widget_label)."</a></span>\n";
|
||||
|
||||
if ($widget_chart_type == "doughnut") {
|
||||
?>
|
||||
@@ -193,7 +199,7 @@
|
||||
|
||||
//disk usage
|
||||
if ($widget_row_span >= 1) {
|
||||
echo " <span class='hud_title' style='text-align: left; font-size: 11px; line-height: 1.8; font-weight: unset; padding-left: 10%;'>".$text['label-disk_usage']."</span>\n";
|
||||
echo " <span class='hud_title' style='text-align: left; font-size: 11px; line-height: 1.8; font-weight: unset; padding-left: 10%;'>".$text['label-system_disk_usage']."</span>\n";
|
||||
echo " <div class='progress_container' style='width: 80%; height: 15px; overflow: hidden; border-radius: 10px; background: ".($settings->get('theme', 'dashboard_disk_usage_chart_sub_color') ?? '#d4d4d4').";'>\n";
|
||||
echo " <div class='progress_bar' style='width: ".$percent_disk_usage."%; height: 15px; border-radius: 10px; font-size: x-small; color: ".$row['widget_number_text_color']."; background: ".($settings->get('theme', 'dashboard_disk_usage_chart_main_color') ?? '#03c04a').";'>".round($percent_disk_usage)."%</div>\n";
|
||||
echo " </div>\n";
|
||||
@@ -329,7 +335,7 @@
|
||||
$style = ($percent_disk_usage > 90) ? "color: red;" : (($percent_disk_usage > 75) ? "color: orange;" : "");
|
||||
|
||||
echo "<tr class='tr_link_void'>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-disk_usage']."</td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-system_disk_usage']."</td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; $style'>".$percent_disk_usage."% (".$used_space." / ".$total_space.")"."</td>\n";
|
||||
echo "</tr>\n";
|
||||
$c = ($c) ? 0 : 1;
|
||||
|
||||
Reference in New Issue
Block a user