[Openfirst-cvscommit] modules export.php,1.4,1.5 index.php,1.4,1.5
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2005-08-23 18:22:28
|
Update of /cvsroot/openfirst/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11731/modules Modified Files: export.php index.php Log Message: Updates for module system Index: export.php =================================================================== RCS file: /cvsroot/openfirst/modules/export.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** export.php 31 May 2005 22:18:44 -0000 1.4 --- export.php 23 Aug 2005 18:22:19 -0000 1.5 *************** *** 1,91 **** ! <?php ! /* ! * openFIRST.modules - export.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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 ! * ! */ ! require_once("../includes/globals.php"); ! ! $incl = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('config')); ! ! include_once($Header); ! ?><fieldset> ! <legend>Code</legend> ! <dl> ! <?php ! foreach($Modules as $key => $mod) { ! $id = $mod->getID(); ! $name = $mod->getName(); ! $version = $mod->getVersion(); ! $includes = $mod->getIncludes(); ! $adminbar = $mod->getAdminBar(); ! $navbar = $mod->getNavBar(); ! $author = $mod->getAuthor(); ! $maintainer = $mod->getMaintainer(); ! $dir = $mod->getDir(); ! ! $XMLCode = '<module id="'.htmlspecialchars($id).'"> ! <name>'.htmlspecialchars($name).'</name> ! <version>'.htmlspecialchars($version).'</version> ! <author>'.htmlspecialchars($author).'</author> ! '; ! ! if ($maintainer != '') ! $XMLCode .= ' <maintainer>'.htmlspecialchars($maintainer).'</maintainer> ! '; ! ! if (count($includes) > 0) { ! $XMLCode .= ' <includes> ! '; ! foreach($includes as $inc) { ! $XMLCode .= ' <include>'; ! $XMLCode .= htmlspecialchars($inc); ! $XMLCode .= '</include> ! '; ! } ! } ! ! if ($adminbar != '') ! $XMLCode .= ' <adminbar><![CDATA['.$adminbar.']]></adminbar> ! '; ! if ($navbar != '') ! $XMLCode .= ' <navbar><![CDATA['.$navbar.']]></navbar> ! '; ! '</module>'; ! ! if (isset($_REQUEST['save'])) { ! $save_len = file_put_contents("$fBasePath/$dir/openfirst.info.xml", $XMLCode); ! } ! ! ?><dt style="font-weight:bold;"><h2><?php echo htmlentities($name); ?></h2><?php ! if (isset($_REQUEST['save'])) { ! echo htmlentities("$save_len / ".strlen($PHPCode)); ! } ! ?></dt><dd> ! <textarea class="code xml" readonly="readonly" rows="18" cols="75"><?php ! ! echo htmlentities($XMLCode); ! ?></textarea></dd><?php ! } ! ?> ! </dl></fieldset> ! <?php ! include_once($Footer); ! ?> --- 1,93 ---- ! <?php ! /* ! * openFIRST.modules - export.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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 ! * ! */ ! require_once("../includes/globals.php"); ! ! include_once($Header); ! ?> ! <p class="into">This takes module info in the database and generates XML for it. Note that it does ! <strong>not</strong> include table information.</p> ! ! <dl> ! <?php ! foreach($ogModuleManager->getDirs() as $moddir) { ! $mod = $ogModuleManager->addModuleFromDir($moddir); ! ! $id = $mod->getID(); ! $name = $mod->getName(); ! $version = $mod->getVersion(); ! $includes = $mod->getIncludes(); ! $adminbar = $mod->getAdminBar(); ! $navbar = $mod->getNavBar(); ! $author = $mod->getAuthor(); ! $maintainer = $mod->getMaintainer(); ! $dir = $mod->getDir(); ! ! $XMLCode = '<module id="'.htmlspecialchars($id).'"> ! <name>'.htmlspecialchars($name).'</name> ! <version>'.htmlspecialchars($version).'</version> ! <author>'.htmlspecialchars($author).'</author> ! '; ! ! if ($maintainer != '') ! $XMLCode .= ' <maintainer>'.htmlspecialchars($maintainer).'</maintainer> ! '; ! ! if (count($includes) > 0) { ! $XMLCode .= ' <includes> ! '; ! foreach($includes as $inc) { ! $XMLCode .= ' <include>'; ! $XMLCode .= htmlspecialchars($inc); ! $XMLCode .= '</include> ! '; ! } ! } ! ! if ($adminbar != '') ! $XMLCode .= ' <adminbar><![CDATA['.$adminbar.']]></adminbar> ! '; ! if ($navbar != '') ! $XMLCode .= ' <navbar><![CDATA['.$navbar.']]></navbar> ! '; ! $XMLCode .= '</module>'; ! ! if (isset($_REQUEST['save'])) { ! $save_len = file_put_contents("$fBasePath/$dir/openfirst.info.xml", $XMLCode); ! } ! ! ?><dt style="font-weight:bold;"><h2><?php echo htmlentities($name); ?></h2><?php ! if (isset($_REQUEST['save'])) { ! echo htmlentities("$save_len / ".strlen($PHPCode)); ! } ! ?></dt><dd> ! <textarea class="code xml" readonly="readonly" rows="18" cols="75"><?php ! ! echo htmlentities($XMLCode); ! ?></textarea></dd><?php ! } ! ?> ! </dl> ! <?php ! include_once($Footer); ! ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/modules/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 27 May 2005 14:37:40 -0000 1.4 --- index.php 23 Aug 2005 18:22:19 -0000 1.5 *************** *** 1,135 **** ! <?php ! /* ! * openFIRST.modules - index.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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 ! * ! */ ! require_once('../includes/globals.php'); ! require_once('modules.php'); ! ! $files = glob("$fBasePath/*/openfirst.info.xml"); ! ! $oMods = array(); ! ! foreach($files as $file) { ! $oMods[] =& Module::createFromFile($file); ! } ! ! include($Header); ?> ! <table> ! <thead> ! <tr> ! <th>ID</th> ! <th>Name</th> ! <th>Version</th> ! <th>Author</th> ! <th>Maintainer</th> ! <th>Includes</th> ! <th>Navbar</th> ! <th>Adminbar</th> ! <th>Setup script</th> ! <th>Remove script</th> ! <th>Upgrade script</th> ! </tr> ! </thead> ! <tbody> ! <?php foreach($oMods as $mod) { ! echo ' <tr> ! '; ! ! echo ' <td><code class="ID">'; ! echo htmlentities($mod->getID()); ! echo '</code></td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getName()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getVersion()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getAuthor()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getMaintainer()); ! echo '</td> ! '; ! ! echo ' <td>'; ! $incs = $mod->getIncludes(); ! if (count($incs) <= 0) { ! echo '‍'; ! } else { ! echo ' ! <ul> ! '; ! foreach($incs as $inc) { ! echo ' <li><code class="file">'; ! echo htmlentities($inc); ! echo '</code></li> ! '; ! } ! echo ' </ul> ! '; ! } ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getNavBar()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getAdminBar()); ! echo '</td> ! '; ! ! echo ' <td><code class="file">'; ! echo htmlentities($mod->getSetupScript()); ! echo '</code></td> ! '; ! ! echo ' <td><code class="file">'; ! echo htmlentities($mod->getRemoveScript()); ! echo '</code></td> ! '; ! ! echo ' <td><code class="file">'; ! echo htmlentities($mod->getUpgradeScript()); ! echo '</code></td> ! '; ! ! echo ' </tr> ! '; ! } ! ?> ! </tbody> ! </table> ! <?php ! include($Footer); ! ?> --- 1,144 ---- ! <?php ! /* ! * openFIRST.modules - index.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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 ! * ! */ ! require_once('../includes/globals.php'); ! require_once('xmlModule.php'); ! ! $files = glob("$fBasePath/*/openfirst.info.xml"); ! ! $oMods = array(); ! ! foreach($files as $file) { ! $oMods[] =& xmlModule::createFromFile($file); ! } ! ! include($Header); ?> ! <p class="intro">Below is a table showing the modules available in this installation. The data is ! loaded from the <tt class="file">openfirst.info.xml</tt> file distrubuted with each module. ! This allows you to test your XML and debug module installation issues.</p> ! <table> ! <thead> ! <tr> ! <th>Dir</th> ! <th>ID</th> ! <th>Name</th> ! <th>Version</th> ! <th>Author</th> ! <th>Maintainer</th> ! <th>Includes</th> ! <th>Navbar</th> ! <th>Adminbar</th> ! <th>Setup script</th> ! <th>Remove script</th> ! <th>Upgrade script</th> ! </tr> ! </thead> ! <tbody> ! <?php foreach($oMods as $mod) { ! echo ' <tr> ! '; ! ! echo ' <th><tt class="file">'; ! echo htmlentities($mod->getDir()); ! echo '</tt></th> ! '; ! ! echo ' <td><code class="ID">'; ! echo htmlentities($mod->getID()); ! echo '</code></td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getName()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getVersion()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getAuthor()); ! echo '</td> ! '; ! ! echo ' <td>'; ! echo htmlentities($mod->getMaintainer()); ! echo '</td> ! '; ! ! echo ' <td>'; ! $incs = $mod->getIncludes(); ! if (count($incs) <= 0) { ! echo ' '; ! } else { ! echo ' ! <ul> ! '; ! foreach($incs as $inc) { ! echo ' <li><code class="file">'; ! echo htmlentities($inc); ! echo '</code></li> ! '; ! } ! echo ' </ul> ! '; ! } ! echo '</td> ! '; ! ! echo ' <td><pre>'; ! echo htmlentities($mod->getNavBar()); ! echo '</pre></td> ! '; ! ! echo ' <td><pre>'; ! echo htmlentities($mod->getAdminBar()); ! echo '</pre></td> ! '; ! ! echo ' <td><tt class="file">'; ! echo htmlentities($mod->getSetupScript()); ! echo '</tt></td> ! '; ! ! echo ' <td><tt class="file">'; ! echo htmlentities($mod->getRemoveScript()); ! echo '</tt></td> ! '; ! ! echo ' <td><tt class="file">'; ! echo htmlentities($mod->getUpgradeScript()); ! echo '</tt></td> ! '; ! ! echo ' </tr> ! '; ! } ! ?> ! </tbody> ! </table> ! <?php ! include($Footer); ! ?> |