|
1 | 1 | <txp:evaluate query='"<txp:page_url type="3" />" = "json"'> |
2 | 2 | <txp:output_form form="json_card_reader" /> |
3 | 3 | <txp:variable name="body"><txp:article><txp:body /></txp:article></txp:variable> |
4 | | -<txp:header name="Content-Type" value="application/json; charset=utf-8" />{ |
5 | | - "name": "<txp:article_url_title escape="json" />", |
6 | | -<txp:if_variable name="json-require-plugin"> |
7 | | - "require": { |
8 | | - "<txp:variable name="json-require-plugin" escape="json" />": "<txp:if_variable name="json-require-match" value="greater than">></txp:if_variable><txp:if_variable name="json-require-match" value="at least">>=</txp:if_variable><txp:if_variable name="json-require-match" value="less than"><</txp:if_variable><txp:if_variable name="json-require-match" value="no greater than"><=</txp:if_variable><txp:if_variable name="json-require-match" value="equal">=</txp:if_variable><txp:variable name="json-require-version" escape="json" />" |
9 | | - }, |
10 | | -</txp:if_variable> |
11 | | -<txp:if_variable name="superseded-by-type"> |
12 | | - "supersededBy": { |
13 | | - "name": "<txp:variable name="superseded-by-type" escape="json" />", |
14 | | - "location": "<txp:variable name="superseded-by-location" escape="json" />" |
15 | | - }, |
16 | | -</txp:if_variable> |
17 | | -<txp:if_variable name="json-latest-is-beta"> |
18 | | - "beta": { |
19 | | - "version": "<txp:variable name="json-beta-version" escape="json" />", |
20 | | - <txp:if_variable name="json-beta-manifest">"phpHasManifest": 1,</txp:if_variable> |
21 | | - <txp:if_custom_field name="max-txp-version-verified-beta">"verifiedMaxTxpCompatibility": "<txp:custom_field name="max-txp-version-verified-beta" escape="json" />",</txp:if_custom_field> |
22 | | - <txp:if_variable name="json-beta-date">"datePublished": "<txp:variable name="json-beta-date" escape="json" />",</txp:if_variable> |
23 | | - <txp:if_variable name="json-beta-txt">"endpointUrl": "<txp:variable name="json-beta-txt" escape="json" />"<txp:else />"endpointUrl": "<txp:variable name="json-beta-php" escape="json" />"</txp:if_variable> |
24 | | - }, |
25 | | -</txp:if_variable> |
26 | | -<txp:if_variable name="json-stable-version"> |
27 | | - "stable": { |
28 | | - "version": "<txp:variable name="json-stable-version" escape="json" />", |
29 | | - <txp:if_variable name="json-stable-manifest">"phpHasManifest": 1,</txp:if_variable> |
30 | | - <txp:if_custom_field name="max-txp-version-verified">"verifiedMaxTxpCompatibility": "<txp:custom_field name="max-txp-version-verified" escape="json" />",</txp:if_custom_field> |
31 | | - <txp:if_custom_field name="min-txp-version-verified">"verifiedMinTxpCompatibility": "<txp:custom_field name="min-txp-version-verified" escape="json" />",</txp:if_custom_field> |
32 | | - <txp:if_variable name="json-stable-date">"datePublished": "<txp:variable name="json-stable-date" escape="json" />",</txp:if_variable> |
33 | | - <txp:if_variable name="json-stable-txt">"endpointUrl": "<txp:variable name="json-stable-txt" escape="json" />"<txp:else />"endpointUrl": "<txp:variable name="json-stable-php" escape="json" />"</txp:if_variable> |
34 | | - } |
35 | | -<txp:else /> |
36 | | - "beta": { |
37 | | - "version": "<txp:variable name="json-beta-version" escape="json" />", |
38 | | - <txp:if_variable name="json-beta-manifest">"phpHasManifest": 1,</txp:if_variable> |
39 | | - <txp:if_custom_field name="max-txp-version-verified-beta">"verifiedMaxTxpCompatibility": "<txp:custom_field name="max-txp-version-verified-beta" escape="json" />",</txp:if_custom_field> |
40 | | - <txp:if_custom_field name="min-txp-version-verified">"verifiedMinTxpCompatibility": "<txp:custom_field name="min-txp-version-verified" escape="json" />",</txp:if_custom_field> |
41 | | - <txp:if_variable name="json-beta-date">"datePublished": "<txp:variable name="json-beta-date" escape="json" />",</txp:if_variable> |
42 | | - <txp:if_variable name="json-beta-txt">"endpointUrl": "<txp:variable name="json-beta-txt" escape="json" />"<txp:else />"endpointUrl": "<txp:variable name="json-beta-php" escape="json" />"</txp:if_variable> |
43 | | - } |
44 | | -</txp:if_variable> |
45 | | -<txp:php> |
46 | | -global $gotFile; |
47 | | -global $json; |
48 | | - |
49 | | -$json2 = json_decode($gotFile, true); |
50 | | -$newJson = array(); |
51 | | - |
52 | | -if (!empty($json2['legacy'])) { |
53 | | - foreach ($json2['legacy'] as $txpBlock) { |
54 | | - foreach ($txpBlock as $txpver => $endpointData) { |
55 | | - $newJson['legacy'][$txpver]['version'] = txpspecialchars($endpointData['version']); |
56 | | - |
57 | | - if (!empty($endpointData['phpHasManifest'])) { |
58 | | - if ($endpointData['phpHasManifest'] = 1) { |
59 | | - $newJson['legacy'][$txpver]['phpHasManifest'] = txpspecialchars($endpointData['phpHasManifest']); |
60 | | - } |
61 | | - } |
62 | | - |
63 | | - if (!empty($endpointData['datePublished'])) { |
64 | | - $newJson['legacy'][$txpver]['datePublished'] = txpspecialchars($endpointData['datePublished']); |
65 | | - } |
66 | | - |
67 | | - if (!empty($endpointData['downloadUrlTxt'])) { |
68 | | - $newJson['legacy'][$txpver]['endpointUrl'] = txpspecialchars($endpointData['downloadUrlTxt']); |
69 | | - } elseif (!empty($endPointData['downloadUrlPhp'])) { |
70 | | - $newJson['legacy'][$txpver]['endpointUrl'] = txpspecialchars($endpointData['downloadUrlPhp']); |
71 | | - } |
72 | | - } |
73 | | - } |
74 | | - |
75 | | - $out = json_encode($newJson, JSON_PRETTY_PRINT); |
76 | | - echo ' ,'.trim($out, '{..}'); |
77 | | -} |
78 | | -</txp:php> |
79 | | -} |
| 4 | +<txp:header name="Content-Type" value="application/json; charset=utf-8" /><txp:output_form form="json_card" /> |
80 | 5 | <txp:else /> |
81 | 6 | <!DOCTYPE html> |
82 | 7 | <html lang="en-GB-oxendict"> |
|
0 commit comments