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