- Timestamp:
- 2009-04-30T14:04:59+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/recpt/formattools.cpp
r19058 r19298 31 31 32 32 #include <assert.h> 33 34 bool spanwrap = false; 33 35 34 36 // a few function prototypes … … 881 883 { 882 884 text_t no_ns_metaname = remove_namespace(meta.metaname); 883 text_t tmp;885 text_t formatted_metatext; 884 886 bool first = true; 885 887 … … 889 891 if (position == -1) { // all 890 892 for (int i=start_i; i<=end_i; ++i) { 891 if (!first) tmp += meta.siblingoptions; 893 if (!first) formatted_metatext += meta.siblingoptions; 894 895 text_t fresh_metatext; 896 892 897 if (meta.metacommand & mSpecial) { 893 898 // special formatting 894 if (no_ns_metaname == "Date") tmp += format_date (metainfo.values[i]);895 else if (no_ns_metaname == "Language") tmp += iso639(metainfo.values[i]);896 else tmp += "_format:"+meta.metaname+"_("+metainfo.values[i]+")";899 if (no_ns_metaname == "Date") fresh_metatext = format_date (metainfo.values[i]); 900 else if (no_ns_metaname == "Language") fresh_metatext = iso639(metainfo.values[i]); 901 else fresh_metatext = "_format:"+meta.metaname+"_("+metainfo.values[i]+")"; 897 902 } 898 else tmp += metainfo.values[i]; 903 else fresh_metatext = metainfo.values[i]; 904 905 if (spanwrap) { 906 fresh_metatext = "<span metaname=\"" + meta.metaname + "\" metapos=\"" + i + "\">" + fresh_metatext + "</span>"; 907 } 908 formatted_metatext += fresh_metatext; 909 899 910 first = false; 900 911 … … 906 917 return ""; 907 918 } 919 920 text_t fresh_metatext; 908 921 if (meta.metacommand & mSpecial) { 922 909 923 // special formatting 910 if (no_ns_metaname == "Date") tmp += format_date (metainfo.values[position]);911 else if (no_ns_metaname == "Language") tmp += iso639(metainfo.values[position]);912 else tmp += "_format:"+meta.metaname+"_("+metainfo.values[position]+")";924 if (no_ns_metaname == "Date") fresh_metatext = format_date (metainfo.values[position]); 925 else if (no_ns_metaname == "Language") fresh_metatext = iso639(metainfo.values[position]); 926 else fresh_metatext = "_format:"+meta.metaname+"_("+metainfo.values[position]+")"; 913 927 } 914 else tmp += metainfo.values[position]; 915 } 916 if (meta.metacommand & mCgiSafe && !no_cgisafe) return cgi_safe_unicode (tmp); 917 else return tmp; 928 else fresh_metatext = metainfo.values[position]; 929 930 if (spanwrap) { 931 fresh_metatext = "<span metaname=\"" + meta.metaname + "\" metapos=\"" + position + "\">" + fresh_metatext + "</span>"; 932 } 933 934 formatted_metatext += fresh_metatext; 935 } 936 937 if (meta.metacommand & mCgiSafe && !no_cgisafe) return cgi_safe_unicode (formatted_metatext); 938 else return formatted_metatext; 918 939 } 919 940 … … 1365 1386 // to see whether we output the "then" or the "else" clause 1366 1387 if (decision.command == dMeta) { 1367 if (get_meta (collection,collectproto,docinfo,disp,decision.meta,options, 1368 logout) != "") { 1388 1389 bool store_spanwrap = spanwrap; 1390 spanwrap = 0; 1391 1392 // temporarily suspend spanwrap (if on) so can test if metadata item really exits or not 1393 bool metadata_exists 1394 = (get_meta (collection,collectproto,docinfo,disp,decision.meta,options, 1395 logout) != ""); 1396 1397 spanwrap = store_spanwrap; 1398 1399 if (metadata_exists) { 1369 1400 if (ifptr != NULL) 1370 1401 return get_formatted_string (collection,collectproto,docinfo, disp, ifptr,
Note:
See TracChangeset
for help on using the changeset viewer.