[development] Forms API Question - Node with table like poll.module

Simon Lindsay simon at dirtbike.ws
Sat Nov 12 11:42:46 UTC 2005


Karoly Negyesi wrote:
> form['entries']['#theme'] = 'mymodule_foo';
> 
> function theme_mymodule_foo($form) {
> }
> 
> For examples, I'd grep on element_children (though there are quite a 
> few  forms that got updated before element_children was born).

OK, but the timesheet module is an extension of node.module, and you're 
supposed to "return $form;" at the end of the "function 
timesheet_form(&$node)", not "return 
drupal_get_form('timesheet_entries', $form);".

However, doing the "return $form" means that the theme doesn't get 
called, and doing the "drupal_get_form" gives array errors.

I can't find a module that extends node that uses the themeing for node 
submission (despite quite a bit of grepping), although several use it 
for administration. If anyone can point one out to me, or where I'm 
going wrong, that would be great.

Simon


More information about the development mailing list