Changeset 10873 for trunk/gsdl/src/recpt/documentaction.cpp
- Timestamp:
- 2005-11-08T17:30:57+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r9923 r10873 380 380 381 381 if (!use_pulldown) { 382 navigationbar += "<nobr>\n"; 382 383 navigationbar += "_navtabsearch_"; 383 384 if (has_search_button) { 384 385 if (args["a"] == "q") { 385 navigationbar += "_icontabsearchgreen_"; 386 } else { 387 navigationbar += "_imagesearch_"; 386 navigationbar += "(selected)"; 388 387 } 389 388 } 390 389 391 if (has_search_button || numc == 0) navigationbar += "_ imagespacer_";390 if (has_search_button || numc == 0) navigationbar += "_navbarspacer_"; 392 391 393 392 bool first = true; 394 393 while (dochere != docend) { 395 394 date_extra = g_EmptyText; 396 if (!first) navigationbar += "_ imagespacer_";395 if (!first) navigationbar += "_navbarspacer_"; 397 396 398 397 text_t title = (*dochere).metadata["Title"].values[0]; … … 402 401 date_meta = "Date"; 403 402 } 404 date_extra = "& dm="+date_meta;403 date_extra = "&dm="+date_meta; 405 404 } 406 405 bool unknown = false; 407 406 408 // test the _XXXwidth_ macro to see if image macros are 409 // defined for this type of classification - if not we'll 410 // just display the text 407 // test if the _tabtext$FIELD_ macro is defined, which means 408 // this is a "known" metadata type and we have a translation for it 411 409 text_t tmpwidth; 412 disp.expandstring ("document", "_" + title + "width_", tmpwidth); 413 if (tmpwidth == ("_" + title + "width_")) unknown = true; 410 text_t macroname="_tabtext" + title + "_"; 411 disp.expandstring ("document", macroname, tmpwidth); 412 if (tmpwidth == macroname) // it wasn't expanded 413 unknown = true; 414 414 415 415 // if we're inside a document all the classification buttons should be enabled 416 if (arg_d.empty() && ((*dochere).OID == topparent)) { 417 if (unknown) navigationbar += " " + title + " "; 418 else navigationbar += "_icontab" + title + "green_"; 419 } else { 420 421 // set the _httpbrowseXXX_ macro for this classification 422 if (unknown) navigationbar += " <a href=\"_httpdocument_&cl=" + 423 (*dochere).OID + date_extra+"\">" + title + "</a> "; 424 else { 425 navigationbar += "_image" + title + "_"; 426 disp.setmacro ("httpbrowse" + title, displayclass::defaultpackage, "_httpdocument_&cl=" + (*dochere).OID+date_extra); 427 } 416 text_t this_tab; 417 bool is_top; 418 419 is_top = ((*dochere).OID == topparent); 420 421 // set default text fragment 422 this_tab = "_navtab_("; 423 424 if (unknown) { // just give the field name 425 if (!is_top) { 426 // work out the link for this classifier, as it isn't the 427 // current page 428 this_tab += "_httpdocument_&cl=" + (*dochere).OID 429 + date_extra; 430 } 431 this_tab += "," + title + ","; 432 } else { // use the macro for this field so we get translations 433 this_tab += "_httpbrowse" + title; 434 this_tab += "_,_tabtext" + title; 435 this_tab += "_,_textdescr" + title + "_"; 428 436 } 437 438 if (arg_d.empty() && is_top) { 439 // don't link to this classifier as it is the current one 440 this_tab += ",selected"; 441 } else if (!unknown) { 442 // set the _httpbrowseXXX_ macro for this classification 443 // set the correct url for this link 444 disp.setmacro ("httpbrowse" + title, displayclass::defaultpackage, "_httpdocument_&cl=" + (*dochere).OID+date_extra); 445 } 446 447 this_tab += ")"; 448 449 navigationbar += this_tab; 450 429 451 ++dochere; 430 452 first = false; 431 453 } 432 454 433 if (!has_search_button && numc == 1) navigationbar += "_imagespacer_"; 434 435 navigationbar += "\n</nobr>\n"; 436 navigationbar += "<!-- End of Navigation Bar -->\n"; 455 if (!has_search_button && numc == 1) navigationbar += "_navbarspacer_"; 456 457 navigationbar += "\n<!-- End of Navigation Bar -->\n"; 437 458 438 459 } else { … … 451 472 navigationbar += " selected"; 452 473 } 453 navigationbar += ">_t exticontabsearchgreen_</option>\n";474 navigationbar += ">_tabtextsearch_</option>\n"; 454 475 } 455 476 … … 461 482 date_meta = "Date"; 462 483 } 463 date_extra = "& dm="+date_meta;484 date_extra = "&dm="+date_meta; 464 485 } 465 486 466 navigationbar += "<option value=\"_httpdocument_& cl=" + dochere->OID +date_extra+ "\"";487 navigationbar += "<option value=\"_httpdocument_&cl=" + dochere->OID +date_extra+ "\""; 467 488 if (topparent == dochere->OID) { 468 489 navigationbar += " selected"; … … 505 526 // _httppagehome_ overridden home url if html collections have own homepage 506 527 507 // _usability_ a macro for remote usability reporting508 528 509 529 // must have a valid collection server to continue … … 549 569 text_t httpdocument; 550 570 disp.expandstring (displayclass::defaultpackage, "_httpdocument_", httpdocument); 551 httpdocument += "& f=1";571 httpdocument += "&f=1"; 552 572 disp.setmacro ("httpdocument", displayclass::defaultpackage, httpdocument); 553 573 disp.setmacro ("gsdltop", displayclass::defaultpackage, "documenttop"); … … 592 612 } 593 613 } 594 text_tmap::iterator usability = cinfo.format.find("Usability");595 if(usability!=cinfo.format.end()){596 disp.setmacro("usability",displayclass::defaultpackage,"_imageusab_");597 disp.setmacro("usabinterface",displayclass::defaultpackage,("_usab"+(*usability).second+"_"));598 disp.setmacro("usabilityscript", displayclass::defaultpackage, "_usabshowscript_");599 }600 614 } 601 615 … … 612 626 if (get_info (inlink, args["c"], args["l"], metadata, false, collectproto, response, logout)) { 613 627 if (!response.docInfo[0].metadata["section"].values[0].empty()) { 614 outlink = "_httpdocument_& d=" + response.docInfo[0].metadata["section"].values[0];628 outlink = "_httpdocument_&d=" + response.docInfo[0].metadata["section"].values[0]; 615 629 return true; 616 630 } … … 635 649 if (get_info (inlink, *col_here, args["l"], metadata, false, collectproto, response, logout)) { 636 650 if (!response.docInfo[0].metadata["section"].values[0].empty()) { 637 outlink = "_httpdocument_& c=" + *col_here + "&d=" +651 outlink = "_httpdocument_&c=" + *col_here + "&d=" + 638 652 response.docInfo[0].metadata["section"].values[0]; 639 653 return true; … … 869 883 bool unknown = false; 870 884 871 // test the _ XXXwidth_ macro to see if image macros are885 // test the _iconXXXpage_ macro to see if image macros are 872 886 // defined for this type of classification - if not we'll 873 887 // just display the text 874 888 text_t tmp; 875 disp.expandstring ("document", "_" + title + "width_", tmp); 876 if (tmp == ("_" + title + "width_")) unknown = true; 889 text_t macroname="_icon" + title + "page_"; 890 disp.expandstring ("document", macroname, tmp); 891 if (tmp == macroname) unknown = true; // it wasn't expanded 877 892 878 893 if (unknown) { … … 1278 1293 // work out values for next link 1279 1294 if (haschildren) { 1280 disp.setmacro ("httpnextarrow", "document", "_httpdocument_& cl=" + args["cl"] +1281 "& d=" + arg_d + ".fc");1295 disp.setmacro ("httpnextarrow", "document", "_httpdocument_&cl=" + args["cl"] + 1296 "&d=" + arg_d + ".fc"); 1282 1297 } else { 1283 1298 text_tarray::const_iterator h = next_siblings.begin(); … … 1285 1300 while (h != e) { 1286 1301 if (!(*h).empty()) { 1287 disp.setmacro ("httpnextarrow", "document", "_httpdocument_& cl=" + args["cl"] +1288 "& d=" + *h);1302 disp.setmacro ("httpnextarrow", "document", "_httpdocument_&cl=" + args["cl"] + 1303 "&d=" + *h); 1289 1304 break; 1290 1305 } … … 1295 1310 // work out value for previous link 1296 1311 if (!previous_sibling.empty()) { 1297 disp.setmacro ("httpprevarrow", "document", "_httpdocument_& cl=" + args["cl"] +1298 "& d=" + previous_sibling);1312 disp.setmacro ("httpprevarrow", "document", "_httpdocument_&cl=" + args["cl"] + 1313 "&d=" + previous_sibling); 1299 1314 } else { 1300 1315 if (countchar(arg_d.begin(), arg_d.end(), '.')) { 1301 disp.setmacro ("httpprevarrow", "document", "_httpdocument_& cl=" + args["cl"] +1302 "& d=" + get_parent(arg_d));1316 disp.setmacro ("httpprevarrow", "document", "_httpdocument_&cl=" + args["cl"] + 1317 "&d=" + get_parent(arg_d)); 1303 1318 } 1304 1319 }
Note:
See TracChangeset
for help on using the changeset viewer.