Changeset 737 for trunk/gsdl/src/recpt
- Timestamp:
- 1999-10-24T20:22:37+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/browsetools.cpp
r730 r737 29 29 /* 30 30 $Log$ 31 Revision 1.32 1999/10/24 07:22:37 sjboddie 32 added a FullTOC option 33 31 34 Revision 1.31 1999/10/20 03:54:20 sjboddie 32 35 problem with expanded contents … … 269 272 270 273 271 static void recurse_contents (ResultDocInfo_t §ion, cgiargsclass &args, 274 static void recurse_contents (ResultDocInfo_t §ion, cgiargsclass &args, bool fulltoc, 272 275 browserclass *bptr, text_tset &metadata, bool &getParents, 273 276 format_t *formatlistptr, format_tmap &formatlistmap, 274 277 formatinfo_t &formatinfo, browsermapclass *browsermap, 275 int colnumber, recptproto *collectproto, displayclass &disp,278 int tabcount, recptproto *collectproto, displayclass &disp, 276 279 outconvertclass &outconvert, ostream &textout, ostream &logout) { 277 280 text_t formatstring; 278 281 279 282 bool is_classify = false; 280 if (args["d"].empty() ) is_classify = true;283 if (args["d"].empty() || fulltoc) is_classify = true; 281 284 282 285 // output this section 283 286 bool use_table = is_table_content (formatlistptr); 284 colnumber += bptr->output_section_group (section, args, colnumber, formatlistptr, use_table,285 286 287 tabcount += bptr->output_section_group (section, args, tabcount, formatlistptr, use_table, 288 metadata, getParents, collectproto, disp, outconvert, 289 textout, logout); 287 290 288 291 text_t classification; 289 292 if (!is_classify) classification = "Document"; 290 else get_top ( section.OID, classification);293 else get_top (args["cl"], classification); 291 294 292 295 int haschildren = section.metadata["haschildren"].values[0].getint(); 293 296 const text_t &doctype = section.metadata["doctype"].values[0]; 294 297 text_t classifytype = section.metadata["childtype"].values[0]; 295 // HLists a re displayed as VLists when contents are expanded,296 // Paged documents are displayed as HLists297 if (classifytype == "HList" ) classifytype = "VList";298 // HLists and DateLists are displayed as VLists when contents 299 // are expanded, Paged documents are displayed as HLists 300 if (classifytype == "HList" || classifytype == "DateList") classifytype = "VList"; 298 301 if (classifytype == "Paged") classifytype = "HList"; 299 302 300 303 // recurse through children 301 if ((haschildren == 1) && ( (!is_classify) || (doctype == "classify"))) {304 if ((haschildren == 1) && (!is_classify || fulltoc || doctype == "classify")) { 302 305 303 306 // get browser for displaying children … … 325 328 326 329 while (thisdoc != lastdoc) { 327 recurse_contents (*thisdoc, args, bptr, metadata, getParents,330 recurse_contents (*thisdoc, args, fulltoc, bptr, metadata, getParents, 328 331 formatlistptr, formatlistmap, formatinfo, browsermap, 329 colnumber, collectproto, disp, outconvert, textout, logout);332 tabcount, collectproto, disp, outconvert, textout, logout); 330 333 thisdoc ++; 331 334 } … … 341 344 // the current one 342 345 343 static void expanded_contents (cgiargsclass &args, browsermapclass *browsermap, 344 formatinfo_t &formatinfo, recptproto *collectproto, 345 displayclass &disp, outconvertclass &outconvert, 346 ostream &textout, ostream &logout) { 346 static void expanded_contents (cgiargsclass &args, int tabcount, bool fulltoc, 347 browsermapclass *browsermap, formatinfo_t &formatinfo, 348 recptproto *collectproto, displayclass &disp, 349 outconvertclass &outconvert, ostream &textout, 350 ostream &logout) { 347 351 348 352 if (args["d"].empty() && args["cl"].empty()) return; … … 353 357 text_tset metadata; 354 358 text_t classifytype, classification, formatstring; 355 int colnumber = 0;356 359 357 360 if (!args["d"].empty()) { 358 // document level - expand from top 359 get_top (args["d"], OID); 360 classification = "Document"; 361 // document level 362 if (fulltoc) { 363 get_top (args["cl"], OID); 364 classification = OID; 365 } 366 else { 367 // always expand document level from top 368 get_top (args["d"], OID); 369 classification = "Document"; 370 } 361 371 } else { 362 372 // classification level … … 416 426 formatlistmap[formatstring] = formatlistptr; 417 427 418 recurse_contents (response.docInfo[0], args, bptr, metadata,428 recurse_contents (response.docInfo[0], args, fulltoc, bptr, metadata, 419 429 getParents, formatlistptr, formatlistmap, formatinfo, browsermap, 420 colnumber, collectproto, disp, outconvert, textout, logout);430 tabcount, collectproto, disp, outconvert, textout, logout); 421 431 422 432 // clean up format list pointers … … 485 495 browsermapclass *browsermap, formatinfo_t &formatinfo, 486 496 format_tmap &formatlistmap, const text_t &classification, 487 int & colnumber, text_tset &metadata, bool &getParents,497 int &tabcount, text_tset &metadata, bool &getParents, 488 498 recptproto *collectproto, displayclass &disp, 489 499 outconvertclass &outconvert, ostream &textout, … … 523 533 524 534 use_table = is_table_content (formatlistptr); 525 colnumber += bptr->output_section_group (*thisparent, args, colnumber, formatlistptr, use_table,526 metadata, getParents, collectproto, disp, outconvert,527 textout, logout);535 tabcount += bptr->output_section_group (*thisparent, args, tabcount, formatlistptr, 536 use_table, metadata, getParents, collectproto, 537 disp, outconvert, textout, logout); 528 538 first = false; 529 539 thisparent ++; … … 532 542 533 543 534 static void contracted_contents (cgiargsclass &args, browsermapclass *browsermap, 535 formatinfo_t &formatinfo, recptproto *collectproto, 536 displayclass &disp, outconvertclass &outconvert, 537 ostream &textout, ostream &logout) { 544 static void contracted_contents (cgiargsclass &args, int tabcount, bool fulltoc, 545 browsermapclass *browsermap, formatinfo_t &formatinfo, 546 recptproto *collectproto, displayclass &disp, 547 outconvertclass &outconvert, ostream &textout, 548 ostream &logout) { 538 549 FilterResponse_t response; 539 550 text_tset metadata; … … 546 557 OID = args["cl"]; 547 558 get_top (OID, classification); 548 } 549 int colnumber = 0;559 } else if (fulltoc) 560 get_top (args["cl"], classification); 550 561 551 562 bool haschildren = has_children (OID, args["c"], collectproto, logout); 552 563 564 if ((!args["d"].empty()) && fulltoc) 565 get_parents_array (args["cl"] + ".fc", parents); 553 566 if (haschildren) get_parents_array (OID + ".fc", parents); 554 567 else get_parents_array (OID, parents); … … 572 585 // display each parent 573 586 output_parents (response, args, browsermap, formatinfo, formatlistmap, 574 classification, colnumber, metadata, getParents,587 classification, tabcount, metadata, getParents, 575 588 collectproto, disp, outconvert, textout, logout); 576 589 … … 618 631 // display children 619 632 bool use_table = is_table_content (formatlistptr); 620 bptr->output_section_group (response, args, colnumber, formatlistptr, use_table,633 bptr->output_section_group (response, args, tabcount, formatlistptr, use_table, 621 634 metadata, getParents, collectproto, disp, outconvert, 622 635 textout, logout); … … 630 643 ostream &textout, ostream &logout) { 631 644 645 int tabcount = 0; 632 646 bool havecontrols = false; 647 bool fulltoc = false; 648 649 if (args["cl"] != "search") { 650 // see if there's a FullTOC string 651 text_t cl_top, full_toc; 652 get_top (args["cl"], cl_top); 653 if (get_formatstring (cl_top, "FullTOC", formatinfo.formatstrings, full_toc)) 654 if (full_toc == "true") fulltoc = true; 655 } 633 656 634 657 // get the cover image (if there is one) and the control buttons 635 658 // if we're inside a book 636 if ( !args["d"].empty()) {659 if ((!fulltoc) && (!args["d"].empty())) { 637 660 textout << "<p><table cellpadding=0 cellspacing=0><tr>\n"; 638 661 textout << "<td valign=top"; 639 if (formatinfo.DocumentContents) textout << " width=200>\n";640 else textout << " width=100%>\n";662 if (formatinfo.DocumentContents) textout << " width=200>\n"; 663 else textout << " width=100%>\n"; 641 664 if (formatinfo.DocumentImages) 642 665 output_cover_image (args, collectproto, disp, outconvert, textout, logout); … … 653 676 654 677 // expanded table of contents 655 expanded_contents (args, browsermap, formatinfo, collectproto,656 disp, outconvert, textout, logout);678 expanded_contents (args, tabcount, fulltoc, browsermap, formatinfo, 679 collectproto, disp, outconvert, textout, logout); 657 680 } else { 658 681 659 682 // contracted table of contents 660 contracted_contents (args, browsermap, formatinfo, collectproto,661 disp, outconvert, textout, logout);683 contracted_contents (args, tabcount, fulltoc, browsermap, formatinfo, 684 collectproto, disp, outconvert, textout, logout); 662 685 } 663 686 }
Note:
See TracChangeset
for help on using the changeset viewer.