fb9bbd16443fe9a2ec33e29fd6ad245997762d95
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Aspect / FileMetadataOverlayAspect.php
1 <?php
2 namespace TYPO3\CMS\Frontend\Aspect;
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 /**
18 * Class FileMetadataTranslationAspect
19 *
20 * We do not have AOP in TYPO3 for now, thus the aspect which
21 * deals with metadata translation is a slot which reacts on a signal
22 * in the Index\MetadataRepository.
23 *
24 * The aspect injects user permissions and mount points into the storage
25 * based on user or group configuration.
26 */
27 class FileMetadataOverlayAspect {
28
29 /**
30 * Do translation and workspace overlay
31 *
32 * @param \ArrayObject $data
33 * @return void
34 */
35 public function languageAndWorkspaceOverlay(\ArrayObject $data) {
36 $overlayedMetaData = $this->getTsfe()->sys_page->getRecordOverlay(
37 'sys_file_metadata',
38 $data->getArrayCopy(),
39 $this->getTsfe()->sys_language_content,
40 $this->getTsfe()->sys_language_contentOL
41 );
42 if ($overlayedMetaData !== NULL) {
43 $data->exchangeArray($overlayedMetaData);
44 }
45 }
46
47 /**
48 * @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
49 */
50 protected function getTsfe() {
51 return $GLOBALS['TSFE'];
52 }
53 }