Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
faddbook_menu.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  * Generate bar menu
9  *
10  * @author Anakeen 2000
11  * @version $Id: faddbook_menu.php,v 1.4 2008/08/14 09:59:14 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 include_once ("GENERIC/generic_util.php");
20 // -----------------------------------
22 {
23  // -----------------------------------
24  global $dbaccess; // use in getChildCatg function
25  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/AnchorPosition.js");
26 
27  $famid = GetHttpVars("dfamid");
28  $onemenu = false; //display menu
29  if ($action->Read("navigator", "") == "EXPLORER") {
30  // special for position style
31  $action->lay->set("positionstyle", "");
32  $action->lay->set("fhelp", "_blank");
33  } else {
34  $action->lay->set("positionstyle", "fixed");
35  $action->lay->set("fhelp", "fhidden");
36  }
37 
38  $dbaccess = $action->GetParam("FREEDOM_DB");
39 
40  $fdoc = new_Doc($dbaccess, $famid);
41 
42  $action->lay->Set("famid", $famid);
43  $action->lay->Set("topid", $fdoc->dfldid);
44 
45  include_once ("FDL/popup_util.php");
46  //--------------------- construction of menu -----------------------
47  popupInit("helpmenu", array(
48  'impcsv',
49  'folders'
50  ));
51 
52  $lmenu = $fdoc->GetMenuAttributes();
53  foreach ($lmenu as $k => $v) {
54  if ($v->getOption("global") == "yes") {
55  $confirm = ($v->getOption("lconfirm") == "yes");
56  $tmenu[$k] = array(
57  "mid" => $v->id,
58  "mtarget" => ($v->getOption("ltarget") != "") ? $v->getOption("ltarget") : $v->id,
59  "mtitle" => $v->getLabel() ,
60  "confirm" => ($confirm) ? "true" : "false",
61  "tconfirm" => ($confirm) ? sprintf(_("Sure %s ?") , addslashes($v->getLabel())) : "",
62  "murl" => addslashes($fdoc->urlWhatEncode($v->link))
63  );
64 
65  popupAddItem('helpmenu', $v->id);
66  $vis = MENU_ACTIVE;
67  if ($v->precond != "") $vis = $fdoc->ApplyMethod($v->precond, MENU_ACTIVE);
68  if ($vis == MENU_ACTIVE) {
69  $onemenu = true;
70  popupActive("helpmenu", 1, $v->id);
71  }
72  }
73  }
74 
75  $action->lay->setBlockData("FAMMENU", $tmenu);
76 
77  if ($action->HasPermission("GENERIC_MASTER", "GENERIC")) {
78  popupActive("helpmenu", 1, 'impcsv');
79  $onemenu = true;
80  } else {
81  popupInvisible("helpmenu", 1, 'impcsv');
82  }
83 
84 
85  popupInvisible("helpmenu", 1, 'folders');
86  if ($action->HasPermission("FREEDOM_GED", "FREEDOM")) {
87  popupActive("helpmenu", 1, 'folders');
88  $onemenu = true;
89  }
90 
91  popupGen(1);
92 
93  $action->lay->set("ONEMENU", $onemenu);
94 }
95 ?>
← centre documentaire © anakeen - published under CC License - Dynacase