20 include_once (
"FDL/Class.Doc.php");
21 include_once (
"FDL/Class.DocAttr.php");
23 include_once (
"FDL/freedom_util.php");
30 $docid = GetHttpVars(
"id");
31 $frameid = strtolower(GetHttpVars(
"frameid"));
32 $abstract = (GetHttpVars(
"abstract",
'N') ==
"Y");
33 $target = GetHttpVars(
"target",
"_self");
34 $ulink = (GetHttpVars(
"ulink",
'2'));
35 $vid = GetHttpVars(
"vid");
36 if ($ulink ==
"N") $ulink =
false;
40 $action->lay->
Set(
"cursor", $ulink ?
"crosshair" :
"inherit");
43 if (($vid !=
"") && (
$doc->cvid > 0)) {
49 $tview = $cvdoc->getView($vid);
51 $doc->setMask($tview[
"CV_MSKID"]);
54 $listattr =
$doc->GetNormalAttributes();
55 $foa =
$doc->getAttribute($frameid);
56 if (!$foa) $action->
exitError(sprintf(
"attribute %s not found", $frameid));
57 if ($foa->getOption(
"vlabel") ==
"none") $action->lay->set(
"flabel",
'');
58 else $action->lay->set(
"flabel",
mb_ucfirst($foa->getLabel()));
61 foreach ($listattr as $k => $v) {
65 if ($v->fieldSet->id != $frameid)
continue;
69 $goodvalue = (((
$value !=
"") || ($v->type ==
"array") || $v->getOption(
"showempty")) && ($v->mvisibility !=
"H") && ($v->mvisibility !=
"O") && (!$v->inArray()));
71 if ((
$value ==
"") && ($v->type !=
"array")) $htmlvalue = $v->getOption(
"showempty");
72 else $htmlvalue =
$doc->GetHtmlValue($v,
$value, $target, $ulink);
73 }
else $htmlvalue =
"";
74 if ($htmlvalue ==
"")
continue;
75 if ($v->mvisibility ==
"O")
continue;
76 if ($v->inArray())
continue;
79 if (($v->mvisibility !=
"H") && ($v->mvisibility !=
"I")) {
81 if ((!$abstract) || ($v->isInAbstract)) {
82 $tval[$k][
"nonelabel"] =
false;
83 $tval[$k][
"normallabel"] =
true;
84 $tval[$k][
"uplabel"] =
false;
85 $tval[$k][
"wvalue"] = ($v->type ==
"array") ?
"1%" :
"30%";
86 $tval[$k][
"ndisplay"] =
"inline";
87 if ($v->getOption(
"vlabel") ==
"none") {
88 $tval[$k][
"nonelabel"] =
true;
89 $tval[$k][
"normallabel"] =
false;
90 }
else if ($v->getOption(
"vlabel") ==
"up") {
91 $tval[$k][
"normallabel"] =
false;
92 $tval[$k][
"uplabel"] =
true;
94 $tval[$k][
"alabel"] = $v->getLabel();;
95 $tval[$k][
"avalue"] = $htmlvalue;
100 if (count($tval) > 0) {
102 $action->lay->setBlockData(
"FIELDSET", array(
107 $action->lay->setBlockData(
"FVALUES", $tval);
exitError($texterr, $exit=true, $code="")
new_Doc($dbaccess, $id= '', $latest=false)