Help me figure out why isn't my form getting styled a la sites/all/modules/pecapture/themes/pecapture-displayform.tpl.php
Here's my code:
/**
* Implementation of hook_theme()
*/
function pecapture_theme() {
$path = drupal_get_path('module', 'pecapture') . '/theme';
return array(
'pecapture_displayform' => array(
'arguments' => array('form' => NULL),
'template' => 'pecapture-displayform',
'path' => $path,
),
);
}
Basically this says that theme files are in the module/theme folder ($path)
There is a theme function pecapture_displayform($form = NULL), called using theme('pecapture_displayform', $form) where $form is a Drupal form array
There is a template file pecapture_displayform.tpl.php at $path
function pecapture_block($op = 'list', $delta = 0, $edit = array()) {
$block = array();
if ($op == "list") { // Generate listing of blocks from this module, for the admin/block page
$block[0]["info"] = t('Persistent E-mail Capture Form Block');
}
else /* if ($op == 'view') */ { // Generate our block content
$block['subject'] = ''; //'Persistent E-mail Capture Form';
$block['content'] = pecapture_displayForm();
}
return $block;
} // function pecapture_block
This says that when you are viewing the block, use the function pecapture_displayForm() to generate the contents. $block gets php print()ed
/**
* Callback for pecapture_theme
*/
function pecapture_displayform() {
return drupal_get_form('pecapture_blockform');
}
This says return the html formatted drupal form array (for output)
function pecapture_blockform(&$form_state) {
/* the form, standard ... */
This is the form contents, it's typical.
I've tried calling the theme function explicitly in pecapture_displayform:
return theme('pecapture_displayform', $form);
and
return theme('pecapture_displayform', drupal_get_form($form));
So why is the form not going through pecapture-displayform.tpl.php ?