17 include_once (
"FDL/Class.Doc.php");
24 $docid = GetHttpVars(
"id");
25 $abstract = (GetHttpVars(
"abstract",
'N') ==
"Y");
27 $action->lay->
Set(
"SEP",
false);
32 $action->lay->
Set(
"id",
$doc->id);
34 include_once (
"FDL/popup_util.php");
36 $lmenu =
$doc->GetMenuAttributes();
41 foreach ($lmenu as $k => $v) {
45 if (($v->getOption(
"onlyglobal") ==
"yes") && (
$doc->doctype !=
"C"))
continue;
46 if (($v->getOption(
"global") !=
"yes") && (
$doc->doctype ==
"C"))
continue;
47 if ($v->link[0] ==
'?') {
48 $v->link = substr($v->link, 1);
51 if ($v->getOption(
"lconfirm") ==
"yes") $confirm =
true;
52 if ($v->link[0] ==
'C') {
53 $v->link = substr($v->link, 1);
56 if ($v->getOption(
"lcontrol") ==
"yes") $control =
true;
57 if (preg_match(
'/\[(.*)\](.*)/', $v->link, $reg)) {
59 $tlink[$k][
"target"] = $reg[1];
61 $tlink[$k][
"target"] = $v->id;
63 if ($v->getOption(
"ltarget") !=
"") $tlink[$k][
"target"] = $v->getOption(
"ltarget");
64 $tlink[$k][
"idlink"] = $v->id;
65 $tlink[$k][
"descr"] = $v->getLabel();
66 $tlink[$k][
"url"] = addslashes(
$doc->urlWhatEncode($v->link));
67 $tlink[$k][
"confirm"] = $confirm ?
"true" :
"false";
68 $tlink[$k][
"control"] = $control;
69 $tlink[$k][
"tconfirm"] = sprintf(_(
"Sure %s ?") , addslashes($v->getLabel()));
71 $tlink[$k][
"barmenu"] = ($v->getOption(
"barmenu") ==
"yes") ?
"true" :
"false";
72 if ($v->precond !=
"") $tlink[$k][
"visibility"] =
$doc->ApplyMethod($v->precond,
MENU_ACTIVE);
74 $tmenu[$km++] = $v->id;
78 $lactions =
$doc->GetActionAttributes();
79 foreach ($lactions as $k => $v) {
80 if ($v->getOption(
"submenu") !=
"") {
83 $v->link = $v->getLink(
$doc->id);
84 if ($v->getOption(
"lconfirm") ==
"yes") $confirm =
true;
85 if ($v->getOption(
"lcontrol") ==
"yes") $control =
true;
87 if (preg_match(
'/\[(.*)\](.*)/', $v->link, $reg)) {
89 $tlink[$k][
"target"] = $reg[1];
91 $tlink[$k][
"target"] = $v->id;
93 $tlink[$k][
"barmenu"] = ($v->getOption(
"barmenu") ==
"yes") ?
"true" :
"false";
94 $tlink[$k][
"idlink"] = $v->id;
95 $tlink[$k][
"descr"] = $v->getLabel();
96 $tlink[$k][
"url"] = addslashes(
$doc->urlWhatEncode($v->link));
97 $tlink[$k][
"confirm"] = $confirm ?
"true" :
"false";
98 $tlink[$k][
"control"] = $control;
99 $tlink[$k][
"tconfirm"] = sprintf(_(
"Sure %s ?") , addslashes($v->getLabel()));
101 if ($v->precond !=
"") $tlink[$k][
"visibility"] =
$doc->ApplyMethod($v->precond,
MENU_ACTIVE);
103 $tmenu[$km++] = $v->id;
108 if (count($tmenu) == 0)
return;
113 $lmenu = array_merge($lmenu, $lactions);
115 foreach ($lmenu as $k => $v) {
116 $sm = $v->getOption(
"submenu");
118 $smid = base64_encode(
$sm);
119 $tsubmenu[$smid] = array(
127 foreach ($tmenu as $k => $v) {
129 Popupinvisible(
'popupcard', $kdiv, $v);
131 if ($tlink[$v][
"url"] !=
"") {
133 if ($tlink[$v][
"control"]) PopupCtrlInactive(
'popupcard', $kdiv, $v);
134 else PopupInactive(
'popupcard', $kdiv, $v);
136 if ($tlink[$v][
"control"]) PopupCtrlActive(
'popupcard', $kdiv, $v);
137 else Popupactive(
'popupcard', $kdiv, $v);
139 }
else PopupInactive(
'popupcard', $kdiv, $v);
143 $noctrlkey = ($action->
getParam(
"FDL_CTRLKEY",
"yes") ==
"no");
146 $action->lay->SetBlockData(
"ADDLINK", $tlink);
147 $action->lay->
Set(
"SEP",
true);
new_Doc($dbaccess, $id= '', $latest=false)