changeset 76:c49192885290 extractapp

Bug fixed: ambiguous tag occured at Editing-text mode
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 13 Apr 2015 15:43:59 +0200
parents 75233b09c580
children 97c1e5102a22
files models/extractapp.php views/Extractapp/TaggingText.php
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/models/extractapp.php	Thu Apr 09 15:29:46 2015 +0200
+++ b/models/extractapp.php	Mon Apr 13 15:43:59 2015 +0200
@@ -378,11 +378,15 @@
             $require = preg_replace("/<br>/u", "\n", $require);
             //$require = preg_replace("/<br>/u", "\n", $require);
 
-
+            $require = "<text_content>".$require."</text_content>\n";
+            
+            /*
             if ($_postdata['branchId'] == 0) {
                 // -- new branch case
                 $require = "<text_content>".$require."</text_content>\n";
             }
+            */
+
             $require = $this->AppendMetaData($require);
                 
             //saving in my local machine in developing phrase
@@ -1163,7 +1167,10 @@
 
         $contentString = (string)($xml->text_content->asXML());
 
-        return $contentString;
+        $removed_str = array("<text_content>","</text_content>");
+        $new_contentString = str_replace($removed_str, "", $contentString);
+
+        return $new_contentString;
     }
 
 
--- a/views/Extractapp/TaggingText.php	Thu Apr 09 15:29:46 2015 +0200
+++ b/views/Extractapp/TaggingText.php	Mon Apr 13 15:43:59 2015 +0200
@@ -802,7 +802,7 @@
 <div class="info-board">
     <div class="bg-danger"><strong><?php echo $messages['error']; ?> </strong></div>
     <div class="bg-warning"> <?php echo $messages['warning']; ?> 
-        <button id="reloadTextButton" onclick="reloadText(<?php echo $default_topic_id; ?>)" style="display:none;">Load Latest Version</button>
+        <button id="reloadTextButton" onclick="reloadText(<?php echo $default_topic_id; ?>)" style="display:none;">Latest Version</button>
     </div>
     <div class="bg-info"> <?php echo $messages['info']; ?> </div>
     <div class="bg-default"> <?php echo $messages['debug']; ?> </div>