19 include_once (
"FDL/Class.Doc.php");
20 include_once (
"FDL/Lib.Dir.php");
21 include_once (
"FDL/Class.DocRel.php");
27 $action->parent->AddJsRef(
$action->GetParam(
"CORE_PUBURL") .
"/FDL/Layout/common.js");
28 $action->parent->AddJsRef(
$action->GetParam(
"CORE_JSURL") .
"/subwindow.js");
33 $idocid =
$doc->initid;
36 $rdoc->sinitid = $idocid;
41 $trel = $rdoc->getIRelations(
"",
"", $limit);
42 if (count($trel) == 0) {
49 "type" => _(
"Referenced from")
52 foreach ($trel as $k => $v) {
53 $tlay[$v[
"sinitid"] .
'_F'] = array(
54 "iconsrc" =>
$doc->getIcon($v[
"sicon"]) ,
55 "initid" => $v[
"sinitid"],
56 "title" => $v[
"stitle"],
58 "alabel" => $v[
"type"] ? _($v[
"type"]) :
"",
59 "type" => _(
"Referenced from")
63 $trel = $rdoc->getRelations(
"",
"", $limit);
64 if (count($trel) == 0) {
71 "type" => _(
"Reference")
74 foreach ($trel as $k => $v) {
75 $tlay[$v[
"cinitid"] .
'_T'] = array(
76 "iconsrc" =>
$doc->getIcon($v[
"cicon"]) ,
77 "initid" => $v[
"cinitid"],
78 "title" => $v[
"ctitle"],
80 "alabel" => $v[
"type"] ? _($v[
"type"]) :
"",
81 "type" => _(
"Reference")
85 if (count($tlay) > 0) {
86 foreach ($tlay as $k => $v) {
87 $taid[$v[
"aid"]] = $v[
"aid"];
91 $l =
$q->Query(0, 0,
"TABLE");
94 foreach ($l as $k => $v) {
95 $la[$v[
"id"]] = $v[
"labeltext"];
97 foreach ($tlay as $k => $v) {
98 if (
$la[$v[
"aid"]]) $tlay[$k][
"alabel"] =
$la[$v[
"aid"]];
99 else if ($tlay[$k][
"aid"] ==
'folder') $tlay[$k][
"alabel"] = _(
"folder");
105 foreach ($tlay as $k => $v) {
106 $tids[] = $v[
"initid"];
111 if (is_array($vdoc))
foreach ($vdoc as $k => $v) $tids[] = $v[
"initid"];
113 foreach ($tlay as $k => $v) {
114 if ((!in_array($v[
"initid"], $tids)) && ($v[
"initid"] != 0)) unset($tlay[$k]);
117 $action->lay->setBlockData(
"RELS", $tlay);
123 header(
'Content-type: text/xml; charset=utf-8');