X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2FMailForm.php;h=8125ebbfd653579c0baa0d053642e982c9c359b8;hb=20231ee0d47146e1ba9b3c9abce17333c7fe4f45;hp=b87d905177400b683b471c2c0f443eaf228adc54;hpb=b2c16bf312cd037e252e568974a5523407e42099;p=diogenes.git diff --git a/plugins/MailForm.php b/plugins/MailForm.php index b87d905..8125ebb 100644 --- a/plugins/MailForm.php +++ b/plugins/MailForm.php @@ -35,16 +35,8 @@ class MailForm extends Diogenes_Plugin_Filter /** Plugin description */ var $description = "This plugin allows you to insert a form to send an e-mail to a fixed recipient. To make use of this plugin, insert {MailForm} in your page where the mail form should appear."; - - /** Constructor. - */ - function MailForm() - { - $this->declareParam('email', ''); - $this->declareParam('title', ''); - $this->declareParam('subject_tag', '[web form]'); - } - + /** Plugin parameters */ + var $params = array('email' => '', 'title' => '', 'subject_tag' => '[web form] '); /** Show an instance of the MailForm plugin. */ @@ -52,9 +44,9 @@ class MailForm extends Diogenes_Plugin_Filter { global $page; - // get parameters - $to_email = $this->getParamValue('email'); - $form_title = $this->getParamValue('title'); + // get params + $to_email = $this->params['email']; + $form_title = $this->params['title']; if (!isvalid_email($to_email)) { return '

You must specify a valid e-mail in the "email" parameter to make use of the MailForm plugin.

'; @@ -88,7 +80,7 @@ class MailForm extends Diogenes_Plugin_Filter $mymail = new HermesMailer(); $mymail->setFrom($from); - $mymail->setSubject($this->getParamValue('subject_tag').$subject); + $mymail->setSubject($this->params['subject_tag'].$subject); $mymail->addTo($to_email); $mymail->setTxtBody($message); $mymail->send();