view views/Extractapp/ExportTabDelimited.php @ 94:b0cecc104639 extractapp

new: modified tags can work on tagged text
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 09 Nov 2015 12:00:24 +0100
parents f5b0cd4f25b2
children 0ef426b5a1b9
line wrap: on
line source

<?php
/*
 * ExportTabDelimited.php
 * This file is part of Extraction-interface.
 *
 * Extraction-interface is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Extraction-interface is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Extraction-interface.  If not, see <http://www.gnu.org/licenses/>.
*/
/*! \file 
 * This is the view for ExportTabDelimited.
*/

// --- initialize ---
$outputTableArray = $viewmodel['outputTableArray'];
$bookId = $viewmodel['bookId'];
$sectionid = $viewmodel['section_id'];
$bookName = $viewmodel['bookName'];
$sectionName = $viewmodel['sectionName'];
$bookMeta = $viewmodel['bookMeta'];



$count=1;
	foreach ( $outputTableArray as $trIndex =>$trValue ) {
		
		if ( $trIndex==0 ) {
			echo "#\t";
			echo "Book ID\t";
			echo "Section ID\t";
			echo "Name\t";
			echo "部\t";
			echo "Address\t";
			echo "Longitude\t";	// longitude
			echo "Latitude\t";	// latitude
			echo "Description\t";	// description

		} else {
			echo $count++."\t";
			echo $bookId."\t";
			echo $sectionid."\t";
			echo $bookName."\t";
			echo $sectionName."\t";
			echo $bookMeta->place_name."\t";
			echo $bookMeta->x."\t";
			echo $bookMeta->y."\t";
			echo $bookName."_".$sectionName."\t";	// description for LGMap
			
		}
		if ( isset( $trValue["page"] ) ) {
			echo $trValue["page"]."\t";
		} else {
			echo "\t";
		}
		
		foreach ( $outputTableArray[0][0] as $index => $value ) {
			if ( $index == "time" ) {
				if ( isset( $trValue[0][$index] ) ) {
					echo $trValue[0][$index]."\t";
					echo $trValue[0][$index]."\t";
				} else {
					echo "\t";
					echo "\t";
				}
			} else {
				if ( isset( $trValue[0][$index] ) ) {
					echo $trValue[0][$index]."\t";
				} else {
					echo "\t";
				}
			}
		}
		if ( isset( $trValue["other"] ) ) {
			echo $trValue["other"]."\t";
		} else {
			echo "\t";
		}
		if ( isset( $trValue["full"] ) ) {
			echo $trValue["full"]."\t";
		} else {
			echo "\t";
		}
		echo "\n";
	}

?>