|
133 | 133 | $html = '<p>[%no_active_users_found%]</p>';
|
134 | 134 | } else {
|
135 | 135 | $now = $modx->timestamp($_SERVER['REQUEST_TIME']);
|
136 |
| - $ph['now'] = strftime('%H:%M:%S', $now); |
| 136 | + if (extension_loaded('intl')) { |
| 137 | + // https://www.php.net/manual/en/class.intldateformatter.php |
| 138 | + // https://www.php.net/manual/en/datetime.createfromformat.php |
| 139 | + $formatter = new IntlDateFormatter( |
| 140 | + evolutionCMS()->getConfig('manager_language'), |
| 141 | + IntlDateFormatter::MEDIUM, |
| 142 | + IntlDateFormatter::MEDIUM, |
| 143 | + null, |
| 144 | + null, |
| 145 | + "hh:mm:ss" |
| 146 | + ); |
| 147 | + $ph['now'] = $formatter->format($now); |
| 148 | + } else { |
| 149 | + $ph['now'] = strftime('%H:%M:%S', $now); |
| 150 | + } |
137 | 151 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
|
138 | 152 | $html = '
|
139 | 153 | <div class="card-body">
|
|
163 | 177 | $webicon = $activeUser['internalKey'] < 0 ? '<i class="[&icon_globe&]"></i>' : '';
|
164 | 178 | $ip = $activeUser['ip'] === '::1' ? '127.0.0.1' : $activeUser['ip'];
|
165 | 179 | $currentaction = EvolutionCMS\Legacy\LogHandler::getAction($activeUser['action'], $activeUser['id']);
|
| 180 | + if (extension_loaded('intl')) { |
| 181 | + // https://www.php.net/manual/en/class.intldateformatter.php |
| 182 | + // https://www.php.net/manual/en/datetime.createfromformat.php |
| 183 | + $formatter = new IntlDateFormatter( |
| 184 | + evolutionCMS()->getConfig('manager_language'), |
| 185 | + IntlDateFormatter::MEDIUM, |
| 186 | + IntlDateFormatter::MEDIUM, |
| 187 | + null, |
| 188 | + null, |
| 189 | + "hh:mm:ss" |
| 190 | + ); |
| 191 | + $lasthit = $formatter->format($modx->timestamp($activeUser['lasthit'])); |
| 192 | + } else { |
| 193 | + $lasthit = strftime('%H:%M:%S', $modx->timestamp($activeUser['lasthit'])); |
| 194 | + } |
166 | 195 | $userList[] = array(
|
167 | 196 | $idle,
|
168 | 197 | '',
|
169 | 198 | $activeUser['username'],
|
170 | 199 | $webicon,
|
171 | 200 | abs($activeUser['internalKey']),
|
172 | 201 | $ip,
|
173 |
| - strftime('%H:%M:%S', $modx->timestamp($activeUser['lasthit'])), |
| 202 | + $lasthit, |
174 | 203 | $currentaction
|
175 | 204 | );
|
176 | 205 | }
|
|
280 | 309 | 'title' => '[%welcome_title%]',
|
281 | 310 | 'body' => '
|
282 | 311 | <div class="wm_buttons card-body">' .
|
283 |
| - ($modx->hasPermission("new_document") ? ' |
| 312 | + ($modx->hasPermission("new_document") ? ' |
284 | 313 | <span class="wm_button">
|
285 | 314 | <a target="main" href="index.php?a=4">
|
286 | 315 | <i class="'. $_style['icon_document'] . $_style['icon_size_2x'] . $_style['icon_size_fix'] . '"></i>
|
|
294 | 323 | </a>
|
295 | 324 | </span>
|
296 | 325 | ' : '') .
|
297 |
| - ($modx->hasPermission("assets_images") ? ' |
| 326 | + ($modx->hasPermission("assets_images") ? ' |
298 | 327 | <span class="wm_button">
|
299 | 328 | <a target="main" href="media/browser/mcpuk/browse.php?filemanager=media/browser/mcpuk/browse.php&type=images">
|
300 | 329 | <i class="'. $_style['icon_camera'] . $_style['icon_size_2x'] . $_style['icon_size_fix'] . '"></i>
|
301 | 330 | <span>[%images_management%]</span>
|
302 | 331 | </a>
|
303 | 332 | </span>
|
304 | 333 | ' : '') .
|
305 |
| - ($modx->hasPermission("assets_files") ? ' |
| 334 | + ($modx->hasPermission("assets_files") ? ' |
306 | 335 | <span class="wm_button">
|
307 | 336 | <a target="main" href="media/browser/mcpuk/browse.php?filemanager=media/browser/mcpuk/browse.php&type=files">
|
308 | 337 | <i class="'. $_style['icon_files'] . $_style['icon_size_2x'] . $_style['icon_size_fix'] . '"></i>
|
309 | 338 | <span>[%files_management%]</span>
|
310 | 339 | </a>
|
311 | 340 | </span>
|
312 | 341 | ' : '') .
|
313 |
| - ($modx->hasPermission("bk_manager") ? ' |
| 342 | + ($modx->hasPermission("bk_manager") ? ' |
314 | 343 | <span class="wm_button">
|
315 | 344 | <a target="main" href="index.php?a=93">
|
316 | 345 | <i class="'. $_style['icon_database'] . $_style['icon_size_2x'] . $_style['icon_size_fix'] . '"></i>
|
317 | 346 | <span>[%bk_manager%]</span>
|
318 | 347 | </a>
|
319 | 348 | </span>
|
320 | 349 | ' : '') .
|
321 |
| - ($modx->hasPermission("change_password") ? ' |
| 350 | + ($modx->hasPermission("change_password") ? ' |
322 | 351 | <span class="wm_button">
|
323 | 352 | <a target="main" href="index.php?a=28">
|
324 | 353 | <i class="'. $_style['icon_lock'] . $_style['icon_size_2x'] . $_style['icon_size_fix'] . '"></i>
|
|
351 | 380 | <td>[%yourinfo_total_logins%]</td>
|
352 | 381 | <td><b>[[$_SESSION[\'mgrLogincount\']:math(\'%s+1\')]]</b></td>
|
353 | 382 | </tr>' .
|
354 |
| - ($modx->hasPermission("change_password") ? ' |
| 383 | + ($modx->hasPermission("change_password") ? ' |
355 | 384 |
|
356 | 385 | ' : '') . '
|
357 | 386 | </table>
|
|
0 commit comments