1
I am going to develop a module for XOOPS and I am going to use smarty on admin pages.
Can I use smarty in this page ?
I tried with the following code, but the smarty seems didnt loaded. Can somebody tell me how to do this ?
include("admin_header.php");
$table_name = $xoopsDB->prefix("prayer_request");
/// draw the header of administrator
// header and footer defined previosly in /include/cp_functions.php
xoops_cp_header();
/*** administrator content goes here ***/
$smarty = new Smarty();
echo dirname(__FILE__).'/templates/admin_prayer_request.html';
$smarty->display(dirname(__FILE__).'/templates/admin_prayer_request.html');
echo '
';
print_r($smarty) ;
/*** administrator content end here ***/
// draw the footer of administrator
xoops_cp_footer();
?>
admin_header.php
include "../../../mainfile.php";
include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php";
include_once XOOPS_ROOT_PATH."/class/smarty/Smarty.class.php";
include XOOPS_ROOT_PATH."/include/cp_functions.php";
if ( $xoopsUser ) {
$xoopsModule = XoopsModule::getByDirname("myModule");
if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
} else {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) {
include "../language/".$xoopsConfig['language']."/main.php";
} else {
include "../language/english/main.php";
}
?>