File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 11<txp:etc_cache id="crowdin" time="-3600">
22<txp:php>
33$key = parse('<txp:yield name="api-key" />');
4- $xml = new SimpleXMLElement('https://api.crowdin.com/api/project/textpattern-cms-textpacks/status?key='.$key.'&xml', 0, TRUE);
4+
5+ try {
6+ $xml = new SimpleXMLElement('https://api.crowdin.com/api/project/textpattern-cms-textpacks/status?key='.$key.'&xml', 0, TRUE);
7+ } catch (Exception $e) {
8+ return;
9+ }
10+
511echo <<<EOHTML
612<div class="tabular-data">
713 <table>
@@ -22,11 +28,15 @@ echo <<<EOHTML
2228EOHTML;
2329
2430foreach ($xml->language as $languageElement) {
31+ $name = htmlspecialchars($languageElement->name);
32+ $code = htmlspecialchars($languageElement->code);
33+ $progress = htmlspecialchars($languageElement->translated_progress);
34+
2535 echo <<<EOHTML
26- <tr id="{$languageElement->code}" >
27- <th scope="row">{$languageElement-> name}</th>
28- <td><code>{$languageElement-> code}</code></td>
29- <td><progress value="{$languageElement->translated_progress }" max="100"></progress> <b class="data-progress" data-progress="{$languageElement->translated_progress }">{$languageElement->translated_progress }%</b> <a class="button button-small button-list" rel="external" href="https://crowdin.com/project/textpattern-cms-textpacks/{$languageElement-> code}">Translate</a></td>
36+ <tr>
37+ <th scope="row">{$name}</th>
38+ <td><code>{$code}</code></td>
39+ <td><progress value="{$progress }" max="100"></progress> <b class="data-progress" data-progress="{$progress }">{$progress }%</b> <a class="button button-small button-list" rel="external" href="https://crowdin.com/project/textpattern-cms-textpacks/{$code}">Translate</a></td>
3040</tr>
3141
3242EOHTML;
You can’t perform that action at this time.
0 commit comments