Add document metainformation.
This commit is contained in:
@@ -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
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user