Index: unk/gsdl/src/recpt/delhistoryaction.cpp
===================================================================
--- /trunk/gsdl/src/recpt/delhistoryaction.cpp	(revision 1915)
+++ 	(revision )
@@ -1,207 +1,0 @@
-/**********************************************************************
- *
- * delhistoryaction.cpp -- allows user to select history items to delete
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *********************************************************************/
-
-#include "delhistoryaction.h"
-#include "cgiutils.h"
-#include "text_t.h"
-#include "historydb.h"
-
-delhistoryaction::delhistoryaction () {
-
-  // this action uses cgi variable "a"
-  cgiarginfo arg_ainfo;
-  arg_ainfo.shortname = "a";
-  arg_ainfo.longname = "action";
-  arg_ainfo.multiplechar = true;
-  arg_ainfo.defaultstatus = cgiarginfo::weak;
-  arg_ainfo.argdefault = "dh";
-  arg_ainfo.savedarginfo = cgiarginfo::must;
-  argsinfo.addarginfo (NULL, arg_ainfo);
-
-  // "hmode" -- indicate whether selected records are to be
-  // saved or deleted
-  arg_ainfo.shortname = "hmode";
-  arg_ainfo.longname = "history deletion mode";
-  arg_ainfo.multiplechar = true;
-  arg_ainfo.defaultstatus = cgiarginfo::weak;
-  arg_ainfo.argdefault = "delete";
-  arg_ainfo.savedarginfo = cgiarginfo::mustnot;
-  argsinfo.addarginfo (NULL, arg_ainfo);
-
-  // "hsr" -- the selected records
-  arg_ainfo.shortname = "hsr";
-  arg_ainfo.longname = "history selected records";
-  arg_ainfo.multiplechar = true;
-  arg_ainfo.multiplevalue = true;
-  arg_ainfo.defaultstatus = cgiarginfo::weak;
-  arg_ainfo.argdefault = "";
-  arg_ainfo.savedarginfo = cgiarginfo::mustnot;
-  argsinfo.addarginfo (NULL, arg_ainfo);
-
-  // "hdh" delete history for current user
-  // clear history = 0 = delete some, 1 = delete all
-  arg_ainfo.shortname = "hdh";
-  arg_ainfo.longname = "history delete history";
-  arg_ainfo.multiplechar = false;
-  arg_ainfo.multiplevalue = false;
-  arg_ainfo.defaultstatus = cgiarginfo::weak;
-  arg_ainfo.argdefault = "0";
-  arg_ainfo.savedarginfo = cgiarginfo::mustnot;
-  argsinfo.addarginfo (NULL, arg_ainfo);
-
-}
-
-void delhistoryaction::configure (const text_t &key, const text_tarray &cfgline) {
-  action::configure (key, cfgline);
-}
-
-bool delhistoryaction::init (ostream &logout) {
-  return action::init (logout);
-}
-
-bool delhistoryaction::check_cgiargs (cgiargsinfoclass & /*argsinfo*/, cgiargsclass & /*args*/, 
-				      ostream &/*logout*/) {
-  //dont check anything yet
-  return true;
-}
-
-void delhistoryaction::get_cgihead_info (cgiargsclass &/*args*/, recptprotolistclass * /*protos*/,
-					 response_t &response, text_t &response_data, 
-					 ostream &/*logout*/) {
-  response = content;
-  response_data = "text/html";
-}
-
-void delhistoryaction::define_internal_macros (displayclass &/*disp*/, cgiargsclass &/*args*/, 
-					       recptprotolistclass * /*protos*/, 
-					       ostream &/*logout*/) {
-
-  // define_internal_macros sets the following macros:
-  //_searchhistorylist_
-
-  //  define_history_macros(disp, args, protos, logout);
-
-}
-
-
-void delhistoryaction::define_external_macros (displayclass &/*disp*/, cgiargsclass &/*args*/, 
-					       recptprotolistclass * /*protos*/, ostream &/*logout*/) {
-
-  // define_external_macros sets the following macros:
-  
-  // can't do anything if collectproto is null (i.e. no collection was specified)
-  //recptproto *collectproto = protos->getrecptproto (args["c"], logout);
-  //if (collectproto == NULL) return;
-  
-  // define_history_macros(disp, args, protos, logout);
-  
-}
-
-
-void delhistoryaction::define_history_macros(displayclass &disp, cgiargsclass &args, 
-					     recptprotolistclass *protos, ostream &logout) {
-
-  // defines the following macros
-
-  // _searchhistorylist_
-
-    text_t historylist = "<!-- Search History List -->\n";
-   
-    text_t userid = args["z"];
-    text_tarray entries;
-
-    historylist += "<table align=center width=500 border=1> \n <tr><th colspan=4 align=center>";
-    historylist += "_query:textsearchhistory_</th></tr>\n";
-    historylist += "<tr><th width=60>_textselect_</th><th width=40>#</th>\n<th width=340>_query:textquery_</th>\n";
-    historylist += "<th width=60>_query:textresults_</th></tr>\n";
-    if (get_history_info (userid, entries, gsdlhome, logout)) {
-      int count = 1;
-      text_tarray::iterator here = entries.begin();
-      text_tarray::iterator end = entries.end();
-      //      int size=(int)entries.size();
-      while (here !=end ) {
-	text_t c=count;
-	text_t querynum;
-	text_t query;
-	text_t numdocs;
-	text_t cgiargs;
-	text_t  userinfo;
-	split_saved_query(*here, querynum, numdocs, cgiargs);
-	parse_saved_args(cgiargs, "q", query); // get query string out
-	decode_cgi_arg(query); // un cgisafe it
-	
-	format_user_info(cgiargs, userinfo, protos, logout);
-	
-	historylist += "<tr> <td width=60 align=center><input type=checkbox name=hsr value=\""+querynum+"\"></td>";
-	historylist += "<td width=40 align=center>"+querynum+"</td>\n";
-	historylist += "<td width=340 align=left>"+query+"</td><td width=60 align=center>"+numdocs+"</td>\n";
-	here++;
-	count++;
-      }
-     
-     
-    } // if
-    else { // have an empty row
-      historylist += "";
-    }
-    historylist+="</table>";
-    historylist += "<p><! ---- end of history list ----->\n";
-    disp.setmacro("searchhistorylist", "delhistory", historylist);
-
-} // define history macros
-
-
-bool delhistoryaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 
-				  browsermapclass * /*browsers*/, displayclass &disp, 
-				  outconvertclass &outconvert, ostream &textout, 
-				  ostream &logout) {
-
-  if (args["hdh"] !="") {
-    delete_search_history(args);
-  }
-  define_history_macros(disp, args, protos, logout);
-  textout << outconvert << disp << ("_delhistory:header_\n")
-	  << ("_delhistory:content_\n")
-	  << ("_delhistory:footer_\n");
-
-  return true;
-}
-
-
-bool delhistoryaction::delete_search_history (cgiargsclass &args) {
-  
-  bool result;
-  text_t userid = args["z"];
-  text_t type = args["hdh"];
-  if (type == "1") {
-    result = delete_all_history_info (userid, gsdlhome);
-  } else {
-    text_t records = args["hsr"];
-    text_t deletemode = args["hmode"];
-    result = delete_history_info (userid, deletemode, records, gsdlhome);
-  }
-
-  return result;
-}
Index: unk/gsdl/src/recpt/delhistoryaction.h
===================================================================
--- /trunk/gsdl/src/recpt/delhistoryaction.h	(revision 1915)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/**********************************************************************
- *
- * delhistoryaction.h --  allows user to select history items to delete
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *********************************************************************/
-
-
-#ifndef DELHISTORYACTION_H
-#define DELHISTORYACTION_H
-
-#include "gsdlconf.h"
-#include "action.h"
-
-
-class delhistoryaction : public action {
-
-protected:
-
-  void define_history_macros (displayclass &disp, cgiargsclass &args, 
-			       recptprotolistclass *protos, ostream &logout);
-
-  void set_option_macro (const text_t &macroname, text_t current_value,
-			 const FilterOption_t &option, displayclass &disp);
-
-
-  bool delete_search_history(cgiargsclass &args);
-
-public:
-  delhistoryaction ();
-  virtual ~delhistoryaction () {}
-  
-  void configure (const text_t &key, const text_tarray &cfgline);
-  bool init (ostream &logout);
-  
-  text_t get_action_name () {return "dh";}
-  
-  bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args, 
-		      ostream &logout);
-
-  void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
-			 response_t &response, text_t &response_data, 
-			 ostream &logout);
-  
-  void define_internal_macros (displayclass &disp, cgiargsclass &args, 
-			       recptprotolistclass *protos, ostream &logout);
-
-  void define_external_macros (displayclass &disp, cgiargsclass &args, 
-			       recptprotolistclass *protos, ostream &logout);
-  
-  bool do_action (cgiargsclass &args, recptprotolistclass *protos, 
-		  browsermapclass *browsers, displayclass &disp, 
-		  outconvertclass &outconvert, ostream &textout, 
-		  ostream &logout);
-};
-
-#endif
