7 include_once (
"FDL/Class.Doc.php");
8 include_once (
"FDL/editutil.php");
14 $family = new_doc(
"",
$value);
15 if ($family->doctype !==
"C") {
16 return "Must be a family identifier";
20 $family = new_doc(
"",
$famid);
24 $err = $family->control(
"edit");
29 $action->parent->addJsRef(
"lib/jquery-ui/js/jquery-ui.js");
30 $action->parent->addJsRef(
"lib/jquery-dataTables/js/jquery.dataTables.min.js");
31 $action->parent->addCssRef(
"css/dcp/jquery-ui.css");
32 $action->parent->addCssRef(
"lib/jquery-dataTables/css/jquery.dataTables.css");
33 $action->parent->addJsRef(
"FREEDOM/Layout/editdefaultvalues.js");
37 $oas = $family->getAttributes();
38 $d =
createDoc($action->dbaccess, $family->id,
false,
true,
false);
39 $taDefval = $tpDefval = array();
40 foreach ($oas as $oa) {
41 if ($oa->isNormal && $oa->type !==
"array") {
45 $defval = $family->getDefValue($oa->id);
47 if ($oa->type ===
"file" || $oa->type ===
"image") {
48 $htmlvalue = $family->getHtmlValue($oa, $defval,
"_blank");
50 $htmlvalue =
$d->getHtmlAttrValue($oa->id,
"_blank");
52 if ($oa->type ===
"image") {
53 $htmlvalue = sprintf(
'<img class="image" src="%s">', $htmlvalue);
60 "alabel" => htmlspecialchars(sprintf(
"%s / %s", $oa->fieldSet->getLabel() , $oa->getLabel())) ,
61 "multiline" => ($oa->isMultiple() || $oa->type ===
"longtext" || $oa->type ===
"htmltext") ,
62 "defval" => htmlspecialchars($defval, ENT_QUOTES) ,
63 "htmlval" => $htmlvalue
66 if ($oa->usefor ===
"Q") {
74 $action->lay->setBlockData(
"ADEFAULTS", $taDefval);
75 $action->lay->setBlockData(
"PDEFAULTS", $tpDefval);
76 $action->lay->set(
"hasParam", count($tpDefval) > 0);
78 $action->lay->set(
"famid", $family->id);
79 $action->lay->set(
"family", $family->getHTMLTitle());
80 $action->lay->set(
"icon", $family->getIcon(
"", 32));
exitError($texterr, $exit=true, $code="")
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
Verify arguments for action function.
editdefaultvalues(Action $action)
editmode(Action &$action)
if($file) if($subject==""&&$file) if($subject=="") $err