Changeset 9931 for trunk/gsdl/src/recpt/pageaction.cpp
- Timestamp:
- 2005-05-23T16:36:40+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/pageaction.cpp
r9676 r9931 219 219 coll_type += "0"; 220 220 } 221 222 FilterResponse_t response; 223 text_tset metadata; 224 metadata.insert ("collectionname"); 225 text_t lang = args["l"]; 226 if (!lang.empty()) { 227 metadata.insert ("collectionname:"+lang); 228 } 229 text_t collectionname = *collist_here; 230 231 if (get_info ("collection", *collist_here, "", metadata, false, 232 (*rprotolist_here).p, response, logout)) { 233 if (!lang.empty() && !response.docInfo[0].metadata["collectionname:"+lang].values[0].empty()) { 234 collectionname = response.docInfo[0].metadata["collectionname:"+lang].values[0]; 235 } else if (!response.docInfo[0].metadata["collectionname"].values[0].empty()) { 236 collectionname = response.docInfo[0].metadata["collectionname"].values[0]; 237 } 221 text_t collectionname = cinfo->get_collectionmeta("collectionname", args["l"]); 222 if (collectionname.empty()) { 223 collectionname = *collist_here; 238 224 } 239 225 … … 351 337 352 338 found_valid_col = true; 353 FilterResponse_t response; 354 text_tset metadata; 355 metadata.insert ("collectionname"); 356 metadata.insert ("iconcollection"); 357 metadata.insert ("iconcollectionsmall"); 358 // also look for lang specific values 359 text_t lang = args["l"]; 360 if (!lang.empty()) { 361 metadata.insert ("collectionname:"+lang); 362 metadata.insert ("iconcollection:"+lang); 363 metadata.insert ("iconcollectionsmall:"+lang); 339 text_t collectionname = *collist_here; 340 text_t alt = cinfo->get_collectionmeta("collectionname", args["l"]); 341 if (alt.empty()) { 342 alt = collectionname; 364 343 } 365 text_t collectionname = *collist_here; 366 text_t alt = collectionname; 367 368 if (get_info ("collection", *collist_here, "", metadata, false, 369 (*rprotolist_here).p, response, logout)) { 370 // get the "collectionname" 371 if (!lang.empty() && !response.docInfo[0].metadata["collectionname:"+lang].values[0].empty()) { 372 alt = response.docInfo[0].metadata["collectionname:"+lang].values[0]; 373 } else if (!response.docInfo[0].metadata["collectionname"].values[0].empty()) { 374 alt = response.docInfo[0].metadata["collectionname"].values[0]; 344 345 // url to image: try iconcollectionsmall, then iconcollection 346 text_t iconurl = cinfo->get_collectionmeta("iconcollectionsmall", args["l"]); 347 if (iconurl.empty()) { 348 iconurl = cinfo->get_collectionmeta("iconcollection", args["l"]); 349 } 350 351 if (!iconurl.empty()) { 352 353 // check to see URL is local to colserver 354 text_t::iterator iconurl_head = iconurl.begin(); 355 text_t iconhead = substr(iconurl_head,iconurl_head+16); 356 if (iconhead=="_httpcollection_") { 357 358 // local and using _httpcollection_ 359 text_t icontail = substr(iconurl_head+16,iconurl.end()); 360 iconurl = "http://" + cinfo->httpdomain 361 + cinfo->httpprefix + "/collect/" 362 + *collist_here + "/" + icontail; 363 } 364 else if (iconurl[0]=='/') { 365 366 // local but with full path 367 iconurl = "http://" + cinfo->httpdomain + iconurl; 375 368 } 376 369 377 text_t iconurl; 378 iconurl.clear(); 379 380 if (!lang.empty() &&!response.docInfo[0].metadata["iconcollectionsmall:"+lang].values[0].empty()) { 381 iconurl = response.docInfo[0].metadata["iconcollectionsmall:"+lang].values[0]; 382 } else if (!response.docInfo[0].metadata["iconcollectionsmall"].values[0].empty()) { 383 iconurl = response.docInfo[0].metadata["iconcollectionsmall"].values[0]; 384 } else if (!lang.empty() && !response.docInfo[0].metadata["iconcollection:"+lang].values[0].empty()) { 385 iconurl = response.docInfo[0].metadata["iconcollection:"+lang].values[0]; 386 } else if (!response.docInfo[0].metadata["iconcollection"].values[0].empty()) { 387 iconurl = response.docInfo[0].metadata["iconcollection"].values[0]; 388 } 389 390 if (!iconurl.empty()) 391 { 392 // check to see URL is local to colserver 393 text_t::iterator iconurl_head = iconurl.begin(); 394 text_t iconhead = substr(iconurl_head,iconurl_head+16); 395 if (iconhead=="_httpcollection_") 396 { 397 // local and using _httpcollection_ 398 text_t icontail = substr(iconurl_head+16,iconurl.end()); 399 iconurl = "http://" + cinfo->httpdomain 400 + cinfo->httpprefix + "/collect/" 401 + *collist_here + "/" + icontail; 402 } 403 else if (iconurl[0]=='/') 404 { 405 // local but with full path 406 iconurl = "http://" + cinfo->httpdomain + iconurl; 407 } 408 409 collectionname 410 = "<img width=150 border=1 src=\"" + iconurl + "\" alt=\"" + alt + "\">"; 411 } 412 else 413 { 414 collectionname = alt; 415 } 416 370 collectionname 371 = "<img width=150 border=1 src=\"" + iconurl + "\" alt=\"" + alt + "\">"; 372 } else { 373 collectionname = alt; 417 374 } 375 418 376 if ((count%configinfo.HomePageCols == 0) && (!first)) 419 377 homeextra += "</tr><tr valign=top>\n"; … … 426 384 text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type; 427 385 link += "&l=" + args["l"] + "&w=" + args["w"] + "\">"; 428 386 429 387 if (!cinfo->receptionist.empty()) 430 388 link = "<a href=\"" + cinfo->receptionist + "\">"; … … 453 411 } 454 412 455 void pageaction::set_collectionlist_macro (displayclass &disp, recptprotolistclass *protos, 413 void pageaction::set_collectionlist_macro (displayclass &disp, 414 recptprotolistclass *protos, 415 cgiargsclass &args, 456 416 ostream &logout) { 457 417 … … 522 482 coll_type += "0"; 523 483 } 524 FilterResponse_t response; 525 text_tset metadata; 526 metadata.insert ("collectionname"); 527 text_t collectionname = *collist_here; 528 529 if (get_info ("collection", *collist_here, "", metadata, false, 530 (*rprotolist_here).p, response, logout)) { 531 if (!response.docInfo[0].metadata["collectionname"].values[0].empty()) { 532 collectionname = response.docInfo[0].metadata["collectionname"].values[0]; 533 } 484 text_t collectionname = cinfo->get_collectionmeta("collectionname", args["l"]); 485 if (collectionname.empty()) { 486 collectionname = *collist_here; 534 487 } 535 488 … … 836 789 } 837 790 } 838 791 792 839 793 if (arg_p == "home" || arg_p == "homehelp") { 840 794 if (status_disabled) disp.setmacro ("textgoadmin", "home", ""); … … 845 799 homepagestyle (disp, protos, args, logout); 846 800 } else if (arg_p == "homehelp") { 847 set_collectionlist_macro (disp, protos, logout);801 set_collectionlist_macro (disp, protos, args, logout); 848 802 } 849 803 … … 878 832 text_t colname; 879 833 if (*col_here == arg_c) { 880 colname = cinfo-> collectionmeta["collectionname"];834 colname = cinfo->get_collectionmeta("collectionname", args["l"]); 881 835 } else { 882 836 ColInfoResponse_t *this_cinfo = recpt->get_collectinfo_ptr (collectproto, *col_here, logout); 883 837 if (this_cinfo == NULL) {++col_here; continue;} 884 colname = this_cinfo-> collectionmeta["collectionname"];838 colname = this_cinfo->get_collectionmeta("collectionname", args["l"]); 885 839 } 886 840 if (colname.empty()) { 841 colname = *col_here; 842 } 887 843 ++count; 888 844 collectionoption += "<input type=checkbox name=\"cc\" value=\"" + … … 1003 959 if (*here == arg_c) { 1004 960 if (!first) textsubcollections += "<br>"; 1005 textsubcollections += "\n" + cinfo-> collectionmeta["collectionname"]+ "\n";961 textsubcollections += "\n" + cinfo->get_collectionmeta("collectionname", args["l"]) + "\n"; 1006 962 } else { 1007 963 ColInfoResponse_t *this_cinfo = recpt->get_collectinfo_ptr (collectproto, *here, logout); 1008 964 if (this_cinfo == NULL) {++here; continue;} 1009 965 if (!first) textsubcollections += "<br>"; 1010 textsubcollections += "\n" + this_cinfo-> collectionmeta["collectionname"]+ "\n";966 textsubcollections += "\n" + this_cinfo->get_collectionmeta("collectionname", args["l"]) + "\n"; 1011 967 } 1012 968 ++count;
Note:
See TracChangeset
for help on using the changeset viewer.