Add document metainformation.

This commit is contained in:
Michal Čihař
2006-04-28 09:07:46 +00:00
parent 2f8975d2f5
commit 77d003c05d
2 changed files with 15 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ $Source$
* libraries/export/ods.php: Use correct charset.
* libraries/export/odt.php, lang/*, libraries/config.default.php: Add Open
Document Text export (RFE #1068007).
* libraries/opendocument.lib.php: Add document metainformation.
2006-04-27 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* db_printview.php: fixed bug 'no tables found', refactored

View File

@@ -22,10 +22,23 @@ function PMA_createOpenDocument($mime, $data) {
$zipfile = new zipfile();
$zipfile -> addFile($mime, 'mimetype');
$zipfile -> addFile($data, 'content.xml');
$zipfile -> addFile('<?xml version="1.0" encoding="UTF-8"?>'
$zipfile -> addFile('<?xml version="1.0" encoding="UTF-8"?'. '>'
. '<office:document-meta '
. 'xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" '
. 'xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" '
. 'office:version="1.0">'
. '<office:meta>'
. '<meta:generator>phpMyAdmin ' . PMA_VERSION . '</meta:generator>'
. '<meta:initial-creator>phpMyAdmin ' . PMA_VERSION . '</meta:initial-creator>'
. '<meta:creation-date>' . strftime('%Y-%m-%dT%H:%M:%S') . '</meta:creation-date>'
. '</office:meta>'
. '</office:document-meta>'
, 'meta.xml');
$zipfile -> addFile('<?xml version="1.0" encoding="UTF-8"?' . '>'
. '<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">'
. '<manifest:file-entry manifest:media-type="' . $mime . '" manifest:full-path="/"/>'
. '<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="content.xml"/>'
. '<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="meta.xml"/>'
. '</manifest:manifest>'
, 'META-INF/manifest.xml');
return $zipfile -> file();