From 77bc692bb7694aa635be1ca3752894e976477ebb Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 15 Aug 2008 13:32:35 +0000 Subject: Central: Moved over to Four Island Templating system Borrowed the Four Island templating system code so as to ease the creation of frontends. index.php and activate.php have already been converted, and install.php will not be converted (because it would be too difficult, and who would want to skin it anyway?) NOTICE: The Four Island Templating system source code is copyrighted by Starla Insigna (c) 2008. All rights reserved. Use of this code in part or in whole apart from the InstaDisc Central Server is a direct violation of copyright law. You have been warned. Refs #25 --- central/trunk/activate.php | 81 ++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 53 deletions(-) (limited to 'central/trunk/activate.php') diff --git a/central/trunk/activate.php b/central/trunk/activate.php index c8d4aa0..7b319b5 100644 --- a/central/trunk/activate.php +++ b/central/trunk/activate.php @@ -3,6 +3,7 @@ /* InstaDisc Server - A Four Island Project */ include('instadisc.php'); +include('template.php'); if (!isset($_GET['submit'])) { @@ -27,21 +28,9 @@ if (!isset($_GET['submit'])) { if (instaDisc_activateAccount($_POST['username'], $_POST['code'])) { -?> - - - <?php echo(instaDisc_getConfig('siteName')); ?> InstaDisc Central Server - - -
-

InstaDisc Activation

- -

Thank you for activating! You've now been signed up for the InstaDisc service. - You will recieve an email with the information to input into your InstaDisc client. -

- - -add('SITENAME', instaDisc_getConfig('siteName')); + $template->display(); } else { addError($numOfErrors, $errors, '', 'The email could not be sent'); showForm($_POST['username'], $_POST['code'], $errors); @@ -54,46 +43,30 @@ if (!isset($_GET['submit'])) function showForm($username, $code, $errors) { -?> - - - <?php echo(instaDisc_getConfig('siteName')); ?> InstaDisc Central Server - - - -
-

InstaDisc Activation

- -

If you've already registered and an activation email has been sent to your address, please fill in the form below. -

- -
-add('SITENAME', instaDisc_getConfig('siteName')); + if (isset($errors[1])) { -?>
Uh oh! Validation errors!

-

    adds('ERROR', array('ex'=>'1')); + foreach ($errors as $name => $value) { -?>
  1. adds('ERRORS', array( 'NAME' => $name, + 'MSG' => $value['msg'])); } -?>
-
User Details -
- - -
-
- - -
-
-
- - -
add('USERNAME_ERR', ifErrors($errors, 'username')); + $template->add('CODE_ERR', ifErrors($errors, 'code')); + + doErrors($template, $errors, 'username'); + doErrors($template, $errors, 'code'); + + $template->add('USERNAME', $username); + $template->add('CODE', $code); + + $template->display(); } function ifErrors($errors, $id) @@ -102,19 +75,21 @@ function ifErrors($errors, $id) { if ($value['field'] == $id) { - echo(' error'); - return; + return ' error'; } } + + return ''; } -function doErrors($errors, $id) +function doErrors($template, $errors, $id) { foreach ($errors as $name => $value) { if ($value['field'] == $id) { -?>

*

adds(strtoupper($id) . '_ERRS', array( 'NAME' => $name, + 'VALUE' => $value['msg'])); } } } -- cgit 1.4.1