<?php

#############################################################################
#                              Site@School Sitemap module
# Site@School is a website management system designed for schools.
# This is a sitemap module which can be used in Site@School.
#
# coded by Fred Stuurman (fc.stuurman@hccnet.nl)
############################################################################
# admin.php: last changed 27/04/2005  version 1.0.2
#                  by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: admin.php,v 1.1 2006/10/03 10:34:55 fstuurman Exp $
############################################################################
#                        LICENSE INFORMATION
#
# 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##############################################################################
if (!defined('IN_SAS'))
{
	die("Hacking attempt");
}

if (!get_magic_quotes_gpc())
{
	$welcometext = addslashes($_POST['welcometext']);
}
else
{
	$welcometext = $_POST['welcometext'];
}

load_language('', 'sn_sitemap'); //load language file

include ("interface/header.inc.php");
include ("interface/menubar.inc.php");
include ("interface/menustart.inc.php");
include ("interface/menuend.inc.php");
include ("interface/pagestart.inc.php");
$query = "SELECT name FROM $table_modules where id=$module";
$result = mysql_query($query) or die_script($query, mysql_error());
$modulename = mysql_result($result, 0);
unset ($query);
unset ($result);

print "<span class=\"heading\">$modulename " . $sas_lang['configuration'] . "<br><br></span>";

if ($modoption == "saveconfig")
{
	mysql_query("UPDATE $table_configuration SET config_value='$welcometext' where config_key='sitemap_welcome_text'");
	print "<span class=\"text\">" . $sas_lang['configuration_saved'] . "<p></span>";
	$sas_config['sitemap_welcome_text'] = stripslashes($welcometext);
}

print "<FORM METHOD=\"POST\" ACTION=\"index.php?option=modulemanager&module=$module&modoption=saveconfig\">
         <span class=\"text\">" . $sas_lang['sitemap_welcome_text'] . "<br>";
print "<textarea cols=\"70\" rows=\"8\" name=\"welcometext\">" . $sas_config['sitemap_welcome_text'] . "</textarea><br><br>\n";
print "\n&nbsp;</span><input type=\"button\" value=\"&nbsp;&nbsp;&nbsp;" . $sas_lang['goback'] . "\" name=\"backbutton\" 
         onClick=\"javascript:parent.location='index.php?option=modulemanager';\" class=\"backbutton\">
         &nbsp;&nbsp;&nbsp;<input type=\"submit\" value=\"&nbsp;&nbsp;&nbsp;" . $sas_lang['save'] . "\" name=\"savebutton\" class=\"savebutton\"></form>";

include ("interface/pageend.inc.php");
include ("interface/footer.inc.php");
?>