summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/index.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-11-20 12:14:04 +0545
committerStephen Beaver <sbeaver@netgate.com>2015-11-20 07:53:35 -0500
commit4b1a8a6c69f7b298b3f0f3de1cadd397d9cdd61f (patch)
tree87c5c47e11a68ab04f29c88382c7c503daf09ed7 /src/usr/local/www/index.php
parent75ae3d1cd62d76629d02b07c73f1892e91ba95de (diff)
downloadpfsense-4b1a8a6c69f7b298b3f0f3de1cadd397d9cdd61f.zip
pfsense-4b1a8a6c69f7b298b3f0f3de1cadd397d9cdd61f.tar.gz
Redmine #5492 case of acronyms in widget names
I am not sure how else to do this. If someone in future writes a widget about "Smart Carp" (an intelligent species of fish) then it will get turned into "SMART CARP". The other strings are not English words, or parts of English words, so not likely to be matched wrongly in future. Note 1: The redmine issue also mentions changing "Dyn DNS Status" to "Dynamic DNS Status". For that reason I put a special entry to change any "dyn dns" to "Dynamic DNS". I also put the "dns" to "DNS" in case there are ever any other occurrences of "dns" in other widget names that would need to be changed to "DNS". Note 2: "gmirror" to "gmirror" is not a mistake. str_ireplace() is case-insensitive. So this will replaces stuff like "Gmirror" with "gmirror". Note 3: None of this stuff has gettext() translation support. But it did not in 2.2.* either. That is something else for future thought - how to take text that is generated from file names found at run-time and give translators a chance to translate it.
Diffstat (limited to 'src/usr/local/www/index.php')
-rw-r--r--src/usr/local/www/index.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php
index 455ee47..3bc0126 100644
--- a/src/usr/local/www/index.php
+++ b/src/usr/local/www/index.php
@@ -260,6 +260,13 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
}
}
+## Replace any known acronyms in widget names with suitable mixed-case forms
+$input_acronyms = array("carp", "dns", "dyn dns", "gmirror", "ipsec", "ntp", "openvpn", "rss", "smart");
+$output_acronyms = array("CARP", "DNS", "Dynamic DNS", "gmirror", "IPsec", "NTP", "OpenVPN", "RSS", "SMART");
+foreach ($widgets as $widgetname => $widgetconfig) {
+ $widgets[$widgetname]['name'] = str_ireplace($input_acronyms, $output_acronyms, $widgetconfig['name']);
+}
+
##build list of php include files
$phpincludefiles = array();
$directory = "/usr/local/www/widgets/include/";
OpenPOWER on IntegriCloud