Changeset 2745 for trunk/gsdl/src
- Timestamp:
- 2001-09-21T12:20:54+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/queryaction.cpp
r2212 r2745 266 266 argsinfo.addarginfo (NULL, arg_ainfo); 267 267 268 // new arg for granularity, for mgpp collections268 // "g" - new arg for granularity, for mgpp collections 269 269 arg_ainfo.shortname = "g"; 270 270 arg_ainfo.longname = "granularity"; … … 614 614 text_t macrovalue = ""; 615 615 616 macrovalue += "<select name=\"fqf\" onChange=\"updatefqf();\">\n"; 616 if (option.validValues.size() == 1) { 617 macrovalue = "_ZZ_"; 618 } 619 else { 620 macrovalue += "<select name=\"fqf\" onChange=\"updatefqf();\">\n"; 621 622 text_tarray::const_iterator thisvalue = option.validValues.begin(); 623 text_tarray::const_iterator endvalue = option.validValues.end(); 624 625 while (thisvalue != endvalue) { 626 macrovalue += "<option value=\"" + *thisvalue + "\">_"; 627 macrovalue += *thisvalue + "_\n"; 628 thisvalue ++; 629 } 630 macrovalue += "</select>\n"; 631 } 632 disp.setmacro ("fqfselection", "query", macrovalue); 633 634 } 635 // sets the selection box macros _gselection_. 636 void queryaction::set_gselection_macro (text_t current_value, 637 const FilterOption_t &option, 638 displayclass &disp) { 639 640 if (option.validValues.size() <= 1) { 641 return; 642 } 643 644 text_t macrovalue = "<select name=\"g\">\n"; 645 646 if (current_value.empty()) current_value = option.defaultValue; 617 647 618 648 text_tarray::const_iterator thisvalue = option.validValues.begin(); … … 620 650 621 651 while (thisvalue != endvalue) { 622 macrovalue += "<option value=\"" + *thisvalue + "\">_"; 623 macrovalue += *thisvalue + "_\n"; 652 macrovalue += "<option value=\"" + *thisvalue + "\""; 653 if (*thisvalue == current_value) 654 macrovalue += " selected"; 655 macrovalue += ">_" + *thisvalue + "_\n"; 624 656 thisvalue ++; 625 657 } 626 658 macrovalue += "</select>\n"; 627 disp.setmacro ("fqfselection", "query", macrovalue); 628 659 disp.setmacro ("gselection", "Global", macrovalue); 629 660 } 630 661 … … 677 708 // _gselection_ (Level) // for mgpp collections 678 709 it = response.filterOptions.find("Level"); 679 if (it!=end) set_ option_macro("g",args["g"], (*it).second, disp);710 if (it!=end) set_gselection_macro(args["g"], (*it).second, disp); 680 711 681 712 // should probably go into define_internal_macros … … 754 785 parse_saved_args(cgiargs, "q", query); // get query string out 755 786 decode_cgi_arg(query); // un cgisafe it 756 escquery = escape_quotes(query); // escape the quotes 787 escquery = escape_quotes(query); // escape the quotes and newlines 757 788 text_t histvalue = "histvalue"; 758 789 histvalue += i; -
trunk/gsdl/src/recpt/queryaction.h
r1915 r2745 82 82 const FilterOption_t &option, displayclass &disp); 83 83 84 virtual void set_gselection_macro (text_t current_value, 85 const FilterOption_t &option, 86 displayclass &disp); 87 84 88 void output_ccp (cgiargsclass &args, recptprotolistclass *protos, 85 89 displayclass &disp, outconvertclass &outconvert, -
trunk/gsdl/src/recpt/querytools.cpp
r1988 r2745 252 252 else 253 253 querystring.appendint(nextdate); 254 querystring.appendcstr("]:C overage");254 querystring.appendcstr("]:CO"); 255 255 } 256 256 nextdate++; … … 335 335 if (!values[i].empty()) { 336 336 text_t text = formatelem(values[i]); 337 addqueryelem(querystring, fields[i], values[i], combine);337 addqueryelem(querystring, fields[i], text, combine); 338 338 } 339 339 } … … 347 347 348 348 bool space = false; 349 int words = 0; 349 350 text_t newtext = ""; 350 351 while (here != end) { 351 352 if (is_unicode_letdig(*here)) { 352 353 newtext.push_back(*here); 354 if (space==false) words++; 353 355 space = true; 354 356 } … … 362 364 } 363 365 366 if (words > 1) { // have a phrase, put it in quotes 367 newtext = "\""+newtext+"\""; 368 cout <<"new text="<<newtext.getcstr()<<endl; 369 } 364 370 return newtext; 365 371 } … … 402 408 else if (combs[i-1]=="not")combine = "!"; 403 409 } 404 text_t term = values[i];410 text_t term = formatelem(values[i]); 405 411 term = addstemcase(term, stems[i], folds[i]); 406 412 addqueryelem(querystring, fields[i], term, combine); … … 419 425 420 426 while (here !=end) { 427 421 428 if (is_unicode_letdig(*here)) { 422 429 // not word boundary … … 435 442 //else word += "c"; 436 443 } 444 437 445 word += " "; 438 446 outtext += word; 439 447 word.clear(); 440 448 } 441 //outtext.push_back(*here); 449 if (*here == '\"') { 450 outtext.push_back(*here); 451 } 442 452 here++; 443 453 }
Note:
See TracChangeset
for help on using the changeset viewer.