[development] Drupal 6: Theming system_settings_form() forms

Juraj Chlebec havran at gmail.com
Sat Jan 5 18:26:30 UTC 2008


Hi,

For example i have code looks like this:

<?php
...

/**
* hook_theme()
*/
function themedemo_theme() {
  return array(
    'themedemo_example' => array(
      'arguments' => array('form' => NULL)
    )
  );
}

/**
* my admin settings form
*/
function themedemo_example() {
  $form = array();

  $form['example'] = array(
    '#title' => t('This is just an example'),
    '#type' => 'checkbox',
    '#default_value' => FALSE
  );

  return system_settings_form($form);
}

/**
* The function that has to be registered in hook_theme()
*/
function theme_themedemo_example($form) {
  $form['example']['#description'] = t('This description was added by
the registered theme function.');

  $output = drupal_render($form);
  return $output;
}
?>

I think this is legal Drupal form. But in this case my theme function
do not work. If i remove return system_settings_form($form); and
return $form; only theming function work perfect. Where is problem?

Thanks for advance.

Havran

-- 
Juraj Chlebec aka Havran
http://www.fem.uniag.sk/havran - Havranov mini-blog


More information about the development mailing list