19 include_once (
"FDL/Class.Doc.php");
29 $action->lay->Set(
"SEP",
false);
36 include_once (
"FDL/popup_util.php");
38 $lmenu =
$doc->GetMenuAttributes();
42 foreach ($lmenu as $k => $v) {
46 if (($v->getOption(
"onlyglobal") ==
"yes") && (
$doc->doctype !=
"C"))
continue;
47 if (($v->getOption(
"global") !=
"yes") && (
$doc->doctype ==
"C"))
continue;
48 if ($v->link[0] ==
'?') {
49 $v->link = substr($v->link, 1);
52 if ($v->getOption(
"lconfirm") ==
"yes") $confirm =
true;
53 if ($v->link[0] ==
'C') {
54 $v->link = substr($v->link, 1);
57 if ($v->getOption(
"lcontrol") ==
"yes") $control =
true;
58 if (preg_match(
'/\[(.*)\](.*)/', $v->link, $reg)) {
60 $tlink[$k][
"target"] = $reg[1];
62 $tlink[$k][
"target"] = $v->id;
64 if ($v->getOption(
"ltarget") !=
"") $tlink[$k][
"target"] = $v->getOption(
"ltarget");
65 $tlink[$k][
"idlink"] = $v->id;
66 $tlink[$k][
"descr"] = $v->getLabel();
67 $tlink[$k][
"url"] = addslashes(
$doc->urlWhatEncode($v->link));
68 $tlink[$k][
"confirm"] = $confirm ?
"true" :
"false";
69 $tlink[$k][
"control"] = $control;
70 $tlink[$k][
"tconfirm"] = sprintf(_(
"Sure %s ?") , addslashes($v->getLabel()));
72 $tlink[$k][
"barmenu"] = ($v->getOption(
"barmenu") ==
"yes") ?
"true" :
"false";
73 if ($v->precond !=
"") $tlink[$k][
"visibility"] =
$doc->ApplyMethod($v->precond,
MENU_ACTIVE);
75 $tmenu[$km++] = $v->id;
79 $lactions =
$doc->GetActionAttributes();
80 foreach ($lactions as $k => $v) {
81 if ($v->getOption(
"submenu") !=
"") {
84 $v->link = $v->getLink(
$doc->id);
85 if ($v->getOption(
"lconfirm") ==
"yes") $confirm =
true;
86 if ($v->getOption(
"lcontrol") ==
"yes") $control =
true;
88 if (preg_match(
'/\[(.*)\](.*)/', $v->link, $reg)) {
90 $tlink[$k][
"target"] = $reg[1];
92 $tlink[$k][
"target"] = $v->id;
94 $tlink[$k][
"barmenu"] = ($v->getOption(
"barmenu") ==
"yes") ?
"true" :
"false";
95 $tlink[$k][
"idlink"] = $v->id;
96 $tlink[$k][
"descr"] = $v->getLabel();
97 $tlink[$k][
"url"] = addslashes(
$doc->urlWhatEncode($v->link));
98 $tlink[$k][
"confirm"] = $confirm ?
"true" :
"false";
99 $tlink[$k][
"control"] = $control;
100 $tlink[$k][
"tconfirm"] = sprintf(_(
"Sure %s ?") , addslashes($v->getLabel()));
102 if ($v->precond !=
"") $tlink[$k][
"visibility"] =
$doc->ApplyMethod($v->precond,
MENU_ACTIVE);
104 $tmenu[$km++] = $v->id;
109 if (count($tmenu) == 0)
return;
114 $lmenu = array_merge($lmenu, $lactions);
116 foreach ($lmenu as $k => $v) {
117 $sm = $v->getOption(
"submenu");
119 $smid = base64_encode($sm);
120 $tsubmenu[$smid] = array(
128 while (list($k, $v) = each($tmenu)) {
130 Popupinvisible(
'popupcard', $kdiv, $v);
132 if ($tlink[$v][
"url"] !=
"") {
134 if ($tlink[$v][
"control"]) PopupCtrlInactive(
'popupcard', $kdiv, $v);
135 else PopupInactive(
'popupcard', $kdiv, $v);
137 if ($tlink[$v][
"control"]) PopupCtrlActive(
'popupcard', $kdiv, $v);
138 else Popupactive(
'popupcard', $kdiv, $v);
140 }
else PopupInactive(
'popupcard', $kdiv, $v);
144 $noctrlkey = (
$action->getParam(
"FDL_CTRLKEY",
"yes") ==
"no");
147 $action->lay->SetBlockData(
"ADDLINK", $tlink);
148 $action->lay->Set(
"SEP",
true);