7100e8cf1fabcc481a0e2ea9d1ab3f9643cf7f13
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / PagePositionMap.php
1 <?php
2 namespace TYPO3\CMS\Backend\Tree\View;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Utility\BackendUtility;
18 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
19 use TYPO3\CMS\Core\Database\ConnectionPool;
20 use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
21 use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction;
22 use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
23 use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction;
24 use TYPO3\CMS\Core\Imaging\Icon;
25 use TYPO3\CMS\Core\Imaging\IconFactory;
26 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
27 use TYPO3\CMS\Core\Utility\GeneralUtility;
28 use TYPO3\CMS\Lang\LanguageService;
29
30 /**
31 * Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
32 * Used for pages / tt_content element wizards of various kinds.
33 */
34 class PagePositionMap
35 {
36 // EXTERNAL, static:
37 /**
38 * @var string
39 */
40 public $moveOrCopy = 'move';
41
42 /**
43 * @var int
44 */
45 public $dontPrintPageInsertIcons = 0;
46
47 // How deep the position page tree will go.
48 /**
49 * @var int
50 */
51 public $depth = 2;
52
53 // Can be set to the sys_language uid to select content elements for.
54 /**
55 * @var string
56 */
57 public $cur_sys_language;
58
59 // INTERNAL, dynamic:
60 // Request uri
61 /**
62 * @var string
63 */
64 public $R_URI = '';
65
66 // Element id.
67 /**
68 * @var string
69 */
70 public $elUid = '';
71
72 // tt_content element uid to move.
73 /**
74 * @var string
75 */
76 public $moveUid = '';
77
78 // Caching arrays:
79 /**
80 * @var array
81 */
82 public $getModConfigCache = [];
83
84 /**
85 * @var array
86 */
87 public $checkNewPageCache = [];
88
89 // Label keys:
90 /**
91 * @var string
92 */
93 public $l_insertNewPageHere = 'insertNewPageHere';
94
95 /**
96 * @var string
97 */
98 public $l_insertNewRecordHere = 'insertNewRecordHere';
99
100 /**
101 * @var string
102 */
103 public $modConfigStr = 'mod.web_list.newPageWiz';
104
105 /**
106 * Page tree implementation class name
107 *
108 * @var string
109 */
110 protected $pageTreeClassName = ElementBrowserPageTreeView::class;
111
112 /**
113 * @var IconFactory
114 */
115 protected $iconFactory;
116
117 /**
118 * Constructor allowing to set pageTreeImplementation
119 *
120 * @param string $pageTreeClassName
121 */
122 public function __construct($pageTreeClassName = null)
123 {
124 if ($pageTreeClassName !== null) {
125 $this->pageTreeClassName = $pageTreeClassName;
126 }
127 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
128 }
129
130 /*************************************
131 *
132 * Page position map:
133 *
134 **************************************/
135 /**
136 * Creates a "position tree" based on the page tree.
137 *
138 * @param int $id Current page id
139 * @param array $pageinfo Current page record.
140 * @param string $perms_clause Page selection permission clause.
141 * @param string $R_URI Current REQUEST_URI
142 * @return string HTML code for the tree.
143 */
144 public function positionTree($id, $pageinfo, $perms_clause, $R_URI)
145 {
146 // Make page tree object:
147 /** @var \TYPO3\CMS\Backend\Tree\View\PageTreeView $pageTree */
148 $pageTree = GeneralUtility::makeInstance($this->pageTreeClassName);
149 $pageTree->init(' AND ' . $perms_clause);
150 $pageTree->addField('pid');
151 // Initialize variables:
152 $this->R_URI = $R_URI;
153 $this->elUid = $id;
154 // Create page tree, in $this->depth levels.
155 $pageTree->getTree($pageinfo['pid'], $this->depth);
156 // Initialize variables:
157 $saveLatestUid = [];
158 $latestInvDepth = $this->depth;
159 // Traverse the tree:
160 $lines = [];
161 foreach ($pageTree->tree as $cc => $dat) {
162 // Make link + parameters.
163 $latestInvDepth = $dat['invertedDepth'];
164 $saveLatestUid[$latestInvDepth] = $dat;
165 if (isset($pageTree->tree[$cc - 1])) {
166 $prev_dat = $pageTree->tree[$cc - 1];
167 // If current page, subpage?
168 if ($prev_dat['row']['uid'] == $id) {
169 // 1) It must be allowed to create a new page and 2) If there are subpages there is no need to render a subpage icon here - it'll be done over the subpages...
170 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id) && !($prev_dat['invertedDepth'] > $pageTree->tree[$cc]['invertedDepth'])) {
171 end($lines);
172 $lines[key($lines)] .= '<ul><li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id, 1)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li></ul>';
173 }
174 }
175 // If going down
176 if ($prev_dat['invertedDepth'] > $pageTree->tree[$cc]['invertedDepth']) {
177 $prevPid = $pageTree->tree[$cc]['row']['pid'];
178 } elseif ($prev_dat['invertedDepth'] < $pageTree->tree[$cc]['invertedDepth']) {
179 // If going up
180 // First of all the previous level should have an icon:
181 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) {
182 $prevPid = -$prev_dat['row']['uid'];
183 end($lines);
184 $lines[key($lines)] .= '<ul><li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $prev_dat['row']['pid'], 2)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li></ul>';
185 }
186 // Then set the current prevPid
187 $prevPid = -$prev_dat['row']['pid'];
188 } else {
189 // In on the same level
190 $prevPid = -$prev_dat['row']['uid'];
191 }
192 } else {
193 // First in the tree
194 $prevPid = $dat['row']['pid'];
195 }
196 // print arrow on the same level
197 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
198 $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'], 3)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
199 }
200 // The line with the icon and title:
201 $toolTip = BackendUtility::getRecordToolTip($dat['row'], 'pages');
202 $icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord('pages', $dat['row'], Icon::SIZE_SMALL)->render() . '</span>';
203
204 $lines[] = '<span class="text-nowrap">' . $icon . $this->linkPageTitle($this->boldTitle(htmlspecialchars(GeneralUtility::fixed_lgd_cs($dat['row']['title'], $this->getBackendUser()->uc['titleLen'])), $dat, $id), $dat['row']) . '</span>';
205 }
206 // If the current page was the last in the tree:
207 $prev_dat = end($pageTree->tree);
208 if ($prev_dat['row']['uid'] == $id) {
209 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) {
210 $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id, 4)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
211 }
212 }
213 for ($a = $latestInvDepth; $a <= $this->depth; $a++) {
214 $dat = $saveLatestUid[$a];
215 $prevPid = -$dat['row']['uid'];
216 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
217 $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'], 5)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
218 }
219 }
220
221 $code = '<ul class="list-tree">';
222
223 foreach ($lines as $line) {
224 $code .= '<li>' . $line . '</li>';
225 }
226
227 $code .= '</ul>';
228 return $code;
229 }
230
231 /**
232 * Wrap $t_code in bold IF the $dat uid matches $id
233 *
234 * @param string $t_code Title string
235 * @param array $dat Infomation array with record array inside.
236 * @param int $id The current id.
237 * @return string The title string.
238 */
239 public function boldTitle($t_code, $dat, $id)
240 {
241 if ($dat['row']['uid'] == $id) {
242 $t_code = '<strong>' . $t_code . '</strong>';
243 }
244 return $t_code;
245 }
246
247 /**
248 * Creates the onclick event for the insert-icons.
249 *
250 * TSconfig mod.web_list.newPageWiz.overrideWithExtension may contain an extension which provides a module
251 * to be used instead of the normal create new page wizard.
252 *
253 * @param int $pid The pid.
254 * @param int $newPagePID New page id.
255 * @return string Onclick attribute content
256 */
257 public function onClickEvent($pid, $newPagePID)
258 {
259 $TSconfigProp = $this->getModConfig($newPagePID);
260 if ($TSconfigProp['overrideWithExtension']) {
261 if (ExtensionManagementUtility::isLoaded($TSconfigProp['overrideWithExtension'])) {
262 $onclick = 'window.location.href=' . GeneralUtility::quoteJSvalue(ExtensionManagementUtility::extRelPath($TSconfigProp['overrideWithExtension']) . 'mod1/index.php?cmd=crPage&positionPid=' . $pid) . ';';
263 return $onclick;
264 }
265 }
266 $params = '&edit[pages][' . $pid . ']=new&returnNewPageId=1';
267 return BackendUtility::editOnClick($params, '', $this->R_URI);
268 }
269
270 /**
271 * Get label, htmlspecialchars()'ed
272 *
273 * @return string The localized label for "insert new page here
274 */
275 public function insertlabel()
276 {
277 return htmlspecialchars($this->getLanguageService()->getLL($this->l_insertNewPageHere));
278 }
279
280 /**
281 * Wrapping page title.
282 *
283 * @param string $str Page title.
284 * @param array $rec Page record (?)
285 * @return string Wrapped title.
286 */
287 public function linkPageTitle($str, $rec)
288 {
289 return $str;
290 }
291
292 /**
293 * Checks if the user has permission to created pages inside of the $pid page.
294 * Uses caching so only one regular lookup is made - hence you can call the function multiple times without worrying about performance.
295 *
296 * @param int $pid Page id for which to test.
297 * @return bool
298 */
299 public function checkNewPageInPid($pid)
300 {
301 if (!isset($this->checkNewPageCache[$pid])) {
302 $pidInfo = BackendUtility::getRecord('pages', $pid);
303 $this->checkNewPageCache[$pid] = $this->getBackendUser()->isAdmin() || $this->getBackendUser()->doesUserHaveAccess($pidInfo, 8);
304 }
305 return $this->checkNewPageCache[$pid];
306 }
307
308 /**
309 * Returns module configuration for a pid.
310 *
311 * @param int $pid Page id for which to get the module configuration.
312 * @return array The properties of teh module configuration for the page id.
313 * @see onClickEvent()
314 */
315 public function getModConfig($pid)
316 {
317 if (!isset($this->getModConfigCache[$pid])) {
318 // Acquiring TSconfig for this PID:
319 $this->getModConfigCache[$pid] = BackendUtility::getModTSconfig($pid, $this->modConfigStr);
320 }
321 return $this->getModConfigCache[$pid]['properties'];
322 }
323
324 /*************************************
325 *
326 * Content element positioning:
327 *
328 **************************************/
329 /**
330 * Creates HTML for inserting/moving content elements.
331 *
332 * @param int $pid page id onto which to insert content element.
333 * @param int $moveUid Move-uid (tt_content element uid?)
334 * @param string $colPosList List of columns to show
335 * @param bool $showHidden If not set, then hidden/starttime/endtime records are filtered out.
336 * @param string $R_URI Request URI
337 * @return string HTML
338 */
339 public function printContentElementColumns($pid, $moveUid, $colPosList, $showHidden, $R_URI)
340 {
341 $this->R_URI = $R_URI;
342 $this->moveUid = $moveUid;
343 $colPosArray = GeneralUtility::trimExplode(',', $colPosList, true);
344 $lines = [];
345 foreach ($colPosArray as $kk => $vv) {
346 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
347 $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
348 if ($showHidden) {
349 $queryBuilder->getRestrictions()
350 ->removeByType(HiddenRestriction::class)
351 ->removeByType(StartTimeRestriction::class)
352 ->removeByType(EndTimeRestriction::class);
353 }
354 $queryBuilder
355 ->select('*')
356 ->from('tt_content')
357 ->where(
358 $queryBuilder->expr()->eq('pid', (int)$pid),
359 $queryBuilder->expr()->eq('colPos', (int)$vv)
360 )
361 ->orderBy('sorting');
362
363 if ((string)$this->cur_sys_language !== '') {
364 $queryBuilder->andWhere($queryBuilder->expr()->eq('sys_language_uid', (int)$this->cur_sys_language));
365 }
366
367 $res = $queryBuilder->execute();
368 $lines[$vv] = [];
369 $lines[$vv][] = $this->insertPositionIcon('', $vv, $kk, $moveUid, $pid);
370
371 while ($row = $res->fetch()) {
372 BackendUtility::workspaceOL('tt_content', $row);
373 if (is_array($row)) {
374 $lines[$vv][] = $this->wrapRecordHeader($this->getRecordHeader($row), $row);
375 $lines[$vv][] = $this->insertPositionIcon($row, $vv, $kk, $moveUid, $pid);
376 }
377 }
378 }
379 return $this->printRecordMap($lines, $colPosArray, $pid);
380 }
381
382 /**
383 * Creates the table with the content columns
384 *
385 * @param array $lines Array with arrays of lines for each column
386 * @param array $colPosArray Column position array
387 * @param int $pid The id of the page
388 * @return string HTML
389 */
390 public function printRecordMap($lines, $colPosArray, $pid = 0)
391 {
392 $count = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(count($colPosArray), 1);
393 $backendLayout = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getSelectedBackendLayout', $pid, $this);
394 if (isset($backendLayout['__config']['backend_layout.'])) {
395 $this->getLanguageService()->includeLLFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf');
396 $table = '<div class="table-fit"><table class="table table-condensed table-bordered table-vertical-top">';
397 $colCount = (int)$backendLayout['__config']['backend_layout.']['colCount'];
398 $rowCount = (int)$backendLayout['__config']['backend_layout.']['rowCount'];
399 $table .= '<colgroup>';
400 for ($i = 0; $i < $colCount; $i++) {
401 $table .= '<col style="width:' . 100 / $colCount . '%"></col>';
402 }
403 $table .= '</colgroup>';
404 $table .= '<tbody>';
405 $tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $pid, $this);
406 // Cycle through rows
407 for ($row = 1; $row <= $rowCount; $row++) {
408 $rowConfig = $backendLayout['__config']['backend_layout.']['rows.'][$row . '.'];
409 if (!isset($rowConfig)) {
410 continue;
411 }
412 $table .= '<tr>';
413 for ($col = 1; $col <= $colCount; $col++) {
414 $columnConfig = $rowConfig['columns.'][$col . '.'];
415 if (!isset($columnConfig)) {
416 continue;
417 }
418 // Which tt_content colPos should be displayed inside this cell
419 $columnKey = (int)$columnConfig['colPos'];
420 $head = '';
421 foreach ($tcaItems as $item) {
422 if ($item[1] == $columnKey) {
423 $head = htmlspecialchars($this->getLanguageService()->sL($item[0]));
424 }
425 }
426 // Render the grid cell
427 $table .= '<td'
428 . (isset($columnConfig['colspan']) ? ' colspan="' . $columnConfig['colspan'] . '"' : '')
429 . (isset($columnConfig['rowspan']) ? ' rowspan="' . $columnConfig['rowspan'] . '"' : '')
430 . ' class="col-nowrap col-min'
431 . (!isset($columnConfig['colPos']) ? ' warning' : '')
432 . (isset($columnConfig['colPos']) && !$head ? ' danger' : '') . '">';
433 // Render header
434 $table .= '<p>';
435 if (isset($columnConfig['colPos']) && $head) {
436 $table .= '<strong>' . $this->wrapColumnHeader($head, '', '') . '</strong>';
437 } elseif ($columnConfig['colPos']) {
438 $table .= '<em>' . $this->wrapColumnHeader($this->getLanguageService()->getLL('noAccess'), '', '') . '</em>';
439 } else {
440 $table .= '<em>' . $this->wrapColumnHeader(($columnConfig['name']?: '') . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '', '') . '</em>';
441 }
442 $table .= '</p>';
443 // Render lines
444 if (isset($columnConfig['colPos']) && $head && !empty($lines[$columnKey])) {
445 $table .= '<ul class="list-unstyled">';
446 foreach ($lines[$columnKey] as $line) {
447 $table .= '<li>' . $line . '</li>';
448 }
449 $table .= '</ul>';
450 }
451 $table .= '</td>';
452 }
453 $table .= '</tr>';
454 }
455 $table .= '</tbody>';
456 $table .= '</table></div>';
457 } else {
458 // Traverse the columns here:
459 $row = '';
460 foreach ($colPosArray as $kk => $vv) {
461 $row .= '<td class="col-nowrap col-min" width="' . round(100 / $count) . '%">';
462 $row .= '<p><strong>' . $this->wrapColumnHeader(htmlspecialchars($this->getLanguageService()->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $vv))), $vv) . '</strong></p>';
463 if (!empty($lines[$vv])) {
464 $row .= '<ul class="list-unstyled">';
465 foreach ($lines[$vv] as $line) {
466 $row .= '<li>' . $line . '</li>';
467 }
468 $row .= '</ul>';
469 }
470 $row .= '</td>';
471 }
472 $table = '
473
474 <!--
475 Map of records in columns:
476 -->
477 <div class="table-fit">
478 <table class="table table-condensed table-bordered table-vertical-top">
479 <tr>' . $row . '</tr>
480 </table>
481 </div>
482
483 ';
484 }
485 return $table;
486 }
487
488 /**
489 * Wrapping the column header
490 *
491 * @param string $str Header value
492 * @param string $vv Column info.
493 * @return string
494 * @see printRecordMap()
495 */
496 public function wrapColumnHeader($str, $vv)
497 {
498 return $str;
499 }
500
501 /**
502 * Creates a linked position icon.
503 *
504 * @param mixed $row Element row. If this is an array the link will cause an insert after this content element, otherwise
505 * the link will insert at the first position in the column
506 * @param string $vv Column position value.
507 * @param int $kk Column key.
508 * @param int $moveUid Move uid
509 * @param int $pid PID value.
510 * @return string
511 */
512 public function insertPositionIcon($row, $vv, $kk, $moveUid, $pid)
513 {
514 if (is_array($row) && !empty($row['uid'])) {
515 // Use record uid for the hash when inserting after this content element
516 $uid = $row['uid'];
517 } else {
518 // No uid means insert at first position in the column
519 $uid = '';
520 }
521 $cc = hexdec(substr(md5($uid . '-' . $vv . '-' . $kk), 0, 4));
522 return '<a href="#" onclick="' . htmlspecialchars($this->onClickInsertRecord($row, $vv, $moveUid, $pid, $this->cur_sys_language)) . '">' . '<i class="t3-icon fa fa-long-arrow-left" name="mImgEnd' . $cc . '" title="' . htmlspecialchars($this->getLanguageService()->getLL($this->l_insertNewRecordHere)) . '"></i></a>';
523 }
524
525 /**
526 * Create on-click event value.
527 *
528 * @param mixed $row The record. If this is not an array with the record data the insert will be for the first position
529 * in the column
530 * @param string $vv Column position value.
531 * @param int $moveUid Move uid
532 * @param int $pid PID value.
533 * @param int $sys_lang System language (not used currently)
534 * @return string
535 */
536 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
537 {
538 $table = 'tt_content';
539 if (is_array($row)) {
540 $location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=-' . $row['uid'] . '&prErr=1&uPT=1&vC=' . $this->getBackendUser()->veriCode();
541 } else {
542 $location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&data[' . $table . '][' . $moveUid . '][colPos]=' . $vv . '&prErr=1&vC=' . $this->getBackendUser()->veriCode();
543 }
544 $location .= '&redirect=' . rawurlencode($this->R_URI);
545 // returns to prev. page
546 return 'window.location.href=' . GeneralUtility::quoteJSvalue($location) . ';return false;';
547 }
548
549 /**
550 * Wrapping the record header (from getRecordHeader())
551 *
552 * @param string $str HTML content
553 * @param string $row Record array.
554 * @return string HTML content
555 */
556 public function wrapRecordHeader($str, $row)
557 {
558 return $str;
559 }
560
561 /**
562 * Create record header (includes teh record icon, record title etc.)
563 *
564 * @param array $row Record row.
565 * @return string HTML
566 */
567 public function getRecordHeader($row)
568 {
569 $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
570 $toolTip = BackendUtility::getRecordToolTip($row, 'tt_content');
571 $line = '<span ' . $toolTip . ' title="' . BackendUtility::getRecordIconAltText($row, 'tt_content') . '">' . $iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL)->render() . '</span>';
572 $line .= BackendUtility::getRecordTitle('tt_content', $row, true);
573 return $this->wrapRecordTitle($line, $row);
574 }
575
576 /**
577 * Wrapping the title of the record.
578 *
579 * @param string $str The title value.
580 * @param array $row The record row.
581 * @return string Wrapped title string.
582 */
583 public function wrapRecordTitle($str, $row)
584 {
585 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(['uid' => (int)$row['uid'], 'moveUid' => ''])) . '">' . $str . '</a>';
586 }
587
588 /**
589 * Returns the BackendUser
590 *
591 * @return BackendUserAuthentication
592 */
593 protected function getBackendUser()
594 {
595 return $GLOBALS['BE_USER'];
596 }
597
598 /**
599 * Returns the LanguageService
600 *
601 * @return LanguageService
602 */
603 protected function getLanguageService()
604 {
605 return $GLOBALS['LANG'];
606 }
607 }