Changeset 936


Ignore:
Timestamp:
2000-02-17T15:35:04+13:00 (24 years ago)
Author:
sjboddie
Message:

tidied up search history stuff a bit - replaced strings with macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/queryaction.cpp

    r928 r936  
    2828/*
    2929   $Log$
     30   Revision 1.35  2000/02/17 02:35:04  sjboddie
     31   tidied up search history stuff a bit - replaced strings with macros
     32
    3033   Revision 1.34  2000/02/15 22:53:52  kjm18
    3134   search history stuff added.
     
    360363  arg_ainfo.longname = "history display";
    361364  arg_ainfo.multiplechar = false;
     365  arg_ainfo.multiplevalue = false;
    362366  arg_ainfo.defaultstatus = cgiarginfo::weak;
    363367  arg_ainfo.argdefault = "0";
     
    609613} // define external macros
    610614
    611 void queryaction::define_history_macros(displayclass &disp, cgiargsclass &args,
    612                       recptprotolistclass *protos, ostream &logout) {
     615void queryaction::define_history_macros (displayclass &disp, cgiargsclass &args,
     616                     recptprotolistclass *protos, ostream &logout) {
    613617
    614618  // defines the following macros
     
    626630    text_t userid = args["z"];
    627631    text_tarray entries;
    628     if (get_history_info(userid, entries)) {
     632    if (get_history_info (userid, entries, logout)) {
    629633      int count = 1;
    630634      text_tarray::iterator here = entries.begin();
     
    637641      historylist += "<table align=center width=500 border=0>\n";
    638642      historylist += "<tr><td width=300 align=center>";
    639       historylist += "<a href=\"_httpclearhistory_\">Clear History</a></td>\n";
     643      historylist += "<a href=\"_httpclearhistory_\">_textclearhistory_</a></td>\n";
    640644
    641645      if (size>5&&args["hcl"]==1) { //compress the list, show the expand button
    642646       
    643       historylist += "<td><a href=\"_gwcgi_?e=_compressedoptions_&a=q&hcl=0\">Expand</a></td>\n";
     647      historylist += "<td><a href=\"_gwcgi_?e=_compressedoptions_&a=q&hcl=0\">_textexpand_</a></td>\n";
    644648      }
    645649      else if (size >5 && args["hcl"]==0) { // expand the list, show contract button
    646     historylist += "<td><a href=\"_gwcgi_?e=_compressedoptions_&a=q&hcl=1\">Contract</a></td>\n";
     650    historylist += "<td><a href=\"_gwcgi_?e=_compressedoptions_&a=q&hcl=1\">_textcontract_</a></td>\n";
    647651      }
    648652      historylist += "</table>\n";
    649       historylist += " <table align=center width=500 border=1> \n <tr><th colspan=4 align=center>";
    650       historylist += "Search History </th></tr>\n";
    651       historylist += "<tr><th width=40>#</th>\n<th width=340>Query</th>\n";
    652       historylist += "<th width=60>Results</th><th width=60>View</th></tr>\n";
     653      historylist += "<table align=center width=500 border=1>\n<tr><th colspan=4 align=center>";
     654      historylist += "_textsearchhistory_</th></tr>\n";
     655      historylist += "<tr><th width=40>#</th>\n<th width=340>_textquery_</th>\n";
     656      historylist += "<th width=60>_textresults_</th><th width=60>_textview_</th></tr>\n";
    653657
    654658      while (here !=end ) {
    655659    text_t c;
    656660    text_t query;
    657     text_t q = "q";
    658661    text_t numdocs;
    659662    text_t cgiargs;
    660663    text_t  userinfo;
    661664    split_saved_query(*here,c, numdocs, cgiargs);
    662     parse_saved_args(cgiargs, q, query); // get query string out
     665    parse_saved_args(cgiargs, "q", query); // get query string out
    663666    decode_cgi_arg(query); // un cgisafe it
    664667   
     
    668671    historylist += "<td width=340 align=left>"+query+"</td><td width=60 align=center>"+numdocs+"</td>\n";
    669672    historylist += "<td width=60 align=center><a href=\"_gwcgi_?e=_compressedoptions_&";
    670     historylist += *here+"\"><img name=\"display\" src=\"/gsdl/images/display.gif\" width=\"60\" ";
    671     historylist += "height=\"20\" border=\"0\" alt=\"" + userinfo +"\"></a></td></tr>\n";
    672       here++;
    673       count++;
     673    historylist += *here+"\"><img name=\"display\" src=\"_httpicondisplay_\" width=_widthdisplay_ ";
     674    historylist += "height=_heightdisplay_ border=\"0\" alt=\"" + userinfo +"\"></a></td></tr>\n";
     675    here++;
     676    count++;
    674677      }
    675678      historylist+="</table>\n\n";
     
    677680    } // if
    678681    else {
    679       historylist += "Search history not available\n";
     682      historylist += "_textnohistory_";
    680683    }
    681684    historylist += "<p><! ---- end of history list ----->\n";
     
    11071110    logout << "save failed";
    11081111
    1109   define_history_macros(disp, args, protos, logout);
     1112  define_history_macros (disp, args, protos, logout);
    11101113
    11111114  textout << outconvert << disp << "_query:header_\n"
Note: See TracChangeset for help on using the changeset viewer.