diff --git a/system/modules/core/modules/ModulePersonalData.php b/system/modules/core/modules/ModulePersonalData.php index 3d708d891a..3a3bbb6308 100644 --- a/system/modules/core/modules/ModulePersonalData.php +++ b/system/modules/core/modules/ModulePersonalData.php @@ -111,6 +111,16 @@ protected function compile() $hasUpload = false; $row = 0; + // Predefine the group order (other groups will be appended automatically) + $arrGroups = array + ( + 'personal' => array(), + 'address' => array(), + 'contact' => array(), + 'login' => array(), + 'profile' => array() + ); + $blnModified = false; $objMember = \MemberModel::findByPk($this->User->id); @@ -356,37 +366,20 @@ protected function compile() $this->Template->contactDetails = $GLOBALS['TL_LANG']['tl_member']['contactDetails']; $this->Template->personalData = $GLOBALS['TL_LANG']['tl_member']['personalData']; - // Add groups + // Add the groups foreach ($arrFields as $k=>$v) { - $this->Template->$k = $v; + $this->Template->$k = $v; // backwards compatibility + + $key = $k . (($k == 'personal') ? 'Data' : 'Details'); + $arrGroups[$GLOBALS['TL_LANG']['tl_member'][$key]] = $v; } + $this->Template->categories = $arrGroups; $this->Template->formId = 'tl_member_' . $this->id; $this->Template->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['saveData']); $this->Template->action = \Environment::get('indexFreeRequest'); $this->Template->enctype = $hasUpload ? 'multipart/form-data' : 'application/x-www-form-urlencoded'; $this->Template->rowLast = 'row_' . $row . ((($row % 2) == 0) ? ' even' : ' odd'); - - // HOOK: add memberlist fields - if (in_array('memberlist', \ModuleLoader::getActive())) - { - $this->Template->profile = $arrFields['profile']; - $this->Template->profileDetails = $GLOBALS['TL_LANG']['tl_member']['profileDetails']; - } - - // HOOK: add newsletter fields - if (in_array('newsletter', \ModuleLoader::getActive())) - { - $this->Template->newsletter = $arrFields['newsletter']; - $this->Template->newsletterDetails = $GLOBALS['TL_LANG']['tl_member']['newsletterDetails']; - } - - // HOOK: add helpdesk fields - if (in_array('helpdesk', \ModuleLoader::getActive())) - { - $this->Template->helpdesk = $arrFields['helpdesk']; - $this->Template->helpdeskDetails = $GLOBALS['TL_LANG']['tl_member']['helpdeskDetails']; - } } } diff --git a/system/modules/core/modules/ModuleRegistration.php b/system/modules/core/modules/ModuleRegistration.php index 8ea2bef09b..f902ce3e6f 100644 --- a/system/modules/core/modules/ModuleRegistration.php +++ b/system/modules/core/modules/ModuleRegistration.php @@ -113,6 +113,16 @@ protected function compile() $objCaptcha = null; $doNotSubmit = false; + // Predefine the group order (other groups will be appended automatically) + $arrGroups = array + ( + 'personal' => array(), + 'address' => array(), + 'contact' => array(), + 'login' => array(), + 'profile' => array() + ); + // Captcha if (!$this->disableCaptcha) { @@ -281,7 +291,7 @@ protected function compile() $strCaptcha = $objCaptcha->parse(); $this->Template->fields .= $strCaptcha; - $arrFields['captcha'] .= $strCaptcha; + $arrFields['captcha']['captcha'] .= $strCaptcha; } $this->Template->rowLast = 'row_' . ++$i . ((($i % 2) == 0) ? ' even' : ' odd'); @@ -300,37 +310,20 @@ protected function compile() $this->Template->personalData = $GLOBALS['TL_LANG']['tl_member']['personalData']; $this->Template->captchaDetails = $GLOBALS['TL_LANG']['MSC']['securityQuestion']; - // Add groups + // Add the groups foreach ($arrFields as $k=>$v) { - $this->Template->$k = $v; + $this->Template->$k = $v; // backwards compatibility + + $key = $k . (($k == 'personal') ? 'Data' : 'Details'); + $arrGroups[$GLOBALS['TL_LANG']['tl_member'][$key]] = $v; } - $this->Template->captcha = $arrFields['captcha']; + $this->Template->categories = $arrGroups; $this->Template->formId = 'tl_registration'; $this->Template->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['register']); $this->Template->action = \Environment::get('indexFreeRequest'); - - // HOOK: add memberlist fields - if (in_array('memberlist', \ModuleLoader::getActive())) - { - $this->Template->profile = $arrFields['profile']; - $this->Template->profileDetails = $GLOBALS['TL_LANG']['tl_member']['profileDetails']; - } - - // HOOK: add newsletter fields - if (in_array('newsletter', \ModuleLoader::getActive())) - { - $this->Template->newsletter = $arrFields['newsletter']; - $this->Template->newsletterDetails = $GLOBALS['TL_LANG']['tl_member']['newsletterDetails']; - } - - // HOOK: add helpdesk fields - if (in_array('helpdesk', \ModuleLoader::getActive())) - { - $this->Template->helpdesk = $arrFields['helpdesk']; - $this->Template->helpdeskDetails = $GLOBALS['TL_LANG']['tl_member']['helpdeskDetails']; - } + $this->Template->captcha = $arrFields['captcha']['captcha']; // backwards compatibility } diff --git a/system/modules/core/templates/member/member_grouped.html5 b/system/modules/core/templates/member/member_grouped.html5 index 57ed0aae97..c13093d539 100644 --- a/system/modules/core/templates/member/member_grouped.html5 +++ b/system/modules/core/templates/member/member_grouped.html5 @@ -11,109 +11,20 @@ - personal): ?> -
- - - address): ?> - - - - contact): ?> - - - - login): ?> - - - - profile): ?> - - - - newsletter): ?> - - - - helpdesk): ?> - - - - captcha): ?> - - + categories as $legend=>$category): ?> + + + +