7 include_once (
"FDL/Class.Doc.php");
16 $usage->setDefinitionText(
"Modify enum items");
17 $famId =
$usage->addRequiredParameter(
"famid",
"Family identifier",
function ($id)
19 $fam = new_doc(
"", $id);
20 if (!$fam->doctype ==
"C") {
21 return sprintf(
"identifier %s is not a family", $id);
25 $viewOldInterface =
$usage->addOptionalParameter(
"viewoldinterface",
"link to old enum interface", array(
30 $fam = new_doc(
"",
$famId);
31 $err = $fam->control(
"edit");
36 $action->lay->set(
"title", sprintf(_(
"Enum attributes for %s") , $fam->getHTMLTitle()));
37 $action->lay->set(
"famicon", $fam->getIcon(
'', 30));
38 $action->parent->addJsRef(
'lib/jquery/jquery.js');
40 $action->parent->addJsRef(
"lib/jquery-ui/js/jquery-ui.js");
41 $action->parent->addJsRef(
"FDL:editfamilyenums.js");
42 $action->parent->addCssRef(
"css/dcp/jquery-ui.css");
44 $lattr = $fam->getAttributes();
50 foreach ($lattr as $k => $oa) {
51 if ((($oa->type ==
"enum") || ($oa->type ==
"enumlist")) && (($oa->phpfile ==
"") || ($oa->phpfile ==
"-")) && ($oa->getOption(
"system") !=
"yes")) {
54 $label = $oa->getLabel();
55 if (!empty($oa->fieldSet)) {
56 $parentLabel = $oa->fieldSet->getLabel();
57 $parentId = $oa->fieldSet->id;
58 if ($parentLabel == $label) {
59 if (!empty($oa->fieldSet->fieldSet)) {
60 $parentLabel = $oa->fieldSet->fieldSet->getLabel();
61 $parentId = $oa->fieldSet->fieldSet->id;
70 "parentLabel" => $parentLabel,
71 "sameParent" => ($parentId == $lastFieldId) ,
72 "famid" => $oa->docid,
75 $lastFieldId = $parentId;
79 $action->lay->set(
"linkOld", $viewOldInterface ==
"yes");
80 $action->lay->set(
"familyid", $fam->id);
82 $action->lay->set(
"NOENUMS", empty($tcf));
83 $action->lay->setBlockData(
"ENUMS", $tcf);
editfamilyenums(Action &$action)
exitError($texterr, $exit=true, $code="")
Verify arguments for action function.
if($file) if($subject==""&&$file) if($subject=="") $err