Ignore:
Timestamp:
2000-02-07T10:29:11+13:00 (24 years ago)
Author:
sjboddie
Message:

fixed a bug - made some functions virtual for use with cstr collection

File:
1 edited

Legend:

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

    r753 r912  
    2828/*
    2929   $Log$
     30   Revision 1.5  2000/02/06 21:29:11  sjboddie
     31   fixed a bug - made some functions virtual for use with cstr collection
     32
    3033   Revision 1.4  1999/10/30 23:06:25  sjboddie
    3134   tidied up a bit
     
    6770}
    6871
    69 // if the "gp" (go to page) argument is set we need to set 
     72// if the "gp" (go to page) argument is set we need to set
    7073// the "d" argument to the corresponding page
    7174void pagedbrowserclass::processOID (cgiargsclass &args, recptproto *collectproto,
    72                     ostream &logout) {
     75                                    ostream &logout) {
    7376
    7477  text_t &arg_d = args["d"];
    7578  text_t &arg_gp = args["gp"];
    76  
     79  text_tset metadata;
     80  bool getParents = false;
     81  FilterResponse_t response;
     82
    7783  if ((!arg_d.empty()) && (!arg_gp.empty()) && (is_number (arg_gp))) {
    7884    text_t top;
    7985    get_top (arg_d, top);
    80     text_tset metadata;
    8186    metadata.insert ("Title");
    82     bool getParents = false;
    83     FilterResponse_t response;
    8487    get_children (top, args["c"], metadata, getParents, collectproto, response, logout);
    8588    ResultDocInfo_tarray::iterator dochere = response.docInfo.begin();
     
    8790    while (dochere != docend) {
    8891      if ((*dochere).metadata["Title"].values[0] == arg_gp) {
    89     arg_d = (*dochere).OID;
    90     break;
     92        arg_d = (*dochere).OID;
     93        break;
    9194      }
    9295      dochere ++;
    9396    }
    94   }
    95 }
    96 
     97
     98  } else if (!arg_d.empty() && is_top(arg_d)) { // if top level doc, check if not invisible
     99    metadata.insert("thistype");
     100    if(get_info(arg_d, args["c"], metadata, getParents, collectproto, response, logout)) {
     101      text_t type = response.docInfo[0].metadata["thistype"].values[0];
     102      if (type=="Invisible") { // display first child
     103        arg_d = arg_d + ".1";
     104      }
     105    }
     106  }
     107}
    97108
    98109int pagedbrowserclass::output_section_group (ResultDocInfo_t &section, cgiargsclass &args,
     
    156167    previousarrow = "_document:parentarrow_";
    157168
    158       if (thissection != sections.docInfo.end()) {
     169      if ((thissection+1) != endsection) {
    159170    nextOID = (*(thissection+1)).OID;
    160171    nexttitle = (*(thissection+1)).metadata["Title"].values[0];
Note: See TracChangeset for help on using the changeset viewer.