I'm creating a new module and need some help on the module_form() hook.
Here's what I'm trying to achieve:
1. User clicks on "create new vocabulary list"
2. User is presented with a text entry field and asked to enter the number of vocabulary words are in the list.
3. User clicks a "continue" button.
4. User is presented with 'n' text entry fields for their vocabulary words. (where 'n' is the number they entered on the previous screen).
5. The user fills this field out and things continue as with any other node.
Here's what I've done so far (in psuedo code):
if ( I know the number of words){
display form for textfield
}
else if ( this is an update ) {
create the form based on the number
of records in the database.
}
else {
Create form using number of words
entered on the first screen.
}
Here's the problem:
- The first form displays with a "preview" button. Adding an "add" button (form_submit("Add")) makes it confusing and returns a thank you for your submission page.
Here's what I thought of while typing this question up:
1. Create a new function module_request_wordcount() calling form(), form_textfield() and form_submit(), where the action is op=add&type=modulename&wordcount=$n.
2. Modify the module_link()
if ($type == "menu.create" && user_access("post content")) somehow points to the new function.
Is this a good way to handle this problem? Is there a better way? What should the modify module_link() code look like? I don't really understand how those arrays are used.
Any assistance would be greatly appreciated.
- Joe