Changeset 12174 for trunk/gsdl/src/recpt/documentaction.cpp
- Timestamp:
- 2006-07-12T16:11:15+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r12044 r12174 380 380 if (!use_pulldown) { 381 381 if (has_search_button) { 382 // search uses its own navtab, as it may be suppressed based on args 382 383 navigationbar += "_navtabsearch_"; 383 384 385 386 } 387 384 if (args["a"] == "q") { 385 navigationbar += "(selected)"; 386 } 387 } 388 388 389 if (has_search_button || numc == 0) navigationbar += "_navbarspacer_"; 389 390 390 391 bool first = true; 391 392 while (dochere != docend) { 392 if (!first) navigationbar += "_navbarspacer_"; 393 394 bool unknown = false; 395 396 // test if the _tabtext$FIELD_ macro is defined, which means 397 // this is a "known" metadata type and we have a translation for it 398 text_t title = (*dochere).metadata["Title"].values[0]; 399 text_t tmpwidth; 400 text_t macroname="_tabtext" + title + "_"; 401 disp.expandstring ("document", macroname, tmpwidth); 402 if (tmpwidth == macroname) // it wasn't expanded 403 unknown = true; 404 405 // if we're inside a document all the classification buttons should be enabled 406 text_t this_tab; 407 bool is_top; 408 409 is_top = ((*dochere).OID == topparent); 410 // set default text fragment 411 this_tab = "_navtab_("; 412 413 if (unknown) { // just give the field name 414 if (!arg_d.empty() || !is_top) { 415 // work out the link for this classifier, as it isn't the 416 // current page 417 this_tab += "_httpdocument_&cl=" + (*dochere).OID; 418 } 419 this_tab += "," + title + "," + title; 420 } else { // use the macro for this field so we get translations 421 this_tab += "_httpbrowse" + title; 422 this_tab += "_,_tabtext" + title; 423 this_tab += "_,_textdescr" + title + "_"; 393 if (!first) navigationbar += "_navbarspacer_"; 394 395 text_t title = (*dochere).metadata["Title"].values[0]; 396 397 navigationbar += "_navtab_(_httpbrowse"+title+"_,"+title; 398 // if we are at this classifier 399 if (arg_d.empty() && ((*dochere).OID == topparent)) { 400 // don't link to this classifier as it is the current one 401 navigationbar += ",selected"; 424 402 } 425 426 if (arg_d.empty() && is_top) { 427 // don't link to this classifier as it is the current one 428 this_tab += ",selected"; 429 } 430 431 // set the _httpbrowseXXX_ macro for this classification 432 // set the correct url for this link 433 disp.setmacro ("httpbrowse" + title, displayclass::defaultpackage, "_httpdocument_&cl=" + (*dochere).OID); 434 435 436 this_tab += ")"; 437 438 navigationbar += this_tab; 439 403 navigationbar += ")"; 404 405 // set the _httpbrowseXXX_ macro for this classification 406 // set the correct url for this link 407 disp.setmacro ("httpbrowse" + title, displayclass::defaultpackage, "_httpdocument_&cl=" + (*dochere).OID); 440 408 ++dochere; 441 409 first = false; 442 410 } 443 444 //if (!has_search_button && numc == 1) navigationbar += "_navbarspacer_"; 445 411 446 412 navigationbar += "\n<!-- End of Navigation Bar -->\n"; 447 413 … … 471 437 navigationbar += " selected"; 472 438 } 473 navigationbar += "> " + title + "</option>\n";439 navigationbar += ">_navlinktitle_(" + title + ")</option>\n"; 474 440 ++dochere; 475 441 }
Note:
See TracChangeset
for help on using the changeset viewer.