Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
viewxml.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Generated Header (not documented yet)
8  *
9  * @author Anakeen
10  * @version $Id: viewxml.php,v 1.4 2005/06/28 08:37:46 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 // ---------------------------------------------------------------
17 // $Id: viewxml.php,v 1.4 2005/06/28 08:37:46 eric Exp $
18 // $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Fdl/viewxml.php,v $
19 // ---------------------------------------------------------------
20 include_once ("FDL/Class.Doc.php");
21 // -----------------------------------
22 function viewxml(Action & $action)
23 {
24  // -----------------------------------
25  // Get all the params
26  $docid = GetHttpVars("id"); // dccument to export
27  $dbaccess = $action->dbaccess;
28 
30  if (!$doc->isAlive()) {
31  $action->exitError(sprintf(_("unknown document id %s") , $docid));
32  }
33  if (($err = $doc->control("view")) !== "") {
34  $action->exitError($err);
35  }
36  $xml = $doc->toxml(true, $docid);
37  //$doc->fromxml($xml);
38  //$xml=$doc->viewdtd();
39  $export_file = uniqid(getTmpDir() . "/xml");
40  $export_file.= ".xml";
41  $fp = fopen($export_file, "w");
42 
43  fwrite($fp, $xml);
44  fclose($fp);
45  //http_DownloadFile($export_file,chop($doc->title).".xml","text/dtd");
46  http_DownloadFile($export_file, str_replace(" ", "_", chop($doc->title)) . ".xml", "text/xml");
47 
48  unlink($export_file);
49  exit;
50 }
global $action
viewxml(Action &$action)
Definition: viewxml.php:22
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
getTmpDir($def= '/tmp')
Definition: Lib.Common.php:150
switch($command) exit
Definition: checkVault.php:46
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen