Ignore:
Timestamp:
1999-08-03T15:30:48+12:00 (25 years ago)
Author:
sjboddie
Message:

a few small changes related to new format options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/documentaction.cpp

    r420 r431  
    1212/*
    1313   $Log$
     14   Revision 1.16  1999/08/03 03:30:47  sjboddie
     15   a few small changes related to new format options
     16
    1417   Revision 1.15  1999/07/30 02:18:49  sjboddie
    1518   -added collectinfo argument to some functions
     
    284287  }
    285288
    286   bool showtoppage = true;
    287   text_tmap::const_iterator it = collectinfo.format.find("showtoppage");
    288   if ((it != collectinfo.format.end()) && ((*it).second == "false")) showtoppage = false;
     289  bool ShowTopPages = true;
     290  text_tmap::const_iterator it = collectinfo.format.find("ShowTopPages");
     291  if ((it != collectinfo.format.end()) && ((*it).second == "false")) ShowTopPages = false;
    289292
    290293  // do a call to translate OIDs if required
    291294  request.filterName = "NullFilter";
    292295  request.filterResultOptions = FROID;
    293   if ((!arg_d.empty()) && (needs_translating (arg_d) || !showtoppage)) {
     296  if ((!arg_d.empty()) && (needs_translating (arg_d) || !ShowTopPages)) {
    294297    request.docSet.insert (arg_d);
    295298    request.fields.push_back ("classifytype");
     
    301304    text_t &classifytype = response.docInfo[0].metadata[0].values[0];
    302305    if (classifytype.empty() || classifytype == "book")
    303       if (!showtoppage && is_top (arg_d)) arg_d += ".fc";
     306      if (!ShowTopPages && is_top (arg_d)) arg_d += ".fc";
    304307   
    305308    request.clear();
     
    481484      if (classifytype.empty()) classifytype = "Book"; // defaults to Book
    482485      if ((classifytype == "Book") || (classifytype == "Hierarchy")) {
    483     bool showtoppage = true;
    484     text_tmap::const_iterator it = collectinfo.format.find("showtoppage");
    485     if ((it != collectinfo.format.end()) && ((*it).second == "false")) showtoppage = false;
    486     set_arrow_macros (arg_d, classifytype, showtoppage, disp,
     486    bool ShowTopPages = true;
     487    text_tmap::const_iterator it = collectinfo.format.find("ShowTopPages");
     488    if ((it != collectinfo.format.end()) && ((*it).second == "false")) ShowTopPages = false;
     489    set_arrow_macros (arg_d, classifytype, ShowTopPages, disp,
    487490              collectproto, collection, logout);
    488491      }
     
    611614    FilterResponse_t response;
    612615    text_t toptitle, toptype, thistype, formatstring;
    613     bool cover = false;
    614616
    615617    text_t &collection = args["c"];
     
    638640    }
    639641
    640     text_tmap::const_iterator it = collectinfo.format.find(toptype + toptitle);
     642    bool ShowCoverImages = false;
     643    text_t formatkey = toptype + toptitle;
     644    if (!arg_d.empty()) formatkey = toptype + "Document";
     645
     646    text_tmap::const_iterator it = collectinfo.format.find(formatkey);
    641647    if (it != collectinfo.format.end()) formatstring = (*it).second;
    642     it = collectinfo.format.find("cover");
    643     if (it != collectinfo.format.end()) cover = true;
     648    it = collectinfo.format.find("ShowCoverImages");
     649    if ((it != collectinfo.format.end()) && ((*it).second == "true")) ShowCoverImages = true;
    644650
    645651    // output the table of contents
     
    647653     
    648654      if (toptype == "Hierarchy")
    649     output_toc (thistype, formatstring, args, cover, collectproto,
     655    output_toc (thistype, formatstring, args, ShowCoverImages, collectproto,
    650656            disp, outconvert, textout, logout);
    651657      else
     
    661667
    662668    // output the document text
    663     output_document (OID, args, collectproto, disp, outconvert, textout, logout);
     669    output_document (OID, args, collectinfo, collectproto, disp,
     670             outconvert, textout, logout);
    664671
    665672    textout << outconvert << disp << "_document:footer_\n";
     
    670677
    671678void documentaction::output_document (const text_t &OID, cgiargsclass &args,
     679                      const ColInfoResponse_t &collectinfo,
    672680                      recptproto *collectproto, displayclass &disp,
    673681                      outconvertclass &outconvert, ostream &textout,
     
    692700  }
    693701
     702  bool ShowSectionTitles = true;
     703  text_tmap::const_iterator it = collectinfo.format.find("ShowSectionTitles");
     704  if ((it != collectinfo.format.end()) && ((*it).second == "false")) ShowSectionTitles = false;
     705
    694706  // get info on this document
    695707  metadata.push_back("Title");
     
    708720    collectproto->get_document (collection, docrequest, docresponse, err, logout);
    709721     
    710     textout << outconvert << disp << "<p>\n<h3>" << title << "</h3>";
    711       if (highlight)
    712         highlighttext(docresponse.doc, queryresponse.termInfo, disp,
    713               outconvert, textout, logout);
    714       else
    715         textout << outconvert << disp << docresponse.doc;
     722    if (ShowSectionTitles)
     723      textout << outconvert << disp << "<p>\n<h3>" << title << "</h3>";
     724    if (highlight)
     725      highlighttext(docresponse.doc, queryresponse.termInfo, disp,
     726            outconvert, textout, logout);
     727    else
     728      textout << outconvert << disp << docresponse.doc;
    716729      }
    717730    } else {
     
    751764      collectproto->get_document (collection, docrequest, docresponse, err, logout);
    752765     
    753       textout << outconvert << disp << "<p>\n<h3>" << title << "</h3>";
     766      if (ShowSectionTitles)
     767        textout << outconvert << disp << "<p>\n<h3>" << title << "</h3>";
    754768      if (highlight)
    755769        highlighttext(docresponse.doc, queryresponse.termInfo, disp,
Note: See TracChangeset for help on using the changeset viewer.