# HG changeset patch # User Zoe Hong # Date 1423504764 -3600 # Node ID 584b1623e9ef2997b47da8e6f408994fdceb8531 # Parent da10158c6d0a0dc8aa41cd2f9400f6d05527db9b TOC correction list page updated diff -r da10158c6d0a -r 584b1623e9ef develop/models/extractapp.php --- a/develop/models/extractapp.php Mon Feb 09 12:28:09 2015 +0100 +++ b/develop/models/extractapp.php Mon Feb 09 18:59:24 2015 +0100 @@ -25,6 +25,9 @@ $stringInput = $this->GetSectionContent(); $taglistArray = $this->GetTaglistArray(); + // test for GetTaglistByTopicID: + // $taglistArray = $this->GetTaglistByTopicID(1); + $wordlistArray = $this->GetWordlistArray(); @@ -231,6 +234,38 @@ } } + + + // TODO: get taglist by choosen topic + private function GetTaglistByTopicID($topic_id) { + $taglistArray = ""; + + $query = "SELECT * FROM topic_tag_relation WHERE topic_id=".$topic_id; + $result = mysql_query($query); + if (!$result) { + return json_encode("Failed during selecting topics table."); + } + + while ($row = mysql_fetch_assoc($result)) { + $tag_id = $row['tag_id']; + $query = "SELECT * FROM taglist WHERE id=".$tag_id; + $tag_result = mysql_query($query); + if ($tag_result) { + return json_encode("Failed during selecting taglist table."); + } + $row = mysql_fetch_assoc($tag_result)); + $taglistArray[] = array( $row['id'], $row['name'], $row['tag'], $row['color'] ); + // array_push($taglistArray, array( $row['id'], $row['name'], $row['tag'], $row['color'] )); + } + + + return $taglistArray; + + + + + + } // =========================== // === for manage wordlist === diff -r da10158c6d0a -r 584b1623e9ef develop/views/Extractapp/taggingtext.php --- a/develop/views/Extractapp/taggingtext.php Mon Feb 09 12:28:09 2015 +0100 +++ b/develop/views/Extractapp/taggingtext.php Mon Feb 09 18:59:24 2015 +0100 @@ -5,6 +5,9 @@ $taglistArray = $viewmodel['taglistArray']; $section_id = $viewmodel['section_id']; + +var_dump($taglistArray); + ?> @@ -136,6 +139,7 @@ newdiv.innerHTML += "
"; newdiv.innerHTML += "
"; } else { + // for pop up window on edit-area for tag list newdiv.innerHTML = "Tag: "+String(selection)+"
"; newdiv.innerHTML += "
"; @@ -223,6 +227,7 @@ $(document).on("change", '#smartRegexPopUpSelectWord', function (e) { + "; echo ""; echo ""; - echo ""; $str.="
book namelevel1level2 perioddynastystart_yearlast_editoredit_time"; + echo "book namelevel1level2 + perioddynastystart_year + last_editoredit_time + Some notes for the book (optional)"; while ($row = mysql_fetch_assoc($result)) { $str="
".$row['book_name']; @@ -132,25 +146,21 @@ //$str.=" NotFinished"; switch ($row['toc_correction']) { case '0': - $str.=" Not Finished"; - $str.=" Works-in-progress"; - $str.=" Finished"; + $str.=" Finished"; break; case '1': - $str.=" Not Finished"; - $str.=" Works-in-progress"; - $str.=" Finished"; + $str.=" Finished"; break; - case '2': - $str.=" Not Finished"; - $str.=" Works-in-progress"; - $str.=" Finished"; - break; - default: break; } - + // comments for book + $comments = $row['comments']; + if ($comments != "") { + $str.=" "; + } else { + $str.=" "; + } echo $str; } echo "
"; @@ -197,47 +207,59 @@