Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
verifycomputedfiles.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  *
8  * @author Anakeen
9  * @version $Id: verifycomputedfiles.php,v 1.5 2008/04/14 10:12:14 eric Exp $
10  * @package FDL
11  * @subpackage
12  */
13 
14 include_once "FDL/Class.Doc.php";
15 /**
16  * Verify if a file has been computed
17  * @param Action &$action current action
18  */
20 {
21  $usage = new ActionUsage($action);
22 
23  $docid = $usage->addRequiredParameter("id", "docid");
24 
25  $dbaccess = $action->dbaccess;
26 
27  header('Content-type: text/xml; charset=utf-8');
28 
29  $mb = microtime();
30 
31  $action->lay->set("CODE", "OK");
32  $action->lay->set("warning", "");
33 
35  $err = "";
36  if (!$doc->isAffected()) {
37  $err = sprintf(_("cannot see unknow reference %s") , $docid);
38  }
39  $files = array();
40  if ($err == "") {
41  $action->lay->set("docid", $doc->id);
42  $files = $doc->GetFilesProperties();
43  }
44 
45  if ($err != "") {
46  $action->lay->set("CODE", "KO");
47  }
48  $action->lay->set("warning", $err);
49  $action->lay->set("delay", microtime_diff(microtime() , $mb));
50 
51  foreach ($files as $k => $v) {
52  if (($v["teng_state"] == \Dcp\TransformationEngine\Client::status_done) || ($v["teng_state"] < 0)) {
53  $files[$k]["icon"] = sprintf("resizeimg.php?img=Images/%s&amp;size=20", htmlspecialchars(getIconMimeFile($v["mime_s"]) , ENT_QUOTES));
54  } else {
55  $files[$k]["icon"] = "";
56  }
57  $files[$k]["name"] = str_replace('&', '&amp;', $files[$k]["name"]);
58  }
59 
60  $action->lay->setBlockData("FILES", $files);
61  $action->lay->set("count", count($files));
62  $action->lay->set("docid", $doc->id);
63 }
global $action
getIconMimeFile($sysmime)
$docid
Definition: cleanFamily.php:13
microtime_diff($a, $b)
Definition: Lib.Common.php:302
Verify arguments for action function.
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
verifycomputedfiles(Action &$action)
$usage
← centre documentaire © anakeen