[BUGFIX] EXT:form: Make hardcoded messages translatable
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / View / Wizard / AbstractWizardView.php
1 <?php
2 namespace TYPO3\CMS\Form\View\Wizard;
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\Form\Domain\Repository\ContentRepository;
18
19 /**
20 * The form wizard load view
21 *
22 * @author Oliver Hader <oliver.hader@typo3.org>
23 */
24 abstract class AbstractWizardView {
25
26 /**
27 * Is the referenced record available
28 *
29 * @var bool TRUE if available, FALSE if not
30 */
31 protected $recordIsAvailable = FALSE;
32
33 /**
34 * @var ContentRepository
35 */
36 protected $repository;
37
38 /**
39 * Returns an instance of LanguageService
40 *
41 * @return \TYPO3\CMS\Lang\LanguageService
42 */
43 protected function getLanguageService() {
44 return $GLOBALS['LANG'];
45 }
46
47 /**
48 * Creates the object and calls the initialize() method.
49 *
50 * @param ContentRepository $repository
51 */
52 public function __construct(ContentRepository $repository) {
53 $this->setRepository($repository);
54 $this->getLanguageService()->includeLLFile('EXT:form/Resources/Private/Language/locallang_wizard.xlf');
55 }
56
57 /**
58 * Sets the content repository to be used.
59 *
60 * @param ContentRepository $repository
61 * @return void
62 */
63 public function setRepository(ContentRepository $repository) {
64 $this->repository = $repository;
65 }
66
67 /**
68 * The main render method
69 *
70 * @return void
71 */
72 abstract public function render();
73
74 }