[Zope-CVS] CVS: Packages/Moztop/moztop/content/lib - sitesmanager.js:1.11

Stephan Richter srichter@cbu.edu
Sat, 22 Mar 2003 22:05:56 -0500


Update of /cvs-repository/Packages/Moztop/moztop/content/lib
In directory cvs.zope.org:/tmp/cvs-serv16711/moztop/content/lib

Modified Files:
	sitesmanager.js 
Log Message:
After finding the previously reported bug and fixing it, add Site worked 
immediately, of course.

Implemented removeSelectedSite().


=== Packages/Moztop/moztop/content/lib/sitesmanager.js 1.10 => 1.11 ===
--- Packages/Moztop/moztop/content/lib/sitesmanager.js:1.10	Sat Mar 22 21:20:36 2003
+++ Packages/Moztop/moztop/content/lib/sitesmanager.js	Sat Mar 22 22:05:25 2003
@@ -173,7 +173,27 @@
 
        Note: No remote action has to be taken.*/
 
+    // Get some of the needed variables together
+    var site = this.getDataSource(this.sitesurl).getNode(rsdurl);
+    var contentsurl = site.getTarget(this.contentsurlprop).getValue();
+    var typesurl = site.getTarget(this.resourcetypesurlprop).getValue();
+
+    // Decouple the site from the sites RDF
+    sitesds = this.getDataSource(this.sitesurl);
+    sitesds.deleteRecursive(rsdurl);
+    sitesds.save();
+
+    // Now remove data sources from the tree
+    this.removeDataSource(contentsurl);
+    this.removeDataSource(typesurl);
+
     return true;
+}
+
+
+SitesManager.prototype.removeSelectedSite = function() {
+    /* Remove selected site from navigation tree */
+    this.removeSite(this.getSelectedResource().getValue());
 }