17 include_once (
"FDL/Class.Doc.php");
18 include_once (
"FDL/Class.DocAttr.php");
22 $sorm = GetHttpVars(
"sorm",
"single");
25 if (preg_match(
"/([a-z]*)-alone/", $sorm, $reg)) {
29 $action->lay->set(
"notalone", $notalone);
42 return GetHttpVars(
"_" . strtolower($n) , $def);
44 $h = GetHttpVars(strtolower($n));
51 if (($oa->repeat) || $oa->inArray()) {
52 $r =
$doc->getMultipleRawValues($n);
54 $r =
$doc->getRawValue($n);
64 $phpfunc = $oattr->phpfunc;
65 $phpfunc = str_replace(array(
73 $strucFunc = $oParse->parse($phpfunc);
74 if ($strucFunc->getError()) {
75 return $strucFunc->getError();
78 if (!preg_match(
'/(.*)\((.*)\)\:(.*)/', $phpfunc, $reg)) {
79 return sprintf(_(
"the pluggins function description '%s' is not conform for %s attribut") , $phpfunc, $oattr->id);
81 $callfunc = $oParse->functionName;
82 if (!function_exists($callfunc)) {
83 if (!@file_exists(
"EXTERNALS/$oattr->phpfile")) {
84 return sprintf(_(
"the external pluggin file %s cannot be read") , $oattr->phpfile);
86 include_once (
"EXTERNALS/$oattr->phpfile");
89 if (!function_exists($callfunc)) {
90 error_log(__METHOD__ .
" $callfunc not found from " . $oattr->phpfile);
91 return sprintf(_(
"function '%s' declared in %s is not found") , $callfunc, $oattr->id);
93 $rargids = $oParse->outputs;
95 foreach ($strucFunc->inputs as $k => $inpArg) {
96 $v = str_replace(array(
107 $unser = @unserialize($v);
110 } elseif (substr($v, 0, 1) ==
'{' && substr($v, -1, 1) ==
'}') {
112 $arg[$k] =
getAttr($doc->dbaccess, substr($v, 1, -1));
113 } elseif ($inpArg->type ==
"string") {
115 } elseif ($v ==
"A") {
118 } elseif ($v ==
"D") {
119 $arg[$k] = $doc->dbaccess;
120 } elseif ($v ==
"I") {
122 }
else if ($v ==
"WIID") {
124 } elseif ($v ==
"K") {
126 } elseif ($v ==
"T") {
128 } elseif (($v[0] ==
"'") || ($v[0] ==
'"')) {
129 $lc = substr($v, -1);
131 $arg[$k] = mb_substr($v, 1, -1);
133 $arg[$k] = mb_substr($v, 1);
139 $a = $doc->GetAttribute($v);
141 if ($index ===
"" || $index === null) {
150 $arg[$k] = trim($ta);
153 if (
$a && (
$a->usefor ==
"Q")) {
154 if ((
$a->fieldSet->id == $oattr->fieldSet->id)) {
159 $arg[$k] = trim($ta[$index]);
163 } elseif (
$a &&
$a->inArray()) {
164 if ((
$a->fieldSet->id == $oattr->fieldSet->id)) {
169 $arg[$k] = trim($ta[$index]);
179 $arg[$k] = trim($ta);
190 $arg[$k] = trim($ta[$index]);
195 $arg[$k] = trim($ta);
199 if (
$a && (
$a->usefor ==
"Q")) {
200 if (
getFuncVar($v,
false, $whttpvars, $doc,
$a) ===
false) {
207 $res = call_user_func_array($callfunc,
$arg);
209 catch(Exception $e) {
210 $res = $e->getMessage();
213 if (is_array($res) && (count($res) > 0)) {
215 foreach ($res as $k => $v) {
221 foreach ($v as $k2 => $v2) {
229 $res[$k][$k2] = str_replace(
"\r",
"", $v2);
237 foreach ($res as $k => $v) {
238 $tselect[$k][
"choice"] = $v[0];
239 $tselect[$k][
"cindex"] = $ki;
240 $tval[$k][
"index"] = $ki;
243 $tval[$k][
"attrv"] =
"['" . implode(
"','", $v) .
"']";
getResPhpFunc(Doc &$doc, NormalAttribute &$oattr, &$rargids, &$tselect, &$tval, $whttpvars=true, $index="")
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
getFuncVar($n, $def="", $whttpvars, &$doc, &$oa)
static getError($code, $args=null)
getFamilyParameterValue($idp, $def="")
getHttpVars($name, $def="", $scope="all")
getFamIdFromName($dbaccess, $name)
if($file) if($subject==""&&$file) if($subject=="") $err