예제 #1
0
<?php

include_once WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . "anthologize" . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-tei-dom.php';
$tei = new TeiDom($_POST);
$fileName = TeiDom::getFileName($_POST);
$ext = "xml";
header("Content-type: application/xml");
header("Content-Disposition: attachment; filename={$fileName}.{$ext}");
echo $tei->getTeiString();
die;
예제 #2
0
$epub_dir = $plugin_dir . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'epub';
// echo $plugin_dir . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-tei-dom.php'; die();
include_once $plugin_dir . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-tei-dom.php';
// Constants
$upload_dir_array = wp_upload_dir();
$temp_dir_name = $upload_dir_array['basedir'] . DIRECTORY_SEPARATOR . 'epub-tmp';
// Temporary area for building ZIP
$temp_epub_dir_name = $temp_dir_name . DIRECTORY_SEPARATOR . 'epub_under_construction';
// ePub dir structure temp area
$temp_epub_meta_inf_dir = $temp_epub_dir_name . DIRECTORY_SEPARATOR . 'META-INF';
$temp_epub_oebps_dir = $temp_epub_dir_name . DIRECTORY_SEPARATOR . 'OEBPS';
$temp_epub_images_dir = $temp_epub_oebps_dir . DIRECTORY_SEPARATOR;
// . 'images';
$temp_zip_filename = $temp_dir_name . DIRECTORY_SEPARATOR . 'book.epub';
// Temporary ZIP file
$zip_download_filename = TeiDom::getFileName($_POST) . '.epub';
// The name of the filename when it downloads
// Set internal & output text encoding to UTF-16
// iconv_set_encoding("internal_encoding", "UTF-16");
// iconv_set_encoding("output_encoding",   "UTF-16");
// Create temp directory if doesn't exist
if (!file_exists($temp_dir_name)) {
    mkdir($temp_dir_name, 0777, true);
}
// Create directories in temp directory
mkdir($temp_epub_meta_inf_dir, 0777, true);
mkdir($temp_epub_oebps_dir, 0777, true);
if (!file_exists($temp_epub_images_dir)) {
    mkdir($temp_epub_images_dir, 0777, true);
}
// Create & populate mimetype file