Ignore:
Timestamp:
2010-03-03T11:06:37+13:00 (14 years ago)
Author:
kjdon
Message:

now we dynamically generate srclink (and /srclink, and new srchref which is the link without the a tag), using srclink_file metadata. This is to get gs2 receptionist stuff out of metadata and into the source code where it belongs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/formattools.cpp

    r21752 r21758  
    631631    formatlistptr->command = comEndLink;
    632632
     633  else if (meta == "srclink") {
     634    formatlistptr->command = comAssocLink;
     635    formatlistptr->meta.metaname = "srclink_file";
     636    metadata.insert("srclink_file");
     637  }
     638  else if (meta == "srchref") {
     639    formatlistptr->command = comAssocLink;
     640    formatlistptr->text = "href";
     641    formatlistptr->meta.metaname = "srclink_file";
     642    metadata.insert("srclink_file");
     643  }
     644  else if (meta == "/srclink") {
     645    formatlistptr->command = comEndAssocLink;
     646    formatlistptr->meta.metaname = "srclink_file";
     647  }
     648  // and weblink etc
    633649  else if (meta == "href")
    634650    formatlistptr->command = comHref;
     
    17771793    return options["link"];
    17781794     case comEndLink:
    1779     if (options["link"].empty()) return "";
     1795       {
     1796     if (options["link"].empty()) return "";
    17801797    else return "</a>";
     1798       }
    17811799     case comHref:
    17821800    return get_href(options["link"]);
     
    17901808     case comSummary:
    17911809       return format_summary(collection, collectproto, docinfo, disp, options, logout);
    1792 
     1810     case comAssocLink:
     1811       {
     1812     text_t link_filename = get_meta(collection, collectproto, docinfo, disp, formatlistptr->meta, options, logout);
     1813         if (!link_filename.empty()) {
     1814       text_t href= expand_metadata(options["assocfilepath"]+link_filename, collection, collectproto, docinfo, disp, options, logout);
     1815       if (formatlistptr->text == "href") {
     1816         return href;
     1817       }
     1818       return "<a href=\""+ href + "\">";
     1819     }
     1820     return "";
     1821       }
     1822  case comEndAssocLink:
     1823    {
     1824    text_t link_filename = get_meta(collection, collectproto, docinfo, disp, formatlistptr->meta, options, logout);
     1825    if (!link_filename.empty()) {
     1826      return "</a>";
     1827    }
     1828    return "";
     1829    }
    17931830     case comMeta:
    17941831    {
Note: See TracChangeset for help on using the changeset viewer.