Modifying Profile fields in profile settings

alt=
DannyA
@dannya
10 years ago
584 posts
If I want to collect masspay address and threshold from user for masspay, how do I modify the "profile" settings form to collect this info without modifying core files? I believe foxycart works this way.
updated by @dannya: 06/18/14 04:07:26PM
michael
@michael
10 years ago
7,718 posts
You can modify most forms by using the Form Designer

"Using the Form Designer"
https://www.jamroom.net/the-jamroom-network/documentation/getting-started/1275/using-the-form-designer
sbhadauria
@sbhadauria
10 years ago
129 posts
1.Register event listener in jrModule_init() funtion

jrCore_register_event_listener('jrCore', 'form_display', 'jrModule_profile_form_display');


2.function jrModule_profile_form_display($_data, $_user, $_conf, $_args, $event)
{
switch ($_data['form_view']) {
case 'jrProfile/settings':
// Add your field.
$_tmp = array(
'name' => 'profile_field_name',
'label' => 'Field Label',
'type' => 'text',
'help' => 'Help Text',
'required' => true
);
jrCore_form_field_create($_tmp);
break;
}
return $_data;
}



Done :)
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
You can also add to the profile settings in the module's profile.php:
function myModule_profile_settings(){
	// approve
    $_tmp = array(
        'name'     => 'approve',
        'default'  => 'off',
        'type'     => 'checkbox',
        'validate' => 'onoff',
        'required' => 'on',
        'label'    => 3,
        'help'     => 4
    );
    jrProfile_register_setting('myModule',$_tmp);

    return true;
}



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 05/16/14 04:22:41AM

Tags