Changeset 940
- Timestamp:
- 2000-02-17T15:41:13+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/delhistoryaction.cpp
r928 r940 41 41 delhistoryaction::delhistoryaction () { 42 42 43 // num_phrases = 0;44 45 43 // this action uses cgi variable "a" 46 44 cgiarginfo arg_ainfo; … … 58 56 arg_ainfo.longname = "history deletion mode"; 59 57 arg_ainfo.multiplechar = true; 60 //arg_ainfo.multiplevalue = true;61 58 arg_ainfo.defaultstatus = cgiarginfo::weak; 62 59 arg_ainfo.argdefault = "delete"; … … 64 61 argsinfo.addarginfo (NULL, arg_ainfo); 65 62 66 // "hsr" -- the selected records 67 63 // "hsr" -- the selected records 68 64 arg_ainfo.shortname = "hsr"; 69 65 arg_ainfo.longname = "history selected records"; … … 76 72 77 73 // "hdh" delete history for current user 78 // clear history = delete some, delete all 79 74 // clear history = 0 = delete some, 1 = delete all 80 75 arg_ainfo.shortname = "hdh"; 81 76 arg_ainfo.longname = "history delete history"; 82 arg_ainfo.multiplechar = true; 83 arg_ainfo.defaultstatus = cgiarginfo::weak; 84 arg_ainfo.argdefault = ""; 77 arg_ainfo.multiplechar = false; 78 arg_ainfo.multiplevalue = false; 79 arg_ainfo.defaultstatus = cgiarginfo::weak; 80 arg_ainfo.argdefault = "0"; 85 81 arg_ainfo.savedarginfo = cgiarginfo::mustnot; 86 82 argsinfo.addarginfo (NULL, arg_ainfo); … … 122 118 123 119 void delhistoryaction::define_external_macros (displayclass &/*disp*/, cgiargsclass &/*args*/, 124 recptprotolistclass */*protos*/, ostream &/*logout*/) {120 recptprotolistclass * /*protos*/, ostream &/*logout*/) { 125 121 126 122 // define_external_macros sets the following macros: 127 123 128 124 // can't do anything if collectproto is null (i.e. no collection was specified) 129 125 //recptproto *collectproto = protos->getrecptproto (args["c"], logout); 130 126 //if (collectproto == NULL) return; 131 132 // define_history_macros(disp, args, protos, logout); 133 134 } // define external macros 127 128 // define_history_macros(disp, args, protos, logout); 129 130 } 131 135 132 136 133 void delhistoryaction::define_history_macros(displayclass &disp, cgiargsclass &args, 137 recptprotolistclass *protos, ostream &logout) {134 recptprotolistclass *protos, ostream &logout) { 138 135 139 136 // defines the following macros … … 146 143 text_tarray entries; 147 144 148 historylist += " 149 historylist += " Search History</th></tr>\n";150 historylist += "<tr><th width=60> select</th><th width=40>#</th>\n<th width=340>Query</th>\n";151 historylist += "<th width=60> Results</th></tr>\n";152 if (get_history_info (userid, entries)) {145 historylist += "<table align=center width=500 border=1> \n <tr><th colspan=4 align=center>"; 146 historylist += "_query:textsearchhistory_</th></tr>\n"; 147 historylist += "<tr><th width=60>_textselect_</th><th width=40>#</th>\n<th width=340>_query:textquery_</th>\n"; 148 historylist += "<th width=60>_query:textresults_</th></tr>\n"; 149 if (get_history_info (userid, entries, logout)) { 153 150 int count = 1; 154 151 text_tarray::iterator here = entries.begin(); … … 159 156 text_t querynum; 160 157 text_t query; 161 text_t q = "q";162 158 text_t numdocs; 163 159 text_t cgiargs; 164 160 text_t userinfo; 165 161 split_saved_query(*here, querynum, numdocs, cgiargs); 166 parse_saved_args(cgiargs, q, query); // get query string out162 parse_saved_args(cgiargs, "q", query); // get query string out 167 163 decode_cgi_arg(query); // un cgisafe it 168 164 … … 189 185 190 186 bool delhistoryaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 191 browsermapclass */*browsers*/, displayclass &disp,192 193 187 browsermapclass * /*browsers*/, displayclass &disp, 188 outconvertclass &outconvert, ostream &textout, 189 ostream &logout) { 194 190 195 191 if (args["hdh"] !="") { … … 205 201 206 202 207 bool delhistoryaction::delete_search_history(cgiargsclass &args) 208 { 209 203 bool delhistoryaction::delete_search_history (cgiargsclass &args) { 204 210 205 bool result; 211 206 text_t userid = args["z"]; 212 207 text_t type = args["hdh"]; 213 decode_cgi_arg(type); 214 if (type=="Delete All") { 215 result=delete_all_history_info(userid); 216 }else if (type=="Clear History"){ 208 if (type == "1") { 209 result = delete_all_history_info (userid); 210 } else { 217 211 text_t records = args["hsr"]; 218 212 text_t deletemode = args["hmode"]; 219 result=delete_history_info(userid, deletemode, records); 220 } else { 221 result=false; 213 result = delete_history_info (userid, deletemode, records); 222 214 } 223 215 224 216 return result; 225 226 } 227 228 229 230 231 217 } 218 219 220 221 222
Note:
See TracChangeset
for help on using the changeset viewer.