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

Apartment Lines chad at apartmentlines.com
Sat Nov 12 14:50:22 UTC 2005


simon,

please visit the core examples section of the handbook:  http://drupal.org/node/36052

i believe you'll find that the system_user example and the system_themes example have what you're looking for.

also, if you haven't yet, please visit the general forms API documentation at: http://drupal.org/node/33338

at this point, i believe the doc team has covered most of the issues necessary to convert a module to the API.

chad


> -----Original Message-----
> From: Simon Lindsay [mailto:simon at dirtbike.ws]
> Sent: Saturday, November 12, 2005 04:43
> To: development at drupal.org
> Subject: Re: [development] Forms API Question - Node with tablelike
> poll.module
> 
> 
> 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