17 include_once (
"FDL/Class.Dir.php");
38 $docid = GetHttpVars(
"id");
39 $latest = GetHttpVars(
"latest");
40 $zone = GetHttpVars(
"zone");
41 $ulink = (GetHttpVars(
"ulink",
'2'));
42 $target = GetHttpVars(
"target");
43 $vid = GetHttpVars(
"vid");
44 $state = GetHttpVars(
"state");
50 if (
$docid ==
"")
$action->exitError(_(
"no document reference"));
52 if (intval(
$docid) == 0)
$action->exitError(sprintf(_(
"unknow logical reference '%s'") , htmlspecialchars(GetHttpVars(
"id") , ENT_QUOTES)));
54 if (!
$doc->isAffected()) {
57 $action->exitError(sprintf(_(
"Document %s has been destroyed.") , htmlspecialchars(
$docid, ENT_QUOTES)) . sprintf(
" <a href='?app=FDL&action=VIEWDESTROYDOC&id=%s'>%s</a>", urlencode(
$docid) , htmlspecialchars(_(
"See latest information about it.") , ENT_QUOTES)) ,
true);
59 $action->exitError(htmlspecialchars(sprintf(_(
"cannot see unknow reference %s") ,
$docid)) , ENT_QUOTES);
72 $action->exitError(sprintf(_(
"Document %s in %s state not found") , htmlspecialchars(
$doc->title, ENT_QUOTES) , htmlspecialchars(_($state) , ENT_QUOTES)));
79 if (
$docid ==
"")
$action->exitError(_(
"no alive document reference"));
81 }
else if ((
$latest ==
"L") && (
$doc->lmodify !=
'L')) {
85 }
else if ((
$latest ==
"P") && (
$doc->revision > 0)) {
97 $action->parent->addCssRef(
"css/dcp/main.css");
98 $action->parent->addCssRef(
"css/dcp/document-view.css");
99 $mgeo =
$action->getParam(
"MVIEW_GEO");
100 $action->lay->set(
"mviewgeo", $mgeo);
102 $action->lay->set(
"RSS", (
$doc->getRawValue(
"gui_isrss") ===
"yes"));
103 if (
$action->lay->get(
"RSS")) {
109 if (
$action->read(
"navigator") ==
"EXPLORER")
$action->lay->Set(
"shorticon",
getParam(
"DYNACASE_FAVICO"));
110 else $action->lay->Set(
"shorticon",
$doc->getIcon());
111 $action->lay->Set(
"docicon",
$doc->getIcon(
'', 16));
112 $action->lay->Set(
"pds",
$doc->urlWhatEncodeSpec(
""));
115 if (($zone ==
"") && ($vid !=
"")) {
120 if ($cvdoc->fromid == 28) {
123 $err = $cvdoc->control(trim($vid));
124 if (
$err !=
"")
$action->exitError(
"CV:" . htmlspecialchars($cvdoc->title, ENT_QUOTES) .
"\n" .
$err);
125 $tview = $cvdoc->getView($vid);
126 $zone = $tview[
"CV_ZVIEW"];
129 if ($zone ==
"") $zone =
$doc->defaultview;
130 $zo =
$doc->getZoneOption($zone);
132 $action->lay->template =
$doc->viewdoc($zone, $target, $ulink);
134 $engine =
$doc->getZoneTransform($zone);
137 redirect(
$action,
"FDL",
"GETFILETRANSFORMATION&idv=$vid&zone=$zone$sgets&id=" .
$doc->id,
$action->GetParam(
"CORE_STANDURL"));
142 if (!empty($tview[
"CV_MSKID"])) {
143 $err =
$doc->setMask($tview[
"CV_MSKID"]);
146 $file =
$doc->viewdoc($zone, $target, $ulink);
147 if ((!file_exists(
$file))) {
160 $action->lay->set(
"nocss", ($zo ==
"U"));
162 if (
$doc->doctype !=
'C' &&
$doc->doctype !=
'Z') {
163 $listattr =
$doc->GetActionAttributes();
164 $mwidth =
$action->getParam(
"FDL_HD2SIZE", 300);
165 $mheight =
$action->getParam(
"FDL_VD2SIZE", 400);
166 foreach ($listattr as $k => $v) {
167 if (($v->mvisibility !=
"H") && ($v->mvisibility !=
"O")) {
168 if ($v->getOption(
"onlymenu") !=
"yes") {
170 if ($v->precond !=
"") $mvis =
$doc->ApplyMethod($v->precond,
MENU_ACTIVE);
172 $taction[$k] = array(
173 "wadesc" => $v->getOption(
"llabel") ,
174 "walabel" => ucfirst($v->getLabel()) ,
175 "wwidth" => $v->getOption(
"mwidth", $mwidth) ,
176 "wheight" => $v->getOption(
"mheight", $mheight) ,
177 "wtarget" => ($v->getOption(
"ltarget") ==
"") ? (($v->getOption(
"mtarget") ==
"") ? $v->id .
"_" .
$doc->id : $v->getOption(
"mtarget")) : $v->getOption(
"ltarget") ,
178 "wlink" =>
$doc->urlWhatEncode($v->getLink(
$doc->getLatestId()))
185 $action->lay->setBlockData(
"WACTION", $taction);
186 $action->lay->set(
"VALTERN", (
$action->GetParam(
"FDL_VIEWALTERN",
"yes") ==
"yes"));
203 foreach ($_GET as $k => $v) {
204 if (!in_array($k, $exclude))
$s.=
"&$k=$v";
fixMultipleAliveDocument(Doc &$doc)
getSysMimeFile($f, $fn="")
getFileExtension($filename)
getParam($name, $def="")
must be in core or global type
getHttpVars($name, $def="", $scope="all")
new_Doc($dbaccess, $id= '', $latest=false)
Http_DownloadFile($filename, $name, $mime_type= '', $inline=false, $cache=true, $deleteafter=false)
getRevTDoc($dbaccess, $initid, $rev)
getIdFromName($dbaccess, $name)
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
if($file) if($subject==""&&$file) if($subject=="") $err