Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
restoredoc.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * UnTrash document
8  *
9  * @author Anakeen
10  * @version $Id: restoredoc.php,v 1.1 2007/10/16 14:07:14 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Lib.Dir.php");
18 /**
19  * Get a doc from the trash
20  * @param Action &$action current action
21  * @global id int Http var : document id to restore
22  * @global reload string Http var : [Y|N] if Y not xml but redirect to fdl_card
23  * @global containt string Http var : if 'yes' restore also folder items
24  */
26 {
27 
28  $docid = GetHttpVars("id");
29  $dbaccess = $action->dbaccess;
30 
31  $doc = new_doc($dbaccess, $docid);
32 
33  $err = '';
34  if ($doc->isAffected()) {
35  if (!$doc->isAlive()) {
36  $err = $doc->undelete();
37  }
38  } else $err = sprintf(_("document [%s] not found"));
39 
40  if ($err) $action->addWarningMsg($err);
41 
42  redirect($action, "FDL", "FDL_CARD&sole=Y&refreshfld=Y&latest=Y&id=$docid");
43 }
addWarningMsg($msg)
global $action
$docid
Definition: cleanFamily.php:13
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
restoredoc(Action &$action)
Definition: restoredoc.php:25
← centre documentaire © anakeen