Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
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
* @package FDL
5
*/
6
/**
7
* Get Values in XML form
8
*
9
* @author Anakeen
10
* @version $Id: getdocsvalue.php,v 1.1 2008/11/14 16:37:05 eric Exp $
11
* @package FDL
12
* @subpackage FDC
13
*/
14
/**
15
*/
16
17
include_once (
"FDL/Class.Doc.php"
);
18
include_once (
"FDL/Lib.Dir.php"
);
19
/**
20
* Return a single same value from a set of doc
21
* @param Action &$action current action
22
* @global ids string Http var : set of document id ( | separated)
23
*/
24
function
getdocsvalue
(&
$action
)
25
{
26
header(
'Content-type: text/xml; charset=utf-8'
);
27
28
$err
=
''
;
29
$mb = microtime();
30
$docids = GetHttpVars(
"ids"
);
31
$attrid = trim(strtolower(GetHttpVars(
"attrid"
)));
32
$dbaccess
=
$action
->dbaccess;
33
34
$action
->lay->set(
"warning"
,
""
);
35
36
$tdocids = explode(
'|'
, $docids);
37
38
$tvalues = array();
39
foreach
($tdocids as $k => $v) {
40
if
(!is_numeric($v)) {
41
unset($tdocids[$k]);
42
}
43
$tvalues[$v] = array(
44
"attrid"
=> $attrid,
45
"docid"
=> $v[
"id"
],
46
"value"
=>
''
47
);
48
}
49
50
$tdoc
=
getDocsFromIds
(
$dbaccess
, $tdocids);
51
52
foreach
(
$tdoc
as $k => $v) {
53
$value
=
getv
($v, $attrid);
54
$tvalues[$v[
"id"
]] = array(
55
"attrid"
=> $attrid,
56
"docid"
=> $v[
"id"
],
57
"value"
=>
xml_entity_encode
(
$value
)
58
);
59
}
60
61
if
(
$err
)
$action
->lay->set(
"warning"
,
$err
);
62
63
$action
->lay->setBlockData(
"VALUES"
, $tvalues);
64
$action
->lay->set(
"CODE"
,
"OK"
);
65
$action
->lay->set(
"count"
, count($tvalues));
66
$action
->lay->set(
"delay"
,
microtime_diff
(microtime() , $mb));
67
}
$tdoc
$tdoc
Definition:
refreshGroups.php:38
$action
global $action
Definition:
accountRefreshGroup.php:16
getDocsFromIds
getDocsFromIds($dbaccess, $ids, $userid=0)
Definition:
Lib.Dir.php:1034
getv
getv(&$t, $k, $d="")
Definition:
freedom_util.php:447
microtime_diff
microtime_diff($a, $b)
Definition:
Lib.Common.php:302
getdocsvalue
getdocsvalue(&$action)
Definition:
getdocsvalue.php:24
$dbaccess
$dbaccess
Definition:
checkVault.php:17
xml_entity_encode
xml_entity_encode($s)
Definition:
Lib.Util.php:596
$err
if($file) if($subject==""&&$file) if($subject=="") $err
Definition:
fdl_sendmail.php:78
$value
$value
Definition:
change_action.php:32
← centre documentaire
© anakeen