solved Implement the form designer in a new module

Malthor
Malthor
@malthor
6 years ago
15 posts
Hi everyone,

for my site, I want to create a new tab in the account settings. The idea is, to have a seperate information bar, which informs a special kind of quota about any change in this tab. I have already created an new module for this, but at the moment the tab content remains empty.
So I thought to my self, all I need is the form designer to fill my new tab with content. Is there a way to implement the form designer in my new created module?
JR Header3.jpg
JR Header3.jpg  •  48KB

JR Header2.jpg
JR Header2.jpg  •  103KB


updated by @malthor: 01/17/19 10:26:17AM
paul
@paul
6 years ago
4,325 posts
The Form Designer button is added automatically to any module form by including 'registration' code in the module's include.php 'init' function. For instance, take a look at the code below taken from the jrBlog module where it registers the Form Designer on its create and update forms -

function jrBlog_init(){
    // Allow admin to customize our forms
    jrCore_register_module_feature('jrCore', 'designer_form', 'jrBlog', 'create');
    jrCore_register_module_feature('jrCore', 'designer_form', 'jrBlog', 'update');

So you would need to change the 'jrBlog' parameter to the name of your module, and the 'create/update' to the name of your form.
hth


--
Paul Asher - JR Developer and System Import Specialist
Malthor
Malthor
@malthor
6 years ago
15 posts
That works just fine.
Thank you very much for helping Paul!

Tags