Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
getdocvalues.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Get Values in XML form
8  *
9  * @author Anakeen
10  * @version $Id: getdocvalues.php,v 1.4 2008/11/05 10:10:41 eric Exp $
11  * @package FDL
12  * @subpackage FDC
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 /**
19  * Get doc attributes values
20  * @param Action &$action current action
21  * @global id int Http var : document id to view
22  */
24 {
25  header('Content-type: text/xml; charset=utf-8');
26 
27  $err = '';
28  $mb = microtime();
29  $docid = GetHttpVars("id");
30  $attrid = strtolower(GetHttpVars("attrid"));
31  $dbaccess = $action->dbaccess;
32 
33  $action->lay->set("warning", "");
34 
35  $doc = new_doc($dbaccess, $docid);
36  $tvalues = array();
37 
38  if (!$doc->isAlive()) $err = sprintf(_("document [%s] not found") , $docid);
39  if ($err == "") {
40  $err = $doc->control("view");
41  if ($err == "") {
42  if ($attrid) $values[$attrid] = $doc->getRawValue($attrid);
43  else $values = $doc->getValues();
44  foreach ($values as $aid => $v) {
45  $a = $doc->getAttribute($aid);
46  if ($a->visibility != "I") {
47  $tvalues[] = array(
48  "attrid" => $aid,
49  "value" => xml_entity_encode($v)
50  );
51  }
52  }
53  }
54  }
55  if ($err) $action->lay->set("warning", $err);
56 
57  $action->lay->setBlockData("VALUES", $tvalues);
58  $action->lay->set("CODE", "OK");
59  $action->lay->set("count", 1);
60  $action->lay->set("delay", microtime_diff(microtime() , $mb));
61 }
global $action
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
Definition: checklist.php:45
getdocvalues(&$action)
$docid
Definition: cleanFamily.php:13
microtime_diff($a, $b)
Definition: Lib.Common.php:302
$dbaccess
Definition: checkVault.php:17
xml_entity_encode($s)
Definition: Lib.Util.php:596
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen