25 foreach ($module->attr_collections as $coll_i => $coll) {
26 if (!isset($this->info[$coll_i])) {
27 $this->info[$coll_i] = array();
29 foreach ($coll as $attr_i => $attr) {
30 if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) {
32 $this->info[$coll_i][$attr_i] = array_merge(
33 $this->info[$coll_i][$attr_i], $attr);
36 $this->info[$coll_i][$attr_i] = $attr;
41 foreach ($this->info as $name => $attr) {
55 if (!isset($attr[0]))
return;
59 for (
$i = 0; isset($merge[
$i]); $i++) {
60 if (isset($seen[$merge[$i]]))
continue;
61 $seen[$merge[
$i]] =
true;
63 if (!isset($this->info[$merge[$i]]))
continue;
64 foreach ($this->info[$merge[$i]] as $key => $value) {
65 if (isset($attr[$key]))
continue;
68 if (isset($this->info[$merge[$i]][0])) {
70 $merge = array_merge($merge, $this->info[$merge[$i]][0]);
88 foreach ($attr as $def_i => $def) {
90 if ($def_i === 0)
continue;
92 if (isset($processed[$def_i]))
continue;
95 if ($required = (strpos($def_i,
'*') !==
false)) {
98 $def_i = trim($def_i,
'*');
102 $processed[$def_i] =
true;
105 if (is_object($def)) {
107 $attr[$def_i]->required = ($required || $attr[$def_i]->required);
111 if ($def ===
false) {
112 unset($attr[$def_i]);
116 if ($t = $attr_types->get($def)) {
118 $attr[$def_i]->required = $required;
120 unset($attr[$def_i]);