changeset 75:75233b09c580 extractapp

saving latest taglist from db according to topic (even when changing topic)
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Thu, 09 Apr 2015 15:29:46 +0200
parents 60b5a94163c3
children c49192885290
files models/extractapp.php
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/models/extractapp.php	Thu Apr 09 10:59:31 2015 +0200
+++ b/models/extractapp.php	Thu Apr 09 15:29:46 2015 +0200
@@ -302,12 +302,13 @@
         }
     }
 
+    // This is only called by SaveFullTextToLGService()
     private function AppendMetaData($text_content) {
         $text = '<?xml version="1.0" encoding="UTF-8"?>';
         $text .= "\n<text>\n";
-        // topic
+        // --- topic ---
         $text .= "<topic>".$this->topic."</topic>\n";
-        // book meta data
+        // --- book meta data ---
         $book = $this->book_meta;
         foreach ($book as $b) {
             $text .= "<book>\n";
@@ -328,8 +329,12 @@
             $text .= "</book>\n";
             
         }
-        // taglist
-        $taglist = $this->taglist_infile;
+
+        // ---- taglist ---
+        // $taglist = $this->taglist_infile;
+        // obtain the latest taglist from db
+        $taglist = $this->GetTaglistByTopicID($this->GetTopic());
+
         foreach ($taglist as $tagitem) {
             $text .= "<tagitem>\n";
             $text .= "<id>".$tagitem[0]."</id>\n";
@@ -338,10 +343,11 @@
             $text .= "<color>".$tagitem[3]."</color>\n";
             $text .= "</tagitem>\n";
         }
-        
-        // text_content
+        // ----
+        // --- text_content ---
         $text .= $text_content;
         $text .= "</text>";
+        // ----
 
         return $text;
     }