Remove SessionManager and placeholders. (Will be implemented in
JavaScript later.)
This commit is contained in:
parent
608854b57d
commit
06d664ceb2
@ -202,22 +202,19 @@
|
|||||||
"title": "Name on Ticket",
|
"title": "Name on Ticket",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 4,
|
"group": 4
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_name": {
|
"underName_name": {
|
||||||
"title": "Name on Reservation",
|
"title": "Name on Reservation",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 5,
|
"group": 5
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 5,
|
"group": 5
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Booking URL",
|
"title": "Booking URL",
|
||||||
|
@ -260,15 +260,13 @@
|
|||||||
"title": "Ticket holder",
|
"title": "Ticket holder",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": true,
|
"required": true,
|
||||||
"group": 3,
|
"group": 3
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 3,
|
"group": 3
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Reservation URL",
|
"title": "Reservation URL",
|
||||||
|
@ -235,15 +235,13 @@
|
|||||||
"title": "Name on Reservation",
|
"title": "Name on Reservation",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": true,
|
"required": true,
|
||||||
"group": 5,
|
"group": 5
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 5,
|
"group": 5
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Booking URL",
|
"title": "Booking URL",
|
||||||
|
@ -187,15 +187,13 @@
|
|||||||
"title": "Name on Reservation",
|
"title": "Name on Reservation",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": true,
|
"required": true,
|
||||||
"group": 2,
|
"group": 2
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 2,
|
"group": 2
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Booking URL",
|
"title": "Booking URL",
|
||||||
|
@ -237,15 +237,13 @@
|
|||||||
"title": "Name on Reservation",
|
"title": "Name on Reservation",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": true,
|
"required": true,
|
||||||
"group": 2,
|
"group": 2
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 2,
|
"group": 2
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Booking URL",
|
"title": "Booking URL",
|
||||||
|
@ -161,15 +161,13 @@
|
|||||||
"title": "Name on Reservation",
|
"title": "Name on Reservation",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": true,
|
"required": true,
|
||||||
"group": 2,
|
"group": 2
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 2,
|
"group": 2
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Booking URL",
|
"title": "Booking URL",
|
||||||
|
@ -223,22 +223,19 @@
|
|||||||
"title": "Name on Ticket",
|
"title": "Name on Ticket",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 4,
|
"group": 4
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_name": {
|
"underName_name": {
|
||||||
"title": "Name on Reservation",
|
"title": "Name on Reservation",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 5,
|
"group": 5
|
||||||
"default": "USER_NAME"
|
|
||||||
},
|
},
|
||||||
"underName_email": {
|
"underName_email": {
|
||||||
"title": "Email address",
|
"title": "Email address",
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"required": false,
|
"required": false,
|
||||||
"group": 5,
|
"group": 5
|
||||||
"default": "USER_EMAIL"
|
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"title": "Booking URL",
|
"title": "Booking URL",
|
||||||
|
15
index.php
15
index.php
@ -3,7 +3,6 @@
|
|||||||
require_once __DIR__ . '/vendor' . '/autoload.php';
|
require_once __DIR__ . '/vendor' . '/autoload.php';
|
||||||
|
|
||||||
use \Frs\FieldDefinition;
|
use \Frs\FieldDefinition;
|
||||||
use \Frs\SessionManager;
|
|
||||||
use \Frs\Output\HtmlOutput;
|
use \Frs\Output\HtmlOutput;
|
||||||
use \Frs\Output\MailOutput;
|
use \Frs\Output\MailOutput;
|
||||||
use \Frs\Output\Transport\StdoutTransport;
|
use \Frs\Output\Transport\StdoutTransport;
|
||||||
@ -12,8 +11,6 @@ use \Frs\Output\Transport\GScriptTransport;
|
|||||||
$stdout = new StdoutTransport();
|
$stdout = new StdoutTransport();
|
||||||
$ho = new HtmlOutput($stdout, dirname(__FILE__) . '/templates');
|
$ho = new HtmlOutput($stdout, dirname(__FILE__) . '/templates');
|
||||||
|
|
||||||
$sm = new SessionManager();
|
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
if (isset($_GET['action'])) {
|
if (isset($_GET['action'])) {
|
||||||
$action = $_GET['action'];
|
$action = $_GET['action'];
|
||||||
@ -28,10 +25,7 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'send':
|
case 'send':
|
||||||
// Store input in session, in case something happens
|
|
||||||
$sm->storeFormData($_POST['form_type']);
|
|
||||||
echo 'This would send the mail...';
|
echo 'This would send the mail...';
|
||||||
//$mt = new MailTransport($sm);
|
|
||||||
$mt = new GScriptTransport();
|
$mt = new GScriptTransport();
|
||||||
$mo = new MailOutput($mt, dirname(__FILE__) . '/templates');
|
$mo = new MailOutput($mt, dirname(__FILE__) . '/templates');
|
||||||
$form_type = $_REQUEST['form_type'];
|
$form_type = $_REQUEST['form_type'];
|
||||||
@ -68,16 +62,7 @@ switch ($action) {
|
|||||||
$ho->setTemplate($action . '_html');
|
$ho->setTemplate($action . '_html');
|
||||||
$skey = 'form_' . $action;
|
$skey = 'form_' . $action;
|
||||||
|
|
||||||
$placeholders = array(
|
|
||||||
'USER_NAME' => '',
|
|
||||||
'USER_EMAIL' => '',
|
|
||||||
);
|
|
||||||
$fd = new FieldDefinition($action);
|
$fd = new FieldDefinition($action);
|
||||||
$fd->setPlaceholders($placeholders);
|
|
||||||
if (isset($_SESSION[$skey])) {
|
|
||||||
$fd->setFieldValues($_SESSION[$skey]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$by_group = $fd->getGroups();
|
$by_group = $fd->getGroups();
|
||||||
|
|
||||||
// Convert hash to list for Mustache compatibility
|
// Convert hash to list for Mustache compatibility
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Frs;
|
|
||||||
|
|
||||||
class SessionManager
|
|
||||||
{
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function storeFormData($form_type)
|
|
||||||
{
|
|
||||||
$skey = 'form_' . $form_type;
|
|
||||||
$_SESSION[$skey] = $_POST;
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user