Core  3.2
PHP API documentation
 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  * @package FDL
5 */
6 /**
7  * Return Help Files
8  *
9  * @author Anakeen
10  * @version $Id: family_help.php,v 1.4 2007/09/04 09:09:10 eric Exp $
11  * @package FDL
12  */
13 /**
14  */
15 
16 include_once ("Lib.Http.php");
17 include_once ("FDL/Class.Doc.php");
18 
20 {
21 
22  $docid = GetHttpVars("id");
23 
24  $pdffile = getFamilyHelpFile($action, $docid);
25  if ($pdffile) {
26  $name = basename($pdffile);
27  Http_DownloadFile($pdffile, "$name", "application/pdf");
28  } else {
29  $errtext = sprintf(_("file for %s not found.") , $docid);
30  $action->ExitError($errtext);
31  }
32 }
33 
35 {
36  $dbaccess = $action->dbaccess;
37  if (!is_numeric($docid)) $docid = getFamIdFromName($dbaccess, $docid);
38 
40  if ($doc->isAlive()) {
41  $name = $doc->name;
42  if ($name != "") {
43  $pdffile = DEFAULT_PUBDIR . "/Docs/$name.pdf";
44  if (file_exists($pdffile)) {
45  return $pdffile;
46  }
47  }
48  }
49  return false;
50 }
global $action
const DEFAULT_PUBDIR
Definition: Lib.Prefix.php:28
$docid
Definition: cleanFamily.php:13
family_help(Action &$action)
Definition: family_help.php:19
getFamilyHelpFile(Action &$action, $docid)
Definition: family_help.php:34
getFamIdFromName($dbaccess, $name)
new_Doc($dbaccess, $id= '', $latest=false)
Http_DownloadFile($filename, $name, $mime_type= '', $inline=false, $cache=true, $deleteafter=false)
Definition: Lib.Http.php:225
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen