Changeset 15950


Ignore:
Timestamp:
2008-06-10T16:35:26+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding dynamic classifiers) Improvements to get_link_icon() to handle multi-level dynamic classifier nodes.

File:
1 edited

Legend:

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

    r15835 r15950  
    389389    if (args["a"] == "dc")
    390390    {
    391       // Open node
    392       if (section.OID == args["dcn"])
     391      // Parent node or current node
     392      text_t classifier_node_dcn = "";
     393      if (!starts_with (section.OID, args["dcn"]) || section.OID == args["dcn"])
    393394      {
    394395        icon = "_document:iconopenbookshelf_";
    395         link = "<a href=\"_gwcgi_?c=" + args["c"] + "&amp;a=dc&amp;dcl=" + args["dcl"] + "&amp;dcn=\">";
     396
     397        // dcn value is the OID of this node's parent
     398        text_t::iterator hierarchy_split_position = findchar(section.OID.begin(), section.OID.end(), '|');
     399        if (hierarchy_split_position != section.OID.end())
     400        {
     401          classifier_node_dcn = substr (section.OID.begin(), hierarchy_split_position);
     402        }
    396403      }
    397       // Closed node
     404      // Child node
    398405      else
    399406      {
    400407        icon = "_document:iconclosedbookshelf_";
    401 
    402         // The node label is going into the URL, so make it CGI-safe
    403         text_t classifier_node_cgi_safe = cgi_safe_utf8(section.OID);
    404         link = "<a href=\"_gwcgi_?c=" + args["c"] + "&amp;a=dc&amp;dcl=" + args["dcl"] + "&amp;dcn=" + classifier_node_cgi_safe + "\">";
     408        classifier_node_dcn = section.OID;
    405409      }
     410
     411      // The node label is going into the URL, so make it CGI-safe
     412      text_t classifier_node_dcn_cgi_safe = cgi_safe_utf8(classifier_node_dcn);
     413      link = "<a href=\"_gwcgi_?c=" + args["c"] + "&amp;a=dc&amp;dcl=" + args["dcl"] + "&amp;dcn=" + classifier_node_dcn_cgi_safe + "\">";
    406414    }
    407415    // Static classifier nodes
Note: See TracChangeset for help on using the changeset viewer.