Index: trunk/gsdl/src/recpt/pageaction.cpp
===================================================================
--- trunk/gsdl/src/recpt/pageaction.cpp	(revision 865)
+++ trunk/gsdl/src/recpt/pageaction.cpp	(revision 866)
@@ -28,4 +28,9 @@
 /*
    $Log$
+   Revision 1.23  2000/01/24 22:59:57  sjboddie
+   changes to set macros differently for preferences page depending
+   on type of collection - pageaction is getting kind of hacky - should
+   tidy it up some day
+
    Revision 1.22  1999/11/25 23:01:09  sjboddie
    now need to be able to handle it if no collection is selected
@@ -176,6 +181,6 @@
 	text_tarray::iterator collist_end = collist.end();
 	
-	int row1 = 6;
-	int row2 = 4;
+	int row1 = 7;
+	int row2 = 5;
 	int count = 1;
 	while (collist_here != collist_end) {
@@ -219,8 +224,9 @@
 	      if (*collist_here == "chinese")
 		link = "<a href=\"_gwcgi_?a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";
+	      if (*collist_here == "arabic")
+		link = "<a href=\"_gwcgi_?a=p&p=about&w=a&c=" + *collist_here + "\">";
 
 	      if (!cinfo.receptionist.empty()) 
-		link = "<a href=\"" + cinfo.receptionist + "?a=p&p=about&c=" 
-		  + *collist_here + "\">";
+		link = "<a href=\"" + cinfo.receptionist + "\">";
 	      
 	      homeextra += link + collectionname + "</a>\n";
@@ -248,4 +254,9 @@
   // define_internal_macros sets the following macros:
 
+  // _numdocs_             the number of documents in the collection
+
+  // _builddate_           the date last built
+
+
   // if page is "home"
   // _homeextra_           this is the list of available collections and collection info
@@ -253,8 +264,13 @@
 
 
+  // if page is "preferences"
+  // _collectionoption_    collections to search/browse (if cross-collection-searching is on)
+
+  // _htmloptions_         set to _htmloptionson_ if DocumentUseHTML is set
+
+
   // if page is "about"
-  // _numdocs_             the number of documents in the collection
-
-  // _builddate_           the date last built
+  // _textsubcollections_  the text on which subcollections make up the collection (if 
+  //                       cross-collection searching is being used
 
   // _textbrowseoptions_   the 'how to find information' text in the about and help pages
@@ -270,11 +286,12 @@
   
   text_t &arg_p = args["p"];
-
-  recptproto* collectproto = protos->getrecptproto (args["c"], logout);
+  text_t &arg_c = args["c"];
+  ColInfoResponse_t cinfo;
+  comerror_t err;
+
+  recptproto* collectproto = protos->getrecptproto (arg_c, logout);
   if (collectproto != NULL) {
-    comerror_t err;
-    ColInfoResponse_t cinfo;
-    collectproto->get_collectinfo (args["c"], cinfo, err, logout);
-  
+    collectproto->get_collectinfo (arg_c, cinfo, err, logout);
+
     disp.setmacro ("numdocs", "Global", cinfo.numDocs);
     unsigned long current_time = time(NULL);
@@ -285,5 +302,39 @@
   if (arg_p == "home") set_homeextra_macro (disp, protos, logout);
 
-  else if (arg_p == "about" || arg_p == "help") {
+  else if (arg_p == "preferences") {
+    
+    // _collectionoption_
+
+    if (args["ccs"] == "1" && collectproto != NULL && (cinfo.ccsCols.size() > 1)) {
+      text_t collectionoption = "_textcollectionoption_";
+      text_tarray::const_iterator col_here = cinfo.ccsCols.begin();
+      text_tarray::const_iterator col_end = cinfo.ccsCols.end();
+      while (col_here != col_end) {
+	text_t colname;
+	if (*col_here == arg_c) {
+	    colname = cinfo.collectionmeta["collectionname"];
+	} else {
+	  ColInfoResponse_t this_cinfo;
+	  collectproto->get_collectinfo (*col_here, this_cinfo, err, logout);
+	  colname = this_cinfo.collectionmeta["collectionname"];
+	}
+
+	collectionoption += "<input type=checkbox name=\"cc\" value=\"" + 
+	  *col_here + "\" onClick=\"updatecc(\'" + *col_here + "\');\"> " +
+	  colname + "<br>\n";
+	col_here ++;
+      }
+
+      disp.setmacro ("collectionoption", "preferences", collectionoption);
+    }
+
+    // _htmloptions_
+    
+    text_tmap::const_iterator it = cinfo.format.find ("DocumentUseHTML");
+    if ((it != cinfo.format.end()) && ((*it).second == "true"))
+      disp.setmacro ("htmloptions", "preferences", "_htmloptionson_");
+
+    
+  } else if (arg_p == "about" || arg_p == "help") {
     if (collectproto == NULL) return;
     
@@ -322,4 +373,28 @@
     shorttext += "</ul>\n";
     disp.setmacro ("textbrowseoptions", "help", shorttext + longtext);
+
+    if (arg_p == "about") {
+
+      // _textsubcollections_
+      if (args["ccs"] == "1" && (cinfo.ccsCols.size() > 1)) {
+	text_t textsubcollections = "_textsubcols1_(" + text_t(cinfo.ccsCols.size()) + ")";
+	text_tarray::const_iterator here = cinfo.ccsCols.begin();
+	text_tarray::const_iterator end = cinfo.ccsCols.end();
+	while (here != end) {
+	  if (*here == arg_c) {
+	    textsubcollections += "\n<br>" + cinfo.collectionmeta["collectionname"] + "\n";
+	  } else {
+	    ColInfoResponse_t this_cinfo;
+	    collectproto->get_collectinfo (*here, this_cinfo, err, logout);
+	    if (err == noError) {
+	      textsubcollections += "\n<br>" + this_cinfo.collectionmeta["collectionname"] + "\n";
+	    }
+	  }
+	  here ++;
+	}
+	textsubcollections += "_textsubcols2_";
+	disp.setmacro ("textsubcollections", "about", textsubcollections);
+      }
+    }
   }
 }
