Index: /main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl	(revision 36071)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl	(revision 36072)
@@ -25,6 +25,7 @@
   <xsl:param name="google_tracking_id"/>
   <xsl:param name="googlesignin_client_id"/>
-
-  <xsl:variable name="berry_icon">berry.png</xsl:variable>
+  <xsl:param name="favouritebasket"/>
+  <xsl:param name="documentbasket"/>
+
   <xsl:variable name="unselected_favourite_icon">favourite-star-transparent-unselected32.png</xsl:variable>
   <xsl:variable name="selected_favourite_icon">favourite-star-transparent-selected32.png</xsl:variable>
@@ -53,14 +54,6 @@
   <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
   
-  <xsl:variable name="berrybasketswitch">
-    <xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/>
-  </xsl:variable>
-  <xsl:variable name="favouritebasketswitch">
-    <xsl:value-of select="/page/pageRequest/paramList/param[@name='favouritebasket']/@value"/>
-  </xsl:variable>
-  
-  <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
-  <xsl:variable name="favouriteBasketOn" select="/page/pageRequest/paramList/param[@name='favouritebasket' and @value='on']"/>
-  <xsl:variable name="documentBasketOn" select="/page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/>
+  <xsl:variable name="favouriteBasketOn" select="$favouritebasket = 'true' and /page/pageRequest/paramList/param[@name='favouritebasket' and @value='on']"/>
+  <xsl:variable name="documentBasketOn" select="$documentbasket = 'true' and /page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/>
   
 	<xsl:variable name="thisCollectionEditor">
@@ -811,17 +804,10 @@
   
   <!--
-BERRY BASKET TEMPLATES
-These get used on many different pages to add the
-berry basket function to the site
+BASKET TEMPLATES
+These get used on many different pages to add the favourites basket or 
+document basket to the site
   -->
   
   <xsl:template name="displayBaskets">
-      <xsl:if test="$berryBasketOn or $favouriteBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
-
-	      <xsl:if test="$berryBasketOn">
-		<!-- show the berry basket if it's turned on -->
-		<gslib:berryBasket/>
-		<xsl:text> </xsl:text>
-	      </xsl:if>
 
 	      <xsl:if test="$favouriteBasketOn">
@@ -829,39 +815,15 @@
 		<gslib:gotoFavourites/>
 		<xsl:text> </xsl:text>
-	      </xsl:if>
-
+ 	      </xsl:if>
+
+              <!-- is the document basket facility turned on, and does the user have premission to use it? -->
 	      <xsl:if test="$documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
-		<!-- show the document basket if its turned on and the user has permission-->
+		
 		<gslib:documentBasket/>
 		<xsl:text> </xsl:text>
 	      </xsl:if>
-      </xsl:if>
-  </xsl:template>
-
-  <!-- put the drag&drop berry basket on the page -->
-  <xsl:template name="berryBasket">
-    <xsl:if test="$berryBasketOn">
-      <div id="berrybasket" class="hide">
-        <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.title')"/><xsl:text> </xsl:text></span>
-        <span id="berryBasketExpandCollapseLinks" style="display: none;">
-          <a id="berryBasketExpandLink" href="javascript:showBasket()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.expand')"/></a>
-          <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.collapse')"/></a>
-        </span>
-        <div id="baskethandle">
-          <span>
-            <xsl:text> </xsl:text>
-          </span>
-        </div>
-        <div id="berries">
-          <span>
-            <xsl:text> </xsl:text>
-          </span>
-	</div>
-	<div><a id="berryFullViewLink" style="display: none;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
-	<div id="berryHelpMsg"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.help')"/></div>
-      </div>
-     
-    </xsl:if>
-  </xsl:template>
+      <!--</xsl:if>-->
+  </xsl:template>
+
   
   <!--
@@ -871,8 +833,8 @@
   -->
   <xsl:template name="gotoFavourites">
-    <!-- set up these gsf variables so we have access in javascript -->
+   <xsl:if test="$favouriteBasketOn">
+     <!-- set up these gsf variables so we have access in javascript -->
     <gsf:variable name="selected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$selected_favourite_icon"/></gsf:variable>
-    <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable>
-    <xsl:if test="$favouriteBasketOn">
+    <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable>     
       <div id="berrybasket" class="hide">
       <img src="interfaces/{$interface_name}/images/{$selected_favourite_icon}" title="click to add to favourites" width="16" height="16" border="0" />
