summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-02-10 08:57:14 -0500
committerSteve Beaver <sbeaver@netgate.com>2017-02-10 09:12:08 -0500
commitcc8783a53838de40a9a874714458295794bec298 (patch)
tree9679f885187c0d1c249774ae85c3110d3aa5ee35 /src/usr
parentdd23f616db3db3920e47bdfb6af9cd130052dd9f (diff)
downloadpfsense-cc8783a53838de40a9a874714458295794bec298.zip
pfsense-cc8783a53838de40a9a874714458295794bec298.tar.gz
Add "Required field" capability to Groups.class.php
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/classes/Form/Group.class.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/usr/local/www/classes/Form/Group.class.php b/src/usr/local/www/classes/Form/Group.class.php
index bb0ea07..22d400b 100644
--- a/src/usr/local/www/classes/Form/Group.class.php
+++ b/src/usr/local/www/classes/Form/Group.class.php
@@ -176,6 +176,15 @@ EOT;
if (!empty(trim($this->_title)) || is_numeric($this->_title)) {
$title = htmlspecialchars(gettext($this->_title));
+
+ // If the element tile (label) begins with a '*', remove the '*' and add a span with class
+ // 'element-required'. Text decoration can then be added in the CSS to indicate that this is a
+ // required field
+ if (substr($title, 0, 1 ) === "*" ) {
+ $title = '<span class="element-required">' . substr($title, 1) . '</span>';
+ } else {
+ $title = '<span>' . $title . '</span>';
+ }
}
return <<<EOT
OpenPOWER on IntegriCloud