2 namespace TYPO3\CMS\Rtehtmlarea\Hook\Install;
28 protected $title =
'Rte "acronym" button renamed to "abbreviation"';
41 $pagesCount = count($pages);
42 $description =
'<p>The RTE "acronym" button is deprecated and replaced by the "abbreviation" button since TYPO3 CMS 7.0.</p>' . LF .
'<p>Page TSconfig currently includes the string "acronym" on <strong>' . strval($pagesCount) .
' pages</strong> (including deleted and hidden pages).</p>' . LF;
45 foreach ($pages as $page) {
46 $pagesUids[] = $page[
'uid'];
48 $description .=
'<p>Pages id\'s: ' . implode(
', ', $pagesUids) .
'</p>';
52 if (!empty($updateablePages)) {
53 $description .=
'<p>This wizard will perform automatic replacement of the string "acronym" by the string "abbreviation" on the Page TSconfig of <strong>' . strval(count($updateablePages)) .
' pages</strong> (including deleted and hidden):</p>' . LF;
63 $description .=
'<p>Only page records are searched for the string "acronym". However, such string may also be used in BE group and BE user records. These are not searched nor updated by this wizard.</p>'
64 . LF .
'<p>Page TSconfig may also be included from external files. These are not updated by this wizard. If required, the update will need to be done manually.</p>'
65 . LF .
'<p>Note that this string replacement will apply to all contents of PageTSconfig.</p>'
66 . LF .
'<p>Note that the configuration of RTE processing options (RTE.default.proc) may also include the string "acronym".</p>';
82 if (empty($customMessages)) {
83 $pagesCount = count($pages);
86 if (!empty($updateablePages)) {
87 $this->
updatePages($updateablePages, $dbQueries, $customMessages);
89 if (empty($customMessages)) {
90 if (count($updateablePages) !== $pagesCount) {
91 $customMessages =
'Some deprecated Page TSconfig properties were found. However, the wizard was unable to automatically replace all the deprecated properties found. Some properties will have to be replaced manually.';
95 $customMessages =
'Some deprecated Page TSconfig properties were found. However, the wizard was unable to automatically replace any of the deprecated properties found. These properties will have to be replaced manually.';
100 return empty($customMessages);
113 $fields =
'uid, TSconfig';
115 $where =
'TSconfig LIKE BINARY ' . $db->fullQuoteStr(
'%acronym%',
'pages');
116 $res = $db->exec_SELECTquery($fields, $table, $where);
117 $dbQueries[] = str_replace(LF,
' ', $db->debug_lastBuiltQuery);
118 if ($db->sql_error()) {
119 $customMessages =
'SQL-ERROR: ' . htmlspecialchars($db->sql_error());
122 while ($row = $db->sql_fetch_assoc($res)) {
136 foreach ($pages as $index => $page) {
137 $updatedPageTSConfig = str_replace(
'acronym',
'abbreviation', $page[
'TSconfig']);
138 if ($updatedPageTSConfig == $page[
'TSconfig']) {
139 unset($pages[$index]);
141 $pages[$index][
'TSconfig'] = $updatedPageTSConfig;
154 protected function updatePages($pages, &$dbQueries, &$customMessages)
157 foreach ($pages as $page) {
159 $where =
'uid =' . $page[
'uid'];
160 $field_values = array(
161 'TSconfig' => $page[
'TSconfig']
163 $db->exec_UPDATEquery($table, $where, $field_values);
164 $dbQueries[] = str_replace(LF,
' ', $db->debug_lastBuiltQuery);
165 if ($db->sql_error()) {
166 $customMessages .=
'SQL-ERROR: ' . htmlspecialchars($db->sql_error()) . LF . LF;