Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_tceforms_directory
authorSteffen Kamper <info@sk-typo3.de>
Wed, 24 Nov 2010 23:42:26 +0000 (23:42 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 24 Nov 2010 23:42:26 +0000 (23:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9612 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/tceforms/class.t3lib_tceforms_flexforms.php
t3lib/tceforms/class.t3lib_tceforms_suggest.php
t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php
t3lib/tceforms/class.t3lib_tceforms_tree.php

index 8867f9d..658ab00 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2010-11-24  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_tceforms_directory
        * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_stddb_directory
        * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_spritemanager_directory
        * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_search_directory
index 882860e..a659b93 100644 (file)
@@ -92,7 +92,8 @@ class t3lib_TCEforms_Flexforms extends t3lib_TCEforms {
                $TSconfig = $this->setTSconfig($table, $tableRow);\r
                if (!empty($TSconfig[$tableField][$flexformIdentifier . '.'])) {\r
                        $sheetConf = t3lib_div::removeDotsFromTS($TSconfig[$tableField][$flexformIdentifier . '.']);\r
-               };\r
+               }\r
+               ;\r
 \r
                        // Get non-exclude-fields from group access lists\r
                $nonExcludeFields = $this->getFlexFormNonExcludeFields($table, $tableField, $flexformIdentifier);\r
@@ -183,11 +184,11 @@ class t3lib_TCEforms_Flexforms extends t3lib_TCEforms {
                                continue;\r
                        }\r
 \r
-                       $fieldConf   = $sheetConf[$fieldName];\r
+                       $fieldConf = $sheetConf[$fieldName];\r
                        $removeItems = (!empty($fieldConf['removeItems']) ? t3lib_div::trimExplode(',', $fieldConf['removeItems'], TRUE) : array());\r
-                       $keepItems   = (!empty($fieldConf['keepItems'])   ? t3lib_div::trimExplode(',', $fieldConf['keepItems'], TRUE)   : array());\r
-                       $renameItems = (!empty($fieldConf['altLabels']) && is_array($fieldConf['altLabels']) ? $fieldConf['altLabels']   : array());\r
-                       $addItems    = (!empty($fieldConf['addItems'])  && is_array($fieldConf['addItems'])  ? $fieldConf['addItems']    : array());\r
+                       $keepItems = (!empty($fieldConf['keepItems']) ? t3lib_div::trimExplode(',', $fieldConf['keepItems'], TRUE) : array());\r
+                       $renameItems = (!empty($fieldConf['altLabels']) && is_array($fieldConf['altLabels']) ? $fieldConf['altLabels'] : array());\r
+                       $addItems = (!empty($fieldConf['addItems']) && is_array($fieldConf['addItems']) ? $fieldConf['addItems'] : array());\r
 \r
                        unset($fieldConf['removeItems']);\r
                        unset($fieldConf['keepItems']);\r
@@ -290,7 +291,7 @@ class t3lib_TCEforms_Flexforms extends t3lib_TCEforms {
                        // Collect only FlexForm fields\r
                foreach ($accessListFields as $field) {\r
                        if (strpos($field, $identPrefix) !== FALSE) {\r
-                               list(,, $sheetName, $fieldName) = explode(';', $field);\r
+                               list(, , $sheetName, $fieldName) = explode(';', $field);\r
                                $nonExcludeFields[$sheetName][$fieldName] = TRUE;\r
                        }\r
                }\r
index 9b40adb..a1af045 100644 (file)
@@ -1,29 +1,29 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2010 Andreas Wolf <andreas.wolf@ikt-werk.de>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
+ *  Copyright notice
+ *
+ *  (c) 2007-2010 Andreas Wolf <andreas.wolf@ikt-werk.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
 /**
  * TCEforms wizard for rendering an AJAX selector for records
  *
@@ -37,7 +37,7 @@ class t3lib_TCEforms_Suggest {
                // count the number of ajax selectors used
        public $suggestCount = 0;
        public $cssClass = 'typo3-TCEforms-suggest';
-       public $TCEformsObj;    // reference to t3lib_tceforms
+       public $TCEformsObj; // reference to t3lib_tceforms
 
 
        /**
@@ -69,7 +69,7 @@ class t3lib_TCEforms_Suggest {
                $selector = '
                <div class="' . $containerCssClass . '" id="' . $suggestId . '">
                        <input type="text" id="' . $fieldname . 'Suggest" value="' .
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.findRecord') . '" class="' . $this->cssClass . '-search" />
+                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.findRecord') . '" class="' . $this->cssClass . '-search" />
                        <div class="' . $this->cssClass . '-indicator" style="display: none;" id="' . $fieldname . 'SuggestIndicator">
                                <img src="' . $GLOBALS['BACK_PATH'] . 'gfx/spinner.gif" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:alttext.suggestSearching') . '" />
                        </div>
@@ -91,7 +91,7 @@ class t3lib_TCEforms_Suggest {
                $jsObj = str_replace(' ', '', ucwords(str_replace('-', ' ', t3lib_div::strtolower($suggestId))));
                $this->TCEformsObj->additionalJS_post[] = '
                        var ' . $jsObj . ' = new TCEForms.Suggest("' . $fieldname . '", "' . $table . '", "' . $field .
-                       '", "' . $row['uid'] . '", ' . $row['pid'] . ', ' . $minChars . ');
+                                                                                                 '", "' . $row['uid'] . '", ' . $row['pid'] . ', ' . $minChars . ');
                        ' . $jsObj . '.defaultValue = "' . t3lib_div::slashJS($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.findRecord')) . '";
                ';
 
@@ -133,7 +133,7 @@ class t3lib_TCEforms_Suggest {
                $foreign_table_where = '';
                $wizardConfig = $GLOBALS['TCA'][$table]['columns'][$field]['config']['wizards']['suggest'];
                if (isset($GLOBALS['TCA'][$table]['columns'][$field]['config']['allowed'])) {
-               $queryTables = t3lib_div::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$field]['config']['allowed']);
+                       $queryTables = t3lib_div::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$field]['config']['allowed']);
                } elseif (isset($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table'])) {
                        $queryTables = array($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table']);
                        $foreign_table_where = $GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table_where'];
@@ -151,7 +151,7 @@ class t3lib_TCEforms_Suggest {
                        if (!is_array($GLOBALS['TCA'][$queryTable]) || !count($GLOBALS['TCA'][$queryTable])) {
                                continue;
                        }
-                       $config = (array)$wizardConfig['default'];
+                       $config = (array) $wizardConfig['default'];
 
                        if (is_array($wizardConfig[$queryTable])) {
                                $config = t3lib_div::array_merge_recursive_overrule($config, $wizardConfig[$queryTable]);
@@ -164,17 +164,17 @@ class t3lib_TCEforms_Suggest {
                                $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.']['suggest.']['default.']);
                        }
 
-                       if (is_array($TSconfig['TCEFORM.']['suggest.'][$queryTable.'.'])) {
-                               $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.']['suggest.'][$queryTable.'.']);
+                       if (is_array($TSconfig['TCEFORM.']['suggest.'][$queryTable . '.'])) {
+                               $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.']['suggest.'][$queryTable . '.']);
                        }
 
                                // use $table instead of $queryTable here because we overlay a config
                                // for the input-field here, not for the queried table
-                       if (is_array($TSconfig['TCEFORM.'][$table.'.'][$field.'.']['suggest.']['default.'])) {
-                               $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.'][$table.'.'][$field.'.']['suggest.']['default.']);
+                       if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.'])) {
+                               $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.']);
                        }
-                       if (is_array($TSconfig['TCEFORM.'][$table.'.'][$field.'.']['suggest.'][$queryTable.'.'])) {
-                               $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.'][$table.'.'][$field.'.']['suggest.'][$queryTable.'.']);
+                       if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.'])) {
+                               $config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.']);
                        }
 
                                //process addWhere
@@ -183,9 +183,9 @@ class t3lib_TCEforms_Suggest {
                        }
                        if (isset($config['addWhere'])) {
                                $config['addWhere'] = strtr(' ' . $config['addWhere'], array(
-                                       '###THIS_UID###' => intval($uid),
-                                       '###CURRENT_PID###' => intval($pageId),
-                               ));
+                                                                                                                                                       '###THIS_UID###' => intval($uid),
+                                                                                                                                                       '###CURRENT_PID###' => intval($pageId),
+                                                                                                                                          ));
                        }
                                // instantiate the class that should fetch the records for this $queryTable
                        $receiverClassName = $config['receiverClass'];
@@ -223,7 +223,7 @@ class t3lib_TCEforms_Suggest {
                                $row = $resultRows[$rowsSort[$i]];
                                $rowId = $row['table'] . '-' . $row['uid'] . '-' . $table . '-' . $uid . '-' . $field;
                                $listItems[] = '<li' . ($row['class'] != '' ? ' class="' . $row['class'] . '"' : '') .
-                                               ' id="' . $rowId . '" style="' . $row['style'] . '">' . $row['text'] . '</li>';
+                                                          ' id="' . $rowId . '" style="' . $row['style'] . '">' . $row['text'] . '</li>';
                        }
                }
 
index 84ae39f..ae4d8b1 100644 (file)
@@ -1,29 +1,29 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2010 Andreas Wolf <andreas.wolf@ikt-werk.de>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
+ *  Copyright notice
+ *
+ *  (c) 2007-2010 Andreas Wolf <andreas.wolf@ikt-werk.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
 
 /**
  * Default implementation of a handler class for an ajax record selector.
@@ -128,7 +128,7 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
 
                        // if table is versionized, only get the records from the Live Workspace
                        // the overlay itself of WS-records is done below
-               if ($GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == true) {
+               if ($GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == TRUE) {
                        $this->addWhere .= ' AND t3ver_wsid = 0';
                }
 
@@ -153,17 +153,17 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
                $rows = array();
 
                $this->params = &$params;
-               $start  = $recursionCounter * 50;
+               $start = $recursionCounter * 50;
 
                $this->prepareSelectStatement();
                $this->prepareOrderByStatement();
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                               '*',
-                               $this->table,
-                               $this->selectClause,
-                               '',
-                               $this->orderByStatement,
-                               $start . ', 50');
+                       '*',
+                       $this->table,
+                       $this->selectClause,
+                       '',
+                       $this->orderByStatement,
+                       $start . ', 50');
 
                $allRowsCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
 
@@ -171,7 +171,9 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
                        while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
 
                                        // check if we already have collected the maximum number of records
-                               if (count($rows) > $this->maxItems) break;
+                               if (count($rows) > $this->maxItems) {
+                                       break;
+                               }
 
                                $this->manipulateRecord($row);
                                $this->makeWorkspaceOverlay($row);
@@ -187,22 +189,22 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
                                $path = $this->getRecordPath($row, $uid);
                                if (strlen($path) > 30) {
                                        $croppedPath = '<abbr title="' . htmlspecialchars($path) . '">' .
-                                               htmlspecialchars($GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $path, 10) .
-                                                       '...' . $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $path, -20)
-                                               ) . '</abbr>';
+                                                                  htmlspecialchars($GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $path, 10) .
+                                                                                                       '...' . $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $path, -20)
+                                                                  ) . '</abbr>';
                                } else {
                                        $croppedPath = htmlspecialchars($path);
                                }
 
                                $label = $this->getLabel($row);
                                $entry = array(
-                                       'text'  => '<span class="suggest-label">' . $label . '</span><span class="suggest-uid">[' . $uid . ']</span><br />
+                                       'text' => '<span class="suggest-label">' . $label . '</span><span class="suggest-uid">[' . $uid . ']</span><br />
                                                                <span class="suggest-path">' . $croppedPath . '</span>',
                                        'table' => ($this->mmForeignTable ? $this->mmForeignTable : $this->table),
                                        'label' => $label,
-                                       'path'  => $path,
-                                       'uid'   => $uid,
-                                       'icon'  => $iconPath,
+                                       'path' => $path,
+                                       'uid' => $uid,
+                                       'icon' => $iconPath,
                                        'style' => 'background-image:url(' . $iconPath . ');',
                                        'class' => (isset($this->config['cssClass']) ? $this->config['cssClass'] : ''),
                                );
@@ -214,7 +216,7 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
 
                                // if there are less records than we need, call this function again to get more records
                        if (count($rows) < $this->maxItems &&
-                                       $allRowsCount >= 50 && $recursionCounter < $this->maxItems) {
+                               $allRowsCount >= 50 && $recursionCounter < $this->maxItems) {
                                $tmp = self::queryTable($params, ++$recursionCounter);
                                $rows = array_merge($tmp, $rows);
                        }
@@ -236,7 +238,7 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
                if (strlen($searchString)) {
                        $searchString = $GLOBALS['TYPO3_DB']->quoteStr($searchString, $this->table);
                        $likeCondition = ' LIKE \'' . ($searchWholePhrase ? '%' : '') .
-                               $GLOBALS['TYPO3_DB']->escapeStrForLike($searchString, $this->table) . '%\'';
+                                                        $GLOBALS['TYPO3_DB']->escapeStrForLike($searchString, $this->table) . '%\'';
 
                                // Search in all fields given by label or label_alt
                        $selectFieldsList = $GLOBALS['TCA'][$this->table]['ctrl']['label'] . ',' . $GLOBALS['TCA'][$this->table]['ctrl']['label_alt'];
@@ -327,15 +329,15 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
         *  Selects whether the logged in Backend User is allowed to read a specific record
         */
        protected function checkRecordAccess($row, $uid) {
-               $retValue = true;
+               $retValue = TRUE;
                $table = ($this->mmForeignTable ? $this->mmForeignTable : $this->table);
                if ($table == 'pages') {
                        if (!t3lib_BEfunc::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(1))) {
-                               $retValue = false;
+                               $retValue = FALSE;
                        }
                } else {
                        if (!is_array(t3lib_BEfunc::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)))) {
-                               $retValue = false;
+                               $retValue = FALSE;
                        }
                }
                return $retValue;
@@ -349,7 +351,7 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
         */
        protected function makeWorkspaceOverlay(&$row) {
                        // check for workspace-versions
-               if ($GLOBALS['BE_USER']->workspace != 0 && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == true) {
+               if ($GLOBALS['BE_USER']->workspace != 0 && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == TRUE) {
                        t3lib_BEfunc::workspaceOL(($this->mmForeignTable ? $this->mmForeignTable : $this->table), $row);
                }
        }
@@ -396,7 +398,7 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
         * @return string The label
         */
        protected function getLabel($row) {
-               return t3lib_BEfunc::getRecordTitle(($this->mmForeignTable ? $this->mmForeignTable : $this->table), $row, true);
+               return t3lib_BEfunc::getRecordTitle(($this->mmForeignTable ? $this->mmForeignTable : $this->table), $row, TRUE);
        }
 
        /**
@@ -413,8 +415,8 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
                if ($this->config['renderFunc'] != '') {
                        $params = array(
                                'table' => $this->table,
-                               'uid'   => $row['uid'],
-                               'row'   => $row,
+                               'uid' => $row['uid'],
+                               'row' => $row,
                                'entry' => &$entry
                        );
                        t3lib_div::callUserFunction($this->config['renderFunc'], $params, $this, '');
index ce6fd42..f71a72e 100644 (file)
@@ -1,30 +1,30 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Steffen Ritter <info@steffen-ritter.net>
-*  (c) 2010 Steffen Kamper <steffen@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
+ *  Copyright notice
+ *
+ *  (c) 2010 Steffen Ritter <info@steffen-ritter.net>
+ *  (c) 2010 Steffen Kamper <steffen@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
 /**
  * TCEforms wizard for rendering an AJAX selector for records
  *
@@ -76,13 +76,13 @@ class t3lib_TCEforms_Tree {
                                        $item = new stdClass();
                                        $item->uid = $additionalItem[1];
                                        $item->text = $GLOBALS['LANG']->sL($additionalItem[0]);
-                                       $item->selectable = true;
-                                       $item->leaf = true;
+                                       $item->selectable = TRUE;
+                                       $item->leaf = TRUE;
                                        $item->checked = in_array($additionalItem[1], $selectedNodes);
                                        if (file_exists(PATH_typo3 . $additionalItem[3])) {
                                                $item->icon = $additionalItem[3];
                                        } elseif (strlen(trim($additionalItem[3]))) {
-                                               $item->iconCls= t3lib_iconWorks::getSpriteIconClasses($additionalItem[3]);
+                                               $item->iconCls = t3lib_iconWorks::getSpriteIconClasses($additionalItem[3]);
                                        }
 
                                        $itemArray[] = $item;
@@ -94,12 +94,12 @@ class t3lib_TCEforms_Tree {
 
                $id = md5($PA['itemFormElName']);
 
-               if (isset($PA['fieldConf']['config']['size']) && intval($PA['fieldConf']['config']['size']) > 0 ) {
+               if (isset($PA['fieldConf']['config']['size']) && intval($PA['fieldConf']['config']['size']) > 0) {
                        $height = intval($PA['fieldConf']['config']['size']) * 20;
                } else {
                        $height = 280;
                }
-               if (isset($PA['fieldConf']['config']['autoSizeMax']) && intval($PA['fieldConf']['config']['autoSizeMax']) > 0 ) {
+               if (isset($PA['fieldConf']['config']['autoSizeMax']) && intval($PA['fieldConf']['config']['autoSizeMax']) > 0) {
                        $autoSizeMax = intval($PA['fieldConf']['config']['autoSizeMax']) * 20;
                }
 
@@ -130,17 +130,17 @@ class t3lib_TCEforms_Tree {
                                onChange: "' . $onChange . '",
                                tcaMaxItems: ' . ($PA['fieldConf']['config']['maxitems'] ? intval($PA['fieldConf']['config']['maxitems']) : 99999) . ',
                                tcaExclusiveKeys: "' . (
-                                       $PA['fieldConf']['config']['exclusiveKeys']
-                                               ? $PA['fieldConf']['config']['exclusiveKeys'] : '') . '",
-                               ucId: "' . md5($table . '|' . $field ) . '",
+               $PA['fieldConf']['config']['exclusiveKeys']
+                               ? $PA['fieldConf']['config']['exclusiveKeys'] : '') . '",
+                               ucId: "' . md5($table . '|' . $field) . '",
                                selModel: TYPO3.Components.Tree.EmptySelectionModel
                        });
                        tree' . $id . '.' . ($autoSizeMax
-                                       ? 'bodyStyle = "max-height: ' . $autoSizeMax . 'px;"'
-                                       : 'height = ' . $height
-                               ) . ';
+                               ? 'bodyStyle = "max-height: ' . $autoSizeMax . 'px;"'
+                               : 'height = ' . $height
+               ) . ';
                        tree' . $id . '.render("tree_' . $id . '");' .
-                       ($expanded ? 'tree' . $id . '.expandAll();' : '') . '
+                                                                                ($expanded ? 'tree' . $id . '.expandAll();' : '') . '
                ');
 
                $formField = '