annotate views/Extractapp/ExportTabDelimited.php @ 101:a264460c77ca extractapp

new: auto save and reload page after updating taglist.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 04 May 2016 15:22:11 +0200
parents b0cecc104639
children 0ef426b5a1b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
2 /*
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 * ExportTabDelimited.php
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
4 * This file is part of Extraction-interface.
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 *
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 * Extraction-interface is free software: you can redistribute it and/or modify
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
8 * the Free Software Foundation, either version 3 of the License, or
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
9 * (at your option) any later version.
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
10 *
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
11 * Extraction-interface is distributed in the hope that it will be useful,
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
14 * GNU General Public License for more details.
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
15 *
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
17 * along with Extraction-interface. If not, see <http://www.gnu.org/licenses/>.
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 */
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
19 /*! \file
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
20 * This is the view for ExportTabDelimited.
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 */
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
22
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 // --- initialize ---
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 $outputTableArray = $viewmodel['outputTableArray'];
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 $bookId = $viewmodel['bookId'];
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
26 $sectionid = $viewmodel['section_id'];
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 $bookName = $viewmodel['bookName'];
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
28 $sectionName = $viewmodel['sectionName'];
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 $bookMeta = $viewmodel['bookMeta'];
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
30
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
31
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
32
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
33 $count=1;
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
34 foreach ( $outputTableArray as $trIndex =>$trValue ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
35
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
36 if ( $trIndex==0 ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
37 echo "#\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
38 echo "Book ID\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
39 echo "Section ID\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
40 echo "Name\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
41 echo "部\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
42 echo "Address\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
43 echo "Longitude\t"; // longitude
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
44 echo "Latitude\t"; // latitude
94
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 92
diff changeset
45 echo "Description\t"; // description
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 92
diff changeset
46
92
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
47 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
48 echo $count++."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
49 echo $bookId."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
50 echo $sectionid."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
51 echo $bookName."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
52 echo $sectionName."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
53 echo $bookMeta->place_name."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
54 echo $bookMeta->x."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
55 echo $bookMeta->y."\t";
94
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 92
diff changeset
56 echo $bookName."_".$sectionName."\t"; // description for LGMap
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 92
diff changeset
57
92
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
58 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
59 if ( isset( $trValue["page"] ) ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
60 echo $trValue["page"]."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
61 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
62 echo "\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
63 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
64
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
65 foreach ( $outputTableArray[0][0] as $index => $value ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
66 if ( $index == "time" ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
67 if ( isset( $trValue[0][$index] ) ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
68 echo $trValue[0][$index]."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
69 echo $trValue[0][$index]."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
70 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
71 echo "\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
72 echo "\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
73 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
74 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
75 if ( isset( $trValue[0][$index] ) ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
76 echo $trValue[0][$index]."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
77 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
78 echo "\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
79 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
80 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
81 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
82 if ( isset( $trValue["other"] ) ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
83 echo $trValue["other"]."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
84 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
85 echo "\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
86 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
87 if ( isset( $trValue["full"] ) ) {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
88 echo $trValue["full"]."\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
89 } else {
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
90 echo "\t";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
91 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
92 echo "\n";
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
93 }
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
94
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
95 ?>
f5b0cd4f25b2 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
96