summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/index.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-04-27 09:58:52 +0545
committerPhil Davis <phil.davis@inf.org>2017-04-27 09:58:52 +0545
commit0fc6d49d4be58f5de57a3143a091034f99783e65 (patch)
treef327dc293cf48ba172e36077a4dda3c91683fab9 /src/usr/local/www/index.php
parent49a6769d99b4ea0306b0d619d14c3c0c841386e9 (diff)
downloadpfsense-0fc6d49d4be58f5de57a3143a091034f99783e65.zip
pfsense-0fc6d49d4be58f5de57a3143a091034f99783e65.tar.gz
Allow customize of dashboard widget names
Diffstat (limited to 'src/usr/local/www/index.php')
-rw-r--r--src/usr/local/www/index.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php
index e4ac5c2..a06b44e 100644
--- a/src/usr/local/www/index.php
+++ b/src/usr/local/www/index.php
@@ -302,17 +302,20 @@ if ($user_settings['widgets']['sequence'] != "") {
if (false !== $offset) {
$basename = substr($basename, 0, $offset);
}
+ $widgetkey = $basename . '-' . $copynum;
- // Get the widget title that should be in a var defined in the widget's inc file.
- $widgettitle = ${$basename . '_title'};
+ if (isset($user_settings['widgets'][$widgetkey]['descr'])) {
+ $widgettitle = htmlentities($user_settings['widgets'][$widgetkey]['descr']);
+ } else {
+ // Get the widget title that should be in a var defined in the widget's inc file.
+ $widgettitle = ${$basename . '_title'};
- if (empty(trim($widgettitle))) {
- // Fall back to constructing a title from the file name of the widget.
- $widgettitle = ucwords(str_replace('_', ' ', $basename));
+ if (empty(trim($widgettitle))) {
+ // Fall back to constructing a title from the file name of the widget.
+ $widgettitle = ucwords(str_replace('_', ' ', $basename));
+ }
}
- $widgetkey = $basename . '-' . $copynum;
-
$widgetsfromconfig[$widgetkey] = array(
'basename' => $basename,
'title' => $widgettitle,
OpenPOWER on IntegriCloud