|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* |
|
5
|
|
|
* The MIT License (MIT) |
|
6
|
|
|
* |
|
7
|
|
|
* Copyright (c) 2015 Daniel Popiniuc |
|
8
|
|
|
* |
|
9
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
10
|
|
|
* of this software and associated documentation files (the "Software"), to deal |
|
11
|
|
|
* in the Software without restriction, including without limitation the rights |
|
12
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
13
|
|
|
* copies of the Software, and to permit persons to whom the Software is |
|
14
|
|
|
* furnished to do so, subject to the following conditions: |
|
15
|
|
|
* |
|
16
|
|
|
* The above copyright notice and this permission notice shall be included in all |
|
17
|
|
|
* copies or substantial portions of the Software. |
|
18
|
|
|
* |
|
19
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
20
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
21
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
22
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
23
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
24
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
25
|
|
|
* SOFTWARE. |
|
26
|
|
|
* |
|
27
|
|
|
*/ |
|
28
|
|
|
|
|
29
|
|
|
namespace danielgp\common_lib; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* DOM component functions |
|
33
|
|
|
* |
|
34
|
|
|
* @author Daniel Popiniuc |
|
35
|
|
|
*/ |
|
36
|
|
|
trait DomComponentsByDanielGP |
|
37
|
|
|
{ |
|
38
|
|
|
|
|
39
|
|
|
use \danielgp\browser_agent_info\BrowserAgentInfosByDanielGP; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Calculate the optimal for all options within a select tag |
|
43
|
|
|
* |
|
44
|
|
|
* @param array $aElements |
|
45
|
|
|
* @param array $aFeatures |
|
46
|
|
|
* @return string|int |
|
47
|
|
|
*/ |
|
48
|
|
|
private function calculateSelectOptionsSize($aElements, $aFeatures = []) |
|
49
|
|
|
{ |
|
50
|
|
|
if (is_null($aFeatures)) { |
|
51
|
|
|
$aFeatures = []; |
|
52
|
|
|
} |
|
53
|
|
|
if (is_array($aElements)) { |
|
54
|
|
|
if (isset($aFeatures['size'])) { |
|
55
|
|
|
if ($aFeatures['size'] == 0) { |
|
56
|
|
|
$selectSize = count($aElements); |
|
57
|
|
|
} else { |
|
58
|
|
|
$selectSize = min(count($aElements), $aFeatures['size']); |
|
59
|
|
|
} |
|
60
|
|
|
} else { |
|
61
|
|
|
$selectSize = 1; |
|
62
|
|
|
} |
|
63
|
|
|
if ((in_array('include_null', $aFeatures)) && ($selectSize != '1')) { |
|
64
|
|
|
$selectSize++; |
|
65
|
|
|
} |
|
66
|
|
|
return $selectSize; |
|
67
|
|
|
} else { |
|
68
|
|
|
return ''; |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
protected function cleanStringForId($givenString) |
|
73
|
|
|
{ |
|
74
|
|
|
return preg_replace("/[^a-zA-Z0-9]/", '', ucwords($givenString)); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Builds a <select> based on a given array |
|
79
|
|
|
* |
|
80
|
|
|
* @version 20080618 |
|
81
|
|
|
* @param array $aElements |
|
82
|
|
|
* @param string/array $sDefaultValue |
|
|
|
|
|
|
83
|
|
|
* @param string $select_name |
|
84
|
|
|
* @param array $features_array |
|
85
|
|
|
* @return string |
|
86
|
|
|
*/ |
|
87
|
|
|
protected function setArrayToSelect($aElements, $sDefaultValue, $select_name, $features_array = null) |
|
88
|
|
|
{ |
|
89
|
|
|
if (!is_array($aElements)) { |
|
90
|
|
|
return ''; |
|
91
|
|
|
} |
|
92
|
|
|
$select_id = '" id="' . str_replace(['[', ']'], ['', ''], $select_name) |
|
93
|
|
|
. (isset($features_array['id_no']) ? $features_array['id_no'] : ''); |
|
94
|
|
|
if (isset($features_array['readonly'])) { |
|
95
|
|
|
return $this->setStringIntoShortTag('input', [ |
|
96
|
|
|
'name' => $select_name, |
|
97
|
|
|
'id' => $select_id, |
|
98
|
|
|
'readonly' => 'readonly', |
|
99
|
|
|
'class' => 'input_readonly', |
|
100
|
|
|
'value' => $sDefaultValue, |
|
101
|
|
|
]) . $aElements[$sDefaultValue]; |
|
102
|
|
|
} |
|
103
|
|
|
if (isset($features_array['id_no'])) { |
|
104
|
|
|
unset($features_array['id_no']); |
|
105
|
|
|
} |
|
106
|
|
|
$string2return = '<select name="' . $select_name . $select_id |
|
107
|
|
|
. '" size="' . $this->calculateSelectOptionsSize($aElements, $features_array) . '"'; |
|
108
|
|
|
if (is_array($features_array)) { |
|
109
|
|
|
if (isset($features_array['additional_javascript_action'])) { |
|
110
|
|
|
$temporary_string = $features_array['additional_javascript_action']; |
|
111
|
|
|
} else { |
|
112
|
|
|
$temporary_string = ''; |
|
113
|
|
|
} |
|
114
|
|
|
if (in_array('autosubmit', $features_array)) { |
|
115
|
|
|
$string2return .= ' onchange="javascript:' . $temporary_string . 'submit();"'; |
|
116
|
|
|
} else { |
|
117
|
|
|
if ($temporary_string != '') { |
|
118
|
|
|
$string2return .= ' onchange="javascript:' . $temporary_string . '"'; |
|
119
|
|
|
} |
|
120
|
|
|
} |
|
121
|
|
|
if (in_array('disabled', $features_array)) { |
|
122
|
|
|
$string2return .= ' disabled="disabled"'; |
|
123
|
|
|
} |
|
124
|
|
|
if (in_array('hidden', $features_array)) { |
|
125
|
|
|
$string2return .= ' style="visibility: hidden;"'; |
|
126
|
|
|
} |
|
127
|
|
|
if (in_array('multiselect', $features_array)) { |
|
128
|
|
|
$string2return .= ' multiple="multiple"'; |
|
129
|
|
|
} |
|
130
|
|
|
if (array_key_exists('style', $features_array)) { |
|
131
|
|
|
$string2return .= ' style="' . $features_array['style'] . '"'; |
|
132
|
|
|
} |
|
133
|
|
|
} |
|
134
|
|
|
$string2return .= '>' |
|
135
|
|
|
. $this->setOptionsForSelect($aElements, $sDefaultValue, $features_array) |
|
136
|
|
|
. '</select>'; |
|
137
|
|
|
return $string2return; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* Converts an array to string |
|
142
|
|
|
* |
|
143
|
|
|
* @param string $sSeparator |
|
144
|
|
|
* @param array $aElements |
|
145
|
|
|
* @return string |
|
146
|
|
|
*/ |
|
147
|
|
|
protected function setArrayToStringForUrl($sSeparator, $aElements, $aExceptedElements = ['']) |
|
148
|
|
|
{ |
|
149
|
|
|
if (is_array($aElements)) { |
|
150
|
|
|
if (count($aElements) == 0) { |
|
151
|
|
|
$sReturn = ['']; |
|
152
|
|
|
} else { |
|
153
|
|
|
$sReturn = []; |
|
154
|
|
|
foreach ($aElements as $key => $value) { |
|
155
|
|
|
if (!in_array($key, $aExceptedElements)) { |
|
156
|
|
|
if (is_array($aElements[$key])) { |
|
157
|
|
|
$aCounter = count($aElements[$key]); |
|
158
|
|
|
for ($counter2 = 0; $counter2 < $aCounter; $counter2++) { |
|
159
|
|
|
if ($value[$counter2] !== '') { |
|
160
|
|
|
$sReturn[] = $key . '[]=' . $value[$counter2]; |
|
161
|
|
|
} |
|
162
|
|
|
} |
|
163
|
|
|
} else { |
|
164
|
|
|
if ($value !== '') { |
|
165
|
|
|
$sReturn[] = $key . '=' . $value; |
|
166
|
|
|
} |
|
167
|
|
|
} |
|
168
|
|
|
} |
|
169
|
|
|
} |
|
170
|
|
|
} |
|
171
|
|
|
} else { |
|
172
|
|
|
$sReturn = ['']; |
|
173
|
|
|
} |
|
174
|
|
|
return implode($sSeparator, $sReturn); |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
/** |
|
178
|
|
|
* Returns a table from an query |
|
179
|
|
|
* |
|
180
|
|
|
* @param array $gArray |
|
|
|
|
|
|
181
|
|
|
* @param array $features |
|
|
|
|
|
|
182
|
|
|
* @param boolean $bKeepFullPage |
|
|
|
|
|
|
183
|
|
|
* @return string |
|
184
|
|
|
*/ |
|
185
|
|
|
protected function setArrayToTable($aElements, $ftrs = null, $bKpFlPge = true) |
|
|
|
|
|
|
186
|
|
|
{ |
|
187
|
|
|
$rows = count($aElements); |
|
188
|
|
|
if ($rows == 0) { |
|
189
|
|
|
$divTab = [ |
|
190
|
|
|
'start' => '', |
|
191
|
|
|
'end' => '', |
|
192
|
|
|
]; |
|
193
|
|
|
if (array_key_exists('showGroupingCounter', $ftrs)) { |
|
194
|
|
|
if (array_key_exists('grouping_cell_type', $ftrs) && ($ftrs['grouping_cell_type'] == 'tab')) { |
|
195
|
|
|
$ditTitle = 'No data found'; |
|
196
|
|
|
if (isset($ftrs['showGroupingCounter'])) { |
|
197
|
|
|
$ditTitle .= ' (0)'; |
|
198
|
|
|
} |
|
199
|
|
|
$divTab = [ |
|
200
|
|
|
'start' => '<div class="tabbertab tabbertabdefault" id="tab_NoData" title="' . $ditTitle . '">', |
|
201
|
|
|
'end' => '</div><!-- from tab_NoData -->', |
|
202
|
|
|
]; |
|
203
|
|
|
if (!isset($ftrs['noGlobalTab'])) { |
|
204
|
|
|
$divTab = [ |
|
205
|
|
|
'start' => '<div class="tabber" id="tab">' . $divTab['start'], |
|
206
|
|
|
'end' => $divTab['end'] . '</div><!-- from global Tab -->', |
|
207
|
|
|
]; |
|
208
|
|
|
} |
|
209
|
|
|
} |
|
210
|
|
|
} |
|
211
|
|
|
return $divTab['start'] |
|
212
|
|
|
. $this->setFeedbackModern('error', 'Error', $this->lclMsgCmn('i18n_NoData')) |
|
|
|
|
|
|
213
|
|
|
. $divTab['end']; |
|
214
|
|
|
} |
|
215
|
|
|
if (isset($ftrs['limits'])) { |
|
216
|
|
|
$ftrs['limits'][1] = min($ftrs['limits'][1], $ftrs['limits'][2]); |
|
217
|
|
|
if ($ftrs['limits'][2] > $ftrs['limits'][1]) { |
|
218
|
|
|
$iStartingPageRecord = 1; |
|
219
|
|
|
} |
|
220
|
|
|
} |
|
221
|
|
|
$sReturn = ''; |
|
222
|
|
|
if (isset($ftrs['hidden_columns'])) { |
|
223
|
|
|
$hdClmns = $this->setArrayValuesAsKey($ftrs['hidden_columns']); |
|
|
|
|
|
|
224
|
|
|
} else { |
|
225
|
|
|
$hdClmns = ['']; |
|
226
|
|
|
} |
|
227
|
|
|
if ((isset($ftrs['actions']['checkbox_inlineEdit'])) || (isset($ftrs['actions']['checkbox']))) { |
|
228
|
|
|
$checkboxFormId = 'frm' . date('YmdHis'); |
|
229
|
|
|
$sReturn .= '<form id="' . $checkboxFormId . '" ' . 'name="' . $checkboxFormId |
|
230
|
|
|
. '" method="post" ' . ' action="' . $_SERVER['PHP_SELF'] . '" >'; |
|
231
|
|
|
} |
|
232
|
|
|
$tbl['Def'] = '<table' |
|
|
|
|
|
|
233
|
|
|
. (isset($ftrs['table_style']) ? ' style="' . $ftrs['table_style'] . '"' : '') |
|
234
|
|
|
. (isset($ftrs['table_class']) ? ' class="' . $ftrs['table_class'] . '"' : '') |
|
235
|
|
|
. '>'; |
|
236
|
|
|
if (!isset($ftrs['grouping_cell_type'])) { |
|
237
|
|
|
$ftrs['grouping_cell_type'] = 'row'; |
|
238
|
|
|
} |
|
239
|
|
|
switch ($ftrs['grouping_cell_type']) { |
|
240
|
|
|
case 'row': |
|
241
|
|
|
$sReturn .= $tbl['Def']; |
|
242
|
|
|
break; |
|
243
|
|
|
case 'tab': |
|
244
|
|
|
if (!isset($ftrs['noGlobalTab'])) { |
|
245
|
|
|
$sReturn .= '<div class="tabber" id="tab">'; |
|
246
|
|
|
} |
|
247
|
|
|
break; |
|
248
|
|
|
} |
|
249
|
|
|
$iTableColumns = 0; |
|
250
|
|
|
$remebered_value = -1; |
|
251
|
|
|
$remindGroupValue = null; |
|
252
|
|
|
$color_no = null; |
|
253
|
|
|
if (!isset($ftrs['headers_breaked'])) { |
|
254
|
|
|
$ftrs['headers_breaked'] = true; |
|
255
|
|
|
} |
|
256
|
|
|
for ($rCntr = 0; $rCntr < $rows; $rCntr++) { |
|
257
|
|
|
if ($rCntr == 0) { |
|
258
|
|
|
$header = array_diff_key($aElements[$rCntr], $hdClmns); |
|
259
|
|
|
$iTableColumns = count($header); |
|
260
|
|
|
if (isset($ftrs['computed_columns'])) { |
|
261
|
|
|
$iTableColumns += count($ftrs['computed_columns']); |
|
262
|
|
|
} |
|
263
|
|
|
if (isset($ftrs['actions'])) { |
|
264
|
|
|
$iTableColumns += 1; |
|
265
|
|
|
} |
|
266
|
|
|
if (isset($ftrs['grouping_cell'])) { |
|
267
|
|
|
$iTableColumns -= 1; |
|
268
|
|
|
} |
|
269
|
|
|
$tbl['Head'] = '<thead>'; |
|
270
|
|
|
if ($ftrs['grouping_cell_type'] == 'row') { |
|
271
|
|
|
$sReturn .= $tbl['Head']; |
|
272
|
|
|
} |
|
273
|
|
View Code Duplication |
if (isset($iStartingPageRecord)) { |
|
|
|
|
|
|
274
|
|
|
$pgn = $this->setPagination($ftrs['limits'][0], $ftrs['limits'][1], $ftrs['limits'][2], $bKpFlPge); |
|
|
|
|
|
|
275
|
|
|
$sReturn .= $this->setStringIntoTag($this->setStringIntoTag($pgn, 'th', [ |
|
276
|
|
|
'colspan' => $iTableColumns |
|
277
|
|
|
]), 'tr'); |
|
278
|
|
|
} |
|
279
|
|
|
$tbl['Header'] = '<tr>'; |
|
280
|
|
|
if (isset($ftrs['grouping_cell'])) { // Grouping columns |
|
281
|
|
|
$header = array_diff_key($header, [$ftrs['grouping_cell'] => '']); |
|
282
|
|
|
} |
|
283
|
|
|
if (isset($ftrs['actions'])) { // Action column |
|
284
|
|
|
$tbl['Header'] .= '<th> </th>'; |
|
285
|
|
|
} |
|
286
|
|
|
if (isset($ftrs['RowStyle'])) { //Exclude style columns from displaying |
|
287
|
|
|
$tmpClmns = $this->setArrayValuesAsKey([$ftrs['RowStyle']]); |
|
|
|
|
|
|
288
|
|
|
$header = array_diff_key($header, $tmpClmns); |
|
289
|
|
|
$hdClmns = array_merge($hdClmns, $tmpClmns); |
|
290
|
|
|
unset($tmpClmns); |
|
291
|
|
|
} |
|
292
|
|
|
$tbl['Header'] .= $this->setTableHeader($header, $ftrs['headers_breaked']); // Regular columns |
|
293
|
|
|
if (isset($ftrs['computed_columns'])) { // Computed columns |
|
294
|
|
|
$tbl['Header'] .= $this->setTableHeader($ftrs['computed_columns'], $ftrs['headers_breaked']); |
|
295
|
|
|
} |
|
296
|
|
|
$tbl['Header'] .= '</tr></thead><tbody>'; |
|
297
|
|
|
if ($ftrs['grouping_cell_type'] == 'row') { |
|
298
|
|
|
$sReturn .= $tbl['Header']; |
|
299
|
|
|
} |
|
300
|
|
|
} |
|
301
|
|
|
$row_current = array_diff_key($aElements[$rCntr], $hdClmns); |
|
302
|
|
|
if (isset($ftrs['row_colored_alternated'])) { |
|
303
|
|
|
if ($ftrs['row_colored_alternated'][0] == '#') { |
|
304
|
|
|
$color_column_value = $rCntr; |
|
305
|
|
|
} else { |
|
306
|
|
|
$color_column_value = $row_current[$ftrs['row_colored_alternated'][0]]; |
|
307
|
|
|
} |
|
308
|
|
|
if ($remebered_value != $color_column_value) { |
|
309
|
|
|
if (isset($color_no)) { |
|
310
|
|
|
$color_no = 1; |
|
311
|
|
|
} else { |
|
312
|
|
|
$color_no = 2; |
|
313
|
|
|
} |
|
314
|
|
|
$remebered_value = $color_column_value; |
|
315
|
|
|
} |
|
316
|
|
|
$color = ' style="background-color: ' . $ftrs['row_colored_alternated'][$color_no] . ';"'; |
|
317
|
|
|
} else { |
|
318
|
|
|
if (isset($ftrs['RowStyle'])) { |
|
319
|
|
|
$color = ' style="' . $aElements[$rCntr][$ftrs['RowStyle']] . '"'; |
|
320
|
|
|
} else { |
|
321
|
|
|
$color = ''; |
|
322
|
|
|
} |
|
323
|
|
|
} |
|
324
|
|
|
$tbl['tr_Color'] = '<tr' . $color . '>'; |
|
325
|
|
|
// Grouping column |
|
326
|
|
|
if (isset($ftrs['grouping_cell'])) { |
|
327
|
|
|
foreach ($aElements[$rCntr] as $key => $value) { |
|
328
|
|
|
if (($ftrs['grouping_cell'] == $key) && ($remindGroupValue != $value)) { |
|
329
|
|
|
switch ($ftrs['grouping_cell_type']) { |
|
330
|
|
|
case 'row': |
|
331
|
|
|
$sReturn .= $tbl['tr_Color'] . '<td ' . 'colspan="' . $iTableColumns . '">' |
|
332
|
|
|
. $this->setStringIntoTag($value, 'div', ['class' => 'rowGroup rounded']) |
|
333
|
|
|
. '</td></tr>'; |
|
334
|
|
|
break; |
|
335
|
|
|
case 'tab': |
|
336
|
|
|
if (is_null($remindGroupValue)) { |
|
337
|
|
|
if (isset($ftrs['showGroupingCounter'])) { |
|
338
|
|
|
$groupCounter = 0; |
|
339
|
|
|
} |
|
340
|
|
|
} else { |
|
341
|
|
|
$sReturn .= '</tbody></table>'; |
|
342
|
|
|
if (isset($ftrs['showGroupingCounter'])) { |
|
343
|
|
|
$sReturn .= $this->updateDivTitleName($remindGroupValue, $groupCounter); |
|
|
|
|
|
|
344
|
|
|
$groupCounter = 0; |
|
345
|
|
|
} |
|
346
|
|
|
$sReturn .= '</div>'; |
|
347
|
|
|
} |
|
348
|
|
|
$sReturn .= '<div class="tabbertab'; |
|
349
|
|
|
if (isset($ftrs['grouping_default_tab'])) { |
|
350
|
|
|
$sReturn .= ($ftrs['grouping_default_tab'] == $value ? ' tabbertabdefault' : ''); |
|
351
|
|
|
} |
|
352
|
|
|
$sReturn .= '" id="tab_' . $this->cleanStringForId($value) . '" ' |
|
353
|
|
|
. 'title="' . $value . '">' |
|
354
|
|
|
. $tbl['Def'] . $tbl['Head'] . $tbl['Header']; |
|
355
|
|
|
break; |
|
356
|
|
|
} |
|
357
|
|
|
$remindGroupValue = $value; |
|
358
|
|
|
} |
|
359
|
|
|
} |
|
360
|
|
|
} |
|
361
|
|
|
if (isset($ftrs['grouping_cell'])) { |
|
362
|
|
|
if ($ftrs['grouping_cell_type'] == 'tab') { |
|
363
|
|
|
if (isset($ftrs['showGroupingCounter'])) { |
|
364
|
|
|
$groupCounter++; |
|
365
|
|
|
} |
|
366
|
|
|
} |
|
367
|
|
|
} |
|
368
|
|
|
$sReturn .= $tbl['tr_Color']; |
|
369
|
|
|
// Action column |
|
370
|
|
|
if (isset($ftrs['actions'])) { |
|
371
|
|
|
$sReturn .= '<td style="white-space:nowrap;">'; |
|
372
|
|
|
$action_argument = 0; |
|
373
|
|
|
if (isset($ftrs['actions']['key'])) { |
|
374
|
|
|
$action_key = $ftrs['actions']['key']; |
|
375
|
|
|
} else { |
|
376
|
|
|
$action_key = 'view'; |
|
377
|
|
|
} |
|
378
|
|
|
if (isset($ftrs['action_prefix'])) { |
|
379
|
|
|
$actPrfx = $ftrs['action_prefix'] . '&'; |
|
380
|
|
|
$action_key = 'view2'; |
|
381
|
|
|
} else { |
|
382
|
|
|
$actPrfx = ''; |
|
383
|
|
|
} |
|
384
|
|
|
foreach ($ftrs['actions'] as $key => $value) { |
|
385
|
|
|
if ($action_argument != 0) { |
|
386
|
|
|
$sReturn .= ' '; |
|
387
|
|
|
} |
|
388
|
|
|
switch ($key) { |
|
389
|
|
|
case 'checkbox': |
|
390
|
|
|
$checkboxName = $value . '[]'; |
|
391
|
|
|
$checkboxNameS = $value; |
|
392
|
|
|
$sReturn .= ' <input type="checkbox" name="' . $checkboxName |
|
393
|
|
|
. '" id="n' . $aElements[$rCntr][$value] |
|
394
|
|
|
. '" value="' . $aElements[$rCntr][$value] . '" '; |
|
395
|
|
|
if (isset($_REQUEST[$checkboxNameS])) { |
|
396
|
|
|
if (is_array($_REQUEST[$checkboxNameS])) { |
|
397
|
|
|
if (in_array($aElements[$rCntr][$value], $_REQUEST[$checkboxNameS])) { |
|
398
|
|
|
$sReturn .= 'checked="checked" '; |
|
399
|
|
|
} |
|
400
|
|
|
} else { |
|
401
|
|
|
if ($aElements[$rCntr][$value] == $_REQUEST[$checkboxNameS]) { |
|
402
|
|
|
$sReturn .= 'checked="checked" '; |
|
403
|
|
|
} |
|
404
|
|
|
} |
|
405
|
|
|
} |
|
406
|
|
|
if (strpos($_REQUEST['view'], 'multiEdit') !== false) { |
|
407
|
|
|
$sReturn .= 'disabled="disabled" '; |
|
408
|
|
|
} |
|
409
|
|
|
$sReturn .= '/>'; |
|
410
|
|
|
break; |
|
411
|
|
|
case 'checkbox_inlineEdit': |
|
412
|
|
|
$checkboxName = $value . '[]'; |
|
413
|
|
|
$checkboxNameS = $value; |
|
414
|
|
|
$sReturn .= ' <input type="checkbox" name="' . $checkboxName |
|
415
|
|
|
. '" id="n' . $aElements[$rCntr][$value] . '" value="' |
|
416
|
|
|
. $aElements[$rCntr][$value] . '"/>'; |
|
417
|
|
|
break; |
|
418
|
|
|
case 'edit': |
|
419
|
|
|
$edt = ''; |
|
420
|
|
|
if (isset($ftrs['NoAjaxEditing'])) { |
|
421
|
|
|
$edt .= $_SERVER['PHP_SELF'] . '?' . $actPrfx |
|
422
|
|
|
. $action_key . '=' . $value[0] . '&'; |
|
423
|
|
|
$iActArgs = count($value[1]); |
|
424
|
|
|
for ($cntr2 = 0; $cntr2 < $iActArgs; $cntr2++) { |
|
425
|
|
|
$edt .= $value[1][$cntr2] . '=' . $aElements[$rCntr][$value[1][$cntr2]]; |
|
426
|
|
|
} |
|
427
|
|
|
$sReturn .= '<a href="' . $edt . '"><i class="fa fa-pencil"> </i></a>'; |
|
428
|
|
View Code Duplication |
} else { |
|
|
|
|
|
|
429
|
|
|
$edt .= 'javascript:loadAE(\'' . $_SERVER['PHP_SELF'] . '?' |
|
430
|
|
|
. $actPrfx . $action_key . '=' . $value[0] . '&'; |
|
431
|
|
|
$iActArgs = count($value[1]); |
|
432
|
|
|
for ($cntr2 = 0; $cntr2 < $iActArgs; $cntr2++) { |
|
433
|
|
|
$edt .= $value[1][$cntr2] . '=' . $aElements[$rCntr][$value[1][$cntr2]]; |
|
434
|
|
|
} |
|
435
|
|
|
$edt .= '\');'; |
|
436
|
|
|
$sReturn .= '<a href="#" onclick="' . $edt . '">' |
|
437
|
|
|
. '<i class="fa fa-pencil"> </i></a>'; |
|
438
|
|
|
} |
|
439
|
|
|
break; |
|
440
|
|
|
case 'list2': |
|
441
|
|
|
$edt = ''; |
|
442
|
|
|
if (isset($ftrs['NoAjaxEditing'])) { |
|
443
|
|
|
$sReturn .= '<a href="?' . $actPrfx . $action_key . '=' . $value[0] . '&'; |
|
444
|
|
|
$iActArgs = count($value[1]); |
|
445
|
|
|
for ($cntr2 = 0; $cntr2 < $iActArgs; $cntr2++) { |
|
446
|
|
|
$sReturn .= $value[1][$cntr2] . '=' . $aElements[$rCntr][$value[1][$cntr2]]; |
|
447
|
|
|
} |
|
448
|
|
|
$sReturn .= '"><i class="fa fa-list"> </i></a>'; |
|
449
|
|
View Code Duplication |
} else { |
|
|
|
|
|
|
450
|
|
|
$edt .= 'javascript:loadAE(\'' . $_SERVER['PHP_SELF'] . '?' |
|
451
|
|
|
. $actPrfx . $action_key . '=' . $value[0] . '&'; |
|
452
|
|
|
$iActArgs = count($value[1]); |
|
453
|
|
|
for ($cntr2 = 0; $cntr2 < $iActArgs; $cntr2++) { |
|
454
|
|
|
$edt .= $value[1][$cntr2] . '=' . $aElements[$rCntr][$value[1][$cntr2]]; |
|
455
|
|
|
} |
|
456
|
|
|
$edt .= '\');'; |
|
457
|
|
|
$sReturn .= '<a href="#" onclick="' . $edt . '">' |
|
458
|
|
|
. '<i class="fa fa-list"> </i></a>'; |
|
459
|
|
|
} |
|
460
|
|
|
break; |
|
461
|
|
|
case 'delete': |
|
462
|
|
|
$sReturn .= '<a href="javascript:setQuest(\'' . $value[0] . '\',\''; |
|
463
|
|
|
$iActArgs = count($value[1]); |
|
464
|
|
|
for ($cntr2 = 0; $cntr2 < $iActArgs; $cntr2++) { |
|
465
|
|
|
$sReturn .= $value[1][$cntr2] . '=' . $aElements[$rCntr][$value[1][$cntr2]]; |
|
466
|
|
|
} |
|
467
|
|
|
$sReturn .= '\');"><i class="fa fa-times"> </i></a>'; |
|
468
|
|
|
break; |
|
469
|
|
|
} |
|
470
|
|
|
$action_argument += 1; |
|
471
|
|
|
} |
|
472
|
|
|
$sReturn .= '</td>'; |
|
473
|
|
|
} |
|
474
|
|
|
// Regular columns |
|
475
|
|
|
$sReturn .= $this->setTableCell($row_current, $ftrs); |
|
476
|
|
|
// Computed columns |
|
477
|
|
|
if (isset($ftrs['computed_columns'])) { |
|
478
|
|
|
foreach ($ftrs['computed_columns'] as $key => $value) { |
|
479
|
|
|
if ($value[0] == '%') { |
|
480
|
|
|
$dec = $value[2] + 2; |
|
481
|
|
|
} else { |
|
482
|
|
|
$dec = $value[2]; |
|
483
|
|
|
} |
|
484
|
|
|
switch ($value[1]) { |
|
485
|
|
|
case '/': |
|
486
|
|
|
// next variable is only to avoid a long line |
|
487
|
|
|
$shorter = [ |
|
488
|
|
|
$aElements[$rCntr][$value[3]], |
|
489
|
|
|
$aElements[$rCntr][$value[4]], |
|
490
|
|
|
]; |
|
491
|
|
|
$aElements[$rCntr][$key] = $this->setDividedResult($shorter[0], $shorter[1], $dec); |
|
|
|
|
|
|
492
|
|
|
break; |
|
493
|
|
|
case '+': |
|
494
|
|
|
// next variable is only to avoid a long line |
|
495
|
|
|
$iTemp = $this->setArrayValuesAsKey([ |
|
|
|
|
|
|
496
|
|
|
$value[0], |
|
497
|
|
|
$value[1], |
|
498
|
|
|
$value[2] |
|
499
|
|
|
]); |
|
500
|
|
|
$aTemp = array_diff($value, $iTemp); |
|
501
|
|
|
$aElements[$rCntr][$key] = 0; |
|
502
|
|
|
foreach ($aTemp as $sValue) { |
|
503
|
|
|
$aElements[$rCntr][$key] += $aElements[$rCntr][$sValue]; |
|
504
|
|
|
} |
|
505
|
|
|
break; |
|
506
|
|
|
default: |
|
507
|
|
|
$row_computed[$key] = ''; |
|
|
|
|
|
|
508
|
|
|
break; |
|
509
|
|
|
} |
|
510
|
|
|
if ($value[0] == '%') { |
|
511
|
|
|
$row_computed[$key] = ($aElements[$rCntr][$key] * 100); |
|
|
|
|
|
|
512
|
|
|
$dec -= 2; |
|
513
|
|
|
} else { |
|
514
|
|
|
$row_computed[$key] = $aElements[$rCntr][$key]; |
|
515
|
|
|
} |
|
516
|
|
|
$decimals[$key] = $dec; |
|
|
|
|
|
|
517
|
|
|
} |
|
518
|
|
|
// displaying them |
|
519
|
|
|
$sReturn .= $this->setTableCell($row_computed, ['decimals' => $decimals]); |
|
|
|
|
|
|
520
|
|
|
} |
|
521
|
|
|
$sReturn .= '</tr>'; |
|
522
|
|
|
} |
|
523
|
|
View Code Duplication |
if (isset($iStartingPageRecord)) { |
|
|
|
|
|
|
524
|
|
|
$pgn = $this->setPagination($ftrs['limits'][0], $ftrs['limits'][1], $ftrs['limits'][2]); |
|
|
|
|
|
|
525
|
|
|
$sReturn .= '<tr>' . $this->setStringIntoTag($pgn, 'th', ['colspan' => $iTableColumns]) . '</tr>'; |
|
526
|
|
|
} |
|
527
|
|
|
$sReturn .= '</tbody></table>'; |
|
528
|
|
|
if ($ftrs['grouping_cell_type'] == 'tab') { |
|
529
|
|
|
if (isset($ftrs['showGroupingCounter'])) { |
|
530
|
|
|
$sReturn .= $this->updateDivTitleName($remindGroupValue, $groupCounter); |
|
531
|
|
|
} |
|
532
|
|
|
$sReturn .= '</div><!-- from ' . $remindGroupValue . ' -->'; |
|
533
|
|
|
if (!isset($ftrs['noGlobalTab'])) { |
|
534
|
|
|
$sReturn .= '</div><!-- from global tab -->'; |
|
535
|
|
|
} |
|
536
|
|
|
} |
|
537
|
|
|
if (isset($ftrs['actions']['checkbox'])) { |
|
538
|
|
|
if (strpos($_REQUEST['view'], 'multiEdit') === false) { |
|
539
|
|
|
$sReturn .= '<a href="#" onclick="javascript:checking(\'' . $checkboxFormId |
|
|
|
|
|
|
540
|
|
|
. '\',\'' . $checkboxName . '\',true);">Check All</a> ' |
|
|
|
|
|
|
541
|
|
|
. '<a href="#" onclick="javascript:checking(\'' . $checkboxFormId |
|
542
|
|
|
. '\',\'' . $checkboxName . '\',false);">Uncheck All</a> ' |
|
543
|
|
|
. '<input type="hidden" name="action" value="multiEdit_' . $checkboxNameS . '" />'; |
|
|
|
|
|
|
544
|
|
View Code Duplication |
if (isset($ftrs['hiddenInput'])) { |
|
|
|
|
|
|
545
|
|
|
if (is_array($ftrs['hiddenInput'])) { |
|
546
|
|
|
foreach ($ftrs['hiddenInput'] as $valueF) { |
|
547
|
|
|
$sReturn .= '<input type="hidden" name="' . $valueF |
|
548
|
|
|
. '" value="' . $_REQUEST[$valueF] . '" />'; |
|
549
|
|
|
} |
|
550
|
|
|
} else { |
|
551
|
|
|
$sReturn .= '<input type="hidden" name="' . $ftrs['hiddenInput'] |
|
552
|
|
|
. '" value="' . $_REQUEST[$ftrs['hiddenInput']] . '" />'; |
|
553
|
|
|
} |
|
554
|
|
|
} |
|
555
|
|
|
$sReturn .= '<input style="margin: 0 3em 0 3em;" type="submit" ' . 'value="Edit selected" />'; |
|
556
|
|
|
} |
|
557
|
|
|
$sReturn .= '</form>'; |
|
558
|
|
|
} |
|
559
|
|
|
if (isset($ftrs['actions']['checkbox_inlineEdit'])) { |
|
560
|
|
|
$sReturn .= '<a href="#" onclick="javascript:checking(\'' . $checkboxFormId |
|
561
|
|
|
. '\',\'' . $checkboxName . '\',true);">Check All</a> ' |
|
562
|
|
|
. '<a href="#" onclick="javascript:checking(\'' . $checkboxFormId |
|
563
|
|
|
. '\',\'' . $checkboxName . '\',false);">Uncheck All</a> '; |
|
564
|
|
|
if (isset($ftrs['visibleInput'])) { |
|
565
|
|
|
$sReturn .= $ftrs['visibleInput']; |
|
566
|
|
|
} |
|
567
|
|
|
$sReturn .= '<input type="hidden" name="view" value="save_' . $checkboxNameS . '" />'; |
|
568
|
|
View Code Duplication |
if (isset($ftrs['hiddenInput'])) { |
|
|
|
|
|
|
569
|
|
|
if (is_array($ftrs['hiddenInput'])) { |
|
570
|
|
|
foreach ($ftrs['hiddenInput'] as $valueF) { |
|
571
|
|
|
$sReturn .= '<input type="hidden" name="' . $valueF |
|
572
|
|
|
. '" value="' . $_REQUEST[$valueF] . '" />'; |
|
573
|
|
|
} |
|
574
|
|
|
} else { |
|
575
|
|
|
$sReturn .= '<input type="hidden" name="' . $ftrs['hiddenInput'] |
|
576
|
|
|
. '" value="' . $_REQUEST[$ftrs['hiddenInput']] . '" />'; |
|
577
|
|
|
} |
|
578
|
|
|
} |
|
579
|
|
|
$sReturn .= '<input style="margin: 0 3em 0 3em;" type="submit" value="Store the modification" />'; |
|
580
|
|
|
$sReturn .= '</form>'; |
|
581
|
|
|
} |
|
582
|
|
|
return $sReturn; |
|
583
|
|
|
} |
|
584
|
|
|
|
|
585
|
|
|
/** |
|
586
|
|
|
* Set a control to a user-friendly calendar |
|
587
|
|
|
* |
|
588
|
|
|
* @param string $controlName |
|
589
|
|
|
* @param string $additionalStyle |
|
590
|
|
|
* @return string |
|
591
|
|
|
*/ |
|
592
|
|
View Code Duplication |
public function setCalendarControl($controlName, $additionalStyle = '') |
|
|
|
|
|
|
593
|
|
|
{ |
|
594
|
|
|
return $this->setStringIntoTag(' ', 'span', [ |
|
595
|
|
|
'onclick' => implode('', [ |
|
596
|
|
|
'javascript:NewCssCal(\'' . $controlName, |
|
597
|
|
|
'\',\'yyyyMMdd\',\'dropdown\',false,\'24\',false);', |
|
598
|
|
|
]), |
|
599
|
|
|
'class' => 'fa fa-calendar', |
|
600
|
|
|
'id' => $controlName . '_picker', |
|
601
|
|
|
'style' => 'cursor:pointer;' . $additionalStyle, |
|
602
|
|
|
]); |
|
603
|
|
|
} |
|
604
|
|
|
|
|
605
|
|
|
/** |
|
606
|
|
|
* Set a control to a user-friendly calendar with time included |
|
607
|
|
|
* |
|
608
|
|
|
* @param string $controlName |
|
609
|
|
|
* @param string $additionalStyle |
|
610
|
|
|
* @return string |
|
611
|
|
|
*/ |
|
612
|
|
View Code Duplication |
public function setCalendarControlWithTime($controlName, $additionalStyle = '') |
|
|
|
|
|
|
613
|
|
|
{ |
|
614
|
|
|
return $this->setStringIntoTag(' ', 'span', [ |
|
615
|
|
|
'onclick' => implode('', [ |
|
616
|
|
|
'javascript:NewCssCal(\'' . $controlName, |
|
617
|
|
|
'\',\'yyyyMMdd\',\'dropdown\',true,\'24\',true);', |
|
618
|
|
|
]), |
|
619
|
|
|
'class' => 'fa fa-calendar', |
|
620
|
|
|
'id' => $controlName . '_picker', |
|
621
|
|
|
'style' => 'cursor:pointer;' . $additionalStyle, |
|
622
|
|
|
]); |
|
623
|
|
|
} |
|
624
|
|
|
|
|
625
|
|
|
/** |
|
626
|
|
|
* Cleans a string for certain internal rules |
|
627
|
|
|
* |
|
628
|
|
|
* @param type $urlString |
|
629
|
|
|
* @return type |
|
630
|
|
|
*/ |
|
631
|
|
|
protected function setCleanUrl($urlString) |
|
632
|
|
|
{ |
|
633
|
|
|
$arrayToReplace = [ |
|
634
|
|
|
'&' => '&', |
|
635
|
|
|
'&' => '&', |
|
636
|
|
|
'&amp;' => '&', |
|
637
|
|
|
' ' => '%20', |
|
638
|
|
|
]; |
|
639
|
|
|
$kys = array_keys($arrayToReplace); |
|
640
|
|
|
$vls = array_values($arrayToReplace); |
|
641
|
|
|
return str_replace($kys, $vls, filter_var($urlString, FILTER_SANITIZE_URL)); |
|
642
|
|
|
} |
|
643
|
|
|
|
|
644
|
|
|
/** |
|
645
|
|
|
* Returns a div tag that clear any float |
|
646
|
|
|
* |
|
647
|
|
|
* @param integer $height |
|
648
|
|
|
*/ |
|
649
|
|
View Code Duplication |
protected function setClearBoth1px($height = 1) |
|
|
|
|
|
|
650
|
|
|
{ |
|
651
|
|
|
return $this->setStringIntoTag(' ', 'div', [ |
|
652
|
|
|
'style' => implode('', [ |
|
653
|
|
|
'height:' . $height . 'px;', |
|
654
|
|
|
'line-height:' . $height . 'px;', |
|
655
|
|
|
'float:none;', |
|
656
|
|
|
'clear:both;', |
|
657
|
|
|
'margin:0px;' |
|
658
|
|
|
]) |
|
659
|
|
|
]); |
|
660
|
|
|
} |
|
661
|
|
|
|
|
662
|
|
|
/** |
|
663
|
|
|
* Returns css codes |
|
664
|
|
|
* |
|
665
|
|
|
* @param string $cssContent |
|
666
|
|
|
* @param array $optionalFlags |
|
667
|
|
|
* @return string |
|
668
|
|
|
*/ |
|
669
|
|
|
protected function setCssContent($cssContent, $optionalFlags = null) |
|
670
|
|
|
{ |
|
671
|
|
|
if (is_null($optionalFlags)) { |
|
672
|
|
|
$attr['media'] = 'all'; |
|
|
|
|
|
|
673
|
|
|
} else { |
|
674
|
|
|
$knownAttributes = ['media']; |
|
675
|
|
|
foreach ($knownAttributes as $value) { |
|
676
|
|
|
if (in_array($value, array_keys($optionalFlags))) { |
|
677
|
|
|
$attr[$value] = $optionalFlags[$value]; |
|
|
|
|
|
|
678
|
|
|
} |
|
679
|
|
|
} |
|
680
|
|
|
} |
|
681
|
|
|
return '<style type="text/css" media="' . $attr['media'] . '">' |
|
|
|
|
|
|
682
|
|
|
. $cssContent |
|
683
|
|
|
. '</style>'; |
|
684
|
|
|
} |
|
685
|
|
|
|
|
686
|
|
|
/** |
|
687
|
|
|
* Returns css link to a given file |
|
688
|
|
|
* |
|
689
|
|
|
* @param string $cssFile |
|
|
|
|
|
|
690
|
|
|
* @return string |
|
691
|
|
|
*/ |
|
692
|
|
|
protected function setCssFile($cssFileName, $hostsWithoutCDNrq = null) |
|
693
|
|
|
{ |
|
694
|
|
|
$sReturn = null; |
|
|
|
|
|
|
695
|
|
|
if (is_null($hostsWithoutCDNrq)) { |
|
696
|
|
|
$hostsWithoutCDNrq = []; |
|
697
|
|
|
} |
|
698
|
|
|
if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) { |
|
699
|
|
|
$sReturn = '<link rel="stylesheet" type="text/css" href="' |
|
700
|
|
|
. filter_var($cssFileName, FILTER_SANITIZE_STRING) |
|
701
|
|
|
. '" />'; |
|
702
|
|
|
} else { |
|
703
|
|
|
$patternFound = $this->setCssFileCDN($cssFileName); |
|
|
|
|
|
|
704
|
|
|
$sReturn = '<link rel="stylesheet" type="text/css" href="' |
|
705
|
|
|
. filter_var($patternFound[1], FILTER_SANITIZE_STRING) |
|
706
|
|
|
. '" />'; |
|
707
|
|
|
} |
|
708
|
|
|
return $sReturn; |
|
709
|
|
|
} |
|
710
|
|
|
|
|
711
|
|
|
/** |
|
712
|
|
|
* Builds a structured modern message |
|
713
|
|
|
* |
|
714
|
|
|
* @param string $sType |
|
715
|
|
|
* @param string $sTitle |
|
716
|
|
|
* @param string $sMsg |
|
717
|
|
|
* @param boolean $skipBr |
|
718
|
|
|
*/ |
|
719
|
|
|
protected function setFeedbackModern($sType, $sTitle, $sMsg, $skipBr = false) |
|
720
|
|
|
{ |
|
721
|
|
|
$formatTitle[] = 'margin-top:-5px;margin-right:20px;padding:5px;'; |
|
|
|
|
|
|
722
|
|
|
$formatMessage[] = 'display:inline;padding-right:5px;padding-bottom:5px;'; |
|
|
|
|
|
|
723
|
|
|
switch ($sType) { |
|
724
|
|
|
case 'alert': |
|
725
|
|
|
$formatTitle[] = 'border:medium solid orange;background-color:orange;color:navy;'; |
|
726
|
|
|
$formatMessage[] = 'background-color:navy;color:orange;border:medium solid orange;'; |
|
727
|
|
|
break; |
|
728
|
|
|
case 'check': |
|
729
|
|
|
$formatTitle[] = 'border:medium solid green;background-color:green;color:white;'; |
|
730
|
|
|
$formatMessage[] = 'background-color:yellow;color:green;border:medium solid green;'; |
|
731
|
|
|
break; |
|
732
|
|
|
case 'error': |
|
733
|
|
|
$formatTitle[] = 'border:medium solid red;background-color:red;color:white;'; |
|
734
|
|
|
$formatMessage[] = 'background-color:yellow;color:red;border:medium solid red;'; |
|
735
|
|
|
break; |
|
736
|
|
|
case 'info': |
|
737
|
|
|
$formatTitle[] = 'border:medium solid black;background-color:black;color:white;font-weight:bold;'; |
|
738
|
|
|
$formatMessage[] = 'background-color: white; color: black;border:medium solid black;'; |
|
739
|
|
|
break; |
|
740
|
|
|
} |
|
741
|
|
|
if ($sTitle == 'light') { |
|
742
|
|
|
echo $sMsg; |
|
743
|
|
|
} else { |
|
744
|
|
|
$legend = $this->setStringIntoTag($sTitle, 'legend', ['style' => implode('', $formatTitle)]); |
|
745
|
|
|
return implode('', [ |
|
746
|
|
|
($skipBr ? '' : '<br/>'), |
|
747
|
|
|
$this->setStringIntoTag($legend . $sMsg, 'fieldset', [ |
|
748
|
|
|
'style' => implode('', $formatMessage) |
|
749
|
|
|
]), |
|
750
|
|
|
]); |
|
751
|
|
|
} |
|
752
|
|
|
} |
|
753
|
|
|
|
|
754
|
|
|
/** |
|
755
|
|
|
* Outputs an HTML footer |
|
756
|
|
|
* |
|
757
|
|
|
* @param array $footerInjected |
|
758
|
|
|
* @return string |
|
759
|
|
|
*/ |
|
760
|
|
|
protected function setFooterCommon($footerInjected = null) |
|
|
|
|
|
|
761
|
|
|
{ |
|
762
|
|
|
if (isset($_REQUEST['specialHook']) && (in_array('noFooter', $_REQUEST['specialHook']))) { |
|
763
|
|
|
return ''; |
|
764
|
|
|
} |
|
765
|
|
|
$sReturn = ''; |
|
766
|
|
|
if (!is_null($footerInjected)) { |
|
767
|
|
|
$sReturn = $footerInjected; |
|
768
|
|
|
if (is_array($footerInjected)) { |
|
769
|
|
|
$sReturn = implode('', $footerInjected); |
|
770
|
|
|
} |
|
771
|
|
|
} |
|
772
|
|
|
return $sReturn . '</body></html>'; |
|
773
|
|
|
} |
|
774
|
|
|
|
|
775
|
|
|
/** |
|
776
|
|
|
* Sets the gzip footer for HTML |
|
777
|
|
|
*/ |
|
778
|
|
|
protected function setFooterGZiped() |
|
|
|
|
|
|
779
|
|
|
{ |
|
780
|
|
|
if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { |
|
781
|
|
|
if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { |
|
782
|
|
|
if (extension_loaded('zlib')) { |
|
783
|
|
|
$gzip_contents = ob_get_contents(); |
|
784
|
|
|
ob_end_clean(); |
|
785
|
|
|
$gzip_size = strlen($gzip_contents); |
|
786
|
|
|
$gzip_crc = crc32($gzip_contents); |
|
787
|
|
|
$gzip_contents = gzcompress($gzip_contents, 9); |
|
788
|
|
|
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4); |
|
789
|
|
|
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; |
|
790
|
|
|
echo $gzip_contents; |
|
791
|
|
|
echo pack('V', $gzip_crc); |
|
792
|
|
|
echo pack('V', $gzip_size); |
|
793
|
|
|
} |
|
794
|
|
|
} |
|
795
|
|
|
} |
|
796
|
|
|
} |
|
797
|
|
|
|
|
798
|
|
|
/** |
|
799
|
|
|
* Outputs an HTML header |
|
800
|
|
|
* |
|
801
|
|
|
* @param array $headerFeatures |
|
802
|
|
|
* @return string |
|
803
|
|
|
*/ |
|
804
|
|
|
protected function setHeaderCommon($headerFeatures = null) |
|
|
|
|
|
|
805
|
|
|
{ |
|
806
|
|
|
$sReturn = []; |
|
807
|
|
|
if (isset($_REQUEST['specialHook']) && (in_array('noHeader', $_REQUEST['specialHook']))) { |
|
808
|
|
|
$sReturn[] = ''; // no Header |
|
809
|
|
|
} else { |
|
810
|
|
|
$fixedHeaderElements = [ |
|
811
|
|
|
'start' => '<!DOCTYPE html>', |
|
812
|
|
|
'lang' => '<html lang="en-US">', |
|
813
|
|
|
'head' => '<head>', |
|
814
|
|
|
'charset' => '<meta charset="utf-8" />', |
|
815
|
|
|
'viewport' => '<meta name="viewport" content="' . implode(', ', [ |
|
816
|
|
|
'width=device-width', |
|
817
|
|
|
'height=device-height', |
|
818
|
|
|
'initial-scale=1', |
|
819
|
|
|
]) . '" />', |
|
820
|
|
|
]; |
|
821
|
|
|
if (!is_null($headerFeatures)) { |
|
822
|
|
|
if (is_array($headerFeatures)) { |
|
823
|
|
|
$aFeatures = []; |
|
824
|
|
|
foreach ($headerFeatures as $key => $value) { |
|
825
|
|
|
switch ($key) { |
|
826
|
|
View Code Duplication |
case 'css': |
|
|
|
|
|
|
827
|
|
|
if (is_array($value)) { |
|
828
|
|
|
foreach ($value as $value2) { |
|
829
|
|
|
$aFeatures[] = $this->setCssFile(filter_var($value2, FILTER_SANITIZE_URL)); |
|
830
|
|
|
} |
|
831
|
|
|
} else { |
|
832
|
|
|
$aFeatures[] = $this->setCssFile(filter_var($value, FILTER_SANITIZE_URL)); |
|
833
|
|
|
} |
|
834
|
|
|
break; |
|
835
|
|
View Code Duplication |
case 'javascript': |
|
|
|
|
|
|
836
|
|
|
if (is_array($value)) { |
|
837
|
|
|
foreach ($value as $value2) { |
|
838
|
|
|
$vl = filter_var($value2, FILTER_SANITIZE_URL); |
|
839
|
|
|
$aFeatures[] = $this->setJavascriptFile($vl); |
|
840
|
|
|
} |
|
841
|
|
|
} else { |
|
842
|
|
|
$aFeatures[] = $this->setJavascriptFile(filter_var($value, FILTER_SANITIZE_URL)); |
|
843
|
|
|
} |
|
844
|
|
|
break; |
|
845
|
|
|
case 'lang': |
|
846
|
|
|
$fixedHeaderElements['lang'] = '<html lang="' |
|
847
|
|
|
. filter_var($value, FILTER_SANITIZE_STRING) . '">'; |
|
848
|
|
|
break; |
|
849
|
|
|
case 'title': |
|
850
|
|
|
$aFeatures[] = '<title>' |
|
851
|
|
|
. filter_var($value, FILTER_SANITIZE_STRING) . '</title>'; |
|
852
|
|
|
break; |
|
853
|
|
|
} |
|
854
|
|
|
} |
|
855
|
|
|
$sReturn[] = implode('', $fixedHeaderElements) |
|
856
|
|
|
. implode('', $aFeatures) |
|
857
|
|
|
. '</head>' |
|
858
|
|
|
. '<body>'; |
|
859
|
|
|
} else { |
|
860
|
|
|
$sReturn[] = implode('', $fixedHeaderElements) |
|
861
|
|
|
. '</head>' |
|
862
|
|
|
. '<body>' |
|
863
|
|
|
. '<p style="background-color:red;color:#FFF;">The parameter sent to ' |
|
864
|
|
|
. __FUNCTION__ . ' must be an array</p>' |
|
865
|
|
|
. $this->setFooterCommon(); |
|
866
|
|
|
throw new \Exception($sReturn); |
|
867
|
|
|
} |
|
868
|
|
|
} |
|
869
|
|
|
} |
|
870
|
|
|
return implode('', $sReturn); |
|
871
|
|
|
} |
|
872
|
|
|
|
|
873
|
|
|
/** |
|
874
|
|
|
* Sets the gzip header for HTML |
|
875
|
|
|
*/ |
|
876
|
|
|
protected function setHeaderGZiped() |
|
|
|
|
|
|
877
|
|
|
{ |
|
878
|
|
|
if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { |
|
879
|
|
|
if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { |
|
880
|
|
|
if (extension_loaded('zlib')) { |
|
881
|
|
|
ob_start(); |
|
882
|
|
|
ob_implicit_flush(0); |
|
883
|
|
|
header('Content-Encoding: gzip'); |
|
884
|
|
|
} |
|
885
|
|
|
} |
|
886
|
|
|
} |
|
887
|
|
|
} |
|
888
|
|
|
|
|
889
|
|
|
/** |
|
890
|
|
|
* Sets the no-cache header |
|
891
|
|
|
*/ |
|
892
|
|
|
protected function setHeaderNoCache($contentType = 'application/json') |
|
893
|
|
|
{ |
|
894
|
|
|
header("Content-Type: " . $contentType . "; charset=utf-8"); |
|
895
|
|
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
896
|
|
|
header("Cache-Control: no-store, no-cache, must-revalidate"); |
|
897
|
|
|
header("Cache-Control: post-check=0, pre-check=0", false); |
|
898
|
|
|
header("Pragma: no-cache"); |
|
899
|
|
|
} |
|
900
|
|
|
|
|
901
|
|
|
/** |
|
902
|
|
|
* Returns javascript function to support Add or Edit through Ajax |
|
903
|
|
|
* |
|
904
|
|
|
* @return string |
|
905
|
|
|
*/ |
|
906
|
|
|
protected function setJavascriptAddEditByAjax($tabName = 'tabStandard') |
|
907
|
|
|
{ |
|
908
|
|
|
return $this->setJavascriptContent(implode('', [ |
|
909
|
|
|
'function loadAE(action) {', |
|
910
|
|
|
'document.getElementById("' . $tabName . '").tabber.tabShow(1);', |
|
911
|
|
|
'$("#DynamicAddEditSpacer").load(action', |
|
912
|
|
|
'+"&specialHook[]=noHeader"', |
|
913
|
|
|
'+"&specialHook[]=noMenu"', |
|
914
|
|
|
'+"&specialHook[]=noContainer"', |
|
915
|
|
|
'+"&specialHook[]=noFooter"', |
|
916
|
|
|
');', |
|
917
|
|
|
'}', |
|
918
|
|
|
])); |
|
919
|
|
|
} |
|
920
|
|
|
|
|
921
|
|
|
/** |
|
922
|
|
|
* Returns javascript codes |
|
923
|
|
|
* |
|
924
|
|
|
* @param string $javascriptContent |
|
925
|
|
|
* @return string |
|
926
|
|
|
*/ |
|
927
|
|
|
protected function setJavascriptContent($javascriptContent) |
|
928
|
|
|
{ |
|
929
|
|
|
return '<script type="text/javascript">' . $javascriptContent . '</script>'; |
|
930
|
|
|
} |
|
931
|
|
|
|
|
932
|
|
|
/** |
|
933
|
|
|
* Builds up a confirmation dialog and return delection if Yes |
|
934
|
|
|
* |
|
935
|
|
|
* @return string |
|
936
|
|
|
*/ |
|
937
|
|
|
protected function setJavascriptDeleteWithConfirmation() |
|
938
|
|
|
{ |
|
939
|
|
|
return $this->setJavascriptContent(' function setQuest(a, b) { ' |
|
940
|
|
|
. 'c = a.indexOf("_"); switch(a.slice(0, c)) { ' |
|
941
|
|
|
. 'case \'delete\': ' |
|
942
|
|
|
. 'if (confirm(\'' . $this->lclMsgCmn('i18n_ActionDelete_ConfirmationQuestion') . '\')) { ' |
|
|
|
|
|
|
943
|
|
|
. 'window.location = document.location.protocol + "//" + ' |
|
944
|
|
|
. 'document.location.host + document.location.pathname + ' |
|
945
|
|
|
. '"?view=" + a + "&" + b; } break; } }'); |
|
946
|
|
|
} |
|
947
|
|
|
|
|
948
|
|
|
/** |
|
949
|
|
|
* Returns javascript link to a given file |
|
950
|
|
|
* |
|
951
|
|
|
* @param string $jsFileName |
|
952
|
|
|
* @return string |
|
953
|
|
|
*/ |
|
954
|
|
|
protected function setJavascriptFile($jsFileName, $hostsWithoutCDNrq = null) |
|
955
|
|
|
{ |
|
956
|
|
|
$sReturn = null; |
|
|
|
|
|
|
957
|
|
|
if (is_null($hostsWithoutCDNrq)) { |
|
958
|
|
|
$hostsWithoutCDNrq = []; |
|
959
|
|
|
} |
|
960
|
|
|
if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) { |
|
961
|
|
|
$sReturn = '<script type="text/javascript" src="' . $jsFileName . '"></script>'; |
|
962
|
|
|
} else { |
|
963
|
|
|
$patternFound = $this->setJavascriptFileCDN($jsFileName); |
|
|
|
|
|
|
964
|
|
|
$sReturn = '<script type="text/javascript" src="' . $patternFound[1] . '"></script>' |
|
965
|
|
|
. $patternFound[2]; |
|
966
|
|
|
} |
|
967
|
|
|
return $sReturn; |
|
968
|
|
|
} |
|
969
|
|
|
|
|
970
|
|
|
/** |
|
971
|
|
|
* Returns javascript codes from given file |
|
972
|
|
|
* |
|
973
|
|
|
* @param string $jsFileName |
|
974
|
|
|
* @return string |
|
975
|
|
|
*/ |
|
976
|
|
|
protected function setJavascriptFileContent($jsFileName) |
|
977
|
|
|
{ |
|
978
|
|
|
$sReturn[] = '<script type="text/javascript"><!-- '; |
|
|
|
|
|
|
979
|
|
|
$sReturn[] = file_get_contents($jsFileName, true); |
|
980
|
|
|
$sReturn[] = ' //--></script>'; |
|
981
|
|
|
return implode('', $sReturn); |
|
982
|
|
|
} |
|
983
|
|
|
|
|
984
|
|
|
/** |
|
985
|
|
|
* Creates all the child tags required to populate a SELECT tag |
|
986
|
|
|
* |
|
987
|
|
|
* @param array $aElements |
|
988
|
|
|
* @param string|array $sDefaultValue |
|
989
|
|
|
* @param array $features_array |
|
990
|
|
|
* @return string |
|
991
|
|
|
*/ |
|
992
|
|
|
private function setOptionsForSelect($aElements, $sDefaultValue, $features_array = []) |
|
993
|
|
|
{ |
|
994
|
|
|
$string2return = ''; |
|
995
|
|
|
if (is_array($features_array)) { |
|
996
|
|
|
if (in_array('include_null', $features_array)) { |
|
997
|
|
|
$string2return .= '<option value="NULL"> </option>'; |
|
998
|
|
|
} |
|
999
|
|
|
if (isset($features_array['defaultValue_isSubstring'])) { |
|
1000
|
|
|
$default_value_array = explode($features_array['defaultValue_isSubstring'], $sDefaultValue); |
|
1001
|
|
|
} |
|
1002
|
|
|
} |
|
1003
|
|
|
$current_group = null; |
|
1004
|
|
|
foreach ($aElements as $key => $value) { |
|
1005
|
|
|
if (isset($features_array['grouping'])) { |
|
1006
|
|
|
$temporary_string = substr($value, 0, strpos($value, $features_array['grouping']) + 1); |
|
1007
|
|
|
if ($current_group != $temporary_string) { |
|
1008
|
|
|
if ($current_group != '') { |
|
1009
|
|
|
$string2return .= '</optgroup>'; |
|
1010
|
|
|
} |
|
1011
|
|
|
$current_group = $temporary_string; |
|
1012
|
|
|
$string2return .= '<optgroup label="' |
|
1013
|
|
|
. str_replace($features_array['grouping'], '', $current_group) . '">'; |
|
1014
|
|
|
} |
|
1015
|
|
|
} else { |
|
1016
|
|
|
$current_group = ''; |
|
1017
|
|
|
} |
|
1018
|
|
|
$string2return .= '<option value="' . $key . '"'; |
|
1019
|
|
|
if (is_array($sDefaultValue)) { |
|
1020
|
|
|
if (in_array($key, $sDefaultValue)) { |
|
1021
|
|
|
$string2return .= ' selected="selected"'; |
|
1022
|
|
|
} |
|
1023
|
|
|
} else { |
|
1024
|
|
|
if (strcasecmp($key, $sDefaultValue) === 0) { |
|
1025
|
|
|
$string2return .= ' selected="selected"'; |
|
1026
|
|
|
} |
|
1027
|
|
|
if (isset($default_value_array) && is_array($default_value_array)) { |
|
1028
|
|
|
if (in_array($key, $default_value_array)) { |
|
1029
|
|
|
$string2return .= ' selected="selected"'; |
|
1030
|
|
|
} |
|
1031
|
|
|
} |
|
1032
|
|
|
} |
|
1033
|
|
|
if (array_key_exists('styleForOption', $features_array)) { |
|
1034
|
|
|
$string2return .= ' style="' . $features_array['style'] . '"'; |
|
1035
|
|
|
} |
|
1036
|
|
|
$string2return .= '>' . str_replace(['&', $current_group], ['&', ''], $value) . '</option>'; |
|
1037
|
|
|
} |
|
1038
|
|
|
if (isset($features_array['grouping'])) { |
|
1039
|
|
|
if ($current_group != '') { |
|
1040
|
|
|
$string2return .= '</optgroup>'; |
|
1041
|
|
|
} |
|
1042
|
|
|
} |
|
1043
|
|
|
return $string2return; |
|
1044
|
|
|
} |
|
1045
|
|
|
|
|
1046
|
|
|
/** |
|
1047
|
|
|
* Puts a given string into a specific short tag |
|
1048
|
|
|
* |
|
1049
|
|
|
* @param string $sTag |
|
1050
|
|
|
* @param array $features |
|
1051
|
|
|
* @return string |
|
1052
|
|
|
*/ |
|
1053
|
|
|
protected function setStringIntoShortTag($sTag, $features = null) |
|
1054
|
|
|
{ |
|
1055
|
|
|
$attributes = ''; |
|
1056
|
|
|
if (!is_null($features)) { |
|
1057
|
|
|
foreach ($features as $key => $value) { |
|
1058
|
|
|
if ($key != 'dont_close') { |
|
1059
|
|
|
$attributes .= ' ' . $key . '="'; |
|
1060
|
|
View Code Duplication |
if (is_array($value)) { |
|
|
|
|
|
|
1061
|
|
|
foreach ($value as $key2 => $value2) { |
|
1062
|
|
|
$attributes .= $key2 . ':' . $value2 . ';'; |
|
1063
|
|
|
} |
|
1064
|
|
|
} else { |
|
1065
|
|
|
$attributes .= str_replace('"', '\'', $value); |
|
1066
|
|
|
} |
|
1067
|
|
|
$attributes .= '"'; |
|
1068
|
|
|
} |
|
1069
|
|
|
} |
|
1070
|
|
|
} |
|
1071
|
|
|
if (isset($features['dont_close'])) { |
|
1072
|
|
|
$sReturn = '<' . $sTag . $attributes . '>'; |
|
1073
|
|
|
} else { |
|
1074
|
|
|
$sReturn = '<' . $sTag . $attributes . ' />'; |
|
1075
|
|
|
} |
|
1076
|
|
|
return $sReturn; |
|
1077
|
|
|
} |
|
1078
|
|
|
|
|
1079
|
|
|
/** |
|
1080
|
|
|
* Puts a given string into a specific tag |
|
1081
|
|
|
* |
|
1082
|
|
|
* @param string $sString |
|
1083
|
|
|
* @param string $sTag |
|
1084
|
|
|
* @param array $features |
|
1085
|
|
|
* @return string |
|
1086
|
|
|
*/ |
|
1087
|
|
|
protected function setStringIntoTag($sString, $sTag, $features = null) |
|
1088
|
|
|
{ |
|
1089
|
|
|
$attributes = ''; |
|
1090
|
|
|
if (!is_null($features)) { |
|
1091
|
|
|
foreach ($features as $key => $value) { |
|
1092
|
|
|
$attributes .= ' ' . $key . '="'; |
|
1093
|
|
View Code Duplication |
if (is_array($value)) { |
|
|
|
|
|
|
1094
|
|
|
foreach ($value as $key2 => $value2) { |
|
1095
|
|
|
$attributes .= $key2 . ':' . $value2 . ';'; |
|
1096
|
|
|
} |
|
1097
|
|
|
} else { |
|
1098
|
|
|
$attributes .= $value; |
|
1099
|
|
|
} |
|
1100
|
|
|
$attributes .= '"'; |
|
1101
|
|
|
} |
|
1102
|
|
|
} |
|
1103
|
|
|
return '<' . $sTag . $attributes . '>' . $sString . '</' . $sTag . '>'; |
|
1104
|
|
|
} |
|
1105
|
|
|
|
|
1106
|
|
|
/** |
|
1107
|
|
|
* Generates a table cell |
|
1108
|
|
|
* |
|
1109
|
|
|
* @param array $aElements |
|
1110
|
|
|
* @param array $features |
|
1111
|
|
|
* @return string |
|
1112
|
|
|
*/ |
|
1113
|
|
|
private function setTableCell($aElements, $features = null) |
|
1114
|
|
|
{ |
|
1115
|
|
|
$sReturn = null; |
|
1116
|
|
|
foreach ($aElements as $key => $value) { |
|
1117
|
|
|
$value = str_replace(['& ', '\"', "\'"], ['& ', '"', "'"], $value); |
|
1118
|
|
|
if ((isset($features['grouping_cell'])) && ($features['grouping_cell'] == $key)) { |
|
|
|
|
|
|
1119
|
|
|
// just skip |
|
1120
|
|
|
} else { |
|
1121
|
|
|
$sReturn .= '<td '; |
|
1122
|
|
|
if (isset($features['column_formatting'][$key])) { |
|
1123
|
|
|
switch ($features['column_formatting'][$key]) { |
|
1124
|
|
|
case '@': |
|
1125
|
|
|
$sReturn .= 'style="text-align:left;">' . $value; |
|
1126
|
|
|
break; |
|
1127
|
|
|
case 'right': |
|
1128
|
|
|
$sReturn .= 'style="text-align:right;">' . $value; |
|
1129
|
|
|
break; |
|
1130
|
|
|
default: |
|
1131
|
|
|
$sReturn .= '???'; |
|
1132
|
|
|
break; |
|
1133
|
|
|
} |
|
1134
|
|
|
} else { |
|
1135
|
|
|
if (is_numeric($value)) { |
|
1136
|
|
|
if (substr($value, 0, 1) === '0') { |
|
1137
|
|
|
$sReturn .= 'style="text-align: right;">' . $value; |
|
1138
|
|
|
} else { |
|
1139
|
|
|
$decimals = 0; |
|
1140
|
|
|
if (isset($features['no_of_decimals'])) { |
|
1141
|
|
|
$decimals = $features['no_of_decimals']; |
|
1142
|
|
|
} |
|
1143
|
|
|
if (isset($features['decimals']) && array_key_exists($key, $features['decimals'])) { |
|
1144
|
|
|
$decimals = $features['decimals'][$key]; |
|
1145
|
|
|
} |
|
1146
|
|
|
$sReturn .= 'style="text-align: right;">'; |
|
1147
|
|
|
$sReturn .= $this->setNumberFormat($value, [ |
|
|
|
|
|
|
1148
|
|
|
'MinFractionDigits' => $decimals, |
|
1149
|
|
|
'MaxFractionDigits' => $decimals |
|
1150
|
|
|
]); |
|
1151
|
|
|
} |
|
1152
|
|
|
} else { |
|
1153
|
|
|
$outputet = false; |
|
1154
|
|
|
if ((strpos($value, '-') !== false) && (strlen($value) == 10)) { |
|
1155
|
|
|
if (preg_match("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $value, $regs)) { |
|
1156
|
|
|
$outputet = true; |
|
1157
|
|
|
$sReturn .= 'style="text-align:right;width: 10px;">' |
|
1158
|
|
|
. $regs[3] . '.' . $regs[2] . '.' . $regs[1]; |
|
1159
|
|
|
} |
|
1160
|
|
|
} |
|
1161
|
|
|
if (!$outputet) { |
|
1162
|
|
|
$sReturn .= 'style="text-align:left;">' . $value; |
|
1163
|
|
|
} |
|
1164
|
|
|
} |
|
1165
|
|
|
} |
|
1166
|
|
|
$sReturn .= '</td>'; |
|
1167
|
|
|
} |
|
1168
|
|
|
} |
|
1169
|
|
|
return $sReturn; |
|
1170
|
|
|
} |
|
1171
|
|
|
|
|
1172
|
|
|
/** |
|
1173
|
|
|
* Generates a table header |
|
1174
|
|
|
* |
|
1175
|
|
|
* @param array $aElements |
|
1176
|
|
|
* @param boolean $bHeadersBreaked |
|
1177
|
|
|
* @return string |
|
1178
|
|
|
*/ |
|
1179
|
|
|
private function setTableHeader($aElements, $bHeadersBreaked) |
|
1180
|
|
|
{ |
|
1181
|
|
|
if ($bHeadersBreaked) { |
|
1182
|
|
|
$aTableHeader = $this->setArrayToArrayKbr($aElements); |
|
|
|
|
|
|
1183
|
|
|
} else { |
|
1184
|
|
|
$aTableHeader = $aElements; |
|
1185
|
|
|
} |
|
1186
|
|
|
$sReturn[] = null; |
|
|
|
|
|
|
1187
|
|
|
foreach (array_keys($aTableHeader) as $value) { |
|
1188
|
|
|
$sReturn[] = $this->setStringIntoTag($value, 'th'); |
|
1189
|
|
|
} |
|
1190
|
|
|
return implode('', $sReturn); |
|
1191
|
|
|
} |
|
1192
|
|
|
|
|
1193
|
|
|
protected function setViewModernLinkAdd($identifier, $ftrs = null) |
|
1194
|
|
|
{ |
|
1195
|
|
|
$btnText = '<i class="fa fa-plus-square"> </i>' . ' ' . $this->lclMsgCmn('i18n_AddNewRecord'); |
|
|
|
|
|
|
1196
|
|
|
return $this->setStringIntoTag($btnText, 'a', [ |
|
1197
|
|
|
'href' => $this->setViewModernLinkAddUrl($identifier, $ftrs), |
|
1198
|
|
|
'style' => 'margin: 5px 0px 10px 0px; display: inline-block;', |
|
1199
|
|
|
]); |
|
1200
|
|
|
} |
|
1201
|
|
|
|
|
1202
|
|
|
protected function setViewModernLinkAddInjectedArguments($identifier, $ftrs = null) |
|
|
|
|
|
|
1203
|
|
|
{ |
|
1204
|
|
|
$sArgmnts = ''; |
|
1205
|
|
|
if (isset($ftrs['injectAddArguments'])) { |
|
1206
|
|
|
foreach ($ftrs['injectAddArguments'] as $key => $value) { |
|
1207
|
|
|
$sArgmnts .= '&' . $key . '=' . $value; |
|
1208
|
|
|
} |
|
1209
|
|
|
} |
|
1210
|
|
|
return $sArgmnts; |
|
1211
|
|
|
} |
|
1212
|
|
|
|
|
1213
|
|
|
protected function setViewModernLinkAddUrl($identifier, $ftrs = null) |
|
1214
|
|
|
{ |
|
1215
|
|
|
$sArgmnts = $this->setViewModernLinkAddInjectedArguments($identifier); |
|
1216
|
|
|
$rqst = new \Symfony\Component\HttpFoundation\Request; |
|
1217
|
|
|
$addingUrl = $rqst->server->get('PHP_SELF') . '?view=add_' . $identifier . $sArgmnts; |
|
1218
|
|
|
if (!isset($ftrs['NoAjax'])) { |
|
1219
|
|
|
$addingUrl = 'javascript:loadAE(\'' . $addingUrl . '\');'; |
|
1220
|
|
|
} |
|
1221
|
|
|
return $addingUrl; |
|
1222
|
|
|
} |
|
1223
|
|
|
|
|
1224
|
|
|
protected function updateDivTitleName($rememberGroupVal, $groupCounter) |
|
1225
|
|
|
{ |
|
1226
|
|
|
$jsContent = '$(document).ready(function() { $("#tab_' |
|
1227
|
|
|
. $this->cleanStringForId($rememberGroupVal) . '").attr("title", "' |
|
1228
|
|
|
. $rememberGroupVal . ' (' . $groupCounter . ')"); });'; |
|
1229
|
|
|
return $this->setJavascriptContent($jsContent); |
|
1230
|
|
|
} |
|
1231
|
|
|
} |
|
1232
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.