greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 16044

Show
Ignore:
Timestamp:
2008-06-18 14:21:44 (7 months ago)
Author:
mdewsnip
Message:

Added a get_link_icon() function to be similar to vlistbrowserclass.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gsdl/trunk/src/recpt/hlistbrowserclass.cpp

    r16043 r16044  
    139139  text_t icon, link; 
    140140   
    141   while (tsibling != esibling) { 
     141  while (tsibling != esibling) 
     142  { 
     143    get_link_icon (*tsibling, args, link, icon); 
    142144 
    143145    bool highlight = false; 
    144     text_t &doctype = (*tsibling).metadata["doctype"].values[0]; 
    145  
    146     if ((*tsibling).OID == args["cl"] || is_child_of ((*tsibling).OID, args["cl"])) { 
     146    if ((*tsibling).OID == args["cl"] || is_child_of ((*tsibling).OID, args["cl"])) 
     147    { 
    147148      link.clear(); 
    148       highlight = true;    
    149     } else { 
    150       link = "<a href=\"_httpdocument_"; 
    151       if (doctype == "classify")  
    152         link += "&amp;cl=" + (*tsibling).OID + "\">"; 
    153       else { 
    154         link += "&amp;cl=" + args["cl"] + "&amp;d=" + (*tsibling).OID;// + "\">"; 
    155         // [modification to allow default document detach settings -- kjdon] 
    156         if (args["xx"]=="1") { 
    157           // documents should be detached 
    158           link += "&amp;x=1\" target=\"_blank\">"; 
    159         } else { 
    160           link += "\">"; 
    161         } 
    162       } 
     149      highlight = true; 
    163150    } 
    164151 
     
    192179  return 0; 
    193180} 
     181 
     182 
     183void hlistbrowserclass::get_link_icon (ResultDocInfo_t &section, cgiargsclass &args, text_t &link, text_t &icon) 
     184{ 
     185  link = "<a href=\"_httpdocument_"; 
     186 
     187  text_t &doctype = section.metadata["doctype"].values[0]; 
     188  if (doctype == "classify") 
     189  { 
     190    link += "&amp;cl=" + section.OID + "\">"; 
     191  } 
     192  else 
     193  { 
     194    link += "&amp;cl=" + args["cl"] + "&amp;d=" + section.OID; 
     195 
     196    // [modification to allow default document detach settings -- kjdon] 
     197    if (args["xx"] == "1") 
     198    { 
     199      // documents should be detached 
     200      link += "&amp;x=1\" target=\"_blank\">"; 
     201    } 
     202    else 
     203    { 
     204      link += "\">"; 
     205    } 
     206  } 
     207} 
  • gsdl/trunk/src/recpt/hlistbrowserclass.h

    r7432 r16044  
    6565 
    6666protected: 
     67 
     68  virtual void get_link_icon (ResultDocInfo_t &section, cgiargsclass &args, text_t &link, text_t &icon); 
     69 
    6770  receptionist *recpt; 
    6871};