17 include_once (
"FDL/Class.Doc.php");
26 $menuitems[$name] = $items;
27 $tsubmenu[$name] = array();
28 if (count($menuitems[$name]) == 0) {
32 foreach ($menuitems[$name] as $ki => $imenu) {
34 $jsarray.=
'"' . $imenu .
'",';
41 $tsubmenu[$name][
'v' . $ki] =
"";
44 $jsarray[mb_strlen($jsarray) - 1] =
"]";
46 $tmenus[$name][
"menuitems"] = $jsarray;
47 $tmenus[$name][
"name"] = $name;
48 $tmenus[$name][
"nbmitem"] = count($menuitems[$name]);
49 $tmenus[$name][
"menulabel"] =
'["' . implode(
'","', $tsubmenu[$name]) .
'"]';
50 $tmenus[$name][
"nbdiv"] =
"";
60 $menuitems[$name][] = $imenu;
62 $ki = count($menuitems[$name]) - 1;
72 $tsubmenu[$name][
'v' . $ki] =
"";
74 $tmenus[$name][
"menuitems"] =
'["' . implode(
'","', $menuitems[$name]) .
'"]';
75 $tmenus[$name][
"nbmitem"] = count($menuitems[$name]);
76 $tmenus[$name][
"menulabel"] =
'["' . implode(
'","', $tsubmenu[$name]) .
'"]';
83 if (!isset($tmenuaccess[$name][$k][
"divid"])) {
84 $tmenuaccess[$name][$k][
"divid"] = $k;
86 foreach ($menuitems[$name] as $ki => $v) {
87 $tmenuaccess[$name][$k][
'v' . $ki] = 2;
97 $tsubmenu[$name][$$nameid] = $mlabel;
108 foreach ($tsubmenu[$name] as $k => $v) {
110 $ti[] = $menuitems[$name][$ki];
162 return ($tmenuaccess[$name][$k][$$nameid]);
167 $na = intval(substr(
$a, 1));
168 $nb = intval(substr($b, 1));
170 if ($na == $nb)
return 0;
171 return ($na < $nb) ? -1 : 1;
177 if (isset($tmenuaccess)) {
179 foreach ($tmenuaccess as $name => $v)
foreach ($v as $ki => $vi)
foreach ($vi as $kj => $vj) {
181 $tmenuaccess[$name][$ki][$kj] = 1;
182 if ($tsubmenu[$name][$kj] ==
"") $tsubmenu[$name][$kj] =
"ctrlkey";
193 $ta = $tmenuaccess[$popname][1];
196 $ti = $menuitems[$popname];
198 foreach ($ta as $v) {
199 $tu[current($ti) ] = $v;
210 $ti = $menuitems[$popname];
211 foreach ($ta as $i =>
$a) {
212 $kt = array_keys($ti, $i);
213 if (count($kt) == 1) {
215 $tmenuaccess[$popname][1][
"v$k"] =
$a;
234 $action->parent->AddJsRef($action->GetParam(
"CORE_JSURL") .
"/DHTMLapi.js");
235 $action->parent->AddJsRef($action->GetParam(
"CORE_JSURL") .
"/geometry.js");
236 $action->parent->AddJsRef($action->GetParam(
"CORE_PUBURL") .
"/FDL/Layout/common.js");
237 $action->parent->AddJsRef($action->Getparam(
"CORE_PUBURL") .
"/FDL/Layout/popupfunc.js");
242 $action->parent->AddCssRef(
"FDL:POPUP.CSS",
true);
246 if (isset($tmenuaccess)) {
249 foreach ($tmenuaccess as $name => $v2) {
251 foreach ($v2 as $k => $v) {
252 uksort($v,
'vcompare');
254 $tma[$kv][
"vmenuitems"] =
"[";
255 foreach ($v as $ki => $vi) {
257 $tma[$kv][
"vmenuitems"].=
"" . $vi .
",";
260 $tma[$kv][
"vmenuitems"][mb_strlen($tma[$kv][
"vmenuitems"]) - 1] =
"]";
262 $tma[$kv][
"name"] = $name;
263 $tma[$kv][
"divid"] = $v[
"divid"];
267 $tmenus[$name][
"nbdiv"] = $nbdiv;
268 $tmenus[$name][
"menulabel"] =
'["' . implode(
'","', $tsubmenu[$name]) .
'"]';
270 $lpopup->SetBlockData(
"MENUACCESS", $tma);
271 $lpopup->SetBlockData(
"MENUS", $tmenus);
272 if (isset($tcmenus)) $tcmenus = array_merge($tcmenus, $tmenus);
273 else $tcmenus = $tmenus;
274 foreach ($tsubmenu as $kl => $vl)
foreach ($vl as
$sm)
if ($sm !=
"") $tcmenus[
$sm][
"name"] =
$sm;
275 $lpopup->SetBlockData(
"CMENUS", $tcmenus);
277 $action->parent->AddJsCode($lpopup->gen());
279 if ($action->Read(
"navigator",
"") ==
"EXPLORER") $action->lay->Set(
"divpos",
"absolute");
280 else $action->lay->Set(
"divpos",
"fixed");
283 $tmenuaccess = array();
286 unset($tmenusaccess);
303 if (isset($tmenuaccess)) {
307 foreach ($tmenuaccess as $name => $v2) {
309 foreach ($v2 as $k => $v) {
310 uksort($v,
'vcompare');
312 $tma[$kv][
"vmenuitems"] =
"[";
313 foreach ($v as $ki => $vi) {
315 $tma[$kv][
"vmenuitems"].=
"" . $vi .
",";
318 $tma[$kv][
"vmenuitems"][mb_strlen($tma[$kv][
"vmenuitems"]) - 1] =
"]";
320 $tma[$kv][
"name"] = $name;
321 $tma[$kv][
"divid"] = $v[
"divid"];
325 $tmenus[$name][
"nbdiv"] = $nbdiv;
326 $tmenus[$name][
"menulabel"] =
'["' . implode(
'","', $tsubmenu[$name]) .
'"]';
329 $lpopup->SetBlockData(
"ADDMENUACCESS", $tma);
330 $lpopup->SetBlockData(
"ADDMENUS", $tmenus);
332 $action->parent->AddJsCode($lpopup->gen());
335 $tmenuaccess = array();
338 unset($tmenusaccess);
Layout is a template generator.
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a