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
family_help.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
* Return Help Files
9
*
10
* @author Anakeen 2000
11
* @version $Id: family_help.php,v 1.4 2007/09/04 09:09:10 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
*/
15
/**
16
*/
17
18
include_once (
"Lib.Http.php"
);
19
include_once (
"FDL/Class.Doc.php"
);
20
21
function
family_help
(&
$action
)
22
{
23
24
$docid
=
GetHttpVars
(
"id"
);
25
26
$pdffile =
getFamilyHelpFile
(
$action
,
$docid
);
27
if
($pdffile) {
28
$name
= basename($pdffile);
29
Http_DownloadFile
($pdffile,
"$name"
,
"application/pdf"
);
30
}
else
{
31
$errtext = sprintf(_(
"file for %s not found."
) ,
$name
);
32
$action
->ExitError($errtext);
33
}
34
}
35
36
function
getFamilyHelpFile
(&
$action
,
$docid
)
37
{
38
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
39
if
(!is_numeric(
$docid
))
$docid
=
getFamIdFromName
(
$dbaccess
,
$docid
);
40
41
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
42
if
(
$doc
->isAlive()) {
43
$name
=
$doc
->name;
44
if
(
$name
!=
""
) {
45
$pdffile =
$action
->GetParam(
"CORE_PUBDIR"
) .
"/Docs/$name.pdf"
;
46
if
(file_exists($pdffile)) {
47
return
$pdffile;
48
}
49
}
50
}
51
return
false
;
52
}
53
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase