The Drupal process is Core -> Module -> Theme. Trying to work backwards on that route is bad design, and should be avoided at all costs. Modules should not be based on themes, nor should they have any dependencies on themes, as themes are entirely dependent on modules, and downstream of modules.
If you need to make changes based on theme, it should happen in the theme.
Example. In your module, define hook_theme()
function hook_theme($existing, $type, $theme, $path)
{
return array
(
'my_theme_hook' => array
(
// the template will be in [MODULE_ROOT]/templates
'path' => $path . '/templates',
'template' => 'my-theme-hook', // leave off the .tpl.php
),
);
}
The above defines a new theme hook called my_theme_hook
, and the output of that theme hook is built in the template [MODULE_ROOT]/templates/my-theme-hook.tpl.php
Now you can use [MODULE_ROOT]/my-theme-hook.tpl.php
, or even [MODULE_ROOT]/templates/my-theme-hook.tpl.php
(this location works automatically for any templates). Clear your cache, and now the template in your theme will be used instead of the template in the module. Again, don't forget to clear your cache - the template will not be picked up until then.