55 $this->labelText = $label;
66 if ($i !=
$r)
return $i;
79 if (!isset($this->_topt)) {
80 $topt = explode(
"|", $this->options);
81 $this->_topt = array();
82 foreach ($topt as $k => $v) {
84 $v = explode(
"=", $v, 2);
85 $this->_topt[$v[0]] = isset($v[1]) ? $v[1] : null;
89 $r = $this->docname .
'#' . $this->
id .
'#' . $x;
91 if ($i !=
$r)
return $i;
93 $v = (isset($this->_topt[$x]) && $this->_topt[$x] !==
'') ? $this->_topt[$x] : $def;
103 if (!isset($this->_topt)) {
118 if (!isset($this->_topt)) {
121 $this->_topt[$x] = $v;
130 $this->mvisibility = $vis;
139 return $this->
getOption(
"autocreated") !=
"yes";
151 return str_replace(array(
163 return str_replace(array(
209 if ($this->
type ==
'tab') {
212 if (is_object($this->fieldSet) && method_exists($this->fieldSet,
'getTab') && ($this->fieldSet->id != Adoc::HIDDENFIELD)) {
213 return $this->fieldSet->getTab();
225 return sprintf(
"<!-- no Schema %s (%s)-->", $this->
id, $this->
type);
238 return sprintf(
"<!-- no value %s (%s)-->", $this->
id, $this->
type);
263 $lay->set(
"aname", $this->
id);
264 $lay->set(
"label", $this->
encodeXml($this->labelText));
265 $lay->set(
"type", $this->
type);
266 $lay->set(
"visibility", $this->visibility);
267 $lay->set(
"isTitle",
false);
268 $lay->set(
"phpfile",
false);
269 $lay->set(
"phpfunc",
false);
271 $lay->set(
"computed",
false);
272 $lay->set(
"link",
'');
273 $lay->set(
"elink",
'');
274 $lay->set(
"default",
false);
275 $lay->set(
"constraint",
'');
278 foreach ($tops as $k => $v) {
279 if ($k) $t[] = array(
284 $lay->setBlockData(
"options", $t);
286 $play->set(
"minOccurs",
"0");
287 $play->set(
"isnillable",
"true");
288 $play->set(
"maxOccurs",
"1");
289 $play->set(
"aname", $this->
id);
290 $play->set(
"appinfos", $lay->gen());
350 private static $_cache = array();
378 function __construct(
$id,
$docid, $label,
$type,
$format,
$repeat, $order,
$link,
$visibility,
$needed,
$isInTitle,
$isInAbstract, &
$fieldSet,
$phpfile,
$phpfunc,
$elink,
$phpconstraint =
"",
$usefor =
"",
$eformat =
"",
$options =
"",
$docname =
"")
382 $this->labelText = $label;
386 $this->ordered = $order;
409 $this->needed = $need;
419 if ($this->
type ==
"htmltext") {
420 $value = preg_replace_callback(
'/(data-initid=")([0-9]+)/',
function ($matches)
423 return $matches[1] . ($name ? $name : $matches[2]);
438 switch ($this->
type) {
470 return sprintf(
"<!-- no Schema %s (type %s)-->", $this->
id, $this->
type);
482 $lay->set(
"aname", $this->
id);
483 $lay->set(
"label", $this->
encodeXml($this->labelText));
484 $lay->set(
"type", $this->
type);
485 $lay->set(
"visibility", $this->visibility);
486 $lay->set(
"isTitle", $this->isInTitle);
487 $lay->set(
"phpfile", $this->phpfile);
488 $lay->set(
"phpfunc", $this->phpfunc);
490 if (($this->
type ==
"enum") && (!$this->phpfile) || ($this->phpfile ==
"-")) {
491 $lay->set(
"phpfile",
false);
492 $lay->set(
"phpfunc",
false);
494 $lay->set(
"computed", ((!$this->phpfile) && (substr($this->phpfunc, 0, 2) ==
"::")));
495 $lay->set(
"link", $this->
encodeXml($this->link));
496 $lay->set(
"elink", $this->
encodeXml($this->elink));
497 $lay->set(
"default",
false);
498 $lay->set(
"constraint", $this->phpconstraint);
501 foreach ($tops as $k => $v) {
502 if ($k) $t[] = array(
507 $lay->setBlockData(
"options", $t);
509 $play->set(
"minOccurs", $this->needed ?
"1" :
"0");
510 $play->set(
"isnillable", $this->needed ?
"false" :
"true");
511 $play->set(
"maxOccurs", (($this->
getOption(
'multiple') ==
'yes') ?
"unbounded" :
"1"));
512 $play->set(
"aname", $this->
id);
513 $play->set(
"appinfos", $lay->gen());
529 if ($this->
getOption(
"autotitle") ==
"yes") {
530 return sprintf(
"<!--autotitle %s %s -->", $this->
id, $v);
532 if (($v === null) && ($this->
type !=
'array')) {
533 if (($this->
type ==
'file') || ($this->
type ==
'image'))
return sprintf(
'<%s mime="" title="" xsi:nil="true"/>', $this->
id);
534 else return sprintf(
'<%s xsi:nil="true"/>', $this->
id);
536 switch ($this->
type) {
540 return sprintf(
"<%s>%s</%s>", $this->
id, $v, $this->
id);
543 $xmlvalues = array();
546 foreach ($av as $k => $col) {
547 $xmlvalues = array();
548 foreach ($col as $aid => $aval) {
550 if (empty($opt->exportAttributes[$doc->fromid]) || in_array($aid, $opt->exportAttributes[$doc->fromid])) {
552 $xmlvalues[] = $oa->getXmlValue($doc, $opt);
555 $axml[] = sprintf(
"<%s>%s</%s>", $this->
id, implode(
"\n", $xmlvalues) , $this->
id);
558 return implode(
"\n", $axml);
563 if ($opt->withIdentifier) {
571 $href = $base . str_replace(
'&',
'&', $doc->
getFileLink($this->id));
572 if ($opt->withFile) {
575 if (is_file(
$path)) {
577 return sprintf(
'<%s vid="%s" mime="%s" title="%s">[FILE64:%s]</%s>', $this->
id, $vid, $mime, $name,
$path, $this->
id);
579 return sprintf(
'<%s vid="%s" mime="%s" title="%s">%s</%s>', $this->
id, $vid, $mime, $name, base64_encode(file_get_contents(
$path)) , $this->
id);
582 return sprintf(
'<!-- file not found --><%s vid="%s" mime="%s" title="%s"/>', $this->
id, $vid, $mime, $name, $this->
id);
585 return sprintf(
'<%s vid="%s" mime="%s" href="%s" title="%s"/>', $this->
id, $vid, $mime, $href, $this->
encodeXml($name));
588 return sprintf(
"<%s>%s</%s>", $this->
id, $v, $this->
id);
594 return sprintf(
'<%s xsi:nil="true"/>', $this->
id);
606 $latestTitle = ($this->
getOption(
"docrev",
"latest") ==
"latest");
609 if (
$info[
"locked"] == - 1) {
614 if ($opt->withIdentifier) {
615 return sprintf(
'<%s id="%s" name="%s">%s</%s>', $this->
id,
$docid,
$info[
"name"], $this->
encodeXml(
$info[
"title"]) , $this->
id);
617 return sprintf(
'<%s name="%s">%s</%s>', $this->
id,
$info[
"name"], $this->
encodeXml(
$info[
"title"]) , $this->
id);
620 if ($opt->withIdentifier) {
621 return sprintf(
'<%s id="%s">%s</%s>', $this->
id,
$docid, $this->
encodeXml(
$info[
"title"]) , $this->
id);
624 return sprintf(
'<%s>%s</%s>', $this->
id, $this->
encodeXml(
$info[
"title"]) , $this->
id);
628 if ((strpos($v,
'<BR>') ===
false) && (strpos($v,
"\n") ===
false)) {
629 return sprintf(
'<%s id="%s">%s</%s>', $this->
id, $v, _(
"unreferenced document") , $this->
id);
632 $tids = explode(
"\n", str_replace(
'<BR>',
"\n", $v));
636 foreach ($tids as
$id) {
640 if ($lName) $foundName =
true;
643 if ($opt->withIdentifier) {
644 $sIds = sprintf(
'id="%s"', implode(
',', $mId));
649 $sName = sprintf(
'name="%s"', implode(
',', $mName));
651 return sprintf(
'<%s %s %s>%s</%s>', $this->
id, $sName, $sIds, _(
"multiple document") , $this->
id);
656 return sprintf(
"<%s>%s</%s>", $this->
id, $this->
encodeXml($v) , $this->
id);
669 $lay->set(
"maxlength",
false);
670 $lay->set(
"pattern",
false);
685 foreach (
$la as $k => $v) {
691 $lay->setBlockData(
"enums", $te);
704 $lay->set(
"famid", $this->format);
805 $lay->set(
"minOccurs",
"0");
806 $lay->set(
"maxOccurs",
"unbounded");
808 foreach (
$la as $k => $v) {
809 if ($v->fieldSet && $v->fieldSet->id == $this->id) {
811 "axs" => $v->getXmlSchema(
$la)
815 $lay->setBlockData(
"ATTR", $tax);
835 $decimalSeparator = isset($configuration[
'decimalSeparator']) ? $configuration[
'decimalSeparator'] :
'.';
837 if (in_array($this->
type, array(
845 $fc = new \FormatCollection();
846 $stripHtmlTags = isset($configuration[
'stripHtmlTags']) ? $configuration[
'stripHtmlTags'] :
false;
847 $fc->stripHtmlTags($stripHtmlTags);
849 $fc->setDecimalSeparator($decimalSeparator);
851 $dateFormat = isset($configuration[
'dateFormat']) ? $configuration[
'dateFormat'] :
'US';
853 if ($dateFormat ==
'US') {
855 } elseif ($dateFormat ==
"ISO") {
857 } elseif ($dateFormat ==
'FR') {
862 if (isset($configuration[
'longtextMultipleBrToCr'])) {
863 $fc->setLongtextMultipleBrToCr($configuration[
'longtextMultipleBrToCr']);
865 $fc->setLongtextMultipleBrToCr(
" ");
872 return \FormatCollection::getDisplayValue(
$info, $this, $index, $configuration);
881 $numberValue = sprintf($this->format, $numberValue);
883 } elseif ($this->
isMultiple() && $this->format) {
885 foreach ($cellValues as & $cell) {
886 $cell = sprintf($this->format, $cell);
888 $numberValue = implode(
"\n", $cellValues);
892 $numberValue = sprintf($this->format, $numberValue);
896 if (!empty($decimalSeparator)) {
897 $numberValue = str_replace(
".", $decimalSeparator, $numberValue);
908 return ($this->fieldSet && $this->fieldSet->type ===
"array");
919 $cached = self::_cacheFetch(self::_cEnum, array(
922 ) , null, $returnDisabled);
923 if ($cached !== null) {
927 if (($this->
type ==
"enum") || ($this->
type ==
"enumlist")) {
929 $this->
enum = array();
930 $this->enumlabel = array();
931 $br = $this->docname .
'#' . $this->
id .
'#';
932 if ($this->originalPhpfile && $this->originalPhpfunc) {
936 if (($this->phpfile !=
"") && ($this->phpfile !=
"-")) {
938 if (!include_once (
"EXTERNALS/$this->phpfile")) {
943 $action->exitError(sprintf(_(
"the external pluggin file %s cannot be read") , $this->phpfile));
945 if (preg_match(
'/(.*)\((.*)\)/', $this->phpfunc, $reg)) {
946 $args = explode(
",", $reg[2]);
947 if (preg_match(
'/linkenum\((.*),(.*)\)/', $this->phpfunc, $dreg)) {
948 $br = $dreg[1] .
'#' . strtolower($dreg[2]) .
'#';
950 if (function_exists($reg[1])) {
954 $this->phpfunc = call_user_func_array($reg[1],
$args);
958 AddWarningMsg(sprintf(_(
"function [%s] not exists") , $this->phpfunc));
962 AddWarningMsg(sprintf(_(
"invalid syntax for [%s] for enum attribute [%s]") , $this->phpfunc, $this->
id));
964 self::_cacheStore(self::_cEnum, array(
968 self::_cacheStore(self::_cEnumLabel, array(
971 ) , $this->enumlabel);
974 $famId = $this->_getRecursiveParentFamHavingAttribute($this->
docid, $this->
id);
976 $cached = self::_cacheFetch(self::_cEnum, array(
979 ) , null, $returnDisabled);
980 if ($cached !== null) {
984 $sql = sprintf(
"select * from docenum where famid=%d and attrid='%s' order by eorder",
$famId, pg_escape_string($this->
id));
988 foreach ($enums as $k => $item) {
989 $enums[$k][
"keyPath"] = str_replace(
'.',
'\\.', $item[
"key"]);
991 foreach ($enums as $item) {
992 $enumKey = $item[
"key"];
993 $enumPath = $item[
"keyPath"];
994 $translatedEnumValue = _($br . $enumKey);
995 if ($translatedEnumValue != $br . $enumKey) {
996 $enumLabel = $translatedEnumValue;
998 $enumLabel = $item[
"label"];
1000 if ($item[
"parentkey"] !== null) {
1001 $this->
enum[$this->getCompleteEnumKey($enumKey, $enums) ] = $enumLabel;
1002 $enumCompleteLabel = $this->getCompleteEnumlabel($enumKey, $enums, $br);
1003 $this->enumlabel[$enumKey] = $enumCompleteLabel;
1005 $this->
enum[$enumPath] = $enumLabel;
1006 $this->enumlabel[$enumKey] = $enumLabel;
1009 self::_cacheStore(self::_cEnum, array(
1013 self::_cacheStore(self::_cEnumLabel, array(
1016 ) , $this->enumlabel);
1019 if (!$returnDisabled) {
1020 return self::_cacheFetch(self::_cEnum, array(
1023 ) , null, $returnDisabled);
1028 private function getCompleteEnumKey($key, array & $enums)
1030 foreach ($enums as $item) {
1031 if ($item[
"key"] === $key) {
1032 if ($item[
"parentkey"] !== null) {
1034 return sprintf(
"%s.%s", $this->getCompleteEnumKey($item[
"parentkey"], $enums) , $item[
"keyPath"]);
1036 return $item[
"keyPath"];
1042 private function getCompleteEnumLabel($key, array & $enums,
$prefix)
1044 foreach ($enums as $item) {
1045 if ($item[
"key"] === $key) {
1046 $translatedEnumValue = _(
$prefix . $key);
1047 if ($translatedEnumValue !=
$prefix . $key) {
1048 $label = $translatedEnumValue;
1050 $label = $item[
"label"];
1052 if ($item[
"parentkey"] !== null) {
1054 return sprintf(
"%s/%s", $this->getCompleteEnumLabel($item[
"parentkey"], $enums,
$prefix) , $label);
1067 self::_cacheFlush(self::_cEnum);
1068 self::_cacheFlush(self::_cEnumLabel);
1069 self::_cacheFlush(self::_cParent);
1082 $this->
getEnum($returnDisabled);
1084 $cached = self::_cacheFetch(self::_cEnumLabel, array(
1087 ) , null, $returnDisabled);
1088 if ($cached === null) {
1089 $famId = $this->_getRecursiveParentFamHavingAttribute($this->
docid, $this->
id);
1091 $cached = self::_cacheFetch(self::_cEnumLabel, array(
1094 ) , null, $returnDisabled);
1097 if ($cached !== null) {
1098 if ($enumid === null) {
1101 if (strstr($enumid,
"\n")) {
1102 $enumid = explode(
"\n", $enumid);
1105 if (is_array($enumid)) {
1107 foreach ($enumid as $v) {
1108 $tv[] = (isset($cached[$v])) ? $cached[$v] : $v;
1111 return implode(
"\n", $tv);
1115 return (array_key_exists($enumid, $cached)) ? $cached[$enumid] : $enumid;
1133 if ($key ==
"")
return "";
1142 if (!
$a->isAffected()) {
1146 $err = sprintf(_(
"unknow attribute %s (family %s)") , $attrId,
$famId);
1150 if (
$a->isAffected()) {
1159 $key = str_replace(array(
1164 $label = str_replace(array(
1169 if (!
$oe->isAffected()) {
1170 $oe->attrid = $attrId;
1173 $oe->label = $label;
1178 $cachedEnum = self::_cacheFetch(self::_cEnum, array(
1182 $cachedEnumLabel = self::_cacheFetch(self::_cEnumLabel, array(
1186 $cachedEnum[$key] = $label;
1187 $cachedEnumLabel[$key] = $label;
1188 self::_cacheStore(self::_cEnum, array(
1192 self::_cacheStore(self::_cEnumLabel, array(
1195 ) , $cachedEnumLabel);
1199 $err = sprintf(_(
"unknow attribute %s (family %s)") , $attrId,
$famId);
1203 private function _getRecursiveParentFamHavingAttribute(
$famId, $attrId)
1205 $cached = self::_cacheFetch(self::_cParent, array(
1209 if ($cached !== null) {
1213 WITH RECURSIVE parent_attr(fromid,
docid,
id) AS (
1222 docattr.docid = docfam.
id
1237 docattr.docid = parent_attr.fromid
1239 parent_attr.fromid = docfam.
id
1241 SELECT docid FROM parent_attr WHERE
id = '%s' LIMIT 1;
1243 $sql = sprintf(
$sql, pg_escape_string(
$famId) , pg_escape_string($attrId));
1244 $parentFamId =
false;
1246 if ($parentFamId !== false) {
1247 self::_cacheStore(self::_cParent, array(
1252 return $parentFamId;
1256 $parentFamId = $this->_getRecursiveParentFamHavingAttribute(
$famId, $attrId);
1257 if ($parentFamId ===
false) {
1281 return isset($enumKeys[$key]);
1289 private static function _cacheKey($k)
1291 if (is_scalar($k)) {
1293 }
else if (is_array($k)) {
1294 return implode(
':', $k);
1296 return serialize($k);
1305 private static function _cacheExists($cacheId, $k)
1307 $k = self::_cacheKey($k);
1308 return isset(self::$_cache[$cacheId][$k]);
1318 private static function _cacheStore($cacheId, $k, $v)
1320 $k = self::_cacheKey($k);
1321 self::$_cache[$cacheId][$k] = $v;
1333 private static function _cacheFetch($cacheId, $k, $onCacheMiss = null, $returnDisabled =
true)
1335 if (self::_cacheExists($cacheId, $k)) {
1336 $ks = self::_cacheKey($k);
1337 if (!$returnDisabled) {
1341 if (!empty($disabledKeys)) {
1342 $cached = self::$_cache[$cacheId][$ks];
1343 foreach ($disabledKeys as $dKey) {
1344 unset($cached[$dKey]);
1350 return self::$_cache[$cacheId][$ks];
1352 return $onCacheMiss;
1361 private static function _cacheRemove($cacheId, $k)
1363 if (self::_cacheExists($cacheId, $k)) {
1364 $k = self::_cacheKey($k);
1365 unset(self::$_cache[$cacheId][$k]);
1375 private static function _cacheFlush($cacheId = null)
1377 if ($cacheId === null) {
1378 self::$_cache = array();
1380 self::$_cache[$cacheId] = array();
1409 $this->labelText = $label;
1427 $lay->set(
"aname", $this->
id);
1430 $lay->set(
"minOccurs",
"0");
1431 $lay->set(
"maxOccurs",
"1");
1432 $lay->set(
"notop", ($this->fieldSet->id !=
'' && $this->fieldSet->id != Adoc::HIDDENFIELD));
1434 foreach (
$la as $k => $v) {
1435 if ($v->fieldSet && $v->fieldSet->id == $this->id) {
1437 "axs" => $v->getXmlSchema(
$la)
1442 $lay->setBlockData(
"ATTR", $tax);
1457 $xmlvalues = array();
1458 foreach (
$la as $k => $v) {
1462 if ($v->fieldSet && $v->fieldSet->id == $this->id && (empty($opt->exportAttributes[$doc->fromid]) || in_array($v->id, $opt->exportAttributes[$doc->fromid]))) {
1463 $value = $v->getXmlValue($doc, $opt);
1464 if ($v->type ==
"htmltext" && $opt !==
false) {
1466 if ($opt->withFile) {
1467 $value = preg_replace_callback(
'/(<img.*?)src="(((?=.*docid=(.*?)&)(?=.*attrid=(.*?)&)(?=.*index=(-?[0-9]+)))|(file\/(.*?)\/[0-9]+\/(.*?)\/(-?[0-9]+))).*?"/',
function ($matches) use ($opt)
1469 if (isset($matches[7])) {
1471 $attrid = $matches[9];
1472 $index = $matches[10] ==
"-1" ? 0 : $matches[10];
1475 $index = $matches[6] ==
"-1" ? 0 : $matches[6];
1476 $attrid = $matches[5];
1481 $f = $tfiles[$index];
1482 if (is_file($f[
"path"])) {
1483 if ($opt->outFile) {
1484 return sprintf(
'%s title="%s" src="data:%s;base64,[FILE64:%s]"',
"\n" . $matches[1],
unaccent($f[
"name"]) , $f[
"mime_s"], $f[
"path"]);
1486 return sprintf(
'%s title="%s" src="data:%s;base64,%s"',
"\n" . $matches[1],
unaccent($f[
"name"]) , $f[
"mime_s"], base64_encode(file_get_contents($f[
"path"])));
1489 return sprintf(
'%s title="%s" src="data:%s;base64,file not found"',
"\n" . $matches[1],
unaccent($f[
"name"]) , $f[
"mime_s"]);
1498 if ($opt->flat)
return implode(
"\n", $xmlvalues);
1499 else return sprintf(
"<%s>%s</%s>", $this->
id, implode(
"\n", $xmlvalues) , $this->
id);
1511 $this->labelText = $label;
1512 $this->ordered = $order;
1513 $this->link =
$link;
1517 $this->
type =
"menu";
1532 $this->labelText = $label;
1534 $this->ordered = $order;
1539 $this->
type =
"action";
1545 $batch = ($this->
getOption(
"batchfolder") ==
"yes");
1553 if (!stristr($this->waction,
"&id=")) $l.=
"&id=" .
$docid;
1600 if (!$phpfunc)
return array();
1601 if (preg_match(
'/^\[[a-z]*\](.*)/', $phpfunc, $reg)) {
1607 $theEnumlabel = array();
1609 $sphpfunc = str_replace(
"\\.",
"-dot-", $phpfunc);
1610 $sphpfunc = str_replace(
"\\,",
"-comma-", $sphpfunc);
1611 if ($sphpfunc ==
"-") $sphpfunc =
"";
1612 if ($sphpfunc !=
"") {
1613 $tenum = explode(
",", $sphpfunc);
1614 foreach ($tenum as $k => $v) {
1615 list($enumKey, $enumValue) = explode(
"|", $v, 2);
1616 $treeKeys = explode(
".", $enumKey);
1617 $enumKey = trim($enumKey);
1618 if (strlen($enumKey) == 0) $enumKey =
" ";
1619 $enumValue = trim($enumValue);
1621 $n = count($treeKeys);
1623 $enumValue = str_replace(array(
1632 $translatedEnumValue = _(
$locale . $enumKey);
1633 if ($translatedEnumValue !=
$locale . $enumKey) {
1634 $enumValue = $translatedEnumValue;
1638 $theEnum[str_replace(array(
1644 ) , $enumKey) ] = $enumValue;
1645 $theEnumlabel[str_replace(array(
1651 ) , $enumKey) ] = $enumValue;
1656 foreach ($treeKeys as $i => $treeKey) {
1657 $enumlabelKey = $treeKey;
1666 $tmpKey = str_replace(array(
1675 $translatedEnumValue = _(
$locale . $enumlabelKey);
1676 if ($translatedEnumValue !=
$locale . $enumlabelKey) {
1677 $enumValue = $translatedEnumValue;
1680 $enumlabelValue = $theEnum[$tmpKey] .
'/' . $enumValue;
1681 $enumlabelValue = str_replace(array(
1687 ) , $enumlabelValue);
1688 $theEnum[str_replace(array(
1694 ) , $enumKey) ] = $enumValue;
1695 $theEnumlabel[str_replace(array(
1701 ) , $enumlabelKey) ] = $enumlabelValue;
1709 private static function getEnumHierarchy($key, $parents)
1711 if (isset($parents[$key])) {
1712 return array_merge(self::getEnumHierarchy($parents[$key], $parents) , array(
1729 $sql = sprintf(
"select * from docenum where famid='%s' and attrid='%s' and (disabled is null or not disabled) order by eorder", pg_escape_string(
$famid) , pg_escape_string($attrid));
1732 $hierarchy = array();
1733 foreach ($results as $item) {
1734 if ($item[
"parentkey"] !== null) {
1735 $hierarchy[$item[
"key"]] = $item[
"parentkey"];
1738 foreach ($results as $item) {
1739 $key = $item[
"key"];
1740 $label = $item[
"label"];
1741 if ($item[
"parentkey"] !== null) {
1742 $parents = self::getEnumHierarchy($key, $hierarchy);
1743 foreach ($parents as & $pKey) {
1744 $pKey = str_replace(
".",
'-dot-', $pKey);
1746 $key = implode(
'.', $parents);
1747 $key = str_replace(
'-dot-',
'\\.', $key);
1749 $key = str_replace(
'.',
'\\.', $key);
1751 $tItems[] = sprintf(
"%s|%s", str_replace(
',',
'\\,', $key) , str_replace(
',',
'\\,', $label));
1753 return implode(
",", $tItems);
Layout is a template generator.
vault_properties(NormalAttribute $attr)
if(substr($wsh, 0, 1)!= '/') $args
static encodeXml($s, $quot=false)
getTDoc($dbaccess, $id, $sqlfilters=array(), $result=array())
getXmlValue(Doc &$doc, $opt=false)
getLastTitle($id="-1", $def="")
& getAttribute($idAttr, &$oa=null, $useMask=true)
stringDateToIso($date, $format=false, $withT=false)
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
__construct($id, $docid, $label, $visibility="", $usefor="", $type="frame", &$fieldSet=null, $options="", $docname="")
getEnum($returnDisabled=true)
static getDisabledKeys($famId, $attrid)
common_getXmlSchema(&$play)
getEnumLabel($enumid=null, $returnDisabled=true)
getArrayRawValues($idAttr, $index=-1)
if($app->id > 0) return false
getLayoutFile($app, $layfile)
__construct($id, $docid, $label, $order, $visibility="", $wapplication="", $waction="", $precond="", $options="", $docname="")
common_getXmlSchema(&$play)
getMultipleRawValues($idAttr, $def="", $index=-1)
getParam($name, $def="")
must be in core or global type
addEnum($dbaccess, $key, $label)
__construct($id, $docid, $label, $type, $format, $repeat, $order, $link, $visibility, $needed, $isInTitle, $isInAbstract, &$fieldSet, $phpfile, $phpfunc, $elink, $phpconstraint="", $usefor="", $eformat="", $options="", $docname="")
getFileLink($attrid, $index=-1, $cache=false, $inline=false, $otherValue= '', $info=null)
getTextualValue(Doc $doc, $index=-1, Array $configuration=array())
existEnum($key, $completeKey=true)
getTextualValue(Doc $doc, $index=-1, Array $configuration=array())
new_Doc($dbaccess, $id= '', $latest=false)
getNameFromId($dbaccess, $id)
getNumberValue(Doc $doc, $index=-1, $decimalSeparator=".")
& getAttributes($useMask=true)
$textualValueMultipleSeparator
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
if($file) if($subject==""&&$file) if($subject=="") $err
__construct($id, $docid, $label)
getRawValue($idAttr, $def="")
getXmlValue(Doc &$doc, $opt=false)
prepareHtmltextForExport($value)
vault_filename_fromvalue($fileid, $path=false)
getXmlValue(Doc &$doc, $opt=false)