2 namespace TYPO3\CMS\Frontend\Hooks;
45 $pagesEnableFields =
$GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'enablecolumns'];
46 foreach ($pagesEnableFields as $pagesEnableField) {
47 $this->updateRequiringFields[] = $pagesEnableField;
49 $this->updateRequiringFields[] =
$GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'delete'];
53 if (!empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'additionalTreelistUpdateFields'])) {
55 $this->updateRequiringFields = array_merge($this->updateRequiringFields, $additionalTreelistUpdateFields);
75 if ($status ==
'new') {
78 $affectedPageUid = $tceMain->substNEWwithIDs[$recordId];
79 $affectedPagePid = $updatedFields[
'pid'];
80 }
elseif ($status ==
'update') {
82 $affectedPageUid = $recordId;
86 $affectedPagePid = $fullPageRecord[
'pid'];
106 $action = (is_array($commandValue) && isset($commandValue[
'action'])) ? (
string)$commandValue[
'action'] :
'';
107 if ($table ===
'pages' && ($command ===
'delete' || ($command ===
'version' && $action ===
'swap'))) {
109 $affectedPageUid = $affectedRecord[
'uid'];
110 $affectedPagePid = $affectedRecord[
'pid'];
113 $updatedFields = array();
114 if ($command ===
'delete') {
115 $updatedFields[
'deleted'] = 1;
118 $updatedFields[
't3ver_wsid'] = 0;
144 $affectedPageUid = $recordId;
145 $affectedPageOldPid = $movedRecord[
'pid'];
146 $affectedPageNewPid = $updatedFields[
'pid'];
171 $affectedPageUid = $recordId;
172 $affectedPageOldPid = $movedRecord[
'pid'];
173 $affectedPageNewPid = $updatedFields[
'pid'];
190 $requiresUpdate =
false;
191 $updatedFieldNames = array_keys($updatedFields);
192 foreach ($updatedFieldNames as $updatedFieldName) {
193 if (in_array($updatedFieldName, $this->updateRequiringFields)) {
194 $requiresUpdate =
true;
198 return $requiresUpdate;
212 $actionNames = array_keys($actions);
213 foreach ($actionNames as $actionName) {
214 switch ($actionName) {
218 case 'setExpiration':
220 $expirationTime = $updatedFields[
'endtime'];
223 case 'uidInTreelist':
230 $randomNumber = rand(1, 1000);
231 if ($randomNumber == 500) {
246 $rootLineIds = array();
247 foreach ($rootLine as $page) {
248 if ($page[
'uid'] != 0) {
249 $rootLineIds[] = $page[
'uid'];
252 if (!empty($rootLineIds)) {
253 $rootLineIdsImploded = implode(
',', $rootLineIds);
254 $this->
getDatabaseConnection()->exec_DELETEquery(
'cache_treelist',
'pid IN(' . $rootLineIdsImploded .
')');
281 'expires' => $expirationTime
306 if ($status ==
'new') {
308 $actions[
'allParents'] =
true;
309 }
elseif ($status ==
'update') {
310 $updatedFieldNames = array_keys($updatedFields);
311 foreach ($updatedFieldNames as $updatedFieldName) {
312 switch ($updatedFieldName) {
315 case $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'enablecolumns'][
'disabled']:
317 case $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'delete']:
319 case $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'enablecolumns'][
'starttime']:
321 case $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'enablecolumns'][
'fe_group']:
323 case 'extendToSubpages':
327 case 'php_tree_stop':
329 $actions[
'allParents'] =
true;
330 $actions[
'uidInTreelist'] =
true;
332 case $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'enablecolumns'][
'endtime']:
337 if ($updatedFields[
'endtime'] > 0) {
338 $actions[
'setExpiration'] =
true;
340 $actions[
'uidInTreelist'] =
true;
344 if (in_array($updatedFieldName, $this->updateRequiringFields)) {
345 $actions[
'uidInTreelist'] =
true;