Commit 4d8e44e5 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Site pages added

parent 775757f1
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
require('init.php');
$smarty = smarty();
$smarty->assign('page_content', get_site_page_content('about'));
$smarty->display('sitepage.tpl');
?>
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
require('init.php');
$smarty = smarty();
$smarty->assign('page_content', get_site_page_content('contactus'));
$smarty->display('sitepage.tpl');
?>
......@@ -42,12 +42,17 @@ if (!$SESSION->is_logged_in()) {
$form = auth_get_login_form();
$form['renderer'] = 'div';
$login_form = form($form);
$pagename = 'loggedouthome';
}
else {
$pagename = 'home';
}
$smarty = smarty();
if (!$SESSION->is_logged_in()) {
$smarty->assign('login_form', $login_form);
}
$smarty->assign('page_content', get_site_page_content($pagename));
$smarty->display('index.tpl');
?>
......@@ -34,6 +34,7 @@ $string['sessiontimedout'] = 'Your session has timed out, please enter your logi
$string['termsandconditions'] = 'Terms and conditions';
$string['uploadcopyright'] = 'Upload copyright';
$string['cancel'] = 'Cancel';
$string['sitecontentnotfound'] = '%s text not available';
// auth
$string['accountexpired'] = 'Sorry, your account has expired';
......
......@@ -583,6 +583,13 @@ function site_content_pages() {
return array('about','home','loggedouthome','privacy','termsandconditions','uploadcopyright');
}
function get_site_page_content($pagename) {
if ($pagedata = @get_record('site_content','name',$pagename)) {
return $pagedata->content;
}
return get_string('sitecontentnotfound','mahara',get_string($pagename));
}
/**
* This function returns the list of plugintypes we currently care about
* @return array of names
......
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
require('init.php');
$smarty = smarty();
$smarty->assign('page_content', get_site_page_content('privacy'));
$smarty->display('sitepage.tpl');
?>
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
require('init.php');
$smarty = smarty();
$smarty->assign('page_content', get_site_page_content('termsandconditions'));
$smarty->display('sitepage.tpl');
?>
<div id="footer">
<a href="">{str tag=termsandconditions}</a>
<a href="">{str tag=privacystatement}</a>
<a href="">{str tag=about}</a>
<a href="">{str tag=contactus}</a>
<a href="terms.php">{str tag=termsandconditions}</a>
<a href="privacy.php">{str tag=privacystatement}</a>
<a href="about.php">{str tag=about}</a>
<a href="contact.php">{str tag=contactus}</a>
</div>
</body>
</html>
......@@ -9,7 +9,7 @@
{include file="adminmenu.tpl"}
<div class="content">
Content from database here
{$page_content}
</div>
{include file="footer.tpl"}
{include file="header.tpl"}
{include file="adminmenu.tpl"}
<div class="content">
{$page_content}
</div>
{include file="footer.tpl"}
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