[solved] My First Admin Module
Posted: Fri Sep 25, 2009 12:55 pm
I've made my first module, I am trying to improve it to use the provided classes properly. I am only looking at the Admin side and I want to be able to save preferences and add items to an SQL Table.
I have got the Install and Uninstall modules working, creating and dropping the SQL tables, setting some default preferences and creating permissions.
I have created an action.adminDefault.php and I have successfully created Tabs in the Admin interface. The first tab for example says:
So I now have a "function.sendmail.php" which says
So I have a "templates/admin_sendmail.tpl" file that has
I now successfully have an admin page that has a single input box and a submit button.
My question is, where do I put my code to pick up the results of the Submit? What procedure/file do I use to get the inforamtion that was put in the 'sendmail_subject' input box?
Many thanks
Colin
I have got the Install and Uninstall modules working, creating and dropping the SQL tables, setting some default preferences and creating permissions.
I have created an action.adminDefault.php and I have successfully created Tabs in the Admin interface. The first tab for example says:
Code: Select all
echo $this->StartTab('sendmail', $params);
include dirname(__FILE__).'/function.sendmail.php';
echo $this->EndTab();
Code: Select all
$smarty->assign('startform', $this->CreateFormStart($id, 'sendemail'));
$smarty->assign('endform', $this->CreateFormEnd());
...
$smarty->assign('title_subject', $this->Lang('subject'));
$smarty->assign('input_subject', $this->CreateInputText($id,'formsubmit_subject','',50,128));
...
$smarty->assign('submit', $this->CreateInputSubmit($id, 'sendmail_submitbutton', $this->Lang('send')));
echo $this->ProcessTemplate ('admin_sendmail.tpl');
Code: Select all
{$startform}
<div class="pageoverflow">
<p class="pagetext">{$title_subject}:</p>
<p class="pageinput">{$input_subject}</p>
</div>
<div class="pageoverflow">
<p class="pagetext"> </p>
<p class="pageinput">{$submit}</p>
</div>
{$endform}
My question is, where do I put my code to pick up the results of the Submit? What procedure/file do I use to get the inforamtion that was put in the 'sendmail_subject' input box?
Many thanks
Colin