[sword-cvs] sword/src/modules/filters gbfhtmlhref.cpp,1.29,1.30
sword at www.crosswire.org
sword at www.crosswire.org
Wed Jul 21 09:49:22 MST 2004
Committed by: tbiggs
Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv17701
Modified Files:
gbfhtmlhref.cpp
Log Message:
updated htmlhref filters to use new URL class
Index: gbfhtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfhtmlhref.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- gbfhtmlhref.cpp 27 Mar 2004 19:35:30 -0000 1.29
+++ gbfhtmlhref.cpp 21 Jul 2004 16:49:20 -0000 1.30
@@ -21,9 +21,16 @@
#include <utilxml.h>
#include <versekey.h>
#include <ctype.h>
+#include <url.h>
SWORD_NAMESPACE_START
+GBFHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
+ if (module) {
+ version = module->Name();
+ }
+}
+
GBFHTMLHREF::GBFHTMLHREF() {
setTokenStart("<");
setTokenEnd(">");
@@ -72,7 +79,7 @@
if (!substituteToken(buf, token)) {
XMLTag tag(token);
- if (!strncmp(token, "w", 1)) {
+ /*if (!strncmp(token, "w", 1)) {
// OSIS Word (temporary until OSISRTF is done)
valto = val;
num = strstr(token, "lemma=\"x-Strongs:");
@@ -91,13 +98,12 @@
//cout << buf;
}
- /* forget these for now
- else {
+ // forget these for now
+ //else {
// verb morph
- sprintf(wordstr, "%03d", word-1);
- module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
- }
- */
+ //sprintf(wordstr, "%03d", word-1);
+ //module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
+ //}
}
else {
num = strstr(token, "lemma=\"strong:");
@@ -116,13 +122,12 @@
//cout << buf;
}
- /* forget these for now
- else {
+ // forget these for now
+ //else {
// verb morph
- sprintf(wordstr, "%03d", word-1);
- module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
- }
- */
+ //sprintf(wordstr, "%03d", word-1);
+ //module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
+ //}
}
}
valto = val;
@@ -141,11 +146,13 @@
buf += *tok;
buf += "</a>)</em></small> ";
}
- }
+ }*/
- else if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers
- buf += " <small><em><<a href=\"type=Strongs value=";
- for (tok = token+1; *tok; tok++)
+ // else
+ if (!strncmp(token, "WG", 2)) { // strong's numbers
+ //buf += " <small><em><<a href=\"type=Strongs value=";
+ buf += " <small><em><<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
+ for (tok = token+2; *tok; tok++)
//if(token[i] != '\"')
buf += *tok;
buf += "\">";
@@ -154,10 +161,22 @@
buf += *tok;
buf += "</a>></em></small>";
}
-
- else if (!strncmp(token, "WTG", 3) || !strncmp(token, "WTH", 3)) { // strong's numbers tense
- buf += " <small><em>(<a href=\"type=Strongs value=";
+ else if (!strncmp(token, "WH", 2)) { // strong's numbers
+ //buf += " <small><em><<a href=\"type=Strongs value=";
+ buf += " <small><em><<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
+ for (tok = token+2; *tok; tok++)
+ //if(token[i] != '\"')
+ buf += *tok;
+ buf += "\">";
for (tok = token + 2; *tok; tok++)
+ //if(token[i] != '\"')
+ buf += *tok;
+ buf += "</a>></em></small>";
+ }
+ else if (!strncmp(token, "WTG", 3)) { // strong's numbers tense
+ //buf += " <small><em>(<a href=\"type=Strongs value=";
+ buf += " <small><em>(<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
+ for (tok = token + 3; *tok; tok++)
if(*tok != '\"')
buf += *tok;
buf += "\">";
@@ -166,7 +185,19 @@
buf += *tok;
buf += "</a>)</em></small>";
}
-
+ else if (!strncmp(token, "WTH", 3)) { // strong's numbers tense
+ //buf += " <small><em>(<a href=\"type=Strongs value=";
+ buf += " <small><em>(<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
+ for (tok = token + 3; *tok; tok++)
+ if(*tok != '\"')
+ buf += *tok;
+ buf += "\">";
+ for (tok = token + 3; *tok; tok++)
+ if(*tok != '\"')
+ buf += *tok;
+ buf += "</a>)</em></small>";
+ }
+/*
else if (!strncmp(token, "WT", 2) && strncmp(token, "WTH", 3) && strncmp(token, "WTG", 3)) { // morph tags
buf += " <small><em>(<a href=\"type=morph class=none value=";
for (tok = token + 2; *tok; tok++)
@@ -178,7 +209,7 @@
buf += *tok;
buf += "</a>)</em></small>";
}
-
+*/
else if (!strcmp(tag.getName(), "RX")) {
buf += "<a href=\"";
for (tok = token + 3; *tok; tok++) {
@@ -203,7 +234,10 @@
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
//char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), 'n', footnoteNumber.c_str(), 'n');
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup>*n</sup></small></a> ",
+ URL::encode(footnoteNumber.c_str()).c_str(),
+ URL::encode(u->version.c_str()).c_str(),
+ URL::encode(vkey->getText()).c_str());
}
u->suspendTextPassThru = true;
}
More information about the sword-cvs
mailing list