Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Adriano Faria Posted March 24, 2016 Posted March 24, 2016 Need to add a new field on "Complete Registration" form but I can't: /* Build the form */ $form = new \IPS\Helpers\Form( 'form', 'register_button' ); if( !\IPS\Member::loggedIn()->real_name OR \IPS\Member::loggedIn()->name === \IPS\Member::loggedIn()->language()->get('guest') ) { $form->add( new \IPS\Helpers\Form\Text( 'username', NULL, TRUE, array( 'accountUsername' => \IPS\Member::loggedIn() ) ) ); } if( !\IPS\Member::loggedIn()->email ) { $form->add( new \IPS\Helpers\Form\Email( 'email_address', NULL, TRUE, array( 'accountEmail' => TRUE ) ) ); } $form->addButton( 'cancel', 'link', \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=cancel', 'front', 'register' )->csrf() ); \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->completeProfile( $form );
HeadStand Posted March 24, 2016 Posted March 24, 2016 You can. \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->completeProfile( $form ); You got lucky! The form is being passed in as an object instead of as (string)$form. Do a theme hook on front:system, then in PHP mode, overload the completeProfile method. You should be able to make changes to the form in there, then call the parent.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.