Revert "* initial work towards factorizing the controllers (yeah, now it's tsControll...
[vsc.git] / _pages / contact / code.php
blob75b797c9b5cea5197dc058fa06a3c28215f0d51e
1 <?php
2 class contact extends tsPage{
3 public function __construct(){
4 $this->varArray['Contact'];
6 parent::__construct();
7 $action = tsPage::getRequest ('do');
9 if (empty($action))
10 $action = 'display';
12 $this->$action();
14 $this->varArray['footer'] = dirname(__FILE__).'/pages/footer.tpl';
17 private function display() {
18 $this->varArray['action'] = tsPage::setRequest ('contact', array('do' => 'send'));
19 $this->varArray['contentFile'] = dirname(__FILE__).'/pages/form.tpl';
22 private function send() {
23 $m = tsPage::getRequest('m');
24 $t = tsPage::getRequest('t');
26 @mail (C_SYSTEM_EMAIL, 'Mesaj de la '.$m, $t, 'From:'.$m.'\r\nReply-to:'.$m);
28 tsPage::redirect (tsPage::setRequest ('contact', array ('do' => 'thank')));
32 private function thank() {
33 $this->varArray['contentFile'] = dirname(__FILE__).'/pages/thank.tpl';