-
Notifications
You must be signed in to change notification settings - Fork 3
/
admin_backend.php
58 lines (50 loc) · 1.43 KB
/
admin_backend.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
<?php
$content = collect(get_content())->groupBy('content_type');
$translations = collect(DB::table('translations')->get());
$translatedContent = array();
foreach (multilang_locales() as $lang) {
$translatedContent[$lang] = $translations
->where('translatable_type', 'content')
->where('lang', $lang)
->pluck('translatable_id');
}
?>
<div class="mw-module-admin-wrap">
<module type="admin/modules/info" />
<?php require 'admin_settings.php'; ?>
<h3>
Available Translations
(<?php echo $translations->count(); ?>)
</h3>
<?php foreach($content as $contentType => $content): ?>
<h4><?php echo ucfirst( str_plural($contentType) ); ?></h4>
<table class="mw-ui-table" style="text-align: center;">
<thead>
<tr>
<th width="30%"> </th>
<?php foreach (multilang_locales() as $lang): ?>
<th class="mw-language-tag"><?php echo $lang; ?></th>
<?php endforeach; ?>
</tr>
<thead>
<tbody>
<?php foreach ($content as $item): ?>
<tr>
<td align="right">
<a href="<?php echo $item['url']; ?>" target="_blank">
<?php echo str_limit($item['title'], 32); ?>
</a>
</td>
<?php foreach (multilang_locales() as $lang): ?>
<td>
<?php if($lang == config('app.fallback_locale') || $translatedContent[$lang]->search($item['id'])): ?>
<span class="mw-icon mw-icon-check"></span>
<?php endif; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
</div>