Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
viewbarmenu.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  * Specific menu for family
9  *
10  * @author Anakeen 2000
11  * @version $Id: viewbarmenu.php,v 1.10 2008/10/09 08:00:37 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 ("FDL/popupdocdetail.php");
20 include_once ("FDL/popupfamdetail.php");
21 
22 function viewbarmenu(&$action)
23 {
24  $docid = GetHttpVars("id");
25  $dbaccess = $action->GetParam("FREEDOM_DB");
27  if ($docid == "") $action->exitError(_("No identificator"));
28  if ($doc->doctype == 'C') $popup = getpopupfamdetail($action, $docid);
29  else {
30  if ($doc->specialmenu) {
31  if (preg_match("/(.*):(.*)/", $doc->specialmenu, $reg)) {
32  $action->getmenulink = true;
33  $dir = $reg[1];
34  $function = strtolower($reg[2]);
35  $file = $function . ".php";
36  if (include_once ("$dir/$file")) {
37  $function($action);
38  $popup = $action->menulink;
39  } else {
40  AddwarningMsg(sprintf(_("Incorrect specification of special menu : %s") , $doc->specialmenu));
41  }
42  } else {
43  AddwarningMsg(sprintf(_("Incorrect specification of special menu : %s") , $doc->specialmenu));
44  }
45  }
46  }
47  if (!$popup) $popup = getpopupdocdetail($action, $docid);
48  foreach ($popup as $k => $v) {
49  if ($v["visibility"] != POPUP_ACTIVE) unset($popup[$k]);
50  else if (($v["url"] == "") && ($v["jsfunction"] == "")) unset($popup[$k]);
51  else {
52  $popup[$k]["menu"] = ($v["submenu"] != "");
53  $popup[$k]["self"] = (($v["target"] == "_self") && ($v["jsfunction"] == ""));
54  if ($popup[$k]["menu"]) {
55  $idxmenu = $v["submenu"];
56  if (!isset($mpopup[$idxmenu])) {
57  $mpopup[$idxmenu] = true;
58  $popup[$k] = array(
59  "idlink" => $idxmenu,
60  "descr" => ucfirst((_($v["submenu"]))) ,
61  "visibility" => false,
62  "confirm" => false,
63  "jsfunction" => false,
64  "title" => _("Click to view menu") ,
65  "barmenu" => false,
66  "m" => "",
67  "url" => false,
68  "target" => false,
69  "mwidth" => false,
70  "mheight" => false,
71  "smid" => false,
72  "menu" => true,
73  "tconfirm" => false,
74  "issubmenu" => false
75  );
76  } else {
77  unset($popup[$k]);
78  }
79  } else {
80  $popup[$k]["idlink"] = $k;
81  if (!isset($v["jsfunction"])) $popup[$k]["jsfunction"] = '';
82  if ($v["mwidth"] == "") $popup[$k]["mwidth"] = $action->getParam("FDL_HD2SIZE");
83  if ($v["mheight"] == "") $popup[$k]["mheight"] = $action->getParam("FDL_VD2SIZE");
84  if ($v["target"] == "") $popup[$k]["target"] = "$k$docid";
85  $popup[$k]["descr"] = ucfirst($v["descr"]);
86  $popup[$k]["title"] = ucfirst($v["title"]);
87  $popup[$k]["m"] = ($v["barmenu"] == "true") ? "m" : "";
88  $popup[$k]["ISJS"] = ($v["jsfunction"] != "");
89  $popup[$k]["confirm"] = ($v["confirm"] == "true");
90  $popup[$k]["tconfirm"] = str_replace(array(
91  '"',
92  "'"
93  ) , array(
94  '-',
95  "&rsquo;"
96  ) , $v["tconfirm"]);
97  }
98  }
99  }
100  $action->lay->setBlockData("LINKS", $popup);
101  $action->lay->set("id", $docid);
102 
103  $action->lay->Set("canmail", (($doc->usefor != "P") && ($doc->control('send') == "")));
104 }
← centre documentaire © anakeen - published under CC License - Dynacase