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
getdocsvalue.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: getdocsvalue.php,v 1.1 2008/11/14 16:37:05 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
include_once (
"FDL/Lib.Dir.php"
);
21
/**
22
* Return a single same value from a set of doc
23
* @param Action &$action current action
24
* @global ids Http var : set of document id ( | separated)
25
*/
26
function
getdocsvalue
(&
$action
)
27
{
28
header(
'Content-type: text/xml; charset=utf-8'
);
29
30
$mb = microtime();
31
$docids =
GetHttpVars
(
"ids"
);
32
$attrid = trim(strtolower(
GetHttpVars
(
"attrid"
)));
33
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
34
35
$action
->lay->set(
"warning"
,
""
);
36
37
$tdocids = explode(
'|'
, $docids);
38
39
$tvalues = array();
40
foreach
($tdocids as $k => $v) {
41
if
(!is_numeric($v)) {
42
unset($tdocids[$k]);
43
}
44
$tvalues[$v] = array(
45
"attrid"
=> $attrid,
46
"docid"
=> $v[
"id"
],
47
"value"
=>
xml_entity_encode
(
$value
)
48
);
49
}
50
51
$tdoc
=
getDocsFromIds
(
$dbaccess
, $tdocids);
52
53
foreach
(
$tdoc
as $k => $v) {
54
$value
=
getv
($v, $attrid);
55
$tvalues[$v[
"id"
]] = array(
56
"attrid"
=> $attrid,
57
"docid"
=> $v[
"id"
],
58
"value"
=>
xml_entity_encode
(
$value
)
59
);
60
}
61
62
if
(
$err
)
$action
->lay->set(
"warning"
,
$err
);
63
64
$action
->lay->setBlockData(
"VALUES"
, $tvalues);
65
$action
->lay->set(
"CODE"
,
"OK"
);
66
$action
->lay->set(
"count"
, count($tvalues));
67
$action
->lay->set(
"delay"
,
microtime_diff
(microtime() , $mb));
68
}
69
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase