26 foreach ($modules as $module) {
27 foreach ($module->attr_collections as $coll_i => $coll) {
28 if (!isset($this->info[$coll_i])) {
29 $this->info[$coll_i] = array();
31 foreach ($coll as $attr_i => $attr) {
32 if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) {
34 $this->info[$coll_i][$attr_i] = array_merge(
35 $this->info[$coll_i][$attr_i],
40 $this->info[$coll_i][$attr_i] = $attr;
45 foreach ($this->info as $name => $attr) {
60 if (!isset($attr[0])) {
66 for ($i = 0; isset($merge[$i]); $i++) {
67 if (isset($seen[$merge[$i]])) {
70 $seen[$merge[$i]] =
true;
72 if (!isset($this->info[$merge[$i]])) {
75 foreach ($this->info[$merge[$i]] as $key => $value) {
76 if (isset($attr[$key])) {
81 if (isset($this->info[$merge[$i]][0])) {
83 $merge = array_merge($merge, $this->info[$merge[$i]][0]);
101 foreach ($attr as $def_i => $def) {
107 if (isset($processed[$def_i])) {
112 if ($required = (strpos($def_i,
'*') !==
false)) {
114 unset($attr[$def_i]);
115 $def_i = trim($def_i,
'*');
116 $attr[$def_i] = $def;
119 $processed[$def_i] =
true;
122 if (is_object($def)) {
124 $attr[$def_i]->required = ($required || $attr[$def_i]->required);
128 if ($def ===
false) {
129 unset($attr[$def_i]);
133 if (
$t = $attr_types->get($def)) {
135 $attr[$def_i]->required = $required;
137 unset($attr[$def_i]);
performInclusions(&$attr)
Takes a reference to an attribute associative array and performs all inclusions specified by the zero...
$info
Associative array of attribute collections, indexed by name.
__construct($attr_types, $modules)
Performs all expansions on internal data for use by other inclusions It also collects all attribute c...
Defines common attribute collections that modules reference.
expandIdentifiers(&$attr, $attr_types)
Expands all string identifiers in an attribute array by replacing them with the appropriate values in...