Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
unlockfile.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  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: unlockfile.php,v 1.10 2007/09/27 13:57:11 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 // $Id: unlockfile.php,v 1.10 2007/09/27 13:57:11 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Fdl/unlockfile.php,v $
21 // ---------------------------------------------------------------
22 include_once ("FDL/Class.Doc.php");
23 function unlockfile(&$action)
24 {
25 
26  $dbaccess = $action->GetParam("FREEDOM_DB");
27  $docid = GetHttpVars("id", 0);
28  $rzone = GetHttpVars("rzone"); // special zone when finish edition
29  $rvid = GetHttpVars("rvid"); // special zone when finish edition
30  $auto = (GetHttpVars("auto", "N") == "Y"); // just auto unlock
31  $autoclose = (GetHttpVars("autoclose", "N") == "Y"); // close window after
33 
34  $err = $doc->UnLock($auto);
35  if ($err != "") $action->ExitError($err);
36 
37  if (!$auto) $action->AddLogMsg(sprintf(_("%s has been unlocked") , $doc->title));
38 
39  $action->AddActionDone("UNLOCKDOC", $doc->id);
40  // add events for folders
41  $fdlids = $doc->getParentFolderIds();
42  foreach ($fdlids as $fldid) {
43  $action->AddActionDone("MODFOLDERCONTAINT", $fldid);
44  }
45  if ($autoclose) {
46  header('Content-type: text/xml; charset=utf-8');
47  } else {
48  $opt = "";
49  if ($rzone != "") $opt = "&zone=$rzone";
50  if ($rvid != "") $opt = "&vid=$rvid";
51  redirect($action, "FDL", "FDL_CARD$opt&id=" . $doc->id, $action->GetParam("CORE_STANDURL"));
52  }
53 }
54 ?>
← centre documentaire © anakeen - published under CC License - Dynacase