[support] Forms hate me

Earnie Boyd earnie at users.sourceforge.net
Thu Jan 3 16:32:24 UTC 2013


When I want to figure how this works I look at the user module and the
theme for the list of users.  I forget off the top of my head every
time.

Earnie

On Thu, Jan 3, 2013 at 10:31 AM, Ms. Nancy Wichmann
<nan_wich at bellsouth.net> wrote:
> I have a form that I need to format (theme) as a table. The D6 version of
> the module works just fine. The D7 version is being rather obstinate.
>
> Since I have a dsm() in the theme function, I know it is firing. However,
> the variables array passed to the theme has an empty array in it. Anyone see
> what I'm doing wrong?
>
> function log_cleanup_theme() {
>   return array(
>     'log_cleanup_settings' => array(
>       'variables' => array('form' => array()),
>       'render element' => 'form',
>       ),
>     );
> }
>
> function theme_log_cleanup_settings(&$variables) {
>   $form = $variables['form'];
>   dsm(print_r($variables, true));
>
>   $output = '';
>   $table = array();
>   $table['rows'] = array();
>   $table['header'] = array(
>     t('Message Type'),
>     t('Interval'),
>     );
>
>   // Spin through the intervals elements.
>   foreach (element_children($form['intervals']) as $key) {
>
> Nancy
> Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
> Jr.
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]



-- 
Earnie
-- https://sites.google.com/site/earnieboyd


More information about the support mailing list