[Openfirst-cvscommit] base/config modules.php,1.11,1.12
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2005-11-22 16:22:03
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22457/config Modified Files: modules.php Log Message: A readability/performance enhancement Index: modules.php =================================================================== RCS file: /cvsroot/openfirst/base/config/modules.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** modules.php 19 Oct 2005 04:18:00 -0000 1.11 --- modules.php 22 Nov 2005 16:21:55 -0000 1.12 *************** *** 1,105 **** ! <?php ! /* ! * openFIRST.base - config/modules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Dave DiBiase <dav...@ea...> ! * ! * 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: configure OpenFIRST modules, including their position on menus ! ! include("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include($Header); ! ! // Check if user wishes to make updates ! if(isset($_POST['update'])) { ! ! // Query for current module information and loop through with while ! foreach($ogModuleManager->getDirs() as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! $name = $mod->getDir(); ! // Set values to update db for checkboxes ! if ( isset($_POST[$name.'-active']) ) { ! $active = true; ! ! } else { ! $active = false; ! } ! $mod->setActive($active); ! if( isset($_POST[$name.'-showonmenu']) ) { ! $showonmenu = true; ! } else { ! $showonmenu = false; ! } ! $mod->setShowOnMenu($showonmenu); ! } ! ! // Successful creation response and die with footers. ! echo "<p>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]</p>"; ! include($Footer); ! die; ! ! } ! ?> ! ! <h1>Module Administrator</h1> ! <p>This utility will allow you to manage modules for certain openFIRST components.<br> ! This includes enabling them, and setting them to be displayed on the menus.</p> ! ! <?php ! // Get module information and output values ! $mods = $ogModuleManager->getDirs(); ! // Make sure that module exists (bug #124) ! if (count($mods) == 0) ! { ! echo "<p class='error'>Please install modules before administrating them! [ <a href='install.php'>Install Component</a> ]</p>"; ! include($footer); ! die; ! } ! ?> ! <form method="post" action="modules.php"> ! <table> ! <tr> ! <th>Module Name</th> ! <th>Activate</th> ! <th>Show Menu</th> ! </tr> ! <?php ! foreach($mods as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! ?> ! <tr> ! <td><input name="<?php echo $mod->getDir(); ?>-modulename" type="text" id="modulename" value="<?php echo $mod->getName(); ?>"></td> ! <td bgcolor='<?php if ($mod->getActive()){ echo "#00FF00"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-active" type="checkbox" id="active" value="checkbox" <?php if ($mod->getActive()) { echo "checked='checked'"; } ?>></td> ! <td bgcolor='<?php if ($mod->getShowOnMenu()) { echo "#00FF00"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-showonmenu" type="checkbox" id="showonmenu" value="checkbox" <?php if($module->getShowOnMenu()) { echo "checked='checked'"; } ?>></td> ! </tr> ! <?php ! } ! ?> ! </table> ! <br> ! <input type="submit" name="update" value="Update Values" /> ! </form> ! ! <?php include($Footer); ?> \ No newline at end of file --- 1,107 ---- ! <?php ! /* ! * openFIRST.base - config/modules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Dave DiBiase <dav...@ea...> ! * ! * 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: configure OpenFIRST modules, including their position on menus ! ! include("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include($Header); ! ! // Check if user wishes to make updates ! if(isset($_POST['update'])) { ! ! // Query for current module information and loop through with while ! foreach($ogModuleManager->getDirs() as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! $name = $mod->getDir(); ! // Set values to update db for checkboxes ! if ( isset($_POST[$name.'-active']) ) { ! $active = true; ! ! } else { ! $active = false; ! } ! $mod->setActive($active); ! if( isset($_POST[$name.'-showonmenu']) ) { ! $showonmenu = true; ! } else { ! $showonmenu = false; ! } ! $mod->setShowOnMenu($showonmenu); ! } ! ! // Successful creation response and die with footers. ! echo "<p>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]</p>"; ! include($Footer); ! die; ! ! } ! ?> ! ! <h1>Module Administrator</h1> ! <p>This utility will allow you to manage modules for certain openFIRST components.<br> ! This includes enabling them, and setting them to be displayed on the menus.</p> ! ! <?php ! // Get module information and output values ! $mods = $ogModuleManager->getDirs(); ! // Make sure that module exists (bug #124) ! if (count($mods) == 0) ! { ! echo "<p class='error'>Please install modules before administrating them! [ <a href='install.php'>Install Component</a> ]</p>"; ! include($footer); ! die; ! } ! ?> ! <form method="post" action="modules.php"> ! <table> ! <tr> ! <th>Module Name</th> ! <th>Activate</th> ! <th>Show Menu</th> ! </tr> ! <?php ! foreach($mods as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! $show = $mod->getShowOnMenu(); ! $act = $mod->getActive(); ! ?> ! <tr> ! <td><input name="<?php echo $mod->getDir(); ?>-modulename" type="text" id="modulename" value="<?php echo $mod->getName(); ?>"></td> ! <td bgcolor='<?php if ($act ) { echo "lime"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-active" type="checkbox" id="<?php echo $mod->getDir(); ?>-active" value="checkbox" <?php if ($act) { echo "checked='checked'"; } ?>></td> ! <td bgcolor='<?php if ($show) { echo "lime"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-showonmenu" type="checkbox" id="<?php echo $mod->getDir(); ?>-showonmenu" value="checkbox" <?php if ($show) { echo "checked='checked'"; } ?>></td> ! </tr> ! <?php ! } ! ?> ! </table> ! <br> ! <input type="submit" name="update" value="Update Values" /> ! </form> ! ! <?php include($Footer); ?> \ No newline at end of file |