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:
Alex
2025-10-17 16:01:39 -07:00
committed by GitHub
parent a11b79e1b5
commit 729b3bf314
22 changed files with 305 additions and 50 deletions

View File

@@ -26,10 +26,16 @@
require_once dirname(__DIR__, 4) . "/resources/require.php";
require_once "resources/check_auth.php";
//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/devices');
//get the dashboard label
$widget_label = $text['title-'.$widget_key] ?? $widget_name;
//get the vendor functions
$sql = "select v.name as vendor_name, f.type, f.value ";
$sql .= "from v_device_vendors as v, v_device_vendor_functions as f ";
@@ -424,7 +430,7 @@
echo "<div class='hud_content' style='display: block;'>\n";
echo " <div class='action_bar sub'>\n";
echo " <div class='heading' style='padding-left: 5px;'><b>".$text['title-device_keys']."</b></div>\n";
echo " <div class='heading' style='padding-left: 5px;'><b>".escape($widget_label)."</b></div>\n";
echo " <div class='actions' style='padding-top: 2px;'>\n";
echo button::create(['type'=>'button','label'=>$text['button-apply'],'icon'=>$settings->get('theme', 'button_icon_save'),'collapse'=>false,'onclick'=>"document.location.href='".PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync&profile=".$sip_profile_name."&user=".($user_id ?? '')."@".($server_address ?? '')."&domain=".($server_address ?? '')."&agent=".($device_key_vendor ?? '')."';"]);
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save'),'collapse'=>false,'onclick'=>"list_form_submit('form_list_device_keys');"]);