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
restoredoc.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
* UnTrash document
9
*
10
* @author Anakeen 2006
11
* @version $Id: restoredoc.php,v 1.1 2007/10/16 14:07:14 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
19
include_once (
"FDL/Lib.Dir.php"
);
20
/**
21
* Get a doc from the trash
22
* @param Action &$action current action
23
* @global id Http var : document id to restore
24
* @global reload Http var : [Y|N] if Y not xml but redirect to fdl_card
25
* @global containt Http var : if 'yes' restore also folder items
26
*/
27
function
restoredoc
(
Action
&
$action
)
28
{
29
30
$docid
=
GetHttpVars
(
"id"
);
31
$dbaccess
= $action->
GetParam
(
"FREEDOM_DB"
);
32
33
$doc
= new_doc(
$dbaccess
,
$docid
);
34
35
if
(
$doc
->isAffected()) {
36
if
(!
$doc
->isAlive()) {
37
$err
=
$doc
->revive();
38
}
39
}
else
$err
= sprintf(_(
"document [%s] not found"
));
40
41
if
(
$err
) $action->addWarningMsg(
$err
);
42
43
redirect($action,
"FDL"
,
"FDL_CARD&sole=Y&refreshfld=Y&latest=Y&id=$docid"
);
44
}
45
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase