19 include_once (
"FDL/Class.Dir.php");
38 if (
$docid ==
"")
$action->exitError(_(
"no document reference"));
42 if (!
$doc->isAffected())
$action->exitError(sprintf(_(
"cannot see unknow reference %s") ,
$docid));
49 $action->parent->AddJsRef(
$action->GetParam(
"CORE_PUBURL") .
"/FDL/Layout/getfiletransformation.js");
50 $action->parent->AddJsRef(
$action->GetParam(
"CORE_JSURL") .
"/resizeimg.js");
59 if ($zone ==
"") $zone =
$doc->defaultview;
60 $zo =
$doc->getZoneOption($zone);
62 $engine =
$doc->getZoneTransform($zone);
64 $tplfile =
$doc->getZoneFile($zone);
65 if (($idv !=
"") && (
$doc->cvid)) {
67 $err = $cvdoc->control(trim($idv));
68 if (
$err !=
"")
$action->exitError(
"CV:" . $cvdoc->title .
"\n" .
$err);
69 $tview = $cvdoc->getView($idv);
70 if ($tview[
"CV_MSKID"])
$doc->setMask($tview[
"CV_MSKID"]);
72 if (preg_match(
'/\.odt/', $tplfile)) {
77 if ($zo ==
"S") $view =
$doc->viewdoc($zone,
"te");
79 file_put_contents(
$file, preg_replace(
"/<script([^>]*)>.*?<\/script>/is",
"", $view));
87 $action->lay->set(
"tid", $info[
"tid"]);
88 $action->lay->set(
"status", $info[
"status"]);
89 $action->lay->set(
"message", $info[
"comment"]);
90 $action->lay->set(
"processtext", sprintf(_(
"processing <b>%s</b> transformation") , $engine));
94 $action->lay->set(
"status",
"K");
96 $action->lay->set(
"processtext", sprintf(_(
"cannot lauch <b>%s</b> transformation") , $engine));
105 $layout =
"singledoc.xml";
108 $docmail->Set(
"TITLE",
$doc->title);
109 $docmail->Set(
"iconsrc",
$doc->getIcon());
110 $docmail->Set(
"ID",
$doc->id);
111 $docmail->Set(
"zone", $zone);
112 $docmail->Set(
"baseurl", dirname($action->getParam(
"TE_URLINDEX")) .
"/");
114 return $docmail->gen();
120 if ($tea !=
"yes")
return;
121 if (@include_once (
"WHAT/Class.TEClient.php")) {
123 include_once (
"FDL/insertfile.php");
129 if ($ext ==
"") $ext = $infoout->teng_lname;
135 AddWarningMsg(_(
"TE engine activate but TE-CLIENT not found"));
143 if (file_exists(
$filename) && ($engine !=
"")) {
146 if ($tea !=
"yes")
return _(
"TE engine is not activate");
147 if (include_once (
"WHAT/Class.TEClient.php")) {
149 include_once (
"FDL/Class.TaskRequest.php");
153 $err = $ot->sendTransformation($engine, $vid,
$filename, $callback, $info);
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)";