[TASK] Comment legacy files to be removed with 6.2
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / Controller / WizardController.php
1 <?php
2 namespace TYPO3\CMS\Form\Controller;
3
4 /**
5 * The form wizard controller
6 *
7 * @category Controller
8 * @author Patrick Broens <patrick@patrickbroens.nl>
9 */
10 class WizardController {
11
12 /**
13 * Dispatch on action
14 *
15 * Calls the requested action
16 *
17 * @return void
18 */
19 public function dispatch() {
20 switch (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('action')) {
21 case 'save':
22 $this->saveAction();
23 break;
24 case 'load':
25 $this->loadAction();
26 break;
27 default:
28 $this->indexAction();
29 }
30 }
31
32 /**
33 * The index action
34 *
35 * The action which should be taken when the wizard is loaded
36 *
37 * @return void
38 */
39 protected function indexAction() {
40 /** @var $view \TYPO3\CMS\Form\View\Wizard\WizardView */
41 $view = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\View\\Wizard\\WizardView', $this->getRepository());
42 $view->render();
43 }
44
45 /**
46 * The save action
47 *
48 * The action which should be taken when the form in the wizard is saved
49 *
50 * @return void
51 */
52 protected function saveAction() {
53 /** @var $view \TYPO3\CMS\Form\View\Wizard\SaveWizardView */
54 $view = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\View\\Wizard\\SaveWizardView', $this->getRepository());
55 $view->render();
56 }
57
58 /**
59 * The load action
60 *
61 * The action which should be taken when the form in the wizard is loaded
62 *
63 * @return void
64 */
65 protected function loadAction() {
66 /** @var $view \TYPO3\CMS\Form\View\Wizard\LoadWizardView */
67 $view = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\View\\Wizard\\LoadWizardView', $this->getRepository());
68 $view->render();
69 }
70
71 /**
72 * Gets the repository object.
73 *
74 * @return \TYPO3\CMS\Form\Domain\Repository\ContentRepository
75 */
76 protected function getRepository() {
77 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Domain\\Repository\\ContentRepository');
78 }
79
80 }
81
82
83 ?>