Ignore:
Timestamp:
2003-08-11T12:09:06+12:00 (21 years ago)
Author:
kjdon
Message:

made some small changes to allow the user to specify that documents should be detached by default - the links in the search list and classifier lists lead to new windows being opened for the documents. there is a new arg xx, which is 0 by default, but if its 1, it means that docs should be detached. affected classes are documentaction - this is where I defined the arg, just because the x arg is there, and the browser classes where the links to the documents are created. I have only changed vlist, hlist and datelist browser classes - I didn't think the others needed changing. to use this, you need to set the arg to 1 in main.cfg (for all collections), or add it to the receptionist thingy in a colls collect.cfg file

File:
1 edited

Legend:

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

    r4936 r5124  
    192192// get_link_icon attempts to work out what type of icon should be displayed for
    193193// the given section and what it should link to.
     194// [modification to allow default document detach settings -- kjdon]
    194195void vlistbrowserclass::get_link_icon (ResultDocInfo_t &section, cgiargsclass &args,
    195196                       const text_t &collink, text_t &link, text_t &icon) {
    196197
    197198  link = "<a href=\"_httpdocument_" + collink;
     199  text_t link_end = "\">";
     200  text_t detach_link_end = "&x=1\" target=\\_blank>"; // to detach the link, and x=1 signifies it is a detached page
    198201  icon = "_document:icontext_";
     202
     203  text_t doctype;
    199204  int haschildren = 0;
    200205
    201206  if (section.metadata.count("haschildren")>0)
    202207    haschildren = section.metadata["haschildren"].values[0].getint();
    203 
    204   text_t doctype;
    205208  if (section.metadata.count("doctype")>0)
    206209    doctype = section.metadata["doctype"].values[0];
     
    210213
    211214  if (args["a"] == "q") {
    212     // query results
     215    // query results list
     216    link += "&cl=search&d=" + section.OID;
     217   
     218    if (args["xx"] == "1") {
     219      link += detach_link_end;
     220    } else {
     221      link += link_end;
     222    }
    213223    if ((is_top (section.OID)) && (haschildren == 1)) icon = "_document:iconclosedbook_";
    214224    else if (haschildren == 1) icon = "_document:iconclosedfolder_";
    215     link += "&cl=search&d=" + section.OID + "\">";
    216 
     225   
    217226  } else if (!arg_d.empty()) {
    218     // document level
     227    // we are in a document - none of the links should be detach links
    219228    if (is_top(section.OID)) {
     229      // we link back to the originating page eg search page or classifier page
    220230      icon = "_document:iconopenbook_";
    221       if (arg_cl == "search") link = "<a href=\"_httpquery_\">";
     231      if (arg_cl == "search") {
     232    link = "<a href=\"_httpquery_\">";
     233      }
    222234      else link += "&cl=" + arg_cl + "\">";
    223    
     235     
    224236    } else if (haschildren == 1) {
    225237      if ((args["gc"] == "1") ||
     
    239251      }
    240252    }
    241 
     253   
    242254  } else {
    243     // classification level
     255    // classification level - links to docs may be detaching
    244256    if (haschildren == 1) {
    245257      if (doctype == "classify") {
     
    254266    }
    255267      } else {
     268   
    256269    icon = "_document:iconclosedbook_";
    257     link += "&cl=" + arg_cl + "&d=" + section.OID + "\">";
     270    link += "&cl=" + arg_cl + "&d=" + section.OID;
     271    if (args["xx"] == "1") {
     272      link +=  detach_link_end;
     273    } else {
     274      link += link_end;
     275    }
     276   
    258277      }
    259278    } else {
    260279      if (doctype == "classify") link = "";
    261       else link += "&cl=" + arg_cl + "&d=" + section.OID + "\">";
    262     }
    263   }
    264 }
     280      else {
     281    link += "&cl=" + arg_cl + "&d=" + section.OID;
     282    if (args["xx"] == "1") {
     283      link +=  detach_link_end;
     284    } else {
     285      link += link_end;
     286    }
     287      }
     288    }
     289  }
     290 
     291}
Note: See TracChangeset for help on using the changeset viewer.