17 include_once (
"FDL/Class.Dir.php");
40 if (!
$doc->isAffected()) $action->
exitError(sprintf(_(
"cannot see unknow reference %s") ,
$docid));
47 $action->parent->AddJsRef($action->GetParam(
"CORE_PUBURL") .
"/FDL/Layout/getfiletransformation.js");
48 $action->parent->AddJsRef($action->GetParam(
"CORE_JSURL") .
"/resizeimg.js");
53 $action->lay->
Set(
"TITLE",
$doc->getHtmltitle());
54 $action->lay->
Set(
"id",
$doc->id);
55 $action->lay->
Set(
"icon",
$doc->getIcon());
57 if ($zone ==
"") $zone =
$doc->defaultview;
58 $zo =
$doc->getZoneOption($zone);
60 $engine =
$doc->getZoneTransform($zone);
62 $tplfile =
$doc->getZoneFile($zone);
63 if (($idv !=
"") && (
$doc->cvid)) {
69 $err = $cvdoc->control(trim($idv));
71 $tview = $cvdoc->getView($idv);
72 if ($tview[
"CV_MSKID"])
$doc->setMask($tview[
"CV_MSKID"]);
74 if (preg_match(
'/\.odt/', $tplfile)) {
76 $file =
$doc->viewdoc($zone, $target, $ulink =
false);
79 if ($zo ==
"S") $view =
$doc->viewdoc($zone,
"te");
81 file_put_contents(
$file, preg_replace(
"/<script([^>]*)>.*?<\/script>/is",
"", $view));
87 $action->lay->set(
"error", (
$err !=
""));
89 $action->lay->set(
"tid",
$info[
"tid"]);
90 $action->lay->set(
"status",
$info[
"status"]);
91 $action->lay->eset(
"message",
$info[
"comment"]);
92 $action->lay->set(
"processtext", sprintf(_(
"processing <b>%s</b> transformation") , $engine));
95 $action->lay->set(
"tid",
"");
96 $action->lay->set(
"status",
"K");
97 $action->lay->eset(
"message",
$err);
98 $action->lay->eset(
"processtext", sprintf(_(
"cannot lauch <b>%s</b> transformation") , $engine));
107 $layout =
"singledoc.xml";
110 $docmail->Set(
"TITLE", $doc->title);
111 $docmail->Set(
"iconsrc", $doc->
getIcon());
112 $docmail->Set(
"ID", $doc->id);
113 $docmail->Set(
"zone", $zone);
114 $docmail->Set(
"baseurl", dirname($action->getParam(
"TE_URLINDEX")) .
"/");
116 return $docmail->gen();
123 if ($tea !=
"yes" || !\Dcp\Autoloader::classExists(
'Dcp\TransformationEngine\Client'))
return '';
125 include_once (
"FDL/insertfile.php");
143 if (file_exists(
$filename) && ($engine !=
"")) {
146 if ($tea !=
"yes")
return _(
"TE engine is not activate");
147 if (\Dcp\Autoloader::classExists(
'Dcp\TransformationEngine\Client')) {
149 include_once (
"FDL/Class.TaskRequest.php");
152 $ot = new \Dcp\TransformationEngine\Client(
getParam(
"TE_HOST") ,
getParam(
"TE_PORT"));
157 $tr->tid =
$info[
"tid"];
159 $tr->status =
$info[
"status"];
160 $tr->comment =
$info[
"comment"];
161 $tr->uid = $action->user->id;
162 $tr->uname = $action->user->firstname .
" " . $action->user->lastname;
166 AddWarningMsg(_(
"TE engine activate but TE-CLIENT not found"));
169 $err =
"no file filename ($filename) or engine ($engine)";
Layout is a template generator.
getIcon($idicon="", $size=null, $otherId=null)
getSysMimeFile($f, $fn="")
exitError($texterr, $exit=true, $code="")
getLayoutFile($app, $layfile)
getParam($name, $def="")
must be in core or global type
new_Doc($dbaccess, $id= '', $latest=false)
Http_DownloadFile($filename, $name, $mime_type= '', $inline=false, $cache=true, $deleteafter=false)
static getArgument($k, $def= '')
getIdFromName($dbaccess, $name)
getTEFile($tid, $filename, &$info)
if($file) if($subject==""&&$file) if($subject=="") $err