Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Generic/popupcard.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Generated Header (not documented yet)
8  *
9  * @author Anakeen
10  * @version $Id: popupcard.php,v 1.8 2005/06/28 08:37:46 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 // ---------------------------------------------------------------
17 // $Id: popupcard.php,v 1.8 2005/06/28 08:37:46 eric Exp $
18 // $Source: /home/cvsroot/anakeen/freedom/freedom/Zone/Generic/popupcard.php,v $
19 // ---------------------------------------------------------------
20 include_once ("FDL/Class.Doc.php");
21 // -----------------------------------
23 {
24  // -----------------------------------
25  // ------------------------------
26  // define accessibility
27  $docid = GetHttpVars("id");
28  $abstract = (GetHttpVars("abstract", 'N') == "Y");
29  $headers = (GetHttpVars("head", 'no') == "yes");
30 
31  $dbaccess = $action->dbaccess;
33  $kdiv = 1; // only one division
34  $action->lay->Set("id", $doc->id);
35 
36  include_once ("FDL/popup_util.php");
37  // ------------------------------------------------------
38  // definition of popup menu
39  popupInit('popupcard', array(
40  'editdoc',
41  'editstate',
42  'unlockdoc',
43  'chgcatg',
44  'properties',
45  'duplicate',
46  'headers',
47  'delete',
48  'cancel'
49  ));
50 
51  $clf = ($doc->CanLockFile() == "");
52  $cuf = ($doc->CanUnLockFile() == "");
53  $cud = ($doc->canEdit() == "");
54 
55  Popupactive('popupcard', $kdiv, 'cancel');
56 
57  if ($doc->isLocked()) {
58  if ($cuf) popupActive('popupcard', $kdiv, 'unlockdoc');
59  else popupInactive('popupcard', $kdiv, 'unlockdoc');
60  } else popupInvisible('popupcard', $kdiv, 'unlockdoc');
61 
62  popupActive('popupcard', $kdiv, 'duplicate');
63 
64  popupInvisible('popupcard', $kdiv, 'editstate');
65 
66  if ($doc->locked == - 1) { // fixed document
67  popupInvisible('popupcard', $kdiv, 'editdoc');
68  popupInvisible('popupcard', $kdiv, 'delete');
69  popupInvisible('popupcard', $kdiv, 'unlockdoc');
70  popupInvisible('popupcard', $kdiv, 'chgcatg');
71  } else {
72  if ($cud || $clf) {
73  popupActive('popupcard', $kdiv, 'editdoc');
74  $action->lay->eSet("deltitle", $doc->getTitle());
75  popupActive('popupcard', $kdiv, 'delete');
76  popupActive('popupcard', $kdiv, 'chgcatg');
77  } else {
78  popupInactive('popupcard', $kdiv, 'editdoc');
79  popupInactive('popupcard', $kdiv, 'delete');
80  popupInactive('popupcard', $kdiv, 'chgcatg');
81  }
82  if ($doc->wid > 0) {
83  /*
84  * @var WDoc $wdoc
85  */
86  $wdoc = new_Doc($doc->dbaccess, $doc->wid);
87  $wdoc->Set($doc);
88  if (count($wdoc->GetFollowingStates()) > 0) popupActive('popupcard', $kdiv, 'editstate');
89  else popupInactive('popupcard', $kdiv, 'editstate');
90  }
91  }
92 
93  if ($abstract) popupActive('popupcard', $kdiv, 'properties');
94  else popupInvisible('popupcard', $kdiv, 'properties');
95  if ($headers) popupInvisible('popupcard', $kdiv, 'headers');
96  else Popupactive('popupcard', $kdiv, 'headers');
97 
98  popupGen($kdiv);
99 }
global $action
Set($name, &$parent)
$docid
Definition: cleanFamily.php:13
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
popupcard(Action &$action)
← centre documentaire © anakeen