# HG changeset patch # User Zoe Hong # Date 1442234249 -7200 # Node ID 3e11a9c5a672fa890b027f1d4527e8a71c50004e # Parent 94ad33739fa42c99d9e0666b38db2c8ed6d09d7c new: explore table for using on LGMap diff -r 94ad33739fa4 -r 3e11a9c5a672 .DS_Store Binary file .DS_Store has changed diff -r 94ad33739fa4 -r 3e11a9c5a672 config/config.php --- a/config/config.php Fri Jun 12 14:41:30 2015 +0200 +++ b/config/config.php Mon Sep 14 14:37:29 2015 +0200 @@ -22,7 +22,7 @@ $mysql_server = "localhost"; $mysql_user = "root"; $mysql_password = "admin"; - $server_host = "http://localgazetteers/"; + $server_host = "http://localgazetteers.mpiwg-berlin.mpg.de/"; $lgserver_url = $server_host."LGServices/"; } else { diff -r 94ad33739fa4 -r 3e11a9c5a672 controllers/extractapp.php --- a/controllers/extractapp.php Fri Jun 12 14:41:30 2015 +0200 +++ b/controllers/extractapp.php Mon Sep 14 14:37:29 2015 +0200 @@ -154,6 +154,25 @@ } + protected function ExportTabDelimited() { + /** + * ExportTable action returns "./views/Extractapp/ExportTabDelimited.php" view. + * ExportTabDelimited.php is using tab as delimiter. + */ + $viewmodel = $this->viewmodel; + + if (isset($this->postdata['fileId'])) { + $viewmodel->SetInfoFromPreviousPage($this->postdata); // fileId in postdata + + $viewmodel->SetTextFromFileId(); // this will also set section_id + $viewmodel->SetBookMetadataBySectionId(); + } + + $this->ReturnView($viewmodel->ExportTable($this->postdata, true), false); + + + } + protected function ExportTable() { /** * ExportTable action returns "./views/Extractapp/ExportTable.php" view. @@ -167,17 +186,27 @@ } switch ($func) { case 'exportFromExtractionInterface': + $viewmodel->SetInfoFromPreviousPage($this->postdata); + $this->ReturnView($viewmodel->ExportTable($this->postdata, false), true); break; default: // from file - $viewmodel->SetInfoFromPreviousPage($this->postdata); - $viewmodel->SetTextFromFileId(); - $this->ReturnView($viewmodel->ExportTable($this->postdata, true), true); + // exportFromLGServicesHtmlTable + if (isset($this->postdata['fileId'])) { + $viewmodel->SetInfoFromPreviousPage($this->postdata); // only fileId in postdata + + $viewmodel->SetTextFromFileId(); // this will also set section_id + $viewmodel->SetBookMetadataBySectionId(); + } + + $this->ReturnView($viewmodel->ExportTable($this->postdata, true), false); break; } + + } protected function EditWordlist() { diff -r 94ad33739fa4 -r 3e11a9c5a672 models/extractapp.php --- a/models/extractapp.php Fri Jun 12 14:41:30 2015 +0200 +++ b/models/extractapp.php Mon Sep 14 14:37:29 2015 +0200 @@ -294,11 +294,11 @@ $data['topic_name'] = $this->GetTopicName($topic_id); $data['topic_tag_ch'] = $this->GetTopicTagName($topic_id); - $data['info'] = array('file_id'=>$this->file_id, 'user_id'=>$this->user_id, 'branch_id'=>$this->branch_id, 'section_id'=>$this->section_id, 'book_id'=>$this->book_id, 'book_name'=>$this->book_name,'section_name'=>$this->section_name, 'period'=>$this->book_meta->period, - 'current_fileId'=>$this->current_fileId); + 'current_fileId'=>$this->current_fileId); + $this->messages['debug'] .= "[Debug] "; $this->messages['debug'] .= "file_id=".$this->file_id.", section_id=".$this->section_id; @@ -307,10 +307,11 @@ $this->messages['debug'] .= ", current_fileId=".$this->current_fileId."
"; $this->messages['info'] .= "[Info] book name: ".$this->book_name; + $this->messages['info'] .= ", period: ".$this->book_meta->period; $this->messages['info'] .= ", section id: ". $this->section_id; + $this->messages['info'] .= ", section name: ".$this->section_name; $this->messages['info'] .= ", branch id: ".$this->branch_id; $this->messages['info'] .= ", file id: ".$this->file_id; - $this->messages['info'] .= ", period: ".$this->book_meta->period; $this->messages['info'] .= "
"; @@ -726,7 +727,6 @@ } // === for export table === - public function ExportTable($postdata, $isFromFile) { if ($isFromFile) { $content = $this->lg_text; @@ -741,7 +741,6 @@ } else { $content = $postdata['content']; $topic = $postdata['topic']; - $section_id = $postdata['sectionId']; $sectionName = $postdata['sectionName']; $bookId = $postdata['bookId']; @@ -759,6 +758,8 @@ + $bookMeta = $this->book_meta; // just added + // data for view $data = array(); $data['outputTableArray'] = $outputTableArray; @@ -766,11 +767,11 @@ $data['section_id'] = $section_id; $data['bookName'] = $bookName; $data['sectionName'] = $sectionName; + $data['bookMeta'] = $bookMeta; return $data; } - // === for manage tag list === public function EditTaglist($_postdata) { /** diff -r 94ad33739fa4 -r 3e11a9c5a672 views/Extractapp/ExportTable.php --- a/views/Extractapp/ExportTable.php Fri Jun 12 14:41:30 2015 +0200 +++ b/views/Extractapp/ExportTable.php Mon Sep 14 14:37:29 2015 +0200 @@ -27,6 +27,7 @@ $sectionid = $viewmodel['section_id']; $bookName = $viewmodel['bookName']; $sectionName = $viewmodel['sectionName']; +$bookMeta = $viewmodel['bookMeta']; ?> @@ -49,12 +50,18 @@ echo "Section ID"; echo "方志"; echo "部"; + echo "方志地點"; + echo "經度(x)"; // longitude + echo "緯度(y)"; // latitude } else { echo "".$count++.""; echo "".$bookId.""; echo "".$sectionid.""; echo "".$bookName.""; echo "".$sectionName.""; + echo "".$bookMeta->place_name.""; + echo "".$bookMeta->x.""; + echo "".$bookMeta->y.""; } if ( isset( $trValue["page"] ) ) { echo "".$trValue["page"].""; diff -r 94ad33739fa4 -r 3e11a9c5a672 views/Extractapp/TaggingText.php --- a/views/Extractapp/TaggingText.php Fri Jun 12 14:41:30 2015 +0200 +++ b/views/Extractapp/TaggingText.php Mon Sep 14 14:37:29 2015 +0200 @@ -199,7 +199,6 @@ */ $(document).ready(function(){ - // --- for sidebar--- //run once var el=$('#follow-scroll'); @@ -436,6 +435,7 @@ form.appendChild(hiddenField2); var info = JSON.parse( ''); + var book_meta = JSON.parse( ''); if (info) { var hiddenField = document.createElement("input"); @@ -923,7 +923,9 @@
+ @@ -1019,12 +1021,12 @@ -
+
-
+