I was thinking about such a module myself lately. Going breifly over your code I have some suggestions, comments:

1. jQuery, isn't good - if a user has javascript disabled then she will see all the fields. Maybe you can make the field's #access = FALSE
2. You might use menu_get_object() and menu_get_item(), it can be more legant then checking arg(0) && arg(1)
3. Passing the step in argument doesn't sound right, it should be some internal variable - how to do it exactly I don't know, as the $form_state['storage'] is being rebuilt every time you re-show the node form.
4. Maybe to make this module more robust, you should make hook_multistep_info(), that one can define which fields should appear on which steps/ conditions.
5. You have some tabs instead of 2 spaces :)

With all that said, have a look in CTOOLS module, I think there is a module there that deals with something similar.

Anyway, thanks for the module.

Comments

vkareh’s picture

Version: » 5.x-1.x-dev

Thank you for all your comments! I think these are all great ideas.

  1. About the jQuery issue: I've been trying to avoid jQuery myself, but the only other thing that I figured that might work is to override every widget you use and then skip rendering it in the form, however, it's not elegant due to the fact that CCK still doesn't have hooks for the fields. I'll take a look at the #access property, sounds good.
  2. Humm, never tried that. I'll check it out, although I've always used arg(x), maybe it'll be useful for the step passed as argument.
  3. I've done this before with the internal hidden variable (I've used multiple variations, for different clients, of the module I'm currently providing here), and it works (especially if you want to save the current step of the form), but then you'll have to have a way to allow the user to jump to arbitrary steps, without using a button for each menu entry...not good enough yet.
  4. I'll definitely look into that. I like the idea of controlling the multistep at a field level (but as I said, I still haven't found a way to add stuff to a field/widget without overriding it completely).
  5. Thanks, I'll fix those ASAP.

I hope this is at least useful as a starting point.

vkareh’s picture

Version: 5.x-1.x-dev » 5.x-1.1
Assigned: Unassigned » vkareh
Status: Active » Fixed

Fixed the jQuery issue. For the others, see responses below:

  1. No more jQuery, the whole module now uses PHP. Yay!
  2. Won't fix. Those functions are not necessary, since the arguments are used to be able to arbitrarily go to any step, whether the menu is being used or not.
  3. Might add an internal variable later to keep track of where the user left the form. But it's not currently needed for functionality. Sounds like a good idea, though.
  4. Won't fix. The idea is to be able to use this module for any content type, not one provided by the module.
  5. Fixed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.