Author: pwang
Date: 2010-09-10 11:26:30 -0700 (Fri, 10 Sep 2010)
New Revision: 21790
Added:
new_cytoscape_website/plugin_website/plugins/clean.inc
new_cytoscape_website/plugin_website/plugins/dbUtil.inc
new_cytoscape_website/plugin_website/plugins/dbUtilTest.php
new_cytoscape_website/plugin_website/plugins/formPluginInfo.inc
new_cytoscape_website/plugin_website/plugins/formPluginInfo_remember.inc
new_cytoscape_website/plugin_website/plugins/index.php
new_cytoscape_website/plugin_website/plugins/luceneUtil.inc
new_cytoscape_website/plugin_website/plugins/pluginadmin.php
new_cytoscape_website/plugin_website/plugins/populateSearchWords.php
new_cytoscape_website/plugin_website/plugins/themesubmit.php
new_cytoscape_website/plugin_website/plugins/themeversiondelete.php
Log:
Moved from old site
Added: new_cytoscape_website/plugin_website/plugins/clean.inc
===================================================================
--- new_cytoscape_website/plugin_website/plugins/clean.inc
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/clean.inc 2010-09-10
18:26:30 UTC (rev 21790)
@@ -0,0 +1,27 @@
+<?php
+
+
+
+// Secure the user data by escaping characters and shortening the input string
+function cleanLength($input, $maxlength) {
+ $input = substr($input, 0, $maxlength);
+ $input = EscapeShellCmd($input);
+ return ($input);
+}
+
+function cleanInt($input) {
+ if ( preg_match("/^\d+$/", $input) ) {
+ return ($input);
+ } else {
+ return (0);
+ }
+}
+
+function cleanVersion($input) {
+ if ( preg_match("/^\d+\.\d+(\.\d+)*$/", $input) ) {
+ return ($input);
+ } else {
+ return (NULL);
+ }
+}
+?>
Added: new_cytoscape_website/plugin_website/plugins/dbUtil.inc
===================================================================
--- new_cytoscape_website/plugin_website/plugins/dbUtil.inc
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/dbUtil.inc 2010-09-10
18:26:30 UTC (rev 21790)
@@ -0,0 +1,52 @@
+<?php
+
+function getPluginIDs($connection){
+ // get the list of pluigin_id
+ $dbQuery = "SELECT distinct plugin_id FROM plugin_version WHERE status
= 'published'";
+
+ // Run the query
+ if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ $plugin_id_array = array(); // create an empty array
+
+ if (@ mysql_num_rows($result) != 0) {
+ while($_row = @ mysql_fetch_array($result))
+ {
+ $plugin_id_array[] = $_row["plugin_id"];
+ }
+ }
+ return $plugin_id_array;
+}
+
+
+function getPluginInfo($connection, $plugin_id){
+ // get the name and description for this plugin with id = pluigin_id
+ //$dbQuery = "SELECT name, description FROM plugin_list WHERE
plugin_auto_id = $plugin_id";
+
+ $dbQuery = "select name, description, names, affiliation
+ from plugin_list, plugin_version, plugin_author, authors
+ where plugin_list.plugin_auto_id = plugin_version.plugin_id
+ and plugin_author.plugin_version_id = plugin_version.version_auto_id
+ and authors.author_auto_id = plugin_author.author_id
+ and plugin_id = ".$plugin_id;
+
+ // Run the query
+ if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ $plugin_info_array = array(); // create an empty array
+
+ if (@ mysql_num_rows($result) != 0) {
+ while($_row = @ mysql_fetch_array($result))
+ {
+ $plugin_info_array['name'] = $_row["name"];
+ $plugin_info_array['description'] = $_row["description"];
+ $plugin_info_array['author'] = $_row["names"];
+ $plugin_info_array['institution'] = $_row["affiliation"];
+ }
+ }
+ return $plugin_info_array;
+}
+
+?>
\ No newline at end of file
Property changes on: new_cytoscape_website/plugin_website/plugins/dbUtil.inc
___________________________________________________________________
Name: svn:executable
+ *
Added: new_cytoscape_website/plugin_website/plugins/dbUtilTest.php
===================================================================
--- new_cytoscape_website/plugin_website/plugins/dbUtilTest.php
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/dbUtilTest.php 2010-09-10
18:26:30 UTC (rev 21790)
@@ -0,0 +1,34 @@
+<?php
+// This script will create Lucene Index "./luceneIndex" for all the plugins in
CyPluginDB
+// If there is an existing index, the existing one will be overwritten.
+
+// Include the DBMS credentials
+include 'db.inc';
+include 'dbUtil.inc';
+
+
+// Connect to the MySQL DBMS
+if (!($connection = @ mysql_pconnect($dbServer, $cytostaff, $cytostaffPass)))
+ showerror();
+
+// Use the CyPluginDB database
+if (!mysql_select_db($dbName, $connection))
+ showerror();
+
+
+
+$plugin_ids = getPluginIDs($connection);
+
+foreach ($plugin_ids as $plugin_id) {
+ //echo "plugin_id =".$plugin_id."<br>\n";
+}
+
+$plugin_id = 137;
+$pluginInfo = getPluginInfo($connection, $plugin_id);
+
+echo "name =".$pluginInfo['name']."<br>\n";
+echo "description =".$pluginInfo['description']."<br>\n";
+echo "authors = ".$pluginInfo['author']."<br>\n";
+
+
+?>
\ No newline at end of file
Added: new_cytoscape_website/plugin_website/plugins/formPluginInfo.inc
===================================================================
--- new_cytoscape_website/plugin_website/plugins/formPluginInfo.inc
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/formPluginInfo.inc
2010-09-10 18:26:30 UTC (rev 21790)
@@ -0,0 +1,139 @@
+<?php
+/*
+ * Created on Nov 29, 2007
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - PHPeclipse - PHP - Code Templates
+ */
+
+ ?>
+ <table width="878" border="0">
+ <tr>
+ <td width="208"><div align="right" ><span class="style4">*</span>Plugin
name</div></td>
+ <td width="660"><input name="tfName" type="text" value ="<?php echo $name
?>" size="40" /></td>
+ </tr>
+ <tr>
+ <td><div align="right"><span class="style4">*</span>version</div>
</td>
+ <td><input name="tfVersion" type="text" id="tfVersion" value ="<?php echo
$version ?>" size="20" /></td>
+ </tr>
+ <tr>
+ <td height="75"><div align="right"><span
class="style4">*</span>Description</div></td>
+ <td><textarea name="taDescription" cols="80" rows="5"
id="taDescription"><?php echo $description ?></textarea></td>
+ </tr>
+ <tr>
+ <td><div align="right"><span class="style4">*</span>Category</div></td>
+ <td><label>
+ <select name="optCategory" id="optCategory" >
+
+ <option <?php if ($category && $category == 'Please choose one') echo
'selected' ?>>Please choose one</option>
+ <?php if ($mode == 'edit'){ echo '<option>Core</option>';} ?>
+ <option <?php if ($category && $category == 'Analysis') echo
'selected' ?>>Analysis</option>
+ <option <?php if ($category && $category == 'Network and Attribute
I/O') echo 'selected' ?>>Network and Attribute I/O</option>
+ <option <?php if ($category && $category == 'Network Inference') echo
'selected' ?>>Network Inference</option>
+ <option <?php if ($category && $category == 'Functional Enrichment')
echo 'selected' ?>>Functional Enrichment</option>
+ <option <?php if ($category && $category == 'Communication/Scripting')
echo 'selected' ?>>Communication/Scripting</option>
+ <option <?php if ($category && $category == 'Other') echo
'selected' ?>>Other</option>
+ </select>
+ </label></td>
+ </tr>
+ <tr>
+ <td><div align="right"><span class="style4">*</span>Release Date
</div></td>
+ <td><table width="118" border="0">
+ <tr>
+ <td width="32" scope="col"><div align="center">mm</div></td>
+ <td width="29" scope="col"><div align="center">dd</div></td>
+ <td width="57" scope="col"><div align="center">yyyy</div></td>
+ </tr>
+ <tr>
+ <td><input name="tfMonth" type="text" id="tfMonth" value ="<?php
echo $month ?>" size="2" /></td>
+ <td><input name="tfDay" type="text" id="tfDay" value ="<?php echo
$day ?>" size="2" /></td>
+ <td><input name="tfYear" type="text" id="tfYear" value ="<?php echo
$year ?>" size="4" /></td>
+ </tr>
+ </table> </td>
+ </tr>
+ <tr>
+ <td><div align="right"></div></td>
+ <td><label></label></td>
+ </tr>
+
+ <tr>
+ <td width="208"><div align="right" ><span class="style4">*</span>Cytoscape
versions</div></td>
+ <td width="660"><input name="tfCyVersion" type="text" value ="<?php echo
$cyVersion ?>" size="40" /></td>
+ </tr>
+
+
+
+ <tr>
+ <td><div align="right"></div></td>
+ <td><label></label></td>
+ </tr>
+ <tr>
+ <td><div align="right">Author(s)</div></td>
+ <td><table width="660" border="0">
+ <tr>
+ <td width="444"><div align="center"> Name(s)</div></td>
+ <td width="206"><?php //<div align="center">contact e-mail (not made
public) </div> ?></td>
+ </tr>
+ <tr>
+ <td><label>
+ <input name="tfNames0" type="text" id="tfNames0" size="70" value
="<?php echo htmlentities(stripslashes($names[0])) ?>" />
+ </label></td>
+ <td>
+
+ <input name="tfEmail0" type="Hidden" id="tfEmail0" size="30" value
="<?php echo $emails[0] ?>" />
+
+ </td>
+ </tr>
+ <tr>
+ <td><div align="center">Affiliation</div></td>
+ <td><div align="center">Affiliation URL</div></td>
+ </tr>
+ <tr>
+ <td><input name="tfAffiliation0" type="text" id="tfAffiliation0"
size="70" value ="<?php echo htmlentities(stripslashes($affiliations[0])) ?>"
/></td>
+ <td><input name="tfAffiliationURL0" type="text" id="tfAffiliationURL0"
size="30" value ="<?php echo $affiliationURLs[0] ?>" /></td>
+ </tr>
+ </table></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td><table width="660" border="0">
+ <tr>
+ <td width="444"><div align="center"> Name(s)</div></td>
+ <td width="206"><?php //<div align="left">contact e-mail </div>?></td>
+ </tr>
+ <tr>
+ <td><label>
+ <input name="tfNames1" type="text" id="tfNames1" size="70" value
="<?php if (isset($names[1])){ echo htmlentities(stripslashes($names[1]));} ?>"
/>
+ </label></td>
+ <td><input name="tfEmail1" type="Hidden" id="tfEmail02" size="30"
value ="<?php if (isset($emails[1])){ echo $emails[1];} ?>" /></td>
+ </tr>
+ <tr>
+ <td><div align="center">Affiliation</div></td>
+ <td><div align="center">Affiliation URL</div></td>
+ </tr>
+ <tr>
+ <td><input name="tfAffiliation1" type="text" id="tfAffiliation1"
size="70" value ="<?php if (isset($affiliations[1])){echo
htmlentities(stripslashes($affiliations[1]));} ?>" /></td>
+ <td><input name="tfAffiliationURL1" type="text" id="tfAffiliationURL1"
size="30" value ="<?php if (isset($affiliationURLs[1])){ echo
stripslashes($affiliationURLs[1]);} ?>" /></td>
+ </tr>
+ </table></td>
+ </tr>
+
+ <tr>
+<td> </td>
+<td> </td>
+ </tr>
+
+ <tr>
+ <td><div align="right"><?php if (isset($isPluginURLSubmission)) {echo
'<span class="style4">*</span>'; }; ?>Project URL</div></td>
+ <td><input name="tfProjectURL" type="text" id="tfProjectURL" value ="<?php
echo $projectURL ?>" size="80" /></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="tried" type="hidden" id="tried" value="yes">
+ <input name="versionID" type="hidden" id="versionID" value="<?php echo
$versionID; ?>"></td>
+ </tr>
+</table>
+
+<?php
+?>
Added: new_cytoscape_website/plugin_website/plugins/formPluginInfo_remember.inc
===================================================================
--- new_cytoscape_website/plugin_website/plugins/formPluginInfo_remember.inc
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/formPluginInfo_remember.inc
2010-09-10 18:26:30 UTC (rev 21790)
@@ -0,0 +1,71 @@
+<?php
+/*
+ * Created on Nov 29, 2007
+ * Content within the form of user input
+ */
+if (isset ($_POST['tfName'])) {
+ $name = $_POST['tfName'];
+}
+
+if (isset ($_POST['tfVersion'])) {
+ $version = $_POST['tfVersion'];
+}
+
+if (isset ($_POST['taDescription'])) {
+ //Enclding the string for SQL
+ $description = addslashes($_POST['taDescription']);
+}
+
+if (isset ($_POST['tfProjectURL'])) {
+ $projectURL = $_POST['tfProjectURL'];
+}
+
+if (isset ($_POST['optCategory'])) {
+ $category = $_POST['optCategory'];
+}
+
+if (isset ($_POST['tfMonth'])) {
+ $month = $_POST['tfMonth'];
+}
+
+if (isset ($_POST['tfDay'])) {
+ $day = $_POST['tfDay'];
+}
+
+if (isset ($_POST['tfYear'])) {
+ $year = $_POST['tfYear'];
+ $releaseDate = $year . '-' . $month . '-' . $day;
+}
+
+if (isset ($_POST['tfCyVersion'])) {
+ $cyVersion = $_POST['tfCyVersion'];
+}
+
+//Authors
+if (isset ($_POST['tfNames0'])) {
+ $names[0] = addslashes($_POST['tfNames0']);
+}
+if (isset ($_POST['tfEmail0'])) {
+ $emails[0] = $_POST['tfEmail0'];
+}
+if (isset ($_POST['tfAffiliation0'])) {
+ $affiliations[0] = addslashes($_POST['tfAffiliation0']);
+}
+if (isset ($_POST['tfAffiliationURL0'])) {
+ $affiliationURLs[0] = $_POST['tfAffiliationURL0'];
+}
+
+if (isset ($_POST['tfNames1'])) {
+ $names[1] = addslashes($_POST['tfNames1']);
+}
+if (isset ($_POST['tfEmail1'])) {
+ $emails[1] = $_POST['tfEmail1'];
+}
+if (isset ($_POST['tfAffiliation1'])) {
+ $affiliations[1] = addslashes($_POST['tfAffiliation1']);
+}
+if (isset ($_POST['tfAffiliationURL1'])) {
+ $affiliationURLs[1] = $_POST['tfAffiliationURL1'];
+}
+
+?>
Added: new_cytoscape_website/plugin_website/plugins/index.php
===================================================================
--- new_cytoscape_website/plugin_website/plugins/index.php
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/index.php 2010-09-10
18:26:30 UTC (rev 21790)
@@ -0,0 +1,190 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link href="http://chianti.ucsd.edu/~kono/cytoscape/css/main.css"
type="text/css" rel="stylesheet" media="screen">
+<title>Cytoscape 2.x Plugins</title>
+<meta name="description" content="Cytoscape includes a flexible Plugin
architecture that enables developers to add extra functionality beyond that
provided in the core. Plugins also provide a convenient place for testing out
new Cytoscape features. As more Plugins become available, they will be listed
on this page, and posted to our cytoscape-announce mailing list. " />
+
+<script type="text/javascript"
+src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
+<script type="text/javascript"
src="http://chianti.ucsd.edu/~kono/cytoscape/js/menu_generator.js"></script>
+
+ <SCRIPT LANGUAGE="JavaScript" SRC="mktree.js"></SCRIPT>
+ <style type="text/css">
+<!--
+.style3 {
+ font-size: 18;
+ color: #0000FF;
+}
+
+/* Expand/collapse plugin tree */
+/* Put this inside a @media qualifier so Netscape 4 ignores it */
+...@media screen, print {
+ /* Turn off list bullets */
+ ul.mktree li { list-style: none; }
+ /* Control how "spaced out" the tree is */
+ ul.mktree, ul.mktree ul , ul.mktree li { margin-left:10px; padding:0px;
}
+ /* Provide space for our own "bullet" inside the LI */
+ ul.mktree li .bullet { padding-left: 15px; }
+ /* Show "bullets" in the links, depending on the class of the LI that
the link's in */
+ ul.mktree li.liOpen .bullet { cursor: pointer; background:
url(../images/minus.gif) center left no-repeat; }
+ ul.mktree li.liClosed .bullet { cursor: pointer; background:
url(../images/plus.gif) center left no-repeat; }
+ ul.mktree li.liBullet .bullet { cursor: default; background:
url(bullet.gif) center left no-repeat; }
+ /* Sublists are visible or not based on class of parent LI */
+ ul.mktree li.liOpen ul { display: block; }
+ ul.mktree li.liClosed ul { display: none; }
+ /* Format menu items differently depending on what level of the tree
they are in */
+ ul.mktree li { font-size: 12pt; }
+ ul.mktree li ul li { font-size: 11pt; }
+ ul.mktree li ul li ul li { font-size: 10pt; }
+ ul.mktree li ul li ul li ul li { font-size: 8pt; }
+}
+
+-->
+ </style>
+
+</head>
+
+<body>
+
+<div id="container">
+ <script
src="http://chianti.ucsd.edu/~kono/cytoscape//js/header.js"></script>
+
+
+<div align="left">
+ <p align="right"> <a href="plugindownloadstatistics.php">View
download activities</a> <a href="pluginsubmittype.php">Submit a
plugin</span> to Cytoscape</a> </p>
+</div>
+<div id="indent">
+ <p>
+ <?php
+ // Include the DBMS credentials
+ include 'db.inc';
+ // Include the function to display the info for each plugin
+ include 'getpluginInfo.php';
+
+ // Connect to the MySQL DBMS
+ if (!($connection = @ mysql_pconnect($dbServer, $dbUser, $dbPass)))
+ showerror();
+
+ // Use the CyPluginDB database
+ if (!mysql_select_db($dbName, $connection))
+ showerror();
+
+ $query = "SELECT * FROM categories";
+
+ // Run the query
+ if (!($categories = @ mysql_query ($query, $connection)))
+ showerror();
+
+?>
+</p>
+
+<form action="keywordsearch.php" method="post">
+ <label>
+ <input type="text" name="searchwords" size="30">
+ <input type="submit" name="Submit" value="Search">
+ </label>
+</form>
+<br>
+<p>
+ <?php
+
+ echo "\n\n<A href=\"#\" onClick=\"expandTree('tree1'); return
false;\">Expand All</A> ".
+ "\n<A href=\"#\" onClick=\"collapseTree('tree1'); return
false;\">Collapse All</A>  ";
+
+ // build an expandable tree
+ if (@ mysql_num_rows($categories) != 0)
+ {
+ echo "\n\n<ul class=\"mktree\" ", "id=\"tree1\">";
+ while($category_row = @ mysql_fetch_array($categories))
+ {
+ $categoryName = $category_row["name"];
+ if ($categoryName == "Core"){
+ continue;
+ }
+ $categoryDescription = $category_row["description"];
+ $categoryID = $category_row["category_id"];
+ echo "\n\t<li>";
+ echo "<span
class=\"style3\"><B>",$categoryName,"</B></span> -- ",$categoryDescription;
+ //echo $categoryName;
+
+ //Get the plugin list for the category.
"plugin_list.plugin_auto_id = plugin_version.plugin_id" will exclude
+ // those with data in plugin_list, but no data in
plugin_version (caused by failed transaction)
+ $query = 'SELECT distinct plugin_auto_id,name, unique_id,
description, license, license_required, project_url FROM
plugin_list,plugin_version WHERE plugin_list.plugin_auto_id =
plugin_version.plugin_id AND category_id =' . $categoryID.' order by name';
+
+ // Run the query
+ if (!($pluginList = @ mysql_query ($query, $connection)))
+ showerror();
+
+ echo " (",@ mysql_num_rows($pluginList),")";
+
+ // Did we get back any rows?
+ if (@ mysql_num_rows($pluginList) != 0)
+ {
+ echo "\n\t\t<ul>";
+ while($pluginList_row = @
mysql_fetch_array($pluginList))
+ {
+ $pluginID = $pluginList_row["plugin_auto_id"];
+ $unique_id =
$pluginList_row["unique_id"];
+ $plugin_name =
$pluginList_row["name"];
+ echo "\n\t\t\t<li>";
+ //echo "\n\t\t\t\t<a
href=\"displayplugininfo.php?uniqueID=",$unique_id,"\">",$pluginList_row["name"],"</a>";
+ echo "\n\t\t\t\t<a
href=\"displayplugininfo.php?name=".$plugin_name."\">",$pluginList_row["name"],"</a>";
+ // add plugin info
+ echo "\n\t\t\t<ul>";
+ echo "\n\t\t\t\t<li>";
+ echo getPluginInfoPage($connection,
$pluginList_row);
+ echo "\n\t\t\t\t</li>";
+ echo "\n\t\t\t</ul>";
+
+ echo "\n\t\t\t</li>";
+ }
+ echo "\n\t\t</ul>";
+ }
+
+ echo "\n\t</li>";
+
+ } // while loop
+
+ echo "\n</ul>";
+ }
+
+ ?>
+
+
+ <big><b>Old Plugins</b></big>
+ <br>
+ <br><p>
+ We also maintain a list of older <a
href="http://cytoscape.org/plugins2.php">Cytoscape 2.x plugins</a> and <a
href="http://cytoscape.org/plugins1.php">
+ Cytoscape 1.x Plugins</a></p>
+ <br>
+
+ <big><b>Writing Your Own Plugins</b></big>
+ <br><br><p>
+ If you are interested in building your own Cytoscape Plugin, check out
the <a href="http://cytoscape.wodaklab.org/wiki/cytoscape_developer_tutorial">
+ Cytoscape Plugin Tutorial</a></p>
+ <br>
+ <big><b>PlugIn License Policy:</b></big>
+<br><br>
+ <p>
+ Although the Cytoscape core application is distributed under a Library
GNU Public License (LGPL),
+ plugins are separate works which use Cytoscape as a Java code library.
+ Plugins are therefore governed by independent software licenses
+ distributed with and specific to each plugin. The Cytoscape project
+ has no intent to capture plugins under the license terms of the core
Cytoscape LGPL.</p>
+
+<br><big><b>About Cytoscape Plugins:</b></big>
+<br><br><p>
+ Cytoscape includes a flexible Plugin architecture that enables developers to
add extra
+ functionality beyond that provided in the core. Plugins also provide a
convenient place
+ for testing out new Cytoscape features. As more Plugins become available,
they will be
+ listed on this page, and posted to our <a
href="http://groups-beta.google.com/group/cytoscape-announce">cytoscape-announce</a>
mailing list.
+ </p>
+ <br><br>
+
+ <script src="http://chianti.ucsd.edu/~kono/cytoscape/js/footer.js"></script>
+</div>
+</body>
+</html>
Property changes on: new_cytoscape_website/plugin_website/plugins/index.php
___________________________________________________________________
Name: svn:executable
+ *
Added: new_cytoscape_website/plugin_website/plugins/luceneUtil.inc
===================================================================
--- new_cytoscape_website/plugin_website/plugins/luceneUtil.inc
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/luceneUtil.inc 2010-09-10
18:26:30 UTC (rev 21790)
@@ -0,0 +1,47 @@
+<?php
+//
+require_once 'Zend/Search/Lucene.php';
+require_once 'Zend/Search/Lucene/Document.php';
+
+include_once 'dbUtil.inc';
+
+// create a lucene index for all the plugins in CyPluginDB
+function createLuceneIndex($connection) {
+ // get all pluigin ids
+ $plugin_id_array = getPluginIDs($connection);
+
+ // Create an index, this will wipe out the existing index and create a
new one
+ $index = Zend_Search_Lucene::create('./luceneIndex/index');
+
+ // index all the plugins
+ foreach ($plugin_id_array as $plugin_id ) {
+ $plugin_info = getPluginInfo($connection, $plugin_id);
+ $defaultStr = $plugin_info['name']."
".$plugin_info['description']." ".$plugin_info['author']."
".$plugin_info['institution'];
+
+ $doc = new Zend_Search_Lucene_Document();
+ $doc->addField(Zend_Search_Lucene_Field::Text('id',
$plugin_id));
+ $doc->addField(Zend_Search_Lucene_Field::Text('name',
$plugin_info['name'], 'utf-8'));
+ $doc->addField(Zend_Search_Lucene_Field::Text('description',
$plugin_info['description'], 'utf-8'));
+ $doc->addField(Zend_Search_Lucene_Field::Text('author',
$plugin_info['author'], 'utf-8'));
+ $doc->addField(Zend_Search_Lucene_Field::Text('institution',
$plugin_info['institution'], 'utf-8'));
+ $doc->addField(Zend_Search_Lucene_Field::Text('default',
$defaultStr, 'utf-8'));
+ $index->addDocument($doc);
+ }
+
+ $index->commit();
+}
+
+function addDoc2LuceneIndex($doc){
+ $index = Zend_Search_Lucene::open('luceneIndex/index');
+ $index->addDocument($doc);
+ $index->commit();
+}
+
+function removeDocFromLuceneIndex($doc){
+ $index = Zend_Search_Lucene::open('luceneIndex/index');
+ $index->delete($doc->id);
+ $index->commit();
+
+}
+
+?>
\ No newline at end of file
Added: new_cytoscape_website/plugin_website/plugins/pluginadmin.php
===================================================================
--- new_cytoscape_website/plugin_website/plugins/pluginadmin.php
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/pluginadmin.php
2010-09-10 18:26:30 UTC (rev 21790)
@@ -0,0 +1,114 @@
+<?php include "logininfo.inc"; ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+ <title>Cytoscape Plugin Administration</title>
+ <link rel="stylesheet" type="text/css" media="screen"
href="http://cytoscape.org/css/cytoscape.css">
+ <link rel="shortcut icon" href="/cyto_web/images/cyto.ico">
+</head>
+<body bgcolor="#ffffff">
+<div id="topbar">
+ <div class="title">Cytoscape Plugin Administration</div>
+</div>
+<div id="container">
+<?php include "http://cytoscape.org/nav.php"; ?>
+<br>
+<span class="style2">
+ <div id="indent">
+ <div align="center">
+ <p><big><b>List of Cytoscape Plugins in CyPluginDB</b></big>
+ </p>
+ </div>
+</div>
+</span>
+<br>
+<table width="726" height="127" border="1">
+ <tr>
+ <th width="175" scope="col">Category</th>
+ <th width="137" scope="col">Plugin Name </th>
+ <th width="52" scope="col">Version</th>
+ <th width="72" scope="col">Status</th>
+ <th width="72" scope="col">Edit</th>
+ <th width="84" scope="col">Delete</th>
+ <th width="88" scope="col">Last modified </th>
+ </tr>
+
+<?php
+ // Include the DBMS credentials
+ include 'db.inc';
+
+ // Connect to the MySQL DBMS
+ if (!($connection = @ mysql_pconnect($dbServer, $dbUser, $dbPass)))
+ showerror();
+
+ // Use the CyPluginDB database
+ if (!mysql_select_db($dbName, $connection))
+ showerror();
+
+ $query = "SELECT * FROM categories";
+
+ // Run the query
+ if (!($categories = @ mysql_query ($query, $connection)))
+ showerror();
+
+ // Add the table rows
+ if (@ mysql_num_rows($categories) != 0)
+ {
+ while($category_row = @ mysql_fetch_array($categories))
+ {
+ $categoryName = $category_row["name"];
+ $categoryID = $category_row["category_id"];
+ ?>
+ <tr>
+ <td><strong><?php echo $categoryName ?></strong></td>
+
<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>
+ </tr>
+ <?php
+ //Get the plugin versions for the category
+ $query = 'SELECT plugin_list.name,' .
+ 'plugin_version.version, ' .
+ 'plugin_version.status, ' .
+ 'plugin_version.sysdat, ' .
+ 'plugin_version.version_auto_id' .
+ ' FROM plugin_list, plugin_version WHERE category_id ='
. $categoryID.
+ ' and plugin_list.plugin_auto_id =
plugin_version.plugin_id order by plugin_list.name';
+
+ // Run the query
+ if (!($pluginVersions = @ mysql_query ($query, $connection)))
+ showerror();
+
+ // Did we get back any rows?
+ if (@ mysql_num_rows($pluginVersions) != 0)
+ {
+ while($pluginVersion_row = @
mysql_fetch_array($pluginVersions))
+ {
+ $pluginName = $pluginVersion_row["name"];
+ $pluginVersion =
$pluginVersion_row["version"];
+ $pluginStatus = $pluginVersion_row["status"];
+ $lastModified = $pluginVersion_row["sysdat"];
+ $versionID =
$pluginVersion_row["version_auto_id"];
+ ?><tr>
+ <td> </td>
+ <td><?php echo $pluginName;?></td>
+ <td><?php echo
$pluginVersion;?></td>
+ <td><?php echo $pluginStatus;?></td>
+ <td><a
href="pluginsubmit.php?versionid=<?php echo $versionID;?>">Edit</a></td>
+ <td><a
href="pluginversiondelete.php?versionid=<?php echo
$versionID;?>">Delete</a></td>
+ <td><?php echo $lastModified;?></td>
+ </tr>
+ <?php
+
+ } // end of inner while loop
+ }// end if
+
+ } // while loop
+ }
+
+ ?>
+
+</table>
+<?php include "http://cytoscape.org/footer.php"; ?>
+<br>
+</body>
+</html>
Added: new_cytoscape_website/plugin_website/plugins/populateSearchWords.php
===================================================================
--- new_cytoscape_website/plugin_website/plugins/populateSearchWords.php
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/populateSearchWords.php
2010-09-10 18:26:30 UTC (rev 21790)
@@ -0,0 +1,40 @@
+<?php
+// This script will populate the two tables 'description_words' and
'description_word_link' for search
+
+// Include the DBMS credentials
+include 'db.inc';
+include 'processSearchWords.inc';
+include 'dbUtil.inc';
+
+// Connect to the MySQL DBMS
+if (!($connection = @ mysql_pconnect($dbServer, $cytostaff, $cytostaffPass)))
+ showerror();
+
+// Use the CyPluginDB database
+if (!mysql_select_db($dbName, $connection))
+ showerror();
+
+$plugin_id_array = getPluginIDs($connection);
+
+// Clean the tables to make sure it is empty
+$dbQuery = 'delete from description_words';
+// Run the query
+if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+$dbQuery = 'delete from description_word_link';
+// Run the query
+if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+
+// populate the tables of search words for all pluigns
+foreach ($plugin_id_array as $plugin_id ) {
+ addWords($connection, $plugin_id);
+}
+
+
+//deleteWords($connection, $plugin_id);
+
+
+?>
\ No newline at end of file
Property changes on:
new_cytoscape_website/plugin_website/plugins/populateSearchWords.php
___________________________________________________________________
Name: svn:executable
+ *
Added: new_cytoscape_website/plugin_website/plugins/themesubmit.php
===================================================================
--- new_cytoscape_website/plugin_website/plugins/themesubmit.php
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/themesubmit.php
2010-09-10 18:26:30 UTC (rev 21790)
@@ -0,0 +1,484 @@
+<?php
+function getThemeDataFromFile($uploadFile) {
+ //echo "Inside function getThemeDataFromFile()<br>";
+ //echo "tmp_file = ", $tmp_file,'<br>';
+ //echo "fileName = ", $_FILES['themefile']['name'],"<br>";
+
+ //$themeData['test'] = 'test';
+
+ $fp = fopen($uploadFile, 'r');
+
+ if (!$fp) {
+ exit("Error! Couldn't open the file.");
+ }
+
+ $isThemeFile = false;
+
+ while ($line = fgets($fp)) {
+ if (($line == "") || (strstr($line, '#') == $line))
+ continue;
+
+ if (stristr($line, 'Cytoscape theme definition') == $line) { //
the line starts with xxx
+ $isThemeFile = true;
+ }
+
+ if (stristr($line, 'themeName') == $line) { // the line starts
with themeName
+ $pos = strpos($line, "="); // find first "="
+ $themeData['name'] = trim(substr($line, $pos +1));
+ }
+ if (stristr($line, 'themeVersion') == $line) {
+ $pos = strpos($line, "=");
+ $themeData['version'] = trim(substr($line, $pos +1));
+ }
+ if (stristr($line, 'themeDescription') == $line) {
+ $pos = strpos($line, "=");
+ $themeData['description'] = trim(substr($line, $pos
+1));
+ }
+ if (stristr($line, 'cytoscapeVersion') == $line) {
+ $pos = strpos($line, "=");
+ $themeData['cyVersion'] = trim(substr($line, $pos +1));
+ }
+ if (stristr($line, 'releaseDate') == $line) {
+ $pos = strpos($line, "=");
+ $themeData['releaseDate'] = trim(substr($line, $pos
+1));
+ }
+
+ if (stristr($line, 'plugin') == $line) {
+ $pos = strpos($line, "=");
+
+ $tmpArray = preg_split("{:}", trim(substr($line, $pos
+1))); // Split into an array
+ $pluginData['category'] = $tmpArray[0];
+ $pluginData['name'] = $tmpArray[1];
+ $pluginData['version'] = $tmpArray[2];
+
+ if (!isset($themeData['pluginGroup'])) {
+ $pluginGroup[] = $pluginData;
+ $themeData['pluginGroup'] = $pluginGroup;
+ }
+ else {
+ $pluginGroup = $themeData['pluginGroup'];
+ $pluginGroup[] = $pluginData;
+ $themeData['pluginGroup'] = $pluginGroup;
+ }
+ }
+
+ if (stristr($line, 'themeAuthor') == $line) {// not saved for
now
+ $pos = strpos($line, "=");
+ $themeData['themeAuthor'] = trim(substr($line, $pos
+1));
+ }
+ if (stristr($line, 'contactEmail') == $line) {
+ $pos = strpos($line, "=");
+ $themeData['contactEmail'] = trim(substr($line, $pos
+1));
+ }
+ }
+
+ if (!fclose($fp)) {
+ exit("Error! Couldn't close the file.");
+ }
+
+ if (!$isThemeFile) {
+ echo "This may not be a theme file. Theme file should start
with the line 'Cytoscape theme definition'!";
+ exit("");
+ }
+
+
+ //Create test data
+ /*
+ $themeData['name'] = "themeName";
+ $themeData['version'] = '0.1';
+ $themeData['description'] = "themeDescription";
+ $themeData['cyVersion'] = "2.6,2.7";
+ $themeData['releaseDate'] = "2008-01-10";
+
+ $pluginData['name'] = "MCODE";
+ $pluginData['category'] = "Analysis";
+ $pluginData['version'] = "1.2";
+
+ $pluginGroup[] = $pluginData;
+
+ $pluginData['name'] = "GroupTool";
+ $pluginData['category'] = "Other";
+ $pluginData['version'] = "1.0";
+
+ $pluginGroup[] = $pluginData;
+
+ $themeData['pluginGroup'] = $pluginGroup;
+ */
+ return $themeData;
+}
+
+
+function printThemeData($themeData) {
+ if ($themeData == null) {
+ echo "themeData = null<br>";
+ return;
+ }
+ echo "themeName = ", $themeData['name'], "<br>";
+ echo "themeVersion = ", $themeData['version'], "<br>";
+ echo "themeDescription = ", $themeData['description'], "<br>";
+ echo "cyVersion = ",$themeData['cyVersion'],'<br>';
+ echo "releaseDate = ",$themeData['releaseDate'],'<br>';
+
+ $pluginGroup = $themeData['pluginGroup'];
+ for ($i=0; $i< count($pluginGroup); $i++) {
+ $pluginData = $pluginGroup[$i];
+ echo "pluginName = ",$pluginData['name'],'<br>';
+ echo "pluginCategory = ",$pluginData['category'],'<br>';
+ echo "pluginVersion = ",$pluginData['version'],'<br>';
+ }
+ echo "themeAuthor = ",$themeData['themeAuthor'],'<br>';
+ echo "contactEmail = ",$themeData['contactEmail'],'<br>';
+}
+
+
+function getPluginVersionID($connection, $pluginData) {
+ // Get plugin_version_id based on the plugin -- 'category'',
'name' and 'version'
+
+ // Get the category_id
+ $query = 'SELECT category_id FROM categories WHERE name = "' .
$pluginData['category'] . '"';
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+
+ $the_row = @ mysql_fetch_array($result);
+ $category_id = $the_row['category_id'];
+
+ if (empty($category_id)) {
+ echo "<br>Undefined Plugin category:
",$pluginData['category'],'<br>';
+ return "";
+ }
+
+ //
+ $query = 'SELECT version_auto_id FROM
plugin_list,plugin_version WHERE plugin_list.category_id ='.$category_id.
+ ' and plugin_list.plugin_auto_id =
plugin_version.plugin_id '.
+ 'and plugin_list.name
="'.$pluginData['name'].'" and plugin_version.version =
'.$pluginData['version'];
+
+ //Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+
+ $the_row = @ mysql_fetch_array($result);
+ $version_id = $the_row['version_auto_id'];
+
+ return $version_id;
+}
+
+function validateThemeData($connection, $themeData) {
+
+ $retValue = true;
+
+ $theme_version_id = getThemeVersionID($connection, $themeData);
+ if (!empty($theme_version_id)) {
+ echo "Error: Theme already existed!<br>";
+ $retValue = false;
+ }
+
+ if (count($themeData['pluginGroup']) == 0) {
+ echo "Error: Plugin group is not defined!<br>";
+ $retValue = false;
+ }
+
+ $pluginGroup = $themeData['pluginGroup'];
+ for ($i=0; $i<count($pluginGroup); $i++) {
+ $pluginVersionID = getPluginVersionID($connection,
$pluginGroup[$i]);
+ if (empty($pluginVersionID)) {
+ echo "Error: Unknown plugin-version:
",$pluginGroup[$i]['name'],'--',$pluginGroup[$i]['version'],"<br>";
+ $retValue = false;
+ }
+ }
+
+ return $retValue;
+}
+
+function getThemeVersionID($connection, $themeData) {
+ $query = 'SELECT version_auto_id FROM theme_list, theme_version
WHERE theme_list.theme_auto_id = theme_version.theme_id ' .
+ ' and theme_list.name = "' . $themeData['name']
.'"' .
+ ' and theme_version.version = ' .
$themeData['version'];
+
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+
+ $the_row = @ mysql_fetch_array($result);
+ $theme_version_id = $the_row['version_auto_id'];
+
+ return $theme_version_id;
+}
+
+function getThemeUniqueID($connection) {
+ $retValue = -1;
+ $dbQuery = "select max(unique_id) as current_max from theme_list";
+ // Run the query
+ if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ if (@ mysql_num_rows($result) != 0) {
+ $the_row = @ mysql_fetch_array($result);
+ $current_max = $the_row['current_max'];
+ $retValue = $current_max + 1;
+ }
+
+ return $retValue;
+}
+
+
+function saveThemeToDB($connection, $themeData) {
+ //echo "Enter saveThemeToDB() <br>";
+ //printThemeData($themeData);
+ echo "<br><br>";
+
+ //Check if there is an old version of this theme in DB
+ $dbQuery = 'SELECT theme_auto_id FROM theme_list ' .
+ ' WHERE name = "' . $themeData['name'] . '"';
+
+ // Run the query
+ if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ if (@ mysql_num_rows($result) != 0) {
+ //There is an old version in the DB, update the row in
the table theme_list
+
+ $the_row = @ mysql_fetch_array($result);
+ $theme_auto_id = $the_row['theme_auto_id'];
+ echo "There is an old version of this theme in the DB,
theme_auto_id =" . $theme_auto_id . "<br>";
+
+ $theProjuctURL = "";
+ if (isset($pluginProps['projectURL'])) {
+ $theProjuctURL = $pluginProps['projectURL'];
+ }
+
+ // Update the table "theme_list"
+ $dbQuery = 'UPDATE theme_list ' .
+ 'SET description = "' .
addslashes($themeData['description']) . '" ' .
+ 'WHERE theme_auto_id = ' . $theme_auto_id;
+
+ // Run the query
+ if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ }
+ else {
+ //echo "This is a new theme, add a row in the table
theme_list.<br>";
+ //This is a new theme, add a row in the table theme_list
+
+ $theme_unique_id = getThemeUniqueID($connection);
+
+ $dbQuery = 'INSERT INTO theme_list VALUES ' .
+ '(0, "' . $themeData['name'] . '", ' . $theme_unique_id
. ', "' . addslashes($themeData['description']). '",now())';
+
+ // Run the query
+ if (!($result = @ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ $theme_auto_id = mysql_insert_id($connection);
+ }
+
+ // Insert a row into table plugin_version
+ $dbQuery = 'INSERT INTO theme_version VALUES (0, ' . $theme_auto_id .
+ ',\'' . $themeData['cyVersion'] . '\',' .$themeData['version']
. ',\'' . $themeData['releaseDate'] .'\',\'public\',now())';
+
+ //echo "query = ",$dbQuery,'<br>';
+ // Run the query
+ if (!(@ mysql_query($dbQuery, $connection)))
+ showerror();
+
+ $theme_version_auto_id = mysql_insert_id($connection);
+
+ // Insert rows into table theme_plugin
+ $pluginGroup = $themeData['pluginGroup'];
+ for ($i=0; $i< count($pluginGroup); $i++) {
+ $pluginVersionID = getPluginVersionID($connection,
$pluginGroup[$i]);
+
+ $dbQuery = 'INSERT INTO theme_plugin VALUES (0, ' .
$theme_version_auto_id .','. $pluginVersionID.')';
+
+ //echo "query = ",$dbQuery,'<br>';
+ // Run the query
+ if (!(@ mysql_query($dbQuery, $connection)))
+ showerror();
+ }
+}
+
+
+// mode = 'new', Data is submited by user
+// mode = 'edit', Cytostaff edit the data in CyPluginDB
+$mode = 'new'; // by default it is 'new'
+
+// If versionid is provided through URL, it is in edit mode
+$themeID = NULL; // used for edit mode only
+include 'clean.inc';
+if (isset ($_GET['versionid'])) {
+ $themeID = cleanInt($_GET['versionid']);
+}
+
+if ($themeID != NULL) {
+ $mode = 'edit';
+}
+
+// Set the page title based on the mode
+if ($mode == 'new') {
+ $pageTitle = 'Submit Theme to Cytoscape';
+} else
+ if ($mode == 'edit') {
+ $pageTitle = 'Edit Theme in CyPluginDB';
+ } else {
+ exit ('Unknown page mode, mode must be either new or edit');
+ }
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+ <title><?php echo $pageTitle;?></title>
+ <link rel="stylesheet" type="text/css" media="screen"
href="/cyto_web/css/cytoscape.css">
+ <link rel="shortcut icon" href="/cyto_web/images/cyto.ico">
+ <style type="text/css">
+<!--
+.style4 {color: #FF0000}
+-->
+ </style>
+</head>
+<body bgcolor="#ffffff">
+<div id="topbar">
+ <div class="title"><?php echo $pageTitle; ?></div>
+</div>
+
+<?php include "../nav.php"; ?>
+
+<?php
+
+$tried = NULL;
+if (isset ($_POST['tried'])) {
+ $tried = 'yes';
+}
+
+// Include the DBMS credentials
+include 'db.inc';
+
+// Connect to the MySQL DBMS
+if ($mode == 'edit') {
+ if (!($connection = @ mysql_pconnect($dbServer, $cytostaff,
$cytostaffPass)))
+ showerror();
+} else // $mode == 'new'
+ {
+ if (!($connection = @ mysql_pconnect($dbServer, $dbUser, $dbPass)))
+ showerror();
+}
+// Use the CyPluginDB database
+if (!mysql_select_db($dbName, $connection))
+ showerror();
+
+// initialize the variables
+$fileUpload = NULL;
+
+// Case for 'edit', pull data out of DB for the given themeID
+if (($tried == NULL) && ($mode == 'edit')) {
+ exit("Edit page is not implemented yet. <br>If you want to make the
change to the existing theme, you need to delete it and upload it again!");
+}
+
+// Remember the form data. If form validation failed, these data will
+// be used to fill the refreshed form. If pass, they will be saved into
+// database
+// ????
+
+
+//////////////////////// Form validation ////////////////////////
+$validated = true;
+
+if ($tried != NULL && $tried == 'yes') {
+ if (($mode == 'new') && empty ($_FILES['themefile']['name'])) {
+ $validated = false;
+?>
+ <strong>Error: A theme file is required.</strong>
+ <?php
+ }
+}
+//////// End of form validation ////////////////////
+
+
+// if the mode is 'new' (i.e. submit from user), check if the theme already
existed
+if ($tried != NULL && $tried == 'yes' && $validated && $mode == 'new') {
+
+ //if (isThemeVersionExists($connection, $pluginProps)) {
+ // $validated = false;
+ //}
+
+ //$themeData = getThemeDataFromFile($_FILES['themefile']['tmp_name']);
+ //printThemeData($themeData);
+
+ //$themeID = getThemeVersionID($connection, $themeData);
+
+
+}
+///////////////////////////////// Form definition //////////////////////////
+
+if (!($tried && $validated)) {
+?>
+
+<blockquote>
+ <p><SPAN id="_ctl3_LabelRequired"> Fields denoted by an (<span
class="style4">*</span>) are required.</SPAN></p>
+</blockquote>
+
+<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"
enctype="multipart/form-data" name="submittheme" id="submittheme">
+
+ <table width="753" border="0">
+ <tr>
+ <th width="130" scope="col"><span class="style2 style4">*</span>Theme
File </th>
+ <th width="389" scope="col"><div align="left">
+ <input name="themefile" type="file" id="themefile" size="50">
+ </div></th>
+ <th width="220" scope="col"> </th>
+ </tr>
+
+ <?php
+ /*
+ <tr>
+ <th scope="row"> </th>
+ <td><div align="center">Name</div></td>
+ <td><span class="style2 style4">*</span>E-mail</td>
+ </tr>
+ <tr>
+ <th scope="row">Contact</th>
+ <td><input name="tfContact" type="text" id="tfContact" size="62" /></td>
+ <td><input name="tfEmail" type="text" id="tfEmail" size="35" /></td>
+ </tr>
+ */
+ ?>
+ <tr>
+ <th height="80" scope="row"> </th>
+ <td><input name="Submit" type="submit" id="Submit" value="Submit" /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="tried" type="hidden" id="tried" value="yes">
+ <input name="themeID" type="hidden" id="themeID" value="<?php echo
$themeID; ?>"></td>
+ </tr>
+ </table>
+</form>
+
+<?php
+} // end of Form definition
+else
+ ////////////////////////// form processing /////////////////////////
+{
+
+ $themeData = getThemeDataFromFile($_FILES['themefile']['tmp_name']);
+ if (validateThemeData($connection, $themeData)) {
+ saveThemeToDB($connection, $themeData);
+
+ echo "Theme data is uploaded successfully!<br>";
+ }
+ else {
+ echo "<br>Please correct the errors, and try again!<br><br>";
+ }
+
+}
+// end of form processing
+
+?>
+
+<?php include "../footer.php"; ?>
+<br>
+</body>
+</html>
Property changes on:
new_cytoscape_website/plugin_website/plugins/themesubmit.php
___________________________________________________________________
Name: svn:executable
+ *
Added: new_cytoscape_website/plugin_website/plugins/themeversiondelete.php
===================================================================
--- new_cytoscape_website/plugin_website/plugins/themeversiondelete.php
(rev 0)
+++ new_cytoscape_website/plugin_website/plugins/themeversiondelete.php
2010-09-10 18:26:30 UTC (rev 21790)
@@ -0,0 +1,157 @@
+<?php //include "logininfo.inc"; ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+ <title>Delete theme version</title>
+ <link rel="stylesheet" type="text/css" media="screen"
href="http://cytoscape.org/css/cytoscape.css">
+ <link rel="shortcut icon" href="http://cytoscape.org/images/cyto.ico">
+</head>
+<body bgcolor="#ffffff">
+<div id="topbar">
+ <div class="title">Delete theme version</div>
+</div>
+
+
+<?php include "http://cytoscape.org/nav.php"; ?>
+
+<?php
+include 'clean.inc';
+$versionID = NULL;
+if (isset ($_GET['versionid'])) {
+ $versionID = cleanInt($_GET['versionid']);
+}
+if (isset ($_POST['versionid'])) {
+ $versionID = cleanInt($_POST['versionid']);
+}
+
+$deleteAction = NULL;
+if (isset ($_POST['delete'])) {
+ $deleteAction = $_POST['delete'];
+}
+$tried = NULL;
+if (isset ($_POST['tried'])) {
+ $tried = 'yes';
+}
+
+if (!($tried)) {
+?>
+
+
+<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"
enctype="multipart/form-data" name="deletetheme" id="deletetheme">
+ <label></label>
+ <label></label>
+<table width="605" border="0">
+ <tr>
+ <td width="595"> </td>
+ </tr>
+ <tr>
+ <td>Are you sure you want to delete a theme version? </td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><label>
+ <input name="tried" type="hidden" id="tried" value="yes">
+ <input name="versionid" type="hidden" id="versionid" value="<?php echo
$versionID;?>">
+
+ <div align="center">
+ <input name="delete" type="submit" id="delete" value="yes">
+ <input name="delete" type="submit" id="delete" value="cancel">
+ </div>
+ </label></td>
+ </tr>
+ </table>
+</form>
+<?php
+
+
+} else { // process the data
+
+ // If user press cancel button, redirect the user to the admin page
+ if ($deleteAction == 'cancel') {
+ header('location:themeadmin.php');
+ exit();
+ }
+
+ // User confirmed to delete the theme version
+
+ // Include the DBMS credentials
+ include 'db.inc';
+
+ // Connect to the MySQL DBMS
+ if (!($connection = @ mysql_pconnect($dbServer, $cytostaff,
$cytostaffPass)))
+ showerror();
+ // Use the CyPluginDB database
+ if (!mysql_select_db($dbName, $connection))
+ showerror();
+
+ //get the theme_id
+ $query = 'select theme_id from theme_version where version_auto_id
='.$versionID;
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+ $theRow = @ mysql_fetch_array($result);
+ $theme_id = $theRow['theme_id'];
+
+ //echo "theme_id = ",$theme_id,'<br>';
+
+ // get the set of theme_plugin_auto_id from table theme_plugin
+ $query = 'select theme_plugin_auto_id from theme_plugin where
theme_version_id ='.$versionID;
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+ $theme_plugin_ids ='';
+ while ($theRow = @ mysql_fetch_array($result)) {
+ $theme_plugin_ids .= $theRow["theme_plugin_auto_id"].',';
+ }
+ $theme_plugin_ids = substr($theme_plugin_ids, 0,
strlen($theme_plugin_ids)-1); //remove the last ','
+
+ //echo "theme_plugin_ids =",$theme_plugin_ids,'<br>';
+
+ // begin to delete
+ if (trim($theme_plugin_ids)!="") {
+ $query = 'delete from theme_plugin where theme_plugin_auto_id IN
('.$theme_plugin_ids.')';
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+ }
+
+ $query = 'delete from theme_version where version_auto_id ='.$versionID;
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+
+ //Are there any versions for this theme left?
+ $query = 'select version_auto_id from theme_version where theme_id
='.$theme_id;
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+
+ $versionCount = @ mysql_num_rows($result);
+ if ($versionCount == 0) {
+ // If there is no version left for this theme, also delete the
row from the theme_list
+ $query = 'delete from theme_list where theme_auto_id ='.$theme_id;
+ // Run the query
+ if (!($result = @ mysql_query($query, $connection)))
+ showerror();
+ }
+
+
+ // delete successful, redirect to admin page
+ ?>
+ The theme is deleted. <a href="themeadmin.php">Back to theme
administration page</a>
+ <?php
+ include 'luceneUtil.inc';
+ createLuceneIndex($connection);
+
+ // re-run the script "generate_plugin_xml.pl" to update
plugins.xml file
+ system("./run_generate_plugin_xml.csh");
+}
+?>
+<p>
+<?php include "http://cytoscape.org/footer.php"; ?>
+</p>
+</body>
+</html>
Property changes on:
new_cytoscape_website/plugin_website/plugins/themeversiondelete.php
___________________________________________________________________
Name: svn:executable
+ *
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.