diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-02-10 08:57:14 -0500 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-02-10 09:12:08 -0500 |
commit | cc8783a53838de40a9a874714458295794bec298 (patch) | |
tree | 9679f885187c0d1c249774ae85c3110d3aa5ee35 | |
parent | dd23f616db3db3920e47bdfb6af9cd130052dd9f (diff) | |
download | pfsense-cc8783a53838de40a9a874714458295794bec298.zip pfsense-cc8783a53838de40a9a874714458295794bec298.tar.gz |
Add "Required field" capability to Groups.class.php
-rw-r--r-- | src/usr/local/www/classes/Form/Group.class.php | 9 |
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 |