7 include_once (
"FDL/Class.Doc.php");
8 include_once (
"FDL/editutil.php");
15 $family = new_doc(
"",
$value);
16 if ($family->doctype !==
"C") {
17 return "Must be a family identifier";
24 $family = new_doc(
"",
$famid);
25 $attrid =
$usage->addRequiredParameter(
"attrid",
"Attribute identifier",
function (
$value) use ($family)
27 $oa = $family->getAttribute(
$value);
29 return sprintf(
"Attribute \"%s\" not found in family \"%s\"",
$value, $family->name);
36 $err = $family->control(
"edit");
42 $action->parent->addJsRef(
"FREEDOM/Layout/editonedefaultvalue.js");
44 $oa = $family->getAttribute($attrid);
46 $defval = $family->getDefValue($oa->id);
48 if ($oa->fieldSet->type ===
"array") {
49 $oa->fieldSet->type =
"frame";
52 $oa->repeat = ($oa->getOption(
'multiple') ===
"yes");
53 $oa->setVisibility(
"W");
61 $multiline = $oa->repeat;
66 $inputName =
"_UPL_" . $oa->id;
70 $inputName =
"_" . $oa->id;
71 if ($oa->repeat && $oa->type ===
"enum") {
76 $action->lay->set(
"inputname", $inputName);
77 $action->lay->set(
"multiline", $multiline);
78 $action->lay->set(
"family", $family->getHTMLTitle());
79 $action->lay->eset(
"value", $defval);
80 $action->lay->set(
"aid", $oa->id);
81 $action->lay->set(
"alabel", $oa->getLabel());
82 $action->lay->set(
"famid", $family->id);
84 $action->lay->set(
"icon", $family->getIcon(
"", 32));
85 $action->lay->set(
"formatInput",
getHtmlInput($family, $oa, $defval,
"",
"",
true));
editonedefaultvalue(Action $action)
exitError($texterr, $exit=true, $code="")
getHtmlInput(&$doc, &$oattr, $value, $index="", $jsevent="", $notd=false)
Verify arguments for action function.
editmode(Action &$action)
if($file) if($subject==""&&$file) if($subject=="") $err