- Timestamp:
- 2014-06-05T09:57:40+12:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/recpt/queryaction.cpp
r28956 r29087 604 604 displayclass &disp) { 605 605 606 // we need at least two optionshere to continue607 if (option.validValues.size() < 2) {606 // we need at one sort option here to continue 607 if (option.validValues.size() < 1) { 608 608 return; 609 609 } 610 610 if (option.validValues.size() == 1) { 611 // we don't need a drop down list, just the value 612 text_t value = option.defaultValue; 613 text_t macrovalue = ""; 614 if (value == "rank") { 615 macrovalue = "_query:textsortbyrank_"; 616 } else if (value == "none") { 617 return; // no sorting is the only option, so don't display anything 618 } else { 619 macrovalue = "_"+value+"_"; 620 } 621 disp.setmacro ("sfselection", displayclass::defaultpackage, macrovalue); 622 return; 623 } 624 // if we have more than two options, make a drop down list 611 625 text_t macrovalue = "<select name=\"sf\">\n"; 612 626 … … 618 632 // int valid_count = 0; 619 633 while (thisvalue != endvalue) { 634 macrovalue += "<option value=\"" + *thisvalue + "\""; 635 if (current_value == *thisvalue) 636 macrovalue += " selected"; 637 macrovalue += ">"; 620 638 if (*thisvalue == "rank") { 621 macrovalue += "<option value=\"rank\""; 622 if (current_value == "rank") { 623 macrovalue += " selected"; 624 } 625 macrovalue += ">_query:textsortbyrank_\n"; 639 macrovalue += "_query:textsortbyrank_"; 640 } else if (*thisvalue == "none") { 641 macrovalue += "_query:textsortbynone_"; 626 642 } else { 627 macrovalue += "<option value=\"" + *thisvalue + "\""; 628 if (current_value == *thisvalue) 629 macrovalue += " selected"; 630 macrovalue += ">_" + *thisvalue + "_\n"; 631 } 643 macrovalue += "_" + *thisvalue + "_"; 644 } 645 macrovalue += "</option>/n"; 632 646 ++thisvalue; 633 647 }
Note:
See TracChangeset
for help on using the changeset viewer.