Only in typo3/sysext/install_v2: ext_autoload.php.orig diff -rux .svn typo3/sysext/install/updates/class.tx_coreupdates_addflexformstoacl.php typo3/sysext/install_v2/updates/class.tx_coreupdates_addflexformstoacl.php --- typo3/sysext/install/updates/class.tx_coreupdates_addflexformstoacl.php 2011-01-04 14:39:50.000000000 -0600 +++ typo3/sysext/install_v2/updates/class.tx_coreupdates_addflexformstoacl.php 2011-01-04 14:36:09.000000000 -0600 @@ -31,28 +31,8 @@ * * @author Kai Vogel */ -class tx_coreupdates_addflexformstoacl { - - /** - * TYPO3 version number - * - * @var integer - */ - public $versionNumber = 0; - - /** - * Reference to parent object (tx_install) - * - * @var object - */ - public $pObj = NULL; - - /** - * User input - * - * @var array - */ - public $userInput = array(); +class tx_coreupdates_addflexformstoacl extends Tx_Install_Updates_Base { + protected $title = 'Add Excludable FlexForm Fields to Group Access Lists'; /** * Checks if FlexForm fields are missing in group access lists. @@ -62,15 +42,11 @@ */ public function checkForUpdate(&$description) { $description = ' -
TYPO3 4.5 introduced the possibility to exclude FlexForm fields like normal fields in group access lists (ACL). - All excludeable fields will be hidden for non-admins if you do not add them to the ACL of each user group. +
TYPO3 4.5 introduced the possibility to exclude FlexForm fields like normal fields in group access control lists (ACL). + All excludeable fields will be hidden for non-admins if you do not add them to the ACL of each user group manually or with + this update wizard. '; - // Update is only required in TYPO3 version 4.5 and above - if (empty($this->versionNumber) || $this->versionNumber < 4005000) { - return FALSE; - } - // Check access lists if (!$this->getGroupAddFields()) { return FALSE; @@ -87,8 +63,8 @@ */ public function getUserInput($inputPrefix) { $description = ' - Add excludeable FlexForm fields to group access lists (ACL) -
You are about to update all group access lists. +
You are about to update group access control lists to include excludable FlexForm fields. Each backend group will be checked + and only those that already have entries in the access control lists will be updated. '; return $description; @@ -102,11 +78,6 @@ * @return boolean Whether update was successful or not */ public function performUpdate(array &$dbQueries, &$customMessages) { - // Update is only required in TYPO3 version 4.5 and above - if (empty($this->versionNumber) || $this->versionNumber < 4005000) { - return FALSE; - } - // Get additional FlexForm fields for group access lists $addFields = $this->getGroupAddFields(); if (empty($addFields)) { @@ -146,9 +117,9 @@ if (!empty($flexFormArray) && is_array($flexFormArray)) { foreach ($flexFormArray as $tableField => $flexForms) { // Get all sheets - foreach ($flexForms as $extIdent => $extConf) { + foreach ($flexForms as $flexFormIdentifier => $flexFormConfig) { // Get all excludeable fields in sheet - foreach ($extConf['ds']['sheets'] as $sheetName => $sheet) { + foreach ($flexFormConfig['ds']['sheets'] as $sheetName => $sheet) { if (empty($sheet['ROOT']['el']) || !is_array($sheet['ROOT']['el'])) { continue; } @@ -156,7 +127,7 @@ if (empty($field['TCEforms']['exclude'])) { continue; } - $flexExcludeFields[] = $contentTable . ':' . $tableField . ';' . $extIdent . ';' . $sheetName . ';' . $fieldName; + $flexExcludeFields[] = $contentTable . ':' . $tableField . ';' . $flexFormIdentifier . ';' . $sheetName . ';' . $fieldName; } } } @@ -172,7 +143,7 @@ if (empty($nonExcludeFields)) { continue; } - // Add FlexForm fields only if no one was already selected by a user + // Add FlexForm fields only if the field was not already selected by a user $nonExcludeFields = array_diff($flexExcludeFields, $nonExcludeFields); if (!empty($nonExcludeFields) && $nonExcludeFields == $flexExcludeFields) { $addFields[$accessList['uid']] = $nonExcludeFields; @@ -193,11 +164,11 @@ protected function updateGroupAccessLists(array $addFields, array &$dbQueries, &$customMessages) { foreach ($addFields as $groupUID => $flexExcludeFields) { // First get current fields - $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('non_exclude_fields', 'be_groups', 'uid=' . (int) $groupUID); - if (!isset($result[0]['non_exclude_fields'])) { + $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('non_exclude_fields', 'be_groups', 'uid=' . (int) $groupUID); + if (!isset($result['non_exclude_fields'])) { continue; } - $nonExcludeFields = $result[0]['non_exclude_fields']; + $nonExcludeFields = $result['non_exclude_fields']; // Now add new ones $flexExcludeFields = implode(',', $flexExcludeFields);