Changeset 11986
- Timestamp:
- 2006-06-30T16:03:47+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/pageaction.cpp
r11958 r11986 38 38 #include "fileutil.h" 39 39 #include "gsdltools.h" 40 #include "querytools.h" 40 41 #include <time.h> 41 42 … … 148 149 cgiargsclass &args, const recptconf &configinfo, 149 150 ostream &logout) { 150 151 //text_t homeextra = "<center><table width=_pagewidth_><tr valign=top>\n";152 //bool found_valid_col = false;153 151 154 152 text_t homeextra = "<form method=\"get\" name=\"browse\">\n"; … … 177 175 if (cinfo->isPublic && (cinfo->buildDate > 0)) { 178 176 179 text_t coll_type = "&ct=";180 if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) {181 182 if (cinfo->buildType == "mgpp") {183 coll_type += "1";184 }185 else {186 coll_type += "2";187 }188 189 coll_type += "&qto=";190 191 // now we also want to check search types to set the qto arg192 if (cinfo->searchTypes.size() == 0) {193 coll_type += "3"; // default to 3 (= both)194 } else {195 unsigned int search_types = 0;196 text_tarray::const_iterator type_here = cinfo->searchTypes.begin();197 text_tarray::const_iterator type_end = cinfo->searchTypes.end();198 199 while (type_here != type_end) {200 if (*type_here == "form") {201 search_types |= 2;202 } else if (*type_here == "plain") {203 search_types |= 1;204 }205 ++type_here;206 }207 coll_type += search_types;208 if (search_types == 3) {209 // both were specified, now need to look at the order to see which is the default210 type_here = cinfo->searchTypes.begin();211 if (*type_here == "form") {212 coll_type += "&qt=1"; // set the default to form213 }214 }215 216 }217 }218 else {219 coll_type += "0";220 }221 177 text_t collectionname = cinfo->get_collectionmeta("collectionname", args["l"]); 222 178 if (collectionname.empty()) { … … 229 185 if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 230 186 231 text_t link = "_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type;187 text_t link = "_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here; 232 188 link += "&l=" + args["l"] + "&w=" + args["w"]; 233 189 … … 292 248 if (cinfo != NULL) { 293 249 if (cinfo->isPublic && (cinfo->buildDate > 0)) { 294 295 text_t coll_type = "&ct=";296 if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) {297 298 if (cinfo->buildType == "mgpp") {299 coll_type += "1";300 }301 else {302 coll_type += "2";303 }304 305 coll_type += "&qto=";306 307 // now we also want to check search types to set the qto arg308 if (cinfo->searchTypes.size() == 0) {309 coll_type += "3"; // default to 3 (= both)310 } else {311 unsigned int search_types = 0;312 text_tarray::const_iterator type_here = cinfo->searchTypes.begin();313 text_tarray::const_iterator type_end = cinfo->searchTypes.end();314 315 while (type_here != type_end) {316 if (*type_here == "form") {317 search_types |= 2;318 } else if (*type_here == "plain") {319 search_types |= 1;320 }321 ++type_here;322 }323 coll_type += search_types;324 if (search_types == 3) {325 // both were specified, now need to look at the order to see which is the default326 type_here = cinfo->searchTypes.begin();327 if (*type_here == "form") {328 coll_type += "&qt=1"; // set the default to form329 }330 }331 332 }333 }334 else {335 coll_type += "0";336 }337 250 338 251 found_valid_col = true; … … 382 295 if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 383 296 384 text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type;297 text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here; 385 298 link += "&l=" + args["l"] + "&w=" + args["w"] + "\">"; 386 299 … … 439 352 ++count; 440 353 441 text_t coll_type = "&ct=";442 443 if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) {444 445 if (cinfo->buildType == "mgpp") {446 coll_type += "1";447 }448 else {449 coll_type += "2";450 }451 452 coll_type += "&qto=";453 454 // now we also want to check search types to set the qto arg455 if (cinfo->searchTypes.size() == 0) {456 coll_type += "3"; // default to 2 (= both)457 } else {458 int search_types = 0;459 text_tarray::const_iterator type_here = cinfo->searchTypes.begin();460 text_tarray::const_iterator type_end = cinfo->searchTypes.end();461 462 while (type_here != type_end) {463 if (*type_here == "form") {464 search_types |= 0x10;465 } else if (*type_here == "plain") {466 search_types |= 0x01;467 }468 ++type_here;469 }470 coll_type += search_types;471 472 if (search_types == 3) {473 // both were specified, now need to look at the order to see which is the default474 type_here = cinfo->searchTypes.begin();475 if (*type_here == "form") {476 coll_type += "&qt=1"; // set the default to form477 }478 }479 }480 }481 else {482 coll_type += "0";483 }484 354 text_t collectionname = cinfo->get_collectionmeta("collectionname", args["l"]); 485 355 if (collectionname.empty()) { … … 492 362 if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 493 363 494 text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type+"\">";364 text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + "\">"; 495 365 496 366 if (!cinfo->receptionist.empty()) … … 663 533 } 664 534 535 665 536 void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args, 666 537 recptprotolistclass *protos, ostream &logout) { … … 762 633 } 763 634 disp.setmacro("numbytes", displayclass::defaultpackage, numbytes); 764 } 765 635 636 // set up ct, qt, qto 637 set_query_type_args(cinfo, args); 638 639 } 640 766 641 //setting _queryformcontent_ so that the query interface is consistent. 767 642 //also adding usability button if necessary … … 998 873 if (err != noError) issearchable = true; 999 874 outconvertclass t; 1000 if (!issearchable ) {875 if (!issearchable ) { 1001 876 disp.setmacro ("aboutqueryform", "about", ""); 1002 877 }
Note:
See TracChangeset
for help on using the changeset viewer.