[sword-svn] r3037 - trunk/examples/tasks

scribe at crosswire.org scribe at crosswire.org
Thu Feb 27 23:34:00 MST 2014


Author: scribe
Date: 2014-02-27 23:34:00 -0700 (Thu, 27 Feb 2014)
New Revision: 3037

Modified:
   trunk/examples/tasks/parallelbibles.cpp
Log:
updated to add module name headers and copyright and promo footers


Modified: trunk/examples/tasks/parallelbibles.cpp
===================================================================
--- trunk/examples/tasks/parallelbibles.cpp	2014-02-28 05:52:31 UTC (rev 3036)
+++ trunk/examples/tasks/parallelbibles.cpp	2014-02-28 06:34:00 UTC (rev 3037)
@@ -36,7 +36,6 @@
 
 void parallelDisplay(vector<SWModule *>modules, const char *key) {
 
-
 	// We'll use the first module's key as our master key to position all other modules.
 	VerseKey *master = (VerseKey *)modules[0]->createKey();
 
@@ -45,11 +44,11 @@
 	int curChapter = master->getChapter();
 	int curBook    = master->getBook();
 
-	cout << "<table><thead></thead><tbody>";
 	for (master->setVerse(1);	   (master->getBook()    == curBook)
 					&& (master->getChapter() == curChapter)
 					&& !master->popError();
-								(*master)++) {
+										(*master)++) {
+
 		cout << "<tr class=\"" << (master->getVerse() == curVerse ? "currentverse":"verse") << "\">";
 		for (vector<SWModule *>::iterator module = modules.begin(); module != modules.end(); ++module) {
 			(*module)->setKey(master);
@@ -60,11 +59,10 @@
 		}
 		cout << "</tr>";
 	}
-	cout << "</tbody></table>";
-
 	delete master;
 }
 
+
 void outputHeader(vector<SWModule *>modules, const char *key) {
 
 	modules[0]->setKey(key);
@@ -80,7 +78,7 @@
 	<< "<head profile=\"http://www.w3.org/2000/08/w3c-synd/#\">"
 	<< "<meta name=\"keywords\" content=\"Jesus, Christ, Church, Bible, Iran, Persian, Persia, Azeri, Azerbaijan, Armenian, God, Gospel, CrossWire, Java, Web, Software\" />"
 	<< "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"
-	<< "<title>OSIS Web: James 1:19 - Parallel Bible study</title>"
+	<< "<title>OSIS Web: " << modules[0]->getKeyText() << " - Parallel Bible study</title>"
 	<< "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"http://crosswire.org/study/common.css\"  />"
 	<< "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" title=\"Washed Out\" href=\"http://crosswire.org/study/wash.css\"  />"
 	<< "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css\"/>"
@@ -103,14 +101,36 @@
 	<<       "<style>"
 	<<         modules[0]->getRenderHeader()
 	<<       "</style>"
-	<<       "<h2>Parallel Viewing: " << modules[0]->getKeyText() << "</h2>";
+	<<       "<h2>Parallel Viewing: " << modules[0]->getKeyText() << "</h2><br/>"
+	<<       "<table><thead><tr>";
 
+	for (vector<SWModule *>::iterator module = modules.begin(); module != modules.end(); ++module) {
+		cout << "<th>" << (*module)->getDescription() << "</th>";
+	}
+
+	cout
+	<<       "</tr></thead><tbody>";
+
 	
 }
 
-void outputFooter() {
+void outputFooter(vector<SWModule *>modules) {
 
 	cout
+	<<       "</tbody><tfoot><tr>";
+
+	for (vector<SWModule *>::iterator module = modules.begin(); module != modules.end(); ++module) {
+		SWBuf copyLine = (*module)->getConfigEntry("ShortCopyright");
+		SWBuf promoLine = (*module)->getConfigEntry("ShortPromo");
+		cout
+		<< "<th>"
+		<< "<div class=\"copyLine\">" <<  copyLine << "</div>"
+		<< "<div class=\"promoLine\">" << promoLine << "</div>"
+		<< "</th>";
+	}
+
+	cout
+	<<       "</tr></tfoot></table>"
 	<<     "</div>"
 	<<   "</div>"
 	<<   "<div id=\"footer\">"
@@ -126,6 +146,7 @@
 	<< "</html>";
 }
 
+
 int main(int argc, char **argv) {
 
 	SWMgr library(new MarkupFilterMgr(FMT_XHTML));
@@ -152,7 +173,7 @@
 
 	outputHeader(modules, argv[argc-1]);
 	parallelDisplay(modules, argv[argc-1]);
-	outputFooter();
+	outputFooter(modules);
 
 	return 0;
 }




More information about the sword-cvs mailing list