Update of /cvsroot/openfirst/base/config
In directory sc8-pr-cvs1:/tmp/cvs-serv3754
Added Files:
modules.php
Log Message:
Initial upload. Has bugs needs to be fixed.
--- NEW FILE: modules.php ---
<?php
/*
* openFIRST.base - config/install.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: Tim Ginn <tim...@po...>
*
* 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.
* 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
*
*/
// Purpose: set up OpenFIRST modules -- currently only installs MySQL tables
include("../config/globals.php");
include($header);
membersmenu($user->membertype);
if($user->membertype == "administrator") {
if(ISSET($_POST['update'])){
$query = mysql_query("SELECT * FROM ofirst_config");
while($module = mysql_fetch_object($query)){
if(ISSET($_POST[$module->modulename.'-active'])){ $active = "1"; }else{ $active = "0"; }
if(ISSET($_POST[$module->modulename.'-showonmenu'])){ $showonmenu = "1"; }else{ $showonmenu = "0"; }
mysql_query("UPDATE ofirst_config WHERE modulename='".$module->modulename."' SET
modulename ='".$_POST[$module->modulename.'-modulename']."',
modulename ='".$_POST[$module->modulename.'-modulenavigation']."',
modulename ='".$_POST[$module->modulename.'-adminnavigation']."',
modulename ='".$_POST[$module->modulename.'-includes']."',
showonmenu ='".$showonmenu."',
active ='".$active."'");
}
}
?>
<h1>SQL Install</h1>
<p>This utility will create the tables required for certain openFIRST
components to run. Select the SQL scripts you would like to
install...</p>
<form method="post" action="dd">
<table width="52%" align="center">
<tr>
<td width="32%">Module Name</td>
<td width="14%">Activate</td>
<td width="19%">Show Menu</td>
<td width="35%">Includes</td>
</tr>
<?php
$query = mysql_query("SELECT * FROM ofirst_config");
while($module = mysql_fetch_object($query)){
?>
<tr>
<td><input name="<?php echo $module->modulename; ?>-modulename" type="text" id="modulename" value="<?php echo $module->modulename; ?>"></td>
<td><input name="<?php echo $module->modulename; ?>-active" type="checkbox" id="active" value="checkbox" <?php if((bool) $module->active == true){ echo "checked"; } ?>></td>
<td><input name="<?php echo $module->modulename; ?>-showonmenu" type="checkbox" id="showonmenu" value="checkbox" <?php if((bool) $module->showonmenu == true){ echo "checked"; } ?>></td>
<td><input name="<?php echo $module->modulename; ?>-includes" type="text" id="includes" value="<?php echo $module->includes; ?>" size="30"></td>
</tr>
<?php } ?>
</table>
<br />
<input type="submit" value="Update Values" />
</form>
<?php } else {
showlogin();
}
include($footer); ?>
|