I have the editable database template working in the SVN version of the gastbuch module.
It's all working, but there's a small glitch: I loose the breadcrumbs when the apply button is clicked (when the form is posted - a redirect takes place after the cancel and sumbit buttons are clicked and the breadcrumbs show up then, in this case of the apply button not).
I'm not at all familiar with the form functions of CMSMS modules, so I'm probably forgetting something.
What I did was simply adding a form in the same way as is done in the MenuManager module, using:
Code: Select all
$this->smarty->assign('startform', $this->CreateFormStart($id, 'admin_template', $returnid));
and handle the post in an action.admin_template.php file.
This is the full function:
Code: Select all
function DisplayAdminTemplate($id, &$params, $returnid, $message='')
{
$content = $this->getTemplate('guestbookentry_template');
$this->DisplayAdminNav($id, $params, $returnid);
$this->smarty->assign('startform', $this->CreateFormStart($id, 'admin_template', $returnid));
$this->smarty->assign('endform', $this->CreateFormEnd());
$this->smarty->assign('content', $this->Lang('templatecontent'));
$this->smarty->assign('inputcontent', $this->CreateTextArea(false, $id, $content, 'templatecontent'));
$this->smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit')));
$this->smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel')));
$this->smarty->assign('apply', $this->CreateInputSubmit($id, 'apply', lang('apply')));
echo $this->ProcessTemplate('edittemplate.tpl');
}
Anyone an idea?