Changeset 2745 for trunk/gsdl/src/recpt/queryaction.cpp
- Timestamp:
- 2001-09-21T12:20:54+12:00 (23 years ago)
- File:
-
- 1 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;
Note:
See TracChangeset
for help on using the changeset viewer.