Mercurial > hg > extraction-interface
diff develop/views/Extractapp/configtagsintopic.php @ 12:e82ca7375e93
Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 16 Feb 2015 16:51:39 +0100 |
parents | |
children | 115dda3d1728 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/develop/views/Extractapp/configtagsintopic.php Mon Feb 16 16:51:39 2015 +0100 @@ -0,0 +1,72 @@ +<?php +// --- initialize --- +$taglistArray = $viewmodel['taglistArray']; +$topic = $viewmodel['topic']; +$topic_name = $viewmodel['topic_name']; + +?> + +<html> +<head> +<title></title> +</head> + +<body> + + + <form autocomplete='off' action="Javascript:checkTopic(this)"> + <h3>Topic: <?php echo $topic_name;?> </h3> + <div> Select/Unselect the following tags for the topic. </div> + <input type="submit" value="Submit"> + + <table style="" border="1"> + <thead> + <tr> + <td>Name</td> + <td>Tag</td> + <td>Select/Unselect</td> + </tr> + </thead> + <tbody> + <?php + // list the tags with topic + foreach ($taglistArray as $taglistValue) { + echo "<tr>"; + echo "<td>".$taglistValue['name']."</td>"; + echo "<td>".$taglistValue['tag']."</td>"; + // checkbox for topic + if ($taglistValue['topic_id'] == $topic) { + echo "<td> <input type='checkbox' name='".$taglistValue['id']."' checked='true'/> </td>"; + } else { + echo "<td> <input type='checkbox' name='".$taglistValue['id']."'/> </td>"; + } + echo "</tr>"; + } + ?> + </tbody> + </table> + + </form> + + + <script type="text/javascript"> + function checkTopic(t) { + console.log("DEBUG"); + // TODO: save the modification into topic_tag_relation + + var id = t.name; + var val; + console.log(id); + /* + if (t.checked) { + val = '1'; + } else { + val = '0'; + } + */ + + } + + </script> +</body> +</html>