diff develop/views/Extractapp/taggingtext.php @ 11:3d6fba07bfbd

implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 11 Feb 2015 12:33:59 +0100
parents 54a235d43694
children e82ca7375e93
line wrap: on
line diff
--- a/develop/views/Extractapp/taggingtext.php	Tue Feb 10 16:20:29 2015 +0100
+++ b/develop/views/Extractapp/taggingtext.php	Wed Feb 11 12:33:59 2015 +0100
@@ -6,6 +6,7 @@
 $section_id = $viewmodel['section_id'];
 $topiclistArray = $viewmodel['topiclistArray'];
 $default_topic_id = $viewmodel['default_topic_id'];
+$topic_tag = $viewmodel['topic_tag'];
 
 ?>
 
@@ -141,15 +142,31 @@
  			// for pop up window on edit-area for tag list
             newdiv.innerHTML = "Tag: "+String(selection)+"<br>";
             
+            <?php 
+            foreach ( $taglistArray as $taglistValue ) {
+                if ($taglistValue[2] == $topic_tag) {
+                	echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">[TopicTag]Tag as:".$taglistValue[1]."(necessary for this topic!)</button>\";\n";
+                    echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
+                    echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
+            		break;
+            	}
+            }
+            ?>
+
             newdiv.innerHTML += "<button accesskey=\"2\" onclick=\"tagwithtitle( range, '"+String(selection)+"' )\">Tag As Title</button></br>";
             
             <?php 
-                foreach ( $taglistArray as $taglistValue ) {
-                    if ( $taglistValue[2] == "person") {
+            	
+			    foreach ( $taglistArray as $taglistValue ) {
+                	/*
+                	if ( $taglistValue[2] == "person") {
                         echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
                         echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
                         echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
-                    } else if ($taglistValue[2] == "post_time") {
+                	} else */
+                	if ($taglistValue[2] == $topic_tag) {
+                		// pass
+                	} else if ($taglistValue[2] == "post_time") {
                         echo "newdiv.innerHTML += \"<button accesskey=\\\"3\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
                         echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
                     } else if ($taglistValue[2] == "office") {
@@ -158,7 +175,8 @@
                     } else {
                         echo "newdiv.innerHTML += \"<button onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
                         echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
-                    }               
+                    } 
+
                 }
             ?>
         }
@@ -348,7 +366,7 @@
 				</div>
 				<form action="javascript:void(0);">
 					<button onclick="chooseTopic(<?php echo $section_id;?>, <?php echo $default_topic_id; ?>)">Choose Topic</button>
-
+					<button onclick="window.open('../ConfigTagsInTopic/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Config Tag List For Topic</button></br>
 					<fieldset>
 						<legend>Replace By <i><b>Smart Regex</b></i>©:</legend>
 						<div id="smartRegexShowDiv"></div><br>
@@ -384,7 +402,7 @@
 						<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;?>)" style="height: 30px; width: 220px">Export All</button></br>
+						<button onclick="exportAll(<?php echo $section_id;?>,<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br>
 					</fieldset>
 					
 					<fieldset>