| @@ 96-102 (lines=7) @@ | ||
| 93 | { |
|
| 94 | $points = array(); |
|
| 95 | ||
| 96 | foreach ($types as $type => $data) { |
|
| 97 | if (!isset($data['autodetect'])) { |
|
| 98 | continue; |
|
| 99 | } |
|
| 100 | ||
| 101 | $points[$type] = $this->getSimilarityPoints($data['autodetect'], $name, $type); |
|
| 102 | } |
|
| 103 | ||
| 104 | if (max($points) > 0) { |
|
| 105 | $this->setTypeReason($name, 'similar to one in admin.fields'); |
|
| @@ 134-144 (lines=11) @@ | ||
| 131 | { |
|
| 132 | // if (!isset($types['autodetect']) || empty($types['autodetect'])) return false; |
|
| 133 | ||
| 134 | foreach ($types as $type => $data) { |
|
| 135 | if (!isset($data['autodetect'])) { |
|
| 136 | continue; |
|
| 137 | } |
|
| 138 | ||
| 139 | if (in_array($name, $data['autodetect'])) { |
|
| 140 | $this->setTypeReason($name, 'set by user in admin.fields'); |
|
| 141 | ||
| 142 | return $type; |
|
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | return false; |
|
| 147 | } |
|