@@ -880,5 +842,5 @@
 	<span id="favouritesCountDisplay">...</span>
 
-	<div><a id="favouritesFullViewLink" style="display: block;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
+	<div><a id="favouritesFullViewLink" style="display: block;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.full')"/></a></div>
       </div>
       <gsf:script>
@@ -899,5 +861,5 @@
 	}
 	
-	fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&amp;sa=berry&amp;c=&amp;s=DisplayList&amp;rt=r&amp;p.c=" + collectionName);
+	fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&amp;sa=fav&amp;c=&amp;s=DisplayList&amp;rt=r&amp;p.c=" + collectionName);
         fullView.style.display='block';
 
@@ -912,5 +874,5 @@
 	<xsl:template name="documentBasket">
 		<xsl:if test="$documentBasketOn and /page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
-			<div id="documentbasket" class="hide">
+			<div id="documentbasket" class="show">
 				<span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'db.doc_basket')"/><xsl:text> </xsl:text></span>
 				<span id="documentBasketExpandCollapseLinks" style="display: none;">
@@ -934,7 +896,18 @@
 		</xsl:if>
 	</xsl:template>
-  
-  <!-- include the required javascript and css for berry baskets -->
-  <xsl:template name="basketHeadTags">
+
+        <!-- include the required js and css for favourites-->
+        <xsl:template name="favouritesHeadTags">
+          <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
+          <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
+          <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/connection-min.js"><xsl:text> </xsl:text></script>
+          <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dom-min.js"><xsl:text> </xsl:text></script>
+          <script type="text/javascript" src="interfaces/{$interface_name}/js/favouritebasket/favouritebasket.js"><xsl:text> </xsl:text></script>
+    <link rel="stylesheet" href="interfaces/{$interface_name}/style/favourites.css" type="text/css"/>
+        </xsl:template>
+        
+  <!-- include the required javascript and css for document baskets 
+       Note, this may have unneeded things in it -->
+  <xsl:template name="documentBasketHeadTags">
     <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
     <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
@@ -944,5 +917,4 @@
 	<script type="text/javascript" src="interfaces/{$interface_name}/js/yui/cookie-min.js"><xsl:text> </xsl:text></script>
 	<script type="text/javascript" src="interfaces/{$interface_name}/js/yui/animation-min.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berryvariables.js"><xsl:text> </xsl:text></script>
 	<script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDPlayer.js"><xsl:text> </xsl:text></script>
     <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDOnTop.js"><xsl:text> </xsl:text></script>
@@ -967,18 +939,4 @@
   </xsl:template>
   
-  <!--
-create a little berry which can be drag&dropped onto the berry basket
-used on classifier and search result pages
--->
-  <xsl:template name="documentBerryForClassifierOrSearchPage">
-    <xsl:if test="$berryBasketOn">
-      <xsl:variable name="collname"><xsl:choose><xsl:when test="@collection"><xsl:value-of select="@collection"/></xsl:when><xsl:otherwise><xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:otherwise></xsl:choose></xsl:variable>
-      <img class="pick" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0">
-        <xsl:attribute name="id"><xsl:value-of select="$collname"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
-      </img>
-    </xsl:if>
-  </xsl:template>
-
- 
   <xsl:template name="documentFavouriteForClassifierOrSearchPage">
     <xsl:if test="$favouriteBasketOn">
@@ -990,27 +948,5 @@
   </xsl:template>
   
-  <!--
-create little berrys which can be drag&dropped onto the berry basket
-used on the document page
--->
-  <xsl:template name="documentBerryForDocumentPage">
-    <xsl:variable name="selectedNode">
-      <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
-    </xsl:variable>
-    <xsl:variable name="rootNode">
-      <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
-    </xsl:variable>
-    <xsl:if test="$berryBasketOn">
-      <div id="documentberries">
-        <img class="pick" id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
-        <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
-        <!--<xsl:if test="$selectedNode != $rootNode">
-          <img class="pick" id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
-          <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
-        </xsl:if>-->
-      </div>
-    </xsl:if>
-  </xsl:template>
-
+ 
   <xsl:template name="documentFavouriteForDocumentPage">
     <xsl:variable name="selectedNode">
