17 include_once (
"FDL/Class.Doc.php");
22 if ($action->
getParam(
"getmenulink")) {
23 $action->parent->setVolatileParam(
"menulink", $tlink);
27 header(
'Content-type: text/xml; charset=utf-8');
28 $onlyctrl = (GetHttpVars(
"onlyctrl") ==
"yes");
29 $onlysub = GetHttpVars(
"submenu");
32 if ($onlysub && (!
seems_utf8($onlysub))) $onlysub = utf8_encode($onlysub);
36 $action->lay->set(
"CODE",
"OK");
37 $action->lay->set(
"warning",
"");
39 $action->lay->
Set(
"SEP",
false);
40 $noctrlkey = ($action->
getParam(
"FDL_CTRLKEY",
"yes") ==
"no");
44 $rlinkbottom = array();
55 foreach ($tlink as $k => $v) {
61 foreach ($menuKeys as $mKey)
if (!isset($v[$mKey])) $v[$mKey] =
'';
64 else $v[
"submenu"] =
"";
69 $v[
"jsfunction"] =
htmlLayoutEncode(sprintf(
"displayWarningMsg(%s)", json_encode($v[
'title'])));
73 $v[
"jsfunction"] =
'';
76 $v[
"confirm"] =
'false';
79 if ($v[
"submenu"] ==
"") {
80 if (!empty($v[
"icon"])) $useicon =
true;
81 $v[
"ICONS"] =
"mainicon";
83 $smid = base64_encode($v[
"submenu"]);
84 if (!isset($tsubmenu[$smid])) $action->lay->set(
"icon" . $smid,
false);
85 $v[
"ICONS"] =
"icon" . $smid;
86 if ($v[
"icon"]) $action->lay->set(
"icon" . $smid,
true);
89 if ((!isset($v[
"icon"])) || ($v[
"icon"] ==
"")) {
90 $v[
"icon"] =
"Images/none.gif";
93 $v[
"issubmenu"] =
false;
97 if (!isset($v[
"visibility"])) $v[
"visibility"] =
"";
98 if (!isset($v[
"confirm"])) $v[
"confirm"] =
"";
99 if (!isset($v[
"color"])) $v[
"color"] =
false;
100 if (!isset($v[
"title"])) $v[
"title"] =
false;
102 if (!isset($v[
"jsfunction"])) {
103 $v[
"jsfunction"] =
"";
108 if (!isset($v[
"barmenu"])) $v[
"barmenu"] =
"";
109 if (!isset($v[
"url"])) $v[
"url"] =
"";
110 else $v[
"url"] = ($v[
"url"]);
111 if (!isset($v[
"separator"])) $v[
"separator"] =
false;
112 if ((!isset($v[
"idlink"])) || ($v[
"idlink"] ==
"")) $v[
"idlink"] = $k;
113 if ((!isset($v[
"target"])) || ($v[
"target"] ==
"")) $v[
"target"] = $k;
114 if ((!isset($v[
"mwidth"])) || ($v[
"mwidth"] ==
"")) $v[
"mwidth"] = $action->
getParam(
"FDL_HD2SIZE", 300);
115 if ((!isset($v[
"mheight"])) || ($v[
"mheight"] ==
"")) $v[
"mheight"] = $action->
getParam(
"FDL_VD2SIZE", 400);
116 if ((isset($v[
"url"])) && ($v[
"url"] !=
"")) $v[
"URL"] =
true;
117 else $v[
"URL"] =
false;
121 $v[
"submenu"] =
N_(
"menuctrlkey");
126 if ((isset($v[
"jsfunction"])) && ($v[
"jsfunction"] !=
"")) {
134 if ((isset($v[
"submenu"])) && ($v[
"submenu"] !=
"")) {
135 $smid = base64_encode($v[
"submenu"]);
138 if (!isset($tsubmenu[$smid])) {
139 if ((!isset($v[
"icon"])) || ($v[
"icon"] ==
"")) {
140 $icon =
"Images/none.gif";
144 $tsubmenu[$smid] = array(
147 "icon" => $v[
"icon"],
148 "visibility" =>
false,
149 "ICONS" =>
"mainicon",
153 "jsfunction" =>
false,
166 if (!isset($tsubmenu[$smid][
"displayed"])) {
167 $tsubmenu[$smid][
"displayed"] =
true;
168 $tsubmenu[$smid][
"issubmenu"] =
true;
169 $tsubmenu[$smid][
"URL"] =
false;
170 $tsubmenu[$smid][
"JSFT"] =
false;
171 $tsubmenu[$smid][
"separator"] =
false;
172 if ($noctrlkey && ($v[
"submenu"] ==
"menuctrlkey")) {
173 $rlinkbottom[] = $tsubmenu[$smid];
175 $rlink[] = $tsubmenu[$smid];
186 $rlink = array_merge($rlink, $rlinkbottom);
188 $action->lay->
Set(
"mainicon", $useicon);
189 $action->lay->SetBlockData(
"ADDLINK", $rlink);
190 $action->lay->SetBlockData(
"SUBMENU", $tsubmenu);
191 $action->lay->SetBlockData(
"SUBDIVMENU", $tsubmenu);
192 $action->lay->
Set(
"count", count($tlink));
193 $action->lay->
Set(
"SEP", (count($tsubmenu) > 0));
199 return str_replace(
"[",
"[", htmlspecialchars($v, ENT_QUOTES));
Layout is a template generator.
getLayoutFile($app, $layfile)