17 include_once (
"FDL/Class.Doc.php");
23 $usage->setDefinitionText(
"view document in HTML page");
24 $docid =
$usage->addRequiredParameter(
"id",
"document identifier");
25 $mime =
$usage->addOptionalParameter(
"mime",
"other mime type header to send");
26 $ext =
$usage->addOptionalParameter(
"ext",
"file extension if inline is no", null,
"html");
27 $inline =
$usage->addOptionalParameter(
"inline",
"inline (yes|no) - if set to 'no', mime must be set also");
28 $inline = (strtolower(substr($inline, 0, 1)) ==
"y");
29 $zonebodycard =
$usage->addOptionalParameter(
"zone",
"special document view zone");
30 $vid =
$usage->addOptionalParameter(
"vid",
"special controlled view");
31 $state =
$usage->addOptionalParameter(
"state",
"search doc in this state");
32 $latest =
$usage->addOptionalParameter(
"latest",
"get document in latest version if Y", array(
38 $view =
$usage->addOptionalParameter(
"view",
"add view css print", array(
42 $usage->setStrictMode(
false);
47 $action->lay->rSet(
"viewprint", ($view ==
"print"));
51 $action->parent->addCssRef(
"css/dcp/main.css");
55 $action->
exitError(sprintf(_(
"Document %s in %s state not found") ,
$doc->title, _($state)));
63 }
else if ((
$latest ==
"L") && (
$doc->lmodify !=
'L')) {
67 }
else if ((
$latest ==
"P") && (
$doc->revision > 0)) {
74 $action->lay->eset(
"TITLE",
$doc->getTitle());
75 if (($zonebodycard ==
"") && ($vid !=
"")) {
80 $tview = $cvdoc->getView($vid);
81 $zonebodycard = $tview[
"CV_ZVIEW"];
83 if ($zonebodycard ==
"") $zonebodycard =
$doc->defaultview;
84 if ($zonebodycard ==
"") $zonebodycard =
"FDL:VIEWCARD";
86 $zo =
$doc->getZoneOption($zonebodycard);
91 $file =
$doc->viewdoc($zonebodycard, $target, $ulink);
97 if ($zo ==
'S') $szone =
true;
98 $action->lay->rSet(
"nocss", ($zo ==
"U"));
101 include_once (
"FDL/viewscard.php");
107 $export_file = uniqid(
getTmpDir() .
"/export") .
".$ext";
109 $of = fopen($export_file,
"w+");
110 fwrite($of, $action->lay->gen());
112 http_DownloadFile($export_file, chop(
$doc->title) .
".$ext",
"$mime", $inline,
false);
114 unlink($export_file);
Layout is a template generator.
exitError($texterr, $exit=true, $code="")
getLayoutFile($app, $layfile)
Verify arguments for action function.
new_Doc($dbaccess, $id= '', $latest=false)
Http_DownloadFile($filename, $name, $mime_type= '', $inline=false, $cache=true, $deleteafter=false)
getRevTDoc($dbaccess, $initid, $rev)