Changeset 27362
- Timestamp:
- 2013-05-16T15:39:57+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/recpt/queryaction.cpp
r27172 r27362 558 558 } 559 559 set_option_macro ("fqf", args["fqf"], true, form_search, (*it).second, disp); 560 if (args["ct"] == "2") {// lucene 560 } 561 if (args["ct"] == "2") {// lucene 562 it = response.filterOptions.find("SortField"); 561 563 // set the sort field macro 562 564 set_sfselection_macro(args["sf"], (*it).second, disp); 563 565 } 564 566 } 565 }567 566 568 567 569 // add a queryterms macro for plain version of search terms … … 591 593 displayclass &disp) { 592 594 593 // we need at least one optionhere to continue594 if (option.validValues.size() < 1) {595 // we need at least two options here to continue 596 if (option.validValues.size() < 2) { 595 597 return; 596 598 } … … 600 602 if (current_value.empty()) current_value = ""; 601 603 602 // we give a rank option first603 macrovalue += "<option value=\"\"";604 if (current_value == "") {605 macrovalue += " selected";606 }607 macrovalue += ">_query:textsortbyrank_\n";608 609 604 text_tarray::const_iterator thisvalue = option.validValues.begin(); 610 605 text_tarray::const_iterator endvalue = option.validValues.end(); 611 int valid_count = 0;606 // int valid_count = 0; 612 607 while (thisvalue != endvalue) { 613 if (*thisvalue != "ZZ" && *thisvalue != "TX") { 614 ++valid_count; 615 macrovalue += "<option value=\"by" + *thisvalue + "\""; 616 if (current_value == "by"+*thisvalue) 608 if (*thisvalue == "rank") { 609 macrovalue += "<option value=\"rank\""; 610 if (current_value == "rank") { 611 macrovalue += " selected"; 612 } 613 macrovalue += ">_query:textsortbyrank_\n"; 614 } else { 615 macrovalue += "<option value=\"" + *thisvalue + "\""; 616 if (current_value == *thisvalue) 617 617 macrovalue += " selected"; 618 618 macrovalue += ">_" + *thisvalue + "_\n"; … … 620 620 ++thisvalue; 621 621 } 622 macrovalue += "</select>"; 623 if (valid_count > 0) { 624 disp.setmacro ("sfselection", displayclass::defaultpackage, macrovalue); 625 } 626 627 } 628 622 macrovalue += "</select>"; 623 disp.setmacro ("sfselection", displayclass::defaultpackage, macrovalue); 624 625 } 626 629 627 // sets the selection box macro _gformselection_. 630 628 // the default for _gformselection_ is _gselection_
Note:
See TracChangeset
for help on using the changeset viewer.