From db849f9fd70991553802e32b08825c08b8828c0a Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 14 Feb 2019 14:29:25 -0800 Subject: [PATCH] Fixes #3676 - 'required' was not displayed on extended user fields. --- .../shortcodes/batch/usersettings_shortcodes.php | 15 +++++++++++++++ e107_core/templates/usersettings_template.php | 8 ++++---- usersettings.php | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php index 843d51839..e9d68fe64 100755 --- a/e107_core/shortcodes/batch/usersettings_shortcodes.php +++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php @@ -559,10 +559,14 @@ class usersettings_shortcodes extends e_shortcode $uVal = str_replace(chr(1), "", $this->var['user_' . $parm]); $fval = $ue->user_extended_edit($fInfo, $uVal); + + $rVal = !empty($fInfo['user_extended_struct_required']) ; + $ret = $USEREXTENDED_FIELD; $ret = str_replace("{FIELDNAME}", $fname, $ret); $ret = str_replace("{FIELDVAL}", $fval, $ret); $ret = str_replace("{HIDEFIELD}", $fhide, $ret); + $ret = str_replace("{REQUIRED}", $this->required($rVal), $ret); } $extended_showed['field'][$parm] = 1; @@ -578,6 +582,17 @@ class usersettings_shortcodes extends e_shortcode } + private function required($val=null) + { + if(empty($val)) + { + return ''; + } + + return ""; + + } + function sc_deleteaccountbutton($parm=array()) { diff --git a/e107_core/templates/usersettings_template.php b/e107_core/templates/usersettings_template.php index b23f91a1d..8cd72d981 100755 --- a/e107_core/templates/usersettings_template.php +++ b/e107_core/templates/usersettings_template.php @@ -246,7 +246,9 @@ $USERSETTINGS_WRAPPER['edit']['SIGNATURE'] = "
-// Bootstrap 3 only. +// Bootstrap 3 only. + +$USERSETTINGS_TEMPLATE = array(); $USERSETTINGS_TEMPLATE['edit'] = " @@ -309,7 +311,7 @@ $USERSETTINGS_TEMPLATE['edit'] = " $USERSETTINGS_TEMPLATE['extended-category'] = "

{CATNAME}

"; $USERSETTINGS_TEMPLATE['extended-field'] = "
- +
{FIELDVAL} {HIDEFIELD}
@@ -317,5 +319,3 @@ $USERSETTINGS_TEMPLATE['extended-field'] = "
"; - -?> diff --git a/usersettings.php b/usersettings.php index 09e50a1b1..e3d312840 100644 --- a/usersettings.php +++ b/usersettings.php @@ -1110,7 +1110,7 @@ function req($field) $ret = ""; if ($field == 2) { - $ret = " *"; + $ret = ""; } return $ret; }