default.php
9.87 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$notice_homes = $this->homes == 2 || $this->homes == 1 || $this->homes - 1 != count($this->contentlangs) && ($this->language_filter || $this->switchers != 0);
$notice_disabled = !$this->language_filter && ($this->homes > 1 || $this->switchers != 0);
$notice_switchers = !$this->switchers && ($this->homes > 1 || $this->language_filter);
?>
<div class="mod-multilangstatus">
<?php if (!$this->language_filter && $this->switchers == 0) : ?>
<?php if ($this->homes == 1) : ?>
<div class="alert alert-info"><?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_NONE'); ?></div>
<?php else : ?>
<div class="alert alert-info"><?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_USELESS_HOMES'); ?></div>
<?php endif; ?>
<?php else : ?>
<table class="table table-striped table-condensed">
<tbody>
<?php if ($this->defaultHome == true) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_DEFAULT_HOME_MODULE_PUBLISHED'); ?>
</td>
</tr>
<?php endif; ?>
<?php if ($notice_homes) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_MISSING'); ?>
</td>
</tr>
<?php endif; ?>
<?php if ($notice_disabled) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED'); ?>
</td>
</tr>
<?php endif; ?>
<?php if ($notice_switchers) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_UNPUBLISHED'); ?>
</td>
</tr>
<?php endif; ?>
<?php foreach ($this->contentlangs as $contentlang) : ?>
<?php if (array_key_exists($contentlang->lang_code, $this->homepages) && (!array_key_exists($contentlang->lang_code, $this->site_langs) || !$contentlang->published)) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_CONTENT_LANGUAGE', $contentlang->lang_code); ?>
</td>
</tr>
<?php endif; ?>
<?php if (!array_key_exists($contentlang->lang_code, $this->site_langs)) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_LANGUAGE_TAG', $contentlang->lang_code); ?>
</td>
</tr>
<?php endif; ?>
<?php if ($contentlang->published == -2) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_CONTENT_LANGUAGE_TRASHED', $contentlang->lang_code); ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($this->listUsersError) : ?>
<tr class="warning">
<td>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR_TIP'); ?>
<ul>
<?php foreach ($this->listUsersError as $user) : ?>
<li>
<?php echo JText::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR', $user->name); ?>
</li>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<table class="table table-striped table-condensed" style="border-top: 1px solid #CCCCCC;">
<thead>
<tr>
<th>
<?php echo JText::_('JDETAILS'); ?>
</th>
<th class="center">
<?php echo JText::_('JSTATUS'); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER'); ?>
</th>
<td class="center">
<?php if ($this->language_filter) : ?>
<?php echo JText::_('JENABLED'); ?>
<?php else : ?>
<?php echo JText::_('JDISABLED'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
<th scope="row">
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_PUBLISHED'); ?>
</th>
<td class="center">
<?php if ($this->switchers != 0) : ?>
<?php echo $this->switchers; ?>
<?php else : ?>
<?php echo JText::_('JNONE'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
<th scope="row">
<?php if ($this->homes > 1) : ?>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_INCLUDING_ALL'); ?>
<?php else : ?>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED'); ?>
<?php endif; ?>
</th>
<td class="center">
<?php if ($this->homes > 1) : ?>
<?php echo $this->homes; ?>
<?php else : ?>
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_ALL'); ?>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
<table class="table table-striped table-condensed" style="border-top: 1px solid #CCCCCC;">
<thead>
<tr>
<th>
<?php echo JText::_('JGRID_HEADING_LANGUAGE'); ?>
</th>
<th class="center">
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_SITE_LANG_PUBLISHED'); ?>
</th>
<th class="center">
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_PUBLISHED'); ?>
</th>
<th class="center">
<?php echo JText::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED'); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->statuses as $status) : ?>
<?php if ($status->element) : ?>
<tr>
<td>
<?php echo $status->element; ?>
</td>
<?php endif; ?>
<?php // Published Site languages ?>
<?php if ($status->element) : ?>
<td class="center">
<span class="icon-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JYES'); ?></span>
</td>
<?php else : ?>
<td class="center">
<?php echo JText::_('JNO'); ?>
</td>
<?php endif; ?>
<?php // Published Content languages ?>
<?php if ($status->lang_code && $status->published == 1) : ?>
<td class="center">
<span class="icon-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JYES'); ?></span>
</td>
<?php elseif ($status->lang_code && $status->published == 0) : ?>
<td class="center">
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<?php elseif ($status->lang_code && $status->published == -2) : ?>
<td class="center">
<span class="icon-trash" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<?php else : ?>
<td class="center">
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<?php endif; ?>
<?php // Published Home pages ?>
<?php if ($status->home_language) : ?>
<td class="center">
<span class="icon-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JYES'); ?></span>
</td>
<?php else : ?>
<td class="center">
<span class="icon-not-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JNO'); ?></span>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php foreach ($this->contentlangs as $contentlang) : ?>
<?php if (!array_key_exists($contentlang->lang_code, $this->site_langs)) : ?>
<tr>
<td>
<?php echo $contentlang->lang_code; ?>
</td>
<td class="center">
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
</td>
<td class="center">
<?php if ($contentlang->published) : ?>
<span class="icon-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JYES'); ?></span>
<?php elseif (!$contentlang->published && array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
<span class="icon-not-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JNO'); ?></span>
<?php elseif (!$contentlang->published) : ?>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
<?php endif; ?>
</td>
<td class="center">
<?php if (!array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
<span class="icon-pending" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('WARNING'); ?></span>
<?php else : ?>
<span class="icon-ok" aria-hidden="true"></span><span class="element-invisible"><?php echo JText::_('JYES'); ?></span>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>