[sword-cvs] sword/src/modules/filters thmlhtmlhref.cpp,1.50,1.51

sword at www.crosswire.org sword at www.crosswire.org
Wed Jul 21 09:48:26 MST 2004


Committed by: tbiggs

Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv17611

Modified Files:
	thmlhtmlhref.cpp 
Log Message:
/work/sword/src/modules/filters/thmlhtmlhref.cpp

Index: thmlhtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/thmlhtmlhref.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- thmlhtmlhref.cpp	27 Mar 2004 19:35:30 -0000	1.50
+++ thmlhtmlhref.cpp	21 Jul 2004 16:48:24 -0000	1.51
@@ -19,9 +19,10 @@
 #include <swmodule.h>
 #include <utilxml.h>
 #include <versekey.h>
+#include <url.h>
 
 SWORD_NAMESPACE_START
-
+ 
 
 ThMLHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
 	if (module) {
@@ -53,27 +54,19 @@
 		if (tag.getName() && !strcmp(tag.getName(), "sync")) {
 			SWBuf value = tag.getAttribute("value");
 			if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "morph")) { //&gt;
-				buf += "<small><em>(<a href=\"";
-				buf += "type=";
-				buf += tag.getAttribute("type");
-	
-				//const char* value = tag.getAttribute("value");
-				buf += " value=";
-				buf += (value.length()) ? value.c_str() : "";
-				buf += "\">";
+				buf.appendFormatted("<small><em>(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=%s\">", (value.length()) ? value.c_str() : "");
 				buf += (value.length()) ? value.c_str() : "";
 				buf += "</a>) </em></small>";
 			}
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
-				buf += "<small><em>&lt;<a href=\"";
-				buf += "type=";
-				buf += tag.getAttribute("type");
-	
-				//const char* value = tag.getAttribute("value");
-				buf += " value=";
-				buf += (value.length()) ? value.c_str() : "";
-				buf += "\">";
-				value<<1;
+				if(*value == 'H') {
+					value<<1;
+					buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=%s\">",(value.length()) ? value.c_str() : "");
+				}
+				else if(*value == 'G') {
+					value<<1;
+					buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=%s\">",(value.length()) ? value.c_str() : "");
+				}
 				buf += (value.length()) ? value.c_str() : "";
 				buf += "</a>&gt; </em></small>";
 			}
@@ -99,7 +92,12 @@
 					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(), ch, footnoteNumber.c_str(), ch);
+						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a> ", 
+							ch, 
+							URL::encode(footnoteNumber.c_str()).c_str(), 
+							URL::encode(u->version.c_str()).c_str(), 
+							URL::encode(vkey->getText()).c_str(), 
+							ch);
 					}
 					u->suspendTextPassThru = true;
 				}
@@ -121,15 +119,10 @@
 					if (!refList.length())
 						refList = u->lastTextNode;
 					SWBuf version = tag.getAttribute("version");
-					buf += "&nbsp<a href=\"";
-					if (version.length()) {
-						buf += "version=";
-						buf += version;
-						buf += " ";
-					}
-					buf += "passage=";
-					buf += refList.c_str();
-					buf += "\">";
+					
+					buf.appendFormatted("&nbsp<a href=\"passagestudy.jsp?action=showRef&type=scripRef&value=%s&module=%s\">",
+						(refList.length()) ? URL::encode(refList.c_str()).c_str() : "", 
+						(version.length()) ? URL::encode(version.c_str()).c_str() : "");
 					buf += u->lastTextNode.c_str();
 					buf += "</a>&nbsp";
 				}
@@ -143,7 +136,12 @@
 					SWCATCH ( ... ) {}
 					if (vkey) {
 						// leave this special osis type in for crossReference notes types?  Might thml use this some day? Doesn't hurt.
-						buf.appendFormatted("<a href=\"noteID=%s.x.%s\"><small><sup>*x</sup></small></a> ", vkey->getText(), footnoteNumber.c_str());
+						//buf.appendFormatted("<a href=\"noteID=%s.x.%s\"><small><sup>*x</sup></small></a> ", vkey->getText(), footnoteNumber.c_str());
+						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=x&value=%s&module=%s\"><small><sup>*x</sup></small></a> ",  
+							URL::encode(vkey->getText()).c_str(), 
+							URL::encode(footnoteNumber.c_str()).c_str(), 
+							URL::encode(u->version.c_str()).c_str());
+					
 					}
 				}
 



More information about the sword-cvs mailing list