Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
getdocvalues.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* Get Values in XML form
9
*
10
* @author Anakeen 2006
11
* @version $Id: getdocvalues.php,v 1.4 2008/11/05 10:10:41 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage FDC
15
*/
16
/**
17
*/
18
19
include_once (
"FDL/Class.Doc.php"
);
20
/**
21
* Get doc attributes values
22
* @param Action &$action current action
23
* @global id Http var : document id to view
24
*/
25
function
getdocvalues
(&
$action
)
26
{
27
header(
'Content-type: text/xml; charset=utf-8'
);
28
29
$mb = microtime();
30
$docid
=
GetHttpVars
(
"id"
);
31
$attrid = strtolower(
GetHttpVars
(
"attrid"
));
32
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
33
34
$action
->lay->set(
"warning"
,
""
);
35
36
$doc
= new_doc(
$dbaccess
,
$docid
);
37
$tvalues = array();
38
39
if
(!
$doc
->isAlive())
$err
= sprintf(_(
"document [%s] not found"
) ,
$docid
);
40
if
(
$err
==
""
) {
41
$err
=
$doc
->control(
"view"
);
42
if
(
$err
==
""
) {
43
if
($attrid) $values[$attrid] =
$doc
->getValue($attrid);
44
else
$values =
$doc
->getValues();
45
foreach
($values as $aid => $v) {
46
$a
=
$doc
->getAttribute($aid);
47
if
(
$a
->visibility !=
"I"
) {
48
$tvalues[] = array(
49
"attrid"
=> $aid,
50
"value"
=>
xml_entity_encode
($v)
51
);
52
}
53
}
54
}
55
}
56
if
(
$err
)
$action
->lay->set(
"warning"
,
$err
);
57
58
$action
->lay->setBlockData(
"VALUES"
, $tvalues);
59
$action
->lay->set(
"CODE"
,
"OK"
);
60
$action
->lay->set(
"count"
, 1);
61
$action
->lay->set(
"delay"
,
microtime_diff
(microtime() , $mb));
62
}
63
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase