function process($aAddonFields = array())
{
if (!$this->oPF->aArea) {
return 'Profile Fields cache not loaded. Cannot continue.';
}
$this->aPages = array_keys($this->oPF->aArea);
$this->iPage = isset($_POST['join_page']) ? $_POST['join_page'] : 0;
// get current working page from POST
if ($this->iPage !== 'done') {
$this->iPage = (int) $this->iPage;
}
$this->getCoupleOptions();
$this->processPostValues();
if ($this->bAjaxMode && bx_get('join_page_validate') !== false) {
echo $this->showErrorsJson();
exit;
}
$sContent = '';
if ($this->iPage === 'done') {
//if all pages are finished and no errors found
list($iMemberId, $sStatus) = $this->registerMember();
$sContent .= !$iMemberId ? $this->showFailPage() : $this->showFinishPage($iMemberId, $sStatus);
} else {
$sContent .= $this->showJoinForm($aAddonFields);
}
return $sContent;
}