Hi,
I'm currently trying to convert my base theme Opengrid to D7, the problem I have is with a custom theme function that displays a group of fields in a table, I been reading about the changes in the theme_table and hook_theme functions in D7 but still I can't make it work. Here is my code:
This is placed in the theme_settings.php file, this is the call to the function,
<?php
...
// Grids Fieldset
$form[$key .'_layout']['grids_settings'] = array(
'#type' => 'fieldset',
'#theme' => 'grids_settings_table',
);
...
?>
in the template.php file
hook_theme function,
/**
* Implements HOOK_theme().
*/
function opengrid_theme(&$existing, $type, $theme, $path) {
return array
(
'grids_settings_table' => array
(
'render element' => 'form',
),
);
}
finally the theme function itself,
/**
* Returns a table to configure grid settings.
*/
function opengrid_grids_settings_table($variables){
$form = $variables['form'];
$rows = array();
$header = array (
t('Region'),
t('Width'),
t('Prefix'),
t('Suffix'),
t('Push'),
t('Pull'),
t('Extras'),
);
foreach (element_children($form) as $key) {
$name = $form[$key]['grid']['#title'];