3
It works now, but you have to add some code. Here's an example:
require_once 'admin_header.php';
require_once XOOPS_ROOT_PATH . '/class/template.php';
...
xoops_cp_header();
...
if (!isset($xoopsTpl)) {
$xoopsTpl = new XoopsTpl();
}
$xoopsTpl->xoops_setCaching(0);
...
$xoopsTpl->assign('foo', $bar);
$xoopsTpl->display('db:admin/tpl1.html');
...
xoops_cp_footer();
admin_header.php contains:
<?php
require_once '../../../include/cp_header.php';
?>
The "if (!isset($xoopsTpl)) {" is an attempt at upward-compatibilty with future versions of XOOPS that have built-in support for admin templates.
Note that in the above example, the template admin/tpl1.html is in a subdirectory "admin" of the module's templates directory.
The template is also defined in the module's xoops_version.php:
$modversion['templates'][8]['file'] = 'admin/tpl1.html';
$modversion['templates'][8]['description'] = _MI_MODNAME_ADMIN_TPL1;
-----
P.S. I didn't figure all of this out by myself. The procedure was described in other posts.