Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
generic_del.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Suppress a link to a folder
8  *
9  * @author Anakeen
10  * @version $Id: generic_del.php,v 1.13 2006/11/21 15:52:03 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 include_once ("FDL/Class.DocAttr.php");
19 include_once ("FDL/freedom_util.php");
20 /**
21  * Put a doc in trash
22  * @param Action &$action current action
23  * @global id int Http var : document id to trash
24  * @global recursive string Http var : if yes and it is a folder like family try to delete containt (primary relation) also
25  */
27 {
28  // -----------------------------------
29  // Get all the params
30  $docid = GetHttpVars("id");
31  $recursive = (GetHttpVars("recursive") == "yes");
32  $dbaccess = $action->dbaccess;
33 
34  if ($docid > 0) {
35  /*
36  * @var Dir $doc
37  */
39 
40  $err = $doc->PreDocDelete();
41  if ($err != "") $action->ExitError($err);
42  // ------------------------------
43  // delete document
44  if ($recursive) {
45  if ($doc->doctype == 'D') $err = $doc->deleteRecursive();
46  else $action->ExitError(sprintf(_("%s document it is not a folder and cannot support recursive deletion") , $doc->title));
47  } else {
48  $err = $doc->Delete();
49  }
50  if ($err != "") $action->ExitError($err);
51 
52  $action->AddActionDone("DELFILE", $doc->prelid);
53  $action->AddActionDone("TRASHFILE", $doc->prelid);
54  redirect($action, "FDL", "FDL_CARD&sole=Y&refreshfld=Y&id=$docid");
55  }
56 
57  redirect($action, GetHttpVars("app") , "GENERIC_LOGO");
58 }
global $action
generic_del(Action &$action)
Definition: generic_del.php:26
$docid
Definition: cleanFamily.php:13
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen