Commit 2be7aea1 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Contact us form

parent ec519bf3
......@@ -28,9 +28,65 @@ define('INTERNAL', 1);
define('PUBLIC', 1);
require('init.php');
require_once('form.php');
if ($SESSION->is_logged_in()) {
$name = fullname($USER);
$email = $USER->email;
}
else {
$name = '';
$email = '';
}
$contactform = form(array(
'name' => 'contactus',
'method' => 'post',
'action' => '',
'submit' => false,
'autofocus' => '', // only for testing for now
'elements' => array(
'name' => array(
'type' => 'text',
'title' => get_string('name'),
'value' => $name,
'rules' => array(
'required' => true
),
),
'email' => array(
'type' => 'text',
'title' => get_string('email'),
'value' => $email,
'rules' => array(
'required' => true
),
),
'subject' => array(
'type' => 'text',
'title' => get_string('subject'),
'value' => '',
),
'message' => array(
'type' => 'textarea',
'rows' => 10,
'cols' => 60,
'title' => get_string('message'),
'value' => '',
'rules' => array(
'required' => true
),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('submitcontactinformation')
),
)
));
$smarty = smarty();
$smarty->assign('page_content', get_site_page_content('contactus'));
$smarty->assign('page_content', $contactform);
$smarty->assign('site_menu', site_menu());
$smarty->display('sitepage.tpl');
?>
......@@ -121,6 +121,13 @@ $string['pagecontents'] = 'Text to appear on the page';
$string['pagename'] = 'Page name';
$string['pagetext'] = 'Page text';
// Contact us form
$string['name'] = 'Name';
$string['email'] = 'Email';
$string['subject'] = 'Subject';
$string['message'] = 'Message';
$string['submitcontactinformation'] = 'Submit contact information';
// mahara.js
$string['namedfieldempty'] = 'The required field "%s" is empty';
$string['processingform'] = 'Processing form';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment