7
Have a look at the admin templates of debaser 0.9 BETA (
click).
Here is the shortest snippet I found in this module regarding the use of smarty and templates on the admin side:
function playermanager() {
require_once XOOPS_ROOT_PATH.'/class/template.php';
if (!isset($xoopsTpl)) {
$xoopsTpl = new XoopsTpl();
}
global $xoopsDB, $genrelist;
$sql = 'SELECT name FROM '.$xoopsDB->prefix('debaser_player').' ORDER BY name';
$result = $xoopsDB->query($sql);
while (list($player) = $xoopsDB->fetchRow($result)) {
$xoopsTpl->append('player', $player);
}
$nuform = new XoopsThemeForm(_AM_DEBASER_NEWPLAYER, "newplayerform", "index.php");
$formplayername = new XoopsFormText(_AM_DEBASER_NAME, "newplayername", 50, 50);
$formplayercode = new XoopsFormTextArea (_AM_DEBASER_CODE, 'newplayer', '', 15, 30);
$op_hidden = new XoopsFormHidden("op", "newplayer");
$submit_button = new XoopsFormButton("", "dbsubmit", _SUBMIT, "submit");
$nuform->addElement($formplayername);
$nuform->addElement($formplayercode);
$nuform->addElement($op_hidden);
$nuform->addElement($submit_button);
$xoopsTpl->assign('newplayer', $nuform->render());
$xoopsTpl->assign('adminmenu', debaseradminMenu(3, _AM_DEBASER_EDITPLAYERS));
$xoopsTpl->display( 'db:debaser_amplaymanage.html' );
}