diff develop/views/Extractapp/taggingtext.php @ 13:cc36a20a68ab

automatically decide which rows (what data) should be shown in the exporting table based on the topic.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 17 Feb 2015 15:25:11 +0100
parents e82ca7375e93
children ac77748bb813
line wrap: on
line diff
--- a/develop/views/Extractapp/taggingtext.php	Mon Feb 16 16:51:39 2015 +0100
+++ b/develop/views/Extractapp/taggingtext.php	Tue Feb 17 15:25:11 2015 +0100
@@ -54,6 +54,21 @@
 
 <script type="text/javascript">
 
+// === This is only for developing on local machine ====
+var _GET = JSON.parse('<?php echo json_encode($_GET) ?>');
+if (_GET['id']) {
+    
+    var info = JSON.parse('<?php echo json_encode($info) ?>');
+    var redirectUrl = "http://141.14.239.50:1080/localmonographs/develop/Extractapp/TaggingText";
+    var section_id = info['section_id'];
+
+    var form = $('<form action="' + redirectUrl + '" method="post">' +
+        '<input type="hidden" name="sectionId" value="'+section_id+'" />' +
+        '</form>');
+        $('body').append(form);
+        $(form).submit();
+}
+// ====
 
 
 <?php 
@@ -237,7 +252,7 @@
     if (name!=null){
         $.ajax({
             type : 'POST',
-            url : '../../models/_extractapp_func.php',
+            url : '../models/_extractapp_func.php',
             async : false,
             data : 'func=SmartRegexSave'+'&text='+encodeURIComponent($('#smartRegexShowDiv').html())+'&filename='+name
         }).done(function(result) {
@@ -290,13 +305,15 @@
 }
 
 
+
+
 // === for config tags in topic ===
 function configTagsInTopic(topic_id) {
     var form = document.createElement("form");
     
     form.setAttribute("method", "post");
     //form.setAttribute("action", "exportTable.php");
-    form.setAttribute("action", "../ConfigTagsInTopic");  // hand to controller
+    form.setAttribute("action", "./ConfigTagsInTopic");  // hand to controller
     form.setAttribute("target", "_blank");
     
 
@@ -418,7 +435,7 @@
 
 		var form = document.createElement("form");
         form.setAttribute("method", "post");
-        form.setAttribute("action", "./"+info['section_id']);  // hand to controller
+        form.setAttribute("action", "./TaggingText");  // hand to controller
         //form.setAttribute("action", "./"+section_id);  // hand to controller
         form.setAttribute("target", "_self");
 
@@ -546,15 +563,15 @@
 						<button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br>
 						<button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br>
 						</br>
-						<button onclick="window.open('../EditWordlist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Word List</button></br>
-						<button onclick="window.open('../EditTaglist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Tag List</button></br>
+						<button onclick="window.open('./EditWordlist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Word List</button></br>
+						<button onclick="window.open('./EditTaglist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Tag List</button></br>
 					</fieldset>
 					
 					<fieldset>
 						<legend>Export:</legend>
 						Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br>
 						<button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br>
-						<button onclick="exportAll(<?php echo $section_id;?>,<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br>
+						<button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br>
 					</fieldset>
 					
 					<fieldset>