Remove SessionManager and placeholders. (Will be implemented in

JavaScript later.)
This commit is contained in:
2017-02-06 23:36:30 +01:00
parent 608854b57d
commit 06d664ceb2
9 changed files with 16 additions and 64 deletions

View File

@@ -3,7 +3,6 @@
require_once __DIR__ . '/vendor' . '/autoload.php';
use \Frs\FieldDefinition;
use \Frs\SessionManager;
use \Frs\Output\HtmlOutput;
use \Frs\Output\MailOutput;
use \Frs\Output\Transport\StdoutTransport;
@@ -12,8 +11,6 @@ use \Frs\Output\Transport\GScriptTransport;
$stdout = new StdoutTransport();
$ho = new HtmlOutput($stdout, dirname(__FILE__) . '/templates');
$sm = new SessionManager();
$action = '';
if (isset($_GET['action'])) {
$action = $_GET['action'];
@@ -28,10 +25,7 @@ switch ($action) {
break;
case 'send':
// Store input in session, in case something happens
$sm->storeFormData($_POST['form_type']);
echo 'This would send the mail...';
//$mt = new MailTransport($sm);
$mt = new GScriptTransport();
$mo = new MailOutput($mt, dirname(__FILE__) . '/templates');
$form_type = $_REQUEST['form_type'];
@@ -68,16 +62,7 @@ switch ($action) {
$ho->setTemplate($action . '_html');
$skey = 'form_' . $action;
$placeholders = array(
'USER_NAME' => '',
'USER_EMAIL' => '',
);
$fd = new FieldDefinition($action);
$fd->setPlaceholders($placeholders);
if (isset($_SESSION[$skey])) {
$fd->setFieldValues($_SESSION[$skey]);
}
$by_group = $fd->getGroups();
// Convert hash to list for Mustache compatibility