@@ 135-144 (lines=10) @@ | ||
132 | $this->title = $storage['title'] ?? ''; |
|
133 | } |
|
134 | preg_match_all('/<!-- lang (.*) -->/', $code, $matchList); |
|
135 | if (isset($matchList[1])) { |
|
136 | foreach ($matchList[1] as $key => $index) { |
|
137 | $name = explode('>', $index); |
|
138 | $default = trim($name[1] ?? ''); |
|
139 | $name = trim($name[0]); |
|
140 | if (!empty($matchList[0][$key]) && false !== strpos($code, $matchList[0][$key])) { |
|
141 | $code = str_replace($matchList[0][$key], $storage[$name] ?? $default, $code); |
|
142 | } |
|
143 | } |
|
144 | } |
|
145 | } else { |
|
146 | preg_match_all('/<!-- lang (.*) -->/', $code, $matchList); |
|
147 | if (isset($matchList[1])) { |
|
@@ 145-157 (lines=13) @@ | ||
142 | } |
|
143 | } |
|
144 | } |
|
145 | } else { |
|
146 | preg_match_all('/<!-- lang (.*) -->/', $code, $matchList); |
|
147 | if (isset($matchList[1])) { |
|
148 | foreach ($matchList[1] as $key => $index) { |
|
149 | $name = explode('>', $index); |
|
150 | $default = trim($name[1] ?? ''); |
|
151 | $name = trim($name[0]); |
|
152 | if (!empty($matchList[0][$key]) && false !== strpos($code, $matchList[0][$key])) { |
|
153 | $code = str_replace($matchList[0][$key], $this->$name ?? $default, $code); |
|
154 | } |
|
155 | } |
|
156 | } |
|
157 | } |
|
158 | ||
159 | if ($processInclude) { |
|
160 | preg_match_all('/<!-- include (.*) -->/', $code, $matchList); |