[TASK] Migrate extension install upgrade wizards to new API
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Updates / RteHtmlAreaExtractionUpdate.php
1 <?php
2 namespace TYPO3\CMS\Install\Updates;
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\Core\Utility\ExtensionManagementUtility;
18
19 /**
20 * Installs and downloads EXT:rtehtmlarea if needed
21 */
22 class RteHtmlAreaExtractionUpdate extends AbstractDownloadExtensionUpdate
23 {
24 /**
25 * @var \TYPO3\CMS\Install\Updates\Confirmation
26 */
27 protected $confirmation;
28
29 public function __construct()
30 {
31 $this->extension = new ExtensionModel(
32 'rtehtmlarea',
33 'RTE HTMLArea for TYPO3',
34 '8.7.0',
35 'friendsoftypo3/rtehtmlarea',
36 'The extension provides the well-known RTE used in previous TYPO3 versions, if handling of images or custom legacy configurations are necessary.'
37 );
38
39 $this->confirmation = new Confirmation(
40 'Are you sure?',
41 'You should install EXT:rtehtmlarea only if you really need it. ' . $this->extension->getDescription(),
42 false
43 );
44 }
45
46 /**
47 * Return a confirmation message instance
48 *
49 * @return \TYPO3\CMS\Install\Updates\Confirmation
50 */
51 public function getConfirmation(): Confirmation
52 {
53 return $this->confirmation;
54 }
55
56 /**
57 * Return the identifier for this wizard
58 * This should be the same string as used in the ext_localconf class registration
59 *
60 * @return string
61 */
62 public function getIdentifier(): string
63 {
64 return 'rtehtmlareaExtension';
65 }
66
67 /**
68 * Return the speaking name of this wizard
69 *
70 * @return string
71 */
72 public function getTitle(): string
73 {
74 return 'Install extension "rtehtmlarea" from TER';
75 }
76
77 /**
78 * Return the description for this wizard
79 *
80 * @return string
81 */
82 public function getDescription(): string
83 {
84 return 'The extension "rtehtmlarea" (RTE based on HtmlArea) was extracted into'
85 . ' the TYPO3 Extension Repository. This update downloads the TYPO3 Extension from the TER.'
86 . ' Use this if you have special configurations or image handling within Rich Text fields and uninstall the shipped EXT:rte_ckeditor.';
87 }
88
89 /**
90 * Is an update necessary?
91 * Is used to determine whether a wizard needs to be run.
92 *
93 * @return bool
94 */
95 public function updateNecessary(): bool
96 {
97 return !ExtensionManagementUtility::isLoaded('rtehtmlarea');
98 }
99
100 /**
101 * Returns an array of class names of Prerequisite classes
102 * This way a wizard can define dependencies like "database up-to-date" or
103 * "reference index updated"
104 *
105 * @return string[]
106 */
107 public function getPrerequisites(): array
108 {
109 return [];
110 }
111 }