<?php

#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# About Site@School:
# Original Idea: Mark de Haan (mark@starwave.nl)
# PHP coding & Design: Fred Stuurman (fc.stuurman@hccnet.nl)
# Comissioned by: Stadsdeel de Baarsjes, Amsterdam, Netherlands
#############################################################################
# admin.php: last changed 04/10/2006  , version: 2.4.10
#              by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: admin.php,v 1.2 2006/10/15 19:08:54 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 (IsSet ($_POST['path']))
{
	$path = $_POST['path'];
}

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");

if (file_exists("languages/" . $language . "/include/" . $language . ".php"))
{
	include ("languages/" . $language . "/include/" . $language . ".php");
}
else
{
	include ("languages/EN/include/EN.php");
}

$query = "SELECT name FROM $table_modules where id=$module";
$result = mysql_query($query) or die_script(mysql_error());
$modulename = mysql_result($result, 0);
unset ($query);
unset ($result);

if ($modoption == "saveconfig")
{
	mysql_query("UPDATE $table_configuration SET config_value='$path' WHERE config_key='include_module_path'");
	print "<span class=\"heading\">$modulename<br><br></span>";
	print "<span class=\"text\">" . $sas_lang['include_module_saved'] . "</span>";
	print "\n<p><input type=\"button\" value=\"&nbsp;&nbsp;&nbsp;" . $sas_lang['goback'] . "\" name=\"backbutton\" onClick=\"javascript:parent.location='index.php?option=modulemanager';\" class=\"backbutton\">";
	exit;
}

print "<FORM METHOD=\"POST\" ACTION=\"index.php?option=modulemanager&module=$module&modoption=saveconfig\">";
print "<span class=\"heading\">$modulename<br><br></span>";
print "<span class=\"text\">" . $sas_lang['include_module_header'] . "<br><br>";
print $sas_lang['include_module_path'] . ":</span><br><input type=text size=80 class=\"textfield\" name=\"path\" value=\"" . $sas_config['include_module_path'] . "\"><br><br></span>";
print "<br><input type=\"button\" value=\"&nbsp;&nbsp;&nbsp;" . $sas_lang['goback'] . "\" name=\"backbutton\" onClick=\"javascript:parent.location='index.php?option=modulemanager';\" class=\"backbutton\">";
print "\n&nbsp;<input type=\"submit\" value=\"&nbsp;&nbsp;&nbsp;" . $sas_lang['save'] . "\" name=\"savebutton\" class=\"savebutton\">";
print "</form>";

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