forked from islamic-network/alquran.cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
other.php
122 lines (103 loc) · 4.37 KB
/
other.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
$app->get('/', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'home.php', [
'pageTitle' => 'Al Quran Cloud',
'metaDescription' => 'AlQuran Cloud - A resource to read, hear and progamatically interact with the Quran',
'view' => 'home'
]);
});
$app->get('/adhans', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'adhans.php', [
'pageTitle' => 'Adhan Player',
'metaDescription' => 'Listen to Adhans',
'view' => 'adhans'
]);
});
$app->get('/api', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'api.php', [
'pageTitle' => 'Quran API',
'metaDescription' => 'A RESTful Quran API to retrieve an Ayah, Surah, Juz or the enitre Holy Quran',
'view' => 'api'
]);
});
$app->get('/about', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'about.php', [
'pageTitle' => 'About Al Quran Cloud',
'metaDescription' => 'Al Quran Cloud is an online Quran resource',
'view' => 'home'
]);
});
$app->get('/cdn', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'cdn.php', [
'pageTitle' => 'Al Quran Cloud Content Delivery Network',
'metaDescription' => 'The Al Quran Cloud Content Delivery Network for Quran Recitation Audio Files and Quran Ayah Images',
'view' => 'cdn'
]);
});
$app->get('/api-clients', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'api-client.php', [
'pageTitle' => 'Al Quran Cloud API Clients',
'metaDescription' => 'API Clients and Code Samples to interact with the API',
'view' => 'api'
]);
});
$app->get('/download-media', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'download-media.php', [
'pageTitle' => 'Download Media',
'metaDescription' => 'Download Audio Files and Quran Ayah Images',
'view' => 'api'
]);
});
$app->get('/tajweed-guide', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'tajweed-guide.php', [
'pageTitle' => 'Tajweed Guide',
'metaDescription' => 'How to Parse and Dispaly Quran Tajweed text',
'view' => 'api'
]);
});
$app->get('/contact', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'contact.php', [
'pageTitle' => 'Contact',
'metaDescription' => 'Contact Information',
'view' => 'home'
]);
});
$app->get('/terms-and-conditions', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'terms-and-conditions.php', [
'pageTitle' => 'Terms and Conditions',
'metaDescription' => 'Terms and Conditions',
'view' => 'home'
]);
});
$app->get('/contributors', function ($request, $response, $args) {
return $this->get('renderer')->render($response, 'contributors.php', [
'pageTitle' => 'Al Quran Cloud Contributors',
'metaDescription' => 'Contributors to the Al Quran Cloud',
'view' => 'home'
]);
});
$app->get('/liveness', function ($request, $response) {
$response->getBody()->write(json_encode('OK'));
$response->withStatus(200);
return $response;
});
$app->get('/arabic-font-edition-tester', function ($request, $response, $args) {
if (isset($request->getQueryParams()['reference']) && $request->getQueryParams()['reference'] !== null && $request->getQueryParams()['reference'] != '') {
$reference = urldecode($request->getQueryParams()['reference']);
} else {
$reference = '24:35';
}
$ayah = $this->get('client')->AlQuranCloudApi->ayah($reference, 'quran-uthmani-quran-academy');
return $this->get('renderer')->render($response, 'arabic-script-checker.php', [
'pageTitle' => 'Arabic Font Edition Tester - ' . $ayah->data->surah->englishName . ' Ayah ' . $ayah->data->numberInSurah . ' (' . $ayah->data->surah->number . ':' . $ayah->data->numberInSurah . ')',
'metaDescription' => 'AlQuran Cloud',
'ayah' => $ayah,
'reference' => $reference,
'editions' => [
'editions' => $this->get('client')->AlQuranCloudApi->editions(null, null, 'text'),
],
'view' => 'api'
]);
});