Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
folder_barmenu.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Folder barmenu
8  *
9  * @author Anakeen
10  * @version $Id: folder_barmenu.php,v 1.16 2007/10/15 13:01:06 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Dir.php");
18 include_once ("FDL/Class.QueryDir.php");
19 include_once ("FDL/freedom_util.php");
20 
21 include_once ("FDL/popup_util.php");
22 // -----------------------------------
24 {
25  // -----------------------------------
26  // Get all the params
27  $nbdoc = GetHttpVars("nbdoc");
28  $count = getHttpVars("count", "");
29  $dirid = GetHttpVars("dirid");
30  $target = GetHttpVars("target"); // target for hyperlinks
31  $dbaccess = $action->dbaccess;
32 
34 
35  $action->lay->set("wtarget", urlencode($target));
36  $action->lay->set("title", $dir->getHTMLTitle());
37  $action->lay->set("pds", $dir->urlWhatEncodeSpec("")); // parameters for searches
38  if ($nbdoc > 1) {
39  if (is_numeric($count) && $count > $nbdoc) {
40  $nbdocMsg = sprintf(_("Showing %d of %d documents") , $nbdoc, $count);
41  } else {
42  $nbdocMsg = sprintf(_("Showing %d documents") , $nbdoc);
43  }
44  $action->lay->set("nbdoc", $nbdocMsg);
45  } else {
46  $action->lay->set("nbdoc", sprintf(_("Showing %d document") , $nbdoc));
47  }
48 
49  $action->lay->set("dirid", urlencode($dirid));
50  $tarch = array();
51  $toolmenu = array(
52  'tobasket',
53  'insertbasket',
54  'clear',
55  'props',
56  'openfolio',
57  'applybatch',
58  'export',
59  'insert'
60  );
61  if ($dir->fromname != "ARCHIVING") { // no archive archive
62  include_once ("FDL/Class.SearchDoc.php");
63  $s = new SearchDoc($dir->dbaccess, "ARCHIVING");
64  $s->setObjectReturn();
65  $s->addFilter("arc_status = 'O'");
66  $s->search();
67  if ($s->count() > 0) {
68  while ($archive = $s->getNextDoc()) {
69  if ($archive->control("modify") == "") {
70  $toolmenu[] = "arch" . $archive->id;
71  $tarch[] = array(
72  "archid" => $archive->id,
73  "archtitle" => sprintf(_("Insert all into %s archive") , $archive->getHTMLTitle())
74  );
75  }
76  }
77  }
78  $action->lay->setBlockdata("ARCH", $tarch);
79  }
80 
81  popupInit("viewmenu", array(
82  'vlist',
83  'vicon',
84  'vcol',
85  'vdetail'
86  ));
87  popupInit("toolmenu", $toolmenu);
88  foreach ($tarch as $arch) {
89  popupActive("toolmenu", 1, "arch" . $arch["archid"]);
90  }
91  popupActive("viewmenu", 1, 'vlist');
92  popupActive("viewmenu", 1, 'vicon');
93  popupActive("viewmenu", 1, 'vcol');
94  popupActive("viewmenu", 1, 'vdetail');
95  // clear only for basket :: too dangerous
96  if (($dir->fromid == getFamIdFromName($dbaccess, "BASKET")) || ($dir->fromid == getFamIdFromName($dbaccess, "ARCHIVING"))) {
97  popupInvisible("toolmenu", 1, 'tobasket');
98  popupInvisible("toolmenu", 1, 'insertbasket');
99  popupActive("toolmenu", 1, 'clear');
100  } else {
101  popupActive("toolmenu", 1, 'tobasket');
102  if ($dir->defDoctype != 'D') popupInvisible("toolmenu", 1, 'insertbasket');
103  else {
104  popupActive("toolmenu", 1, 'insertbasket');
105  popupActive("toolmenu", 1, 'insert');
106  }
107  popupInvisible("toolmenu", 1, 'clear');
108  }
109  if ($dir->initid == 10) {
110  popupActive("toolmenu", 1, 'clear'); // import folder
111 
112  }
113  popupActive("toolmenu", 1, 'props');
114  popupActive("toolmenu", 1, 'openfolio');
115  if ($action->HasPermission("FREEDOM_ADMIN")) {
116  popupActive("toolmenu", 1, 'applybatch');
117  }
118  if ($action->HasPermission("EXPORT", "FDL")) {
119  popupActive("toolmenu", 1, 'export');
120  }
121 
122  popupGen(1);
123 }
folder_barmenu(Action &$action)
global $action
$archive
if($famId) $s
getHttpVars($name, $def="", $scope="all")
Definition: Lib.Http.php:124
getFamIdFromName($dbaccess, $name)
new_Doc($dbaccess, $id= '', $latest=false)
$dir
Definition: resizeimg.php:144
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen