Commit e82df059 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files
parents 11a8f22c 9da15c03
......@@ -73,7 +73,6 @@ if ($itemid == 'new') {
}
else {
$data->id = $itemid;
log_debug($data);
try {
update_record('site_menu', $data, 'id');
}
......
......@@ -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');
?>
......@@ -108,12 +108,18 @@ $string['forgotpassemailmessagehtml'] = '<p>Dear $fullname,</p>
<p><a href="' . get_config('wwwroot') . 'forgotpass.php?key=%s">' . get_config('wwwroot') . 'forgotpass.php?key=%s</a></p>';
// Admin menu editor
$string['adminfile'] = 'Admin file';
$string['externallink'] = 'External link';
$string['type'] = 'Type';
$string['name'] = 'Name';
$string['noadminfiles'] = 'No admin files';
$string['linkedto'] = 'Linked to';
//$string['menueditor'] = 'Menu editor';
$string['adminfile'] = 'Admin file';
$string['externallink'] = 'External link';
$string['type'] = 'Type';
$string['name'] = 'Name';
$string['noadminfiles'] = 'No admin files';
$string['linkedto'] = 'Linked to';
$string['add'] = 'Add';
$string['delete'] = 'Delete';
$string['edit'] = 'Edit';
$string['loggedinmenu'] = 'Logged in menu';
$string['loggedoutmenu'] = 'Logged out menu';
// Admin site page editor
$string['discardpageedits'] = 'Discard your changes to this page?';
......@@ -121,6 +127,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';
......
......@@ -916,7 +916,6 @@ function main_nav() {
* @return $menu a data structure containing the site menu
*/
function site_menu() {
//$wwwroot = get_config('wwwroot'); (int)
global $SESSION;
$menu = array();
if ($menuitems = @get_records('site_menu','public',(int) !$SESSION->is_logged_in(),'displayorder')) {
......@@ -929,6 +928,8 @@ function site_menu() {
}
return $menu;
}
/**
* Always use this function for all emails to users
*
......
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