comparison 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
comparison
equal deleted inserted replaced
10:54a235d43694 11:3d6fba07bfbd
4 $wordlistArray = $viewmodel['wordlistArray']; 4 $wordlistArray = $viewmodel['wordlistArray'];
5 $taglistArray = $viewmodel['taglistArray']; 5 $taglistArray = $viewmodel['taglistArray'];
6 $section_id = $viewmodel['section_id']; 6 $section_id = $viewmodel['section_id'];
7 $topiclistArray = $viewmodel['topiclistArray']; 7 $topiclistArray = $viewmodel['topiclistArray'];
8 $default_topic_id = $viewmodel['default_topic_id']; 8 $default_topic_id = $viewmodel['default_topic_id'];
9 $topic_tag = $viewmodel['topic_tag'];
9 10
10 ?> 11 ?>
11 12
12 <html> 13 <html>
13 <head> 14 <head>
139 newdiv.innerHTML += "<button onclick=\"removeTagTitle( range, container )\">Remove</button></br>"; 140 newdiv.innerHTML += "<button onclick=\"removeTagTitle( range, container )\">Remove</button></br>";
140 } else { 141 } else {
141 // for pop up window on edit-area for tag list 142 // for pop up window on edit-area for tag list
142 newdiv.innerHTML = "Tag: "+String(selection)+"<br>"; 143 newdiv.innerHTML = "Tag: "+String(selection)+"<br>";
143 144
145 <?php
146 foreach ( $taglistArray as $taglistValue ) {
147 if ($taglistValue[2] == $topic_tag) {
148 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";
149 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
150 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
151 break;
152 }
153 }
154 ?>
155
144 newdiv.innerHTML += "<button accesskey=\"2\" onclick=\"tagwithtitle( range, '"+String(selection)+"' )\">Tag As Title</button></br>"; 156 newdiv.innerHTML += "<button accesskey=\"2\" onclick=\"tagwithtitle( range, '"+String(selection)+"' )\">Tag As Title</button></br>";
145 157
146 <?php 158 <?php
147 foreach ( $taglistArray as $taglistValue ) { 159
148 if ( $taglistValue[2] == "person") { 160 foreach ( $taglistArray as $taglistValue ) {
161 /*
162 if ( $taglistValue[2] == "person") {
149 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n"; 163 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
150 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n"; 164 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
151 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; 165 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
152 } else if ($taglistValue[2] == "post_time") { 166 } else */
167 if ($taglistValue[2] == $topic_tag) {
168 // pass
169 } else if ($taglistValue[2] == "post_time") {
153 echo "newdiv.innerHTML += \"<button accesskey=\\\"3\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n"; 170 echo "newdiv.innerHTML += \"<button accesskey=\\\"3\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
154 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; 171 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
155 } else if ($taglistValue[2] == "office") { 172 } else if ($taglistValue[2] == "office") {
156 echo "newdiv.innerHTML += \"<button accesskey=\\\"4\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n"; 173 echo "newdiv.innerHTML += \"<button accesskey=\\\"4\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
157 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; 174 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
158 } else { 175 } else {
159 echo "newdiv.innerHTML += \"<button onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n"; 176 echo "newdiv.innerHTML += \"<button onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
160 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; 177 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
161 } 178 }
179
162 } 180 }
163 ?> 181 ?>
164 } 182 }
165 $('body').append(newdiv); 183 $('body').append(newdiv);
166 184
346 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" style="height: 30px; width: 50px">>></button> 364 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" style="height: 30px; width: 50px">>></button>
347 <button onclick="replaceSmartClose()" style="height: 30px; width: 50px">Close</button> 365 <button onclick="replaceSmartClose()" style="height: 30px; width: 50px">Close</button>
348 </div> 366 </div>
349 <form action="javascript:void(0);"> 367 <form action="javascript:void(0);">
350 <button onclick="chooseTopic(<?php echo $section_id;?>, <?php echo $default_topic_id; ?>)">Choose Topic</button> 368 <button onclick="chooseTopic(<?php echo $section_id;?>, <?php echo $default_topic_id; ?>)">Choose Topic</button>
351 369 <button onclick="window.open('../ConfigTagsInTopic/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Config Tag List For Topic</button></br>
352 <fieldset> 370 <fieldset>
353 <legend>Replace By <i><b>Smart Regex</b></i>©:</legend> 371 <legend>Replace By <i><b>Smart Regex</b></i>©:</legend>
354 <div id="smartRegexShowDiv"></div><br> 372 <div id="smartRegexShowDiv"></div><br>
355 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br> 373 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br>
356 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> 374 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br>
382 400
383 <fieldset> 401 <fieldset>
384 <legend>Export:</legend> 402 <legend>Export:</legend>
385 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br> 403 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br>
386 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br> 404 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br>
387 <button onclick="exportAll(<?php echo $section_id;?>)" style="height: 30px; width: 220px">Export All</button></br> 405 <button onclick="exportAll(<?php echo $section_id;?>,<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br>
388 </fieldset> 406 </fieldset>
389 407
390 <fieldset> 408 <fieldset>
391 <legend>Replace By <i><b>Regex</b></i>:</legend> 409 <legend>Replace By <i><b>Regex</b></i>:</legend>
392 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> 410 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br>