|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Tdmcreate\Files\Language; |
|
4
|
|
|
|
|
5
|
|
|
use XoopsModules\Tdmcreate; |
|
6
|
|
|
use XoopsModules\Tdmcreate\Files; |
|
7
|
|
|
|
|
8
|
|
|
/* |
|
9
|
|
|
You may not change or alter any portion of this comment or credits |
|
10
|
|
|
of supporting developers from this source code or any supporting source code |
|
11
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
12
|
|
|
|
|
13
|
|
|
This program is distributed in the hope that it will be useful, |
|
14
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
16
|
|
|
*/ |
|
17
|
|
|
/** |
|
18
|
|
|
* tdmcreate module. |
|
19
|
|
|
* |
|
20
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
21
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
|
22
|
|
|
* |
|
23
|
|
|
* @since 2.5.0 |
|
24
|
|
|
* |
|
25
|
|
|
* @author Txmod Xoops http://www.txmodxoops.org |
|
26
|
|
|
* |
|
27
|
|
|
*/ |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Class LanguageModinfo. |
|
31
|
|
|
*/ |
|
32
|
|
|
class LanguageModinfo extends Files\CreateFile |
|
33
|
|
|
{ |
|
34
|
|
|
/** |
|
35
|
|
|
* @public function constructor |
|
36
|
|
|
* @param null |
|
37
|
|
|
*/ |
|
38
|
|
|
public function __construct() |
|
39
|
|
|
{ |
|
40
|
|
|
parent::__construct(); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @static function getInstance |
|
45
|
|
|
* @param null |
|
46
|
|
|
* @return LanguageModinfo |
|
47
|
|
|
*/ |
|
48
|
|
|
public static function getInstance() |
|
49
|
|
|
{ |
|
50
|
|
|
static $instance = false; |
|
51
|
|
|
if (!$instance) { |
|
52
|
|
|
$instance = new self(); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
return $instance; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @public function write |
|
60
|
|
|
* |
|
61
|
|
|
* @param $module |
|
62
|
|
|
* @param $table |
|
63
|
|
|
* @param $filename |
|
64
|
|
|
* |
|
65
|
|
|
* @return string |
|
66
|
|
|
*/ |
|
67
|
|
|
public function write($module, $table, $filename) |
|
68
|
|
|
{ |
|
69
|
|
|
$this->setModule($module); |
|
70
|
|
|
$this->setTable($table); |
|
71
|
|
|
$this->setFileName($filename); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @private function getLanguageMain |
|
76
|
|
|
* |
|
77
|
|
|
* @param $language |
|
78
|
|
|
* @param $module |
|
79
|
|
|
* |
|
80
|
|
|
* @return string |
|
81
|
|
|
*/ |
|
82
|
|
|
private function getLanguageMain($language, $module) |
|
83
|
|
|
{ |
|
84
|
|
|
$df = LanguageDefines::getInstance(); |
|
85
|
|
|
$ret = $df->getAboveHeadDefines('Admin Main'); |
|
86
|
|
|
$ret .= $df->getDefine($language, 'NAME', (string)$module->getVar('mod_name')); |
|
87
|
|
|
$ret .= $df->getDefine($language, 'DESC', (string)$module->getVar('mod_description')); |
|
88
|
|
|
|
|
89
|
|
|
return $ret; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @private function getLanguageMenu |
|
94
|
|
|
* |
|
95
|
|
|
* @param $module |
|
96
|
|
|
* @param $language |
|
97
|
|
|
* |
|
98
|
|
|
* @return string |
|
99
|
|
|
*/ |
|
100
|
|
|
private function getLanguageMenu($module, $language) |
|
101
|
|
|
{ |
|
102
|
|
|
$df = Tdmcreate\Files\Language\LanguageDefines::getInstance(); |
|
103
|
|
|
$tables = $this->getTableTables($module->getVar('mod_id'), 'table_order'); |
|
104
|
|
|
$menu = 1; |
|
105
|
|
|
$ret = $df->getAboveHeadDefines('Admin Menu'); |
|
106
|
|
|
$ret .= $df->getDefine($language, "ADMENU{$menu}", 'Dashboard'); |
|
107
|
|
|
$tablePermissions = []; |
|
108
|
|
|
foreach (array_keys($tables) as $i) { |
|
109
|
|
|
++$menu; |
|
110
|
|
|
$tablePermissions[] = $tables[$i]->getVar('table_permissions'); |
|
111
|
|
|
$ucfTableName = ucfirst($tables[$i]->getVar('table_name')); |
|
112
|
|
|
$ret .= $df->getDefine($language, "ADMENU{$menu}", $ucfTableName); |
|
113
|
|
|
} |
|
114
|
|
|
if (in_array(1, $tablePermissions)) { |
|
115
|
|
|
++$menu; |
|
116
|
|
|
$ret .= $df->getDefine($language, "ADMENU{$menu}", 'Permissions'); |
|
117
|
|
|
} |
|
118
|
|
|
$ret .= $df->getDefine($language, 'ABOUT', 'About'); |
|
119
|
|
|
unset($menu, $tablePermissions); |
|
120
|
|
|
|
|
121
|
|
|
return $ret; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @private function getLanguageAdmin |
|
126
|
|
|
* @param $language |
|
127
|
|
|
* |
|
128
|
|
|
* @return string |
|
129
|
|
|
*/ |
|
130
|
|
|
private function getLanguageAdmin($language) |
|
131
|
|
|
{ |
|
132
|
|
|
$df = LanguageDefines::getInstance(); |
|
133
|
|
|
$ret = $df->getAboveHeadDefines('Admin Nav'); |
|
134
|
|
|
$ret .= $df->getDefine($language, 'ADMIN_PAGER', 'Admin pager'); |
|
135
|
|
|
$ret .= $df->getDefine($language, 'ADMIN_PAGER_DESC', 'Admin per page list'); |
|
136
|
|
|
|
|
137
|
|
|
return $ret; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* @private function getLanguageSubmenu |
|
142
|
|
|
* @param $language |
|
143
|
|
|
* @param array $tables |
|
144
|
|
|
* |
|
145
|
|
|
* @return string |
|
146
|
|
|
*/ |
|
147
|
|
|
private function getLanguageSubmenu($language, $tables) |
|
148
|
|
|
{ |
|
149
|
|
|
$df = LanguageDefines::getInstance(); |
|
150
|
|
|
$ret = $df->getAboveDefines('Submenu'); |
|
151
|
|
|
$i = 1; |
|
152
|
|
|
$tableSubmit = []; |
|
153
|
|
|
foreach (array_keys($tables) as $t) { |
|
154
|
|
|
$tableName = $tables[$t]->getVar('table_name'); |
|
155
|
|
|
$tableSubmit[] = $tables[$t]->getVar('table_submit'); |
|
156
|
|
|
if (1 == $tables[$t]->getVar('table_submenu')) { |
|
157
|
|
|
$ret .= $df->getDefine($language, "SMNAME{$i}", (string)$tableName); |
|
158
|
|
|
} |
|
159
|
|
|
++$i; |
|
160
|
|
|
} |
|
161
|
|
|
if (in_array(1, $tableSubmit)) { |
|
162
|
|
|
$ret .= $df->getDefine($language, "SMNAME{$i}", 'Submit'); |
|
163
|
|
|
} |
|
164
|
|
|
unset($i, $tableSubmit); |
|
165
|
|
|
|
|
166
|
|
|
return $ret; |
|
167
|
|
|
} |
|
168
|
|
|
|
|
169
|
|
|
/** |
|
170
|
|
|
* @private function getLanguageBlocks |
|
171
|
|
|
* @param $language |
|
172
|
|
|
* @param array $tables |
|
173
|
|
|
* |
|
174
|
|
|
* @return string |
|
175
|
|
|
*/ |
|
176
|
|
|
private function getLanguageBlocks($tables, $language) |
|
177
|
|
|
{ |
|
178
|
|
|
$df = LanguageDefines::getInstance(); |
|
179
|
|
|
$ret = $df->getAboveDefines('Blocks'); |
|
180
|
|
|
foreach (array_keys($tables) as $i) { |
|
181
|
|
|
$tableName = $tables[$i]->getVar('table_name'); |
|
182
|
|
|
$stuTableName = mb_strtoupper($tableName); |
|
183
|
|
|
$tableSoleName = $tables[$i]->getVar('table_solename'); |
|
184
|
|
|
$stuTableSoleName = mb_strtoupper($tableSoleName); |
|
185
|
|
|
$ucfTableName = ucfirst($tableName); |
|
186
|
|
|
$ucfTableSoleName = ucfirst($stuTableSoleName); |
|
187
|
|
|
|
|
188
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK", "{$ucfTableName} block"); |
|
189
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_DESC", "{$ucfTableName} block description"); |
|
190
|
|
|
if (1 == $tables[$i]->getVar('table_category')) { |
|
191
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_{$stuTableSoleName}", "{$ucfTableName} block {$ucfTableSoleName}"); |
|
192
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_{$stuTableSoleName}_DESC", "{$ucfTableName} block {$ucfTableSoleName} description"); |
|
193
|
|
|
} else { |
|
194
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_{$stuTableSoleName}", "{$ucfTableName} block {$ucfTableSoleName}"); |
|
195
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_{$stuTableSoleName}_DESC", "{$ucfTableName} block {$ucfTableSoleName} description"); |
|
196
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_LAST", "{$ucfTableName} block last"); |
|
197
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_LAST_DESC", "{$ucfTableName} block last description"); |
|
198
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_NEW", "{$ucfTableName} block new"); |
|
199
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_NEW_DESC", "{$ucfTableName} block new description"); |
|
200
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_HITS", "{$ucfTableName} block hits"); |
|
201
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_HITS_DESC", "{$ucfTableName} block hits description"); |
|
202
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_TOP", "{$ucfTableName} block top"); |
|
203
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_TOP_DESC", "{$ucfTableName} block top description"); |
|
204
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_RANDOM", "{$ucfTableName} block random"); |
|
205
|
|
|
$ret .= $df->getDefine($language, "{$stuTableName}_BLOCK_RANDOM_DESC", "{$ucfTableName} block random description"); |
|
206
|
|
|
} |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
return $ret; |
|
210
|
|
|
} |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* @private function getLanguageUser |
|
214
|
|
|
* @param $language |
|
215
|
|
|
* |
|
216
|
|
|
* @return string |
|
217
|
|
|
*/ |
|
218
|
|
|
private function getLanguageUser($language) |
|
219
|
|
|
{ |
|
220
|
|
|
$df = LanguageDefines::getInstance(); |
|
221
|
|
|
$ret = $df->getAboveDefines('User'); |
|
222
|
|
|
$ret .= $df->getDefine($language, 'USER_PAGER', 'User pager'); |
|
223
|
|
|
$ret .= $df->getDefine($language, 'USER_PAGER_DESC', 'User per page list'); |
|
224
|
|
|
|
|
225
|
|
|
return $ret; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* @private function getLanguageConfig |
|
230
|
|
|
* @param $language |
|
231
|
|
|
* @param $tables |
|
232
|
|
|
* |
|
233
|
|
|
* @return string |
|
234
|
|
|
*/ |
|
235
|
|
|
private function getLanguageConfig($language, $tables) |
|
236
|
|
|
{ |
|
237
|
|
|
$df = LanguageDefines::getInstance(); |
|
238
|
|
|
$ret = $df->getAboveDefines('Config'); |
|
239
|
|
|
$fieldImage = false; |
|
240
|
|
|
$useTag = false; |
|
241
|
|
|
// $usePermissions = false; |
|
242
|
|
|
foreach (array_keys($tables) as $i) { |
|
243
|
|
|
$fields = $this->getTableFields($tables[$i]->getVar('table_mid'), $tables[$i]->getVar('table_id')); |
|
244
|
|
|
foreach (array_keys($fields) as $f) { |
|
245
|
|
|
$fieldElement = $fields[$f]->getVar('field_element'); |
|
246
|
|
|
if (4 == $fieldElement) { |
|
247
|
|
|
$fieldName = $fields[$f]->getVar('field_name'); |
|
248
|
|
|
$rpFieldName = $this->getRightString($fieldName); |
|
249
|
|
|
$ucfFieldName = ucfirst($rpFieldName); |
|
250
|
|
|
$stuFieldName = mb_strtoupper($rpFieldName); |
|
251
|
|
|
$ret .= $df->getDefine($language, 'EDITOR_' . $stuFieldName, 'Editor'); |
|
252
|
|
|
$ret .= $df->getDefine($language, 'EDITOR_' . $stuFieldName . '_DESC', 'Select the Editor ' . $ucfFieldName . ' to use'); |
|
253
|
|
|
} |
|
254
|
|
|
if (13 == $fieldElement) { |
|
255
|
|
|
$fieldImage = true; |
|
256
|
|
|
} |
|
257
|
|
|
} |
|
258
|
|
|
if (0 != $tables[$i]->getVar('table_tag')) { |
|
259
|
|
|
$useTag = true; |
|
260
|
|
|
} |
|
261
|
|
|
// if (0 != $tables[$i]->getVar('table_permissions')) {$usePermissions = true;} |
|
262
|
|
|
} |
|
263
|
|
|
$ret .= $df->getDefine($language, 'KEYWORDS', 'Keywords'); |
|
264
|
|
|
$ret .= $df->getDefine($language, 'KEYWORDS_DESC', 'Insert here the keywords (separate by comma)'); |
|
265
|
|
|
/*if (usePermissions) { |
|
266
|
|
|
$ret .= $df->getDefine($language, "GROUPS", "Groups"); |
|
267
|
|
|
$ret .= $df->getDefine($language, "GROUPS_DESC", "Groups to have permissions"); |
|
268
|
|
|
$ret .= $df->getDefine($language, "ADMIN_GROUPS", "Admin Groups"); |
|
269
|
|
|
$ret .= $df->getDefine($language, "ADMIN_GROUPS_DESC", "Admin Groups to have permissions access"); |
|
270
|
|
|
}*/ |
|
271
|
|
|
if ($fieldImage) { |
|
272
|
|
|
$ret .= $df->getDefine($language, 'MAXSIZE', 'Max size'); |
|
273
|
|
|
$ret .= $df->getDefine($language, 'MAXSIZE_DESC', 'Set a number of max size uploads files in byte'); |
|
274
|
|
|
$ret .= $df->getDefine($language, 'MIMETYPES', 'Mime Types'); |
|
275
|
|
|
$ret .= $df->getDefine($language, 'MIMETYPES_DESC', 'Set the mime types selected'); |
|
276
|
|
|
} |
|
277
|
|
|
if ($useTag) { |
|
278
|
|
|
$ret .= $df->getDefine($language, 'USE_TAG', 'Use TAG'); |
|
279
|
|
|
$ret .= $df->getDefine($language, 'USE_TAG_DESC', 'If you use tag module, check this option to yes'); |
|
280
|
|
|
} |
|
281
|
|
|
$getDefinesConf = [ |
|
282
|
|
|
'NUMB_COL' => 'Number Columns', |
|
283
|
|
|
'NUMB_COL_DESC' => 'Number Columns to View.', |
|
284
|
|
|
'DIVIDEBY' => 'Divide By', |
|
285
|
|
|
'DIVIDEBY_DESC' => 'Divide by columns number.', |
|
286
|
|
|
'TABLE_TYPE' => 'Table Type', |
|
287
|
|
|
'TABLE_TYPE_DESC' => 'Table Type is the bootstrap html table.', |
|
288
|
|
|
'PANEL_TYPE' => 'Panel Type', |
|
289
|
|
|
'PANEL_TYPE_DESC' => 'Panel Type is the bootstrap html div.', |
|
290
|
|
|
'IDPAYPAL' => 'Paypal ID', |
|
291
|
|
|
'IDPAYPAL_DESC' => 'Insert here your PayPal ID for donactions.', |
|
292
|
|
|
'ADVERTISE' => 'Advertisement Code', |
|
293
|
|
|
'ADVERTISE_DESC' => 'Insert here the advertisement code', |
|
294
|
|
|
'MAINTAINEDBY' => 'Maintained By', |
|
295
|
|
|
'MAINTAINEDBY_DESC' => 'Allow url of support site or community', |
|
296
|
|
|
'BOOKMARKS' => 'Social Bookmarks', |
|
297
|
|
|
'BOOKMARKS_DESC' => 'Show Social Bookmarks in the single page', |
|
298
|
|
|
'FACEBOOK_COMMENTS' => 'Facebook comments', |
|
299
|
|
|
'FACEBOOK_COMMENTS_DESC' => 'Allow Facebook comments in the single page', |
|
300
|
|
|
'DISQUS_COMMENTS' => 'Disqus comments', |
|
301
|
|
|
'DISQUS_COMMENTS_DESC' => 'Allow Disqus comments in the single page', |
|
302
|
|
|
]; |
|
303
|
|
|
foreach ($getDefinesConf as $defc => $descc) { |
|
304
|
|
|
$ret .= $df->getDefine($language, $defc, $descc); |
|
305
|
|
|
} |
|
306
|
|
|
|
|
307
|
|
|
return $ret; |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
/** |
|
311
|
|
|
* @private function getLanguageNotifications |
|
312
|
|
|
* @param $language |
|
313
|
|
|
* @param mixed $tableSoleName |
|
314
|
|
|
* |
|
315
|
|
|
* @return string |
|
316
|
|
|
*/ |
|
317
|
|
|
private function getLanguageNotifications($language, $tableSoleName) |
|
318
|
|
|
{ |
|
319
|
|
|
$df = LanguageDefines::getInstance(); |
|
320
|
|
|
$ret = $df->getAboveDefines('Notifications'); |
|
321
|
|
|
$stuTableSoleName = mb_strtoupper($tableSoleName); |
|
322
|
|
|
$ucfTableSoleName = ucfirst($tableSoleName); |
|
323
|
|
|
$getDefinesNotif = [ |
|
324
|
|
|
'GLOBAL_NOTIFY' => 'Global notify', |
|
325
|
|
|
'GLOBAL_NOTIFY_DESC' => 'Global notify desc', |
|
326
|
|
|
'GLOBAL_MODIFY_NOTIFY' => 'Global modify notify', |
|
327
|
|
|
'GLOBAL_MODIFY_NOTIFY_CAPTION' => 'Global modify notify caption', |
|
328
|
|
|
'GLOBAL_MODIFY_NOTIFY_DESC' => 'Global modify notify desc', |
|
329
|
|
|
'GLOBAL_MODIFY_NOTIFY_SUBJECT' => 'Global modify notify subject', |
|
330
|
|
|
'GLOBAL_BROKEN_NOTIFY' => 'Global broken notify', |
|
331
|
|
|
'GLOBAL_BROKEN_NOTIFY_CAPTION' => 'Global broken notify caption', |
|
332
|
|
|
'GLOBAL_BROKEN_NOTIFY_DESC' => 'Global broken notify desc', |
|
333
|
|
|
'GLOBAL_BROKEN_NOTIFY_SUBJECT' => 'Global broken notify subject', |
|
334
|
|
|
'GLOBAL_SUBMIT_NOTIFY' => 'Global submit notify', |
|
335
|
|
|
'GLOBAL_SUBMIT_NOTIFY_CAPTION' => 'Global submit notify caption', |
|
336
|
|
|
'GLOBAL_SUBMIT_NOTIFY_DESC' => 'Global submit notify desc', |
|
337
|
|
|
'GLOBAL_SUBMIT_NOTIFY_SUBJECT' => 'Global submit notify subject', |
|
338
|
|
|
'GLOBAL_NEW_NOTIFY' => 'Global new notify', |
|
339
|
|
|
'GLOBAL_NEW_NOTIFY_CAPTION' => 'Global new notify caption', |
|
340
|
|
|
'GLOBAL_NEW_NOTIFY_DESC' => 'Global new notify desc', |
|
341
|
|
|
'GLOBAL_NEW_NOTIFY_SUBJECT' => 'Global new notify subject', |
|
342
|
|
|
'CATEGORY_NOTIFY' => 'Category notify', |
|
343
|
|
|
'CATEGORY_NOTIFY_DESC' => 'Category notify desc', |
|
344
|
|
|
'CATEGORY_NOTIFY_CAPTION' => 'Category notify caption', |
|
345
|
|
|
'CATEGORY_NOTIFY_SUBJECT' => 'Category notify Subject', |
|
346
|
|
|
'CATEGORY_SUBMIT_NOTIFY' => 'Category submit notify', |
|
347
|
|
|
'CATEGORY_SUBMIT_NOTIFY_CAPTION' => 'Category submit notify caption', |
|
348
|
|
|
'CATEGORY_SUBMIT_NOTIFY_DESC' => 'Category submit notify desc', |
|
349
|
|
|
'CATEGORY_SUBMIT_NOTIFY_SUBJECT' => 'Category submit notify subject', |
|
350
|
|
|
$stuTableSoleName . '_NOTIFY' => $ucfTableSoleName . ' notify', |
|
351
|
|
|
$stuTableSoleName . '_NOTIFY_DESC' => $ucfTableSoleName . ' notify desc', |
|
352
|
|
|
$stuTableSoleName . '_NOTIFY_CAPTION' => $ucfTableSoleName . ' notify caption', |
|
353
|
|
|
$stuTableSoleName . '_NOTIFY_SUBJECT' => $ucfTableSoleName . ' notify subject', |
|
354
|
|
|
'GLOBAL_NEW_CATEGORY_NOTIFY' => 'Global newcategory notify', |
|
355
|
|
|
'GLOBAL_NEW_CATEGORY_NOTIFY_CAPTION' => 'Global newcategory notify caption', |
|
356
|
|
|
'GLOBAL_NEW_CATEGORY_NOTIFY_DESC' => 'Global newcategory notify desc', |
|
357
|
|
|
'GLOBAL_NEW_CATEGORY_NOTIFY_SUBJECT' => 'Global newcategory notify subject', |
|
358
|
|
|
'GLOBAL_' . $stuTableSoleName . '_MODIFY_NOTIFY' => 'Global ' . $tableSoleName . ' modify notify', |
|
359
|
|
|
'GLOBAL_' . $stuTableSoleName . '_MODIFY_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' modify notify caption', |
|
360
|
|
|
'GLOBAL_' . $stuTableSoleName . '_MODIFY_NOTIFY_DESC' => 'Global ' . $tableSoleName . ' modify notify desc', |
|
361
|
|
|
'GLOBAL_' . $stuTableSoleName . '_MODIFY_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' modify notify subject', |
|
362
|
|
|
'GLOBAL_' . $stuTableSoleName . '_BROKEN_NOTIFY' => 'Global ' . $tableSoleName . ' broken notify', |
|
363
|
|
|
'GLOBAL_' . $stuTableSoleName . '_BROKEN_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' broken notify caption', |
|
364
|
|
|
'GLOBAL_' . $stuTableSoleName . '_BROKEN_NOTIFY_DESC' => 'Global ' . $tableSoleName . ' broken notify desc', |
|
365
|
|
|
'GLOBAL_' . $stuTableSoleName . '_BROKEN_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' broken notify subject', |
|
366
|
|
|
'GLOBAL_' . $stuTableSoleName . '_SUBMIT_NOTIFY' => 'Global ' . $tableSoleName . ' submit notify', |
|
367
|
|
|
'GLOBAL_' . $stuTableSoleName . '_SUBMIT_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' submit notify caption', |
|
368
|
|
|
'GLOBAL_' . $stuTableSoleName . '_SUBMIT_NOTIFY_DESC' => 'Global ' . $tableSoleName . ' submit notify desc', |
|
369
|
|
|
'GLOBAL_' . $stuTableSoleName . '_SUBMIT_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' submit notify subject', |
|
370
|
|
|
'GLOBAL_NEW_' . $stuTableSoleName . '_NOTIFY' => 'Global new ' . $tableSoleName . ' notify', |
|
371
|
|
|
'GLOBAL_NEW_' . $stuTableSoleName . '_NOTIFY_CAPTION' => 'Global new ' . $tableSoleName . ' notify caption', |
|
372
|
|
|
'GLOBAL_NEW_' . $stuTableSoleName . '_NOTIFY_DESC' => 'Global new ' . $tableSoleName . ' notify desc', |
|
373
|
|
|
'GLOBAL_NEW_' . $stuTableSoleName . '_NOTIFY_SUBJECT' => 'Global new ' . $tableSoleName . ' notify subject', |
|
374
|
|
|
'CATEGORY_' . $stuTableSoleName . '_SUBMIT_NOTIFY' => 'Category ' . $tableSoleName . ' submit notify', |
|
375
|
|
|
'CATEGORY_' . $stuTableSoleName . '_SUBMIT_NOTIFY_CAPTION' => 'Category ' . $tableSoleName . ' submit notify caption', |
|
376
|
|
|
'CATEGORY_' . $stuTableSoleName . '_SUBMIT_NOTIFY_DESC' => 'Category ' . $tableSoleName . ' submit notify desc', |
|
377
|
|
|
'CATEGORY_' . $stuTableSoleName . '_SUBMIT_NOTIFY_SUBJECT' => 'Category ' . $tableSoleName . ' submit notify subject', |
|
378
|
|
|
'CATEGORY_NEW_' . $stuTableSoleName . '_NOTIFY' => 'Category new ' . $tableSoleName . ' notify', |
|
379
|
|
|
'CATEGORY_NEW_' . $stuTableSoleName . '_NOTIFY_CAPTION' => 'Category new ' . $tableSoleName . ' notify caption', |
|
380
|
|
|
'CATEGORY_NEW_' . $stuTableSoleName . '_NOTIFY_DESC' => 'Category new ' . $tableSoleName . ' notify desc', |
|
381
|
|
|
'CATEGORY_NEW_' . $stuTableSoleName . '_NOTIFY_SUBJECT' => 'Category new ' . $tableSoleName . ' notify subject', |
|
382
|
|
|
'APPROVE_NOTIFY' => $ucfTableSoleName . ' approve notify', |
|
383
|
|
|
'APPROVE_NOTIFY_CAPTION' => $ucfTableSoleName . ' approve notify caption', |
|
384
|
|
|
'APPROVE_NOTIFY_DESC' => $ucfTableSoleName . ' approve notify desc', |
|
385
|
|
|
'APPROVE_NOTIFY_SUBJECT' => $ucfTableSoleName . ' approve notify subject', |
|
386
|
|
|
]; |
|
387
|
|
|
foreach ($getDefinesNotif as $defn => $descn) { |
|
388
|
|
|
$ret .= $df->getDefine($language, $defn, $descn); |
|
389
|
|
|
} |
|
390
|
|
|
|
|
391
|
|
|
return $ret; |
|
392
|
|
|
} |
|
393
|
|
|
|
|
394
|
|
|
/** |
|
395
|
|
|
* @private function getLanguagePermissionsGroups |
|
396
|
|
|
* @param $language |
|
397
|
|
|
* |
|
398
|
|
|
* @return string |
|
399
|
|
|
*/ |
|
400
|
|
|
private function getLanguagePermissionsGroups($language) |
|
401
|
|
|
{ |
|
402
|
|
|
$df = LanguageDefines::getInstance(); |
|
403
|
|
|
$ret = $df->getAboveDefines('Permissions Groups'); |
|
404
|
|
|
$ret .= $df->getDefine($language, 'GROUPS', 'Groups access'); |
|
405
|
|
|
$ret .= $df->getDefine($language, 'GROUPS_DESC', 'Select general access permission for groups.'); |
|
406
|
|
|
$ret .= $df->getDefine($language, 'ADMIN_GROUPS', 'Admin Group Permissions'); |
|
407
|
|
|
$ret .= $df->getDefine($language, 'ADMIN_GROUPS_DESC', 'Which groups have access to tools and permissions page'); |
|
408
|
|
|
|
|
409
|
|
|
return $ret; |
|
410
|
|
|
} |
|
411
|
|
|
|
|
412
|
|
|
/** |
|
413
|
|
|
* @private function getFooter |
|
414
|
|
|
* @param null |
|
415
|
|
|
* @return string |
|
416
|
|
|
*/ |
|
417
|
|
|
private function getLanguageFooter() |
|
418
|
|
|
{ |
|
419
|
|
|
$df = LanguageDefines::getInstance(); |
|
420
|
|
|
$ret = $df->getBelowDefines('End'); |
|
421
|
|
|
$ret .= $df->getBlankLine(); |
|
422
|
|
|
|
|
423
|
|
|
return $ret; |
|
424
|
|
|
} |
|
425
|
|
|
|
|
426
|
|
|
/** |
|
427
|
|
|
* @public function render |
|
428
|
|
|
* @param null |
|
429
|
|
|
* @return bool|string |
|
430
|
|
|
*/ |
|
431
|
|
|
public function render() |
|
432
|
|
|
{ |
|
433
|
|
|
$module = $this->getModule(); |
|
434
|
|
|
$table = $this->getTable(); |
|
|
|
|
|
|
435
|
|
|
$tables = $this->getTableTables($module->getVar('mod_id')); |
|
436
|
|
|
$tableAdmin = []; |
|
437
|
|
|
$tableUser = []; |
|
438
|
|
|
$tableSubmenu = []; |
|
439
|
|
|
$tableBlocks = []; |
|
440
|
|
|
$tableNotifications = []; |
|
441
|
|
|
$tablePermissions = []; |
|
442
|
|
|
foreach (array_keys($tables) as $t) { |
|
443
|
|
|
$tableSoleName = $tables[$t]->getVar('table_solename'); |
|
444
|
|
|
$tableAdmin[] = $tables[$t]->getVar('table_admin'); |
|
445
|
|
|
$tableUser[] = $tables[$t]->getVar('table_user'); |
|
446
|
|
|
$tableSubmenu[] = $tables[$t]->getVar('table_submenu'); |
|
447
|
|
|
$tableBlocks[] = $tables[$t]->getVar('table_blocks'); |
|
448
|
|
|
$tableNotifications[] = $tables[$t]->getVar('table_notifications'); |
|
449
|
|
|
$tablePermissions[] = $tables[$t]->getVar('table_permissions'); |
|
450
|
|
|
} |
|
451
|
|
|
$filename = $this->getFileName(); |
|
452
|
|
|
$moduleDirname = $module->getVar('mod_dirname'); |
|
453
|
|
|
$language = $this->getLanguage($moduleDirname, 'MI'); |
|
454
|
|
|
$content = $this->getHeaderFilesComments($module, $filename); |
|
455
|
|
|
$content .= $this->getLanguageMain($language, $module); |
|
456
|
|
|
$content .= $this->getLanguageMenu($module, $language); |
|
457
|
|
|
if (in_array(1, $tableAdmin)) { |
|
458
|
|
|
$content .= $this->getLanguageAdmin($language); |
|
459
|
|
|
} |
|
460
|
|
|
if (in_array(1, $tableUser)) { |
|
461
|
|
|
$content .= $this->getLanguageUser($language); |
|
462
|
|
|
} |
|
463
|
|
|
if (in_array(1, $tableSubmenu)) { |
|
464
|
|
|
$content .= $this->getLanguageSubmenu($language, $tables); |
|
465
|
|
|
} |
|
466
|
|
|
//if (in_array(1, $tableBlocks)) { |
|
467
|
|
|
$content .= $this->getLanguageBlocks($tables, $language); |
|
468
|
|
|
//} |
|
469
|
|
|
$content .= $this->getLanguageConfig($language, $tables); |
|
470
|
|
|
if (in_array(1, $tableNotifications)) { |
|
471
|
|
|
$content .= $this->getLanguageNotifications($language, $tableSoleName); |
|
|
|
|
|
|
472
|
|
|
} |
|
473
|
|
|
if (in_array(1, $tablePermissions)) { |
|
474
|
|
|
$content .= $this->getLanguagePermissionsGroups($language); |
|
475
|
|
|
} |
|
476
|
|
|
$content .= $this->getLanguageFooter(); |
|
477
|
|
|
|
|
478
|
|
|
$this->create($moduleDirname, 'language/' . $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); |
|
479
|
|
|
|
|
480
|
|
|
return $this->renderFile(); |
|
481
|
|
|
} |
|
482
|
|
|
} |
|
483
|
|
|
|