[TASK] Clean up phpDoc comments in typo3/
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 12 Jun 2012 19:58:08 +0000 (21:58 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Jun 2012 21:38:54 +0000 (23:38 +0200)
Clean up phpDoc comments for the following classes:

* typo3/view_help.php
* typo3/wizard_colorpicker.php
* typo3/wizard_edit.php
* typo3/wizard_forms.php
* typo3/wizard_list.php
* typo3/wizard_rte.php
* typo3/wizard_table.php
* typo3/wizard_tsconfig.php

Clean up provides:

* Provide correct parameter names in phpDoc
* Provide correct data types in phpDoc
* CGLify phpDoc (remove tabs)

Change-Id: Ia5f7b719d9365dcdd8f4d6d3401eecb6ce88ab92
Resolves: #37980
Releases: 6.0
Reviewed-on: http://review.typo3.org/12010
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/view_help.php
typo3/wizard_colorpicker.php
typo3/wizard_edit.php
typo3/wizard_forms.php
typo3/wizard_list.php
typo3/wizard_rte.php
typo3/wizard_table.php
typo3/wizard_tsconfig.php

index 5ce08d7..882a4c2 100644 (file)
@@ -24,6 +24,7 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Document for viewing the online help texts, also known as TCA_DESCR.
  * See Inside TYPO3 for details.
  * Revised for TYPO3 3.7 5/2004 by Kasper Skårhøj
  * XHTML-trans compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 require('init.php');
 require('template.php');
 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_view_help.xml');
 
-
 /**
  * Extension of the parse_html class.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -51,10 +51,10 @@ class local_t3lib_parsehtml extends t3lib_parsehtml {
        /**
         * Processing content between tags for HTML_cleaner
         *
-        * @param       string          The value
-        * @param       integer         Direction, either -1 or +1. 0 (zero) means no change to input value.
-        * @param       mixed           Not used, ignore.
-        * @return      string          The processed value.
+        * @param string $value The value
+        * @param integer $dir Direction, either -1 or +1. 0 (zero) means no change to input value.
+        * @param mixed $conf Not used, ignore.
+        * @return string The processed value.
         * @access private
         */
        function processContent($value, $dir, $conf) {
@@ -64,16 +64,10 @@ class local_t3lib_parsehtml extends t3lib_parsehtml {
        }
 }
 
-
-
-
-
-
-
 /**
  * Script Class for rendering the Context Sensitive Help documents, either the single display in the small pop-up window or the full-table view in the larger window.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -81,9 +75,12 @@ class SC_view_help {
        var $allowedHTML = '<strong><em><b><i>';
 
                // For these vars, see init()
-       var $limitAccess;       // If set access to fields and tables is checked. Should be done for TRUE database tables.
-       var $table;                     // The "table" key
-       var $field;                     // The "field" key
+               // If set access to fields and tables is checked. Should be done for TRUE database tables.
+       var $limitAccess;
+               // The "table" key
+       var $table;
+               // The "field" key
+       var $field;
                /**
                 * Key used to point to the right CSH resource
                 * In simple cases, is equal to $table
@@ -93,21 +90,25 @@ class SC_view_help {
        protected $mainKey;
 
                // Internal, static: GPvar:
-       var $tfID;                      // Table/FIeld id.
-       var $ffID;                      // Flexform file/field information
-       var $back;                      // Back (previous tfID)
-       var $renderALL;         // If set, then in TOC mode the FULL manual will be printed as well!
+               // Table/FIeld id.
+       var $tfID;
+               // Flexform file/field information
+       var $ffID;
+               // Back (previous tfID)
+       var $back;
+               // If set, then in TOC mode the FULL manual will be printed as well!
+       var $renderALL;
 
                // Internal, dynamic:
-       var $content;   // Content accumulation.
-       var $glossaryWords;             // Glossary words
-
-
+               // Content accumulation.
+       var $content;
+               // Glossary words
+       var $glossaryWords;
 
        /**
         * Initialize the class for various input etc.
         *
-        * @return      void
+        * @return void
         */
        function init() {
 
@@ -163,7 +164,7 @@ class SC_view_help {
        /**
         * Main function, rendering the display
         *
-        * @return      void
+        * @return void
         */
        function main() {
 
@@ -190,27 +191,19 @@ class SC_view_help {
                }
 
                        // End page:
-               $this->content.= '<br/>';
+               $this->content .= '<br/>';
                $this->content .= $GLOBALS['TBE_TEMPLATE']->endPage();
        }
 
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
        }
 
-
-
-
-
-
-
-
-
        /************************************
         *
         * Rendering main modes
@@ -220,7 +213,7 @@ class SC_view_help {
        /**
         * Creates Table Of Contents and possibly "Full Manual" mode if selected.
         *
-        * @return      string          HTML content
+        * @return string HTML content
         */
        function render_TOC() {
                        // Initialize:
@@ -238,7 +231,7 @@ class SC_view_help {
                        // Backend Modules:
                $loadModules = t3lib_div::makeInstance('t3lib_loadModules');
                $loadModules->load($GLOBALS['TBE_MODULES']);
-               foreach($loadModules->modules as $mainMod => $info) {
+               foreach ($loadModules->modules as $mainMod => $info) {
                        $cshKey = '_MOD_'.$mainMod;
                        if ($CSHkeys[$cshKey]) {
                                $GLOBALS['LANG']->loadSingleTableDescription($cshKey);
@@ -246,7 +239,7 @@ class SC_view_help {
                        }
 
                        if (is_array($info['sub'])) {
-                               foreach($info['sub'] as $subMod => $subInfo) {
+                               foreach ($info['sub'] as $subMod => $subInfo) {
                                        $cshKey = '_MOD_'.$mainMod.'_'.$subMod;
                                        if ($CSHkeys[$cshKey]) {
                                                $GLOBALS['LANG']->loadSingleTableDescription($cshKey);
@@ -257,7 +250,7 @@ class SC_view_help {
                }
 
                        // Database Tables:
-               foreach($TCAkeys as $table) {
+               foreach ($TCAkeys as $table) {
                                // Load descriptions for table $table
                        $GLOBALS['LANG']->loadSingleTableDescription($table);
                        if (is_array($GLOBALS['TCA_DESCR'][$table]['columns']) && $GLOBALS['BE_USER']->check('tables_select', $table)) {
@@ -266,7 +259,7 @@ class SC_view_help {
                }
 
                        // Extensions
-               foreach($CSHkeys as $cshKey => $value) {
+               foreach ($CSHkeys as $cshKey => $value) {
                        if (t3lib_div::isFirstPartOfStr($cshKey, 'xEXT_') && !isset($GLOBALS['TCA'][$cshKey])) {
                                $GLOBALS['LANG']->loadSingleTableDescription($cshKey);
                                $this->render_TOC_el($cshKey, 'extensions', $outputSections, $tocArray, $CSHkeys);
@@ -274,7 +267,7 @@ class SC_view_help {
                }
 
                        // Glossary
-               foreach($CSHkeys as $cshKey => $value) {
+               foreach ($CSHkeys as $cshKey => $value) {
                        if (t3lib_div::isFirstPartOfStr($cshKey, 'xGLOSSARY_') && !isset($GLOBALS['TCA'][$cshKey])) {
                                $GLOBALS['LANG']->loadSingleTableDescription($cshKey);
                                $this->render_TOC_el($cshKey, 'glossary', $outputSections, $tocArray, $CSHkeys);
@@ -282,7 +275,7 @@ class SC_view_help {
                }
 
                        // Other:
-               foreach($CSHkeys as $cshKey => $value) {
+               foreach ($CSHkeys as $cshKey => $value) {
                        if (!t3lib_div::isFirstPartOfStr($cshKey, '_MOD_') && !isset($GLOBALS['TCA'][$cshKey])) {
                                $GLOBALS['LANG']->loadSingleTableDescription($cshKey);
                                $this->render_TOC_el($cshKey, 'other', $outputSections, $tocArray, $CSHkeys);
@@ -292,28 +285,28 @@ class SC_view_help {
 
                        // COMPILE output:
                $output = '';
-               $output.= '
+               $output .= '
 
                        <h1>'.$GLOBALS['LANG']->getLL('manual_title', 1).'</h1>';
 
-               $output.= '
+               $output .= '
 
                        <h2>'.$GLOBALS['LANG']->getLL('introduction', 1).'</h2>
                        <p>'.$GLOBALS['LANG']->getLL('description', 1).'</p>';
 
-               $output.= '
+               $output .= '
 
                        <h2>'.$GLOBALS['LANG']->getLL('TOC', 1).'</h2>'.
                        $this->render_TOC_makeTocList($tocArray);
 
                if (!$this->renderALL) {
-                       $output.= '
+                       $output .= '
                                <br/>
                                <p class="c-nav"><a href="view_help.php?renderALL=1">'.$GLOBALS['LANG']->getLL('full_manual', 1).'</a></p>';
                }
 
                if ($this->renderALL) {
-                       $output.= '
+                       $output .= '
 
                                <h2>'.$GLOBALS['LANG']->getLL('full_manual_chapters', 1).'</h2>'.
                                implode('
@@ -331,15 +324,16 @@ class SC_view_help {
        /**
         * Creates a TOC list element and renders corresponding HELP content if "renderALL" mode is set.
         *
-        * @param       string          CSH key / Table name
-        * @param       string          TOC category keyword: "core", "modules", "tables", "other"
-        * @param       array           Array for accumulation of rendered HELP Content (in "renderALL" mode). Passed by reference!
-        * @param       array           TOC array; Here TOC index elements are created. Passed by reference!
-        * @param       array           CSH keys array. Every item rendered will be unset in this array so finally we can see what CSH keys are not processed yet. Passed by reference!
-        * @return      void
+        * @param string $table CSH key / Table name
+        * @param string $tocCat TOC category keyword: "core", "modules", "tables", "other"
+        * @param array $outputSections Array for accumulation of rendered HELP Content (in "renderALL" mode). Passed by reference!
+        * @param array $tocArray TOC array; Here TOC index elements are created. Passed by reference!
+        * @param array $CSHkeys CSH keys array. Every item rendered will be unset in this array so finally we can see what CSH keys are not processed yet. Passed by reference!
+        * @return void
         */
        function render_TOC_el($table, $tocCat, &$outputSections, &$tocArray, &$CSHkeys) {
-               if ($this->renderALL)   {       // Render full manual right here!
+                       // Render full manual right here!
+               if ($this->renderALL) {
                        $outputSections[$table] = $this->render_Table($table);
 
                        if ($outputSections[$table]) {
@@ -365,8 +359,8 @@ class SC_view_help {
        /**
         * Renders the TOC index as a HTML bullet list from TOC array
         *
-        * @param       array           ToC Array.
-        * @return      string          HTML bullet list for index.
+        * @param array $tocArray ToC Array.
+        * @return string HTML bullet list for index.
         */
        function render_TOC_makeTocList($tocArray) {
                        // The Various manual sections:
@@ -374,7 +368,7 @@ class SC_view_help {
 
                        // Create TOC bullet list:
                $output = '';
-               foreach($keys as $tocKey) {
+               foreach ($keys as $tocKey) {
                        if (is_array($tocArray[$tocKey])) {
                                $output.='
                                        <li>'.$GLOBALS['LANG']->getLL('TOC_'.$tocKey, 1).'
@@ -409,7 +403,7 @@ class SC_view_help {
        function render_Table($key, $table = NULL) {
                $output = '';
 
-                       // take default key if not explicitly specified
+                       // Take default key if not explicitly specified
                if ($table === NULL) {
                        $table = $key;
                }
@@ -423,7 +417,8 @@ class SC_view_help {
                if (is_array($GLOBALS['TCA_DESCR'][$key]['columns']) && (!$this->limitAccess || $GLOBALS['BE_USER']->check('tables_select', $table))) {
                                // Initialize variables:
                        $parts = array();
-                       $parts[0] = ''; // Reserved for header of table
+                               // Reserved for header of table
+                       $parts[0] = '';
 
                                // Traverse table columns as listed in TCA_DESCR
                        foreach ($GLOBALS['TCA_DESCR'][$key]['columns'] as $field => $_) {
@@ -432,9 +427,11 @@ class SC_view_help {
 
                                if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $field))) {
                                        if (!$field) {
-                                               $parts[0] = $this->printItem($key, '', 1);      // Header
+                                                       // Header
+                                               $parts[0] = $this->printItem($key, '', 1);
                                        } else {
-                                               $parts[] = $this->printItem($key, $field, 1);   // Field
+                                                       // Field
+                                               $parts[] = $this->printItem($key, $field, 1);
                                        }
                                }
                        }
@@ -477,14 +474,14 @@ class SC_view_help {
                $GLOBALS['LANG']->loadSingleTableDescription($key);
 
                        // Render single item
-               $output.= $this->printItem($key, $field);
+               $output .= $this->printItem($key, $field);
 
                        // Substitute glossary words:
                $output = $this->substituteGlossaryWords($output);
 
                        // Link to Full table description and TOC:
                $getLLKey = $this->limitAccess ? 'fullDescription' : 'fullDescription_module';
-               $output.= '<br />
+               $output .= '<br />
                        <p class="c-nav"><a href="view_help.php?tfID=' . rawurlencode($key . '.*') . '">' . $GLOBALS['LANG']->getLL($getLLKey, 1) . '</a></p>
                        <p class="c-nav"><a href="view_help.php">' . $GLOBALS['LANG']->getLL('goToToc', 1) . '</a></p>';
 
@@ -500,37 +497,37 @@ class SC_view_help {
        /**
         * Make seeAlso links from $value
         *
-        * @param       string          See-also input codes
-        * @param       string          If $anchorTable is set to a tablename, then references to this table will be made as anchors, not URLs.
-        * @return      string          See-also links HTML
+        * @param string $value See-also input codes
+        * @param string $anchorTable If $anchorTable is set to a tablename, then references to this table will be made as anchors, not URLs.
+        * @return string See-also links HTML
         */
        function make_seeAlso($value, $anchorTable = '') {
                        // Split references by comma or linebreak
                $items = preg_split('/[,' . LF . ']/', $value);
                $lines = array();
 
-               foreach($items as $val) {
+               foreach ($items as $val) {
                        $val = trim($val);
                        if ($val) {
                                $iP = explode(':', $val);
                                $iPUrl = t3lib_div::trimExplode('|', $val);
                                        // URL reference:
-                               if (substr($iPUrl[1], 0, 4)=='http') {
+                               if (substr($iPUrl[1], 0, 4) == 'http') {
                                        $lines[] = '<a href="'.htmlspecialchars($iPUrl[1]).'" target="_blank"><em>'.htmlspecialchars($iPUrl[0]).'</em></a>';
-                               } elseif (substr($iPUrl[1], 0, 5)=='FILE:') {
+                               } elseif (substr($iPUrl[1], 0, 5) == 'FILE:') {
                                        $fileName = t3lib_div::getFileAbsFileName(substr($iPUrl[1], 5), 1, 1);
                                        if ($fileName && @is_file($fileName)) {
                                                $fileName = '../'.substr($fileName, strlen(PATH_site));
                                                $lines[] = '<a href="'.htmlspecialchars($fileName).'" target="_blank"><em>'.htmlspecialchars($iPUrl[0]).'</em></a>';
                                        }
                                } else {
-                                       // "table" reference
+                                               // "table" reference
                                        t3lib_div::loadTCA($iP[0]);
 
                                        if (!isset($GLOBALS['TCA'][$iP[0]]) || ((!$iP[1] || is_array($GLOBALS['TCA'][$iP[0]]['columns'][$iP[1]])) && (!$this->limitAccess || ($GLOBALS['BE_USER']->check('tables_select', $iP[0]) && (!$iP[1] || !$GLOBALS['TCA'][$iP[0]]['columns'][$iP[1]]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $iP[0].':'.$iP[1]))))))     {       // Checking read access:
                                                if (isset($GLOBALS['TCA_DESCR'][$iP[0]])) {
                                                                // Make see-also link:
-                                                       $href = ($this->renderALL || ($anchorTable && $iP[0]==$anchorTable) ? '#'.implode('.', $iP) : 'view_help.php?tfID='.rawurlencode(implode('.', $iP)).'&back='.$this->tfID);
+                                                       $href = ($this->renderALL || ($anchorTable && $iP[0] == $anchorTable) ? '#'.implode('.', $iP) : 'view_help.php?tfID='.rawurlencode(implode('.', $iP)).'&back='.$this->tfID);
                                                        $label = $this->getTableFieldLabel($iP[0], $iP[1], ' / ');
                                                        $lines[] = '<a href="'.htmlspecialchars($href).'">'.htmlspecialchars($label).'</a>';
                                                }
@@ -544,9 +541,9 @@ class SC_view_help {
        /**
         * Will return an image tag with description in italics.
         *
-        * @param       string          Image file reference (list of)
-        * @param       string          Description string (divided for each image by line break)
-        * @return      string          Image HTML codes
+        * @param string $images Image file reference (list of)
+        * @param string $descr Description string (divided for each image by line break)
+        * @return string Image HTML codes
         */
        function printImage($images, $descr) {
                $code = '';
@@ -555,7 +552,7 @@ class SC_view_help {
                if (count($imgArray)) {
                        $descrArray = explode(LF, $descr, count($imgArray));
 
-                       foreach($imgArray as $k => $image) {
+                       foreach ($imgArray as $k => $image) {
                                $descr = $descrArray[$k];
 
                                $absImagePath = t3lib_div::getFileAbsFileName($image, 1, 1);
@@ -568,8 +565,8 @@ class SC_view_help {
                                                ';
                                                $code.= '<p><em>' . htmlspecialchars($descr) . '</em></p>
                                                ';
-                                       } else $code.= '<div style="background-color: red; border: 1px solid black; color: white;">NOT AN IMAGE: '.$imgFile.'</div>';
-                               } else $code.= '<div style="background-color: red; border: 1px solid black; color: white;">IMAGE FILE NOT FOUND: '.$image.'</div>';
+                                       } else $code .= '<div style="background-color: red; border: 1px solid black; color: white;">NOT AN IMAGE: '.$imgFile.'</div>';
+                               } else $code .= '<div style="background-color: red; border: 1px solid black; color: white;">IMAGE FILE NOT FOUND: '.$image.'</div>';
                        }
                }
 
@@ -579,11 +576,11 @@ class SC_view_help {
        /**
         * Returns header HTML content
         *
-        * @param       string          Header text
-        * @param       string          Header type (1, 0)
-        * @return      string          The HTML for the header.
+        * @param string $str Header text
+        * @param string $type Header type (1, 0)
+        * @return string The HTML for the header.
         */
-       function headerLine($str, $type=0) {
+       function headerLine($str, $type = 0) {
                switch($type) {
                        case 1:
                                $str = '<h2 class="t3-row-header">' . htmlspecialchars($str) . '</h2>
@@ -601,8 +598,8 @@ class SC_view_help {
        /**
         * Returns prepared content
         *
-        * @param       string          Content to format.
-        * @return      string          Formatted content.
+        * @param string $str Content to format.
+        * @return string Formatted content.
         */
        function prepareContent($str) {
                return '<p>'.nl2br(trim(strip_tags($str, $this->allowedHTML))).'</p>
@@ -699,16 +696,6 @@ class SC_view_help {
                return $labelString;
        }
 
-
-
-
-
-
-
-
-
-
-
        /******************************
         *
         * Glossary related
@@ -719,7 +706,7 @@ class SC_view_help {
         * Creates glossary index in $this->glossaryWords
         * Glossary is cached in cache_hash cache and so will be updated only when cache is cleared.
         *
-        * @return      void
+        * @return void
         */
        function createGlossaryIndex() {
                        // Create hash string and try to retrieve glossary array:
@@ -735,7 +722,7 @@ class SC_view_help {
                        $CSHkeys = array_flip(array_keys($GLOBALS['TCA_DESCR']));
 
                                // Glossary
-                       foreach($CSHkeys as $cshKey => $value) {
+                       foreach ($CSHkeys as $cshKey => $value) {
                                if (t3lib_div::isFirstPartOfStr($cshKey, 'xGLOSSARY_') && !isset($GLOBALS['TCA'][$cshKey])) {
                                        $GLOBALS['LANG']->loadSingleTableDescription($cshKey);
 
@@ -755,10 +742,11 @@ class SC_view_help {
                        }
 
                                // First, create unique list of words:
-                       foreach($this->glossaryWords as $key => $value) {
-                               $word = strtolower($value['title']);    // Making word lowercase in order to filter out same words in different cases.
+                       foreach ($this->glossaryWords as $key => $value) {
+                                       // Making word lowercase in order to filter out same words in different cases.
+                               $word = strtolower($value['title']);
 
-                               if ($word!=='') {
+                               if ($word !== '') {
                                        $this->substWords[$word] = $value;
                                        $this->substWords[$word]['key'] = $key;
                                }
@@ -774,8 +762,8 @@ class SC_view_help {
         * Processing of all non-HTML content in the output
         * Will be done by a call-back to ->substituteGlossaryWords_htmlcleaner_callback()
         *
-        * @param       string          Input HTML code
-        * @return      string          Output HTML code
+        * @param string $code Input HTML code
+        * @return string Output HTML code
         */
        function substituteGlossaryWords($code) {
                $htmlParser = t3lib_div::makeInstance('local_t3lib_parsehtml');
@@ -789,9 +777,9 @@ class SC_view_help {
         * Substituting glossary words in the CSH
         * (This is a call-back function from "class local_t3lib_parsehtml extends t3lib_parsehtml", see top of this script)
         *
-        * @param       string          Input HTML string
-        * @return      string          HTML with substituted words in.
-        * @coauthor    alex widschwendter, media.res kommunikationsloesungen
+        * @param string $code Input HTML string
+        * @return string HTML with substituted words in.
+        * @coauthor Alex Widschwendter, media.res kommunikationsloesungen
         */
        function substituteGlossaryWords_htmlcleaner_callback($code) {
                if (is_array($this->substWords) && count($this->substWords) && strlen(trim($code))) {
@@ -817,7 +805,7 @@ class SC_view_help {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_view_help');
 $SOBE->init();
 $SOBE->main();
index 5e25ec1..d8f053d 100644 (file)
  *
  * Revised for TYPO3 3.7 May/2004 by Kasper Skårhøj
  *
- * @author     Mathias Schreiber <schreiber@wmdb.de>
- * @author     Peter Kühn <peter@kuehn.com>
- * @author     Kasper Skårhøj <typo3@typo3.com>
+ * @author Mathias Schreiber <schreiber@wmdb.de>
+ * @author Peter Kühn <peter@kuehn.com>
+ * @author Kasper Skårhøj <typo3@typo3.com>
  */
 
-
 $GLOBALS['BACK_PATH'] = '';
 require('init.php');
 require('template.php');
@@ -43,41 +42,47 @@ $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 /**
  * Script Class for colorpicker wizard
  *
- * @author     Mathias Schreiber <schreiber@wmdb.de>
- * @author     Peter Kühn <peter@kuehn.com>
- * @author     Kasper Skårhøj <typo3@typo3.com>
+ * @author Mathias Schreiber <schreiber@wmdb.de>
+ * @author Peter Kühn <peter@kuehn.com>
+ * @author Kasper Skårhøj <typo3@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_wizard_colorpicker {
 
                // GET vars:
-       var $P;                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $colorValue;        // Value of the current color picked.
-       var $fieldChangeFunc;   // Serialized functions for changing the field... Necessary to call when the value is transferred to the TCEform since the form might need to do internal processing. Otherwise the value is simply not be saved.
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // Value of the current color picked.
+       var $colorValue;
+               // Serialized functions for changing the field... Necessary to call when the value is transferred to the TCEform since the form might need to do internal processing. Otherwise the value is simply not be saved.
+       var $fieldChangeFunc;
        protected $fieldChangeFuncHash;
-       var $fieldName;         // Form name (from opener script)
-       var $formName;          // Field name (from opener script)
-       var $md5ID;                     // ID of element in opener script for which to set color.
-       var $showPicker;        // Internal: If FALSE, a frameset is rendered, if TRUE the content of the picker script.
+               // Form name (from opener script)
+       var $fieldName;
+               // Field name (from opener script)
+       var $formName;
+               // ID of element in opener script for which to set color.
+       var $md5ID;
+               // Internal: If FALSE, a frameset is rendered, if TRUE the content of the picker script.
+       var $showPicker;
 
                // Static:
        var $HTMLcolorList = 'aqua,black,blue,fuchsia,gray,green,lime,maroon,navy,olive,purple,red,silver,teal,yellow,white';
 
                // Internal:
        var $pickerImage = '';
-       var $imageError = '';           // Error message if image not found.
+               // Error message if image not found.
+       var $imageError = '';
 
        /**
-        * document template object
+        * Document template object
         *
         * @var smallDoc
         */
        var $doc;
-       var $content;                           // Accumulated content.
-
-
-
+               // Accumulated content.
+       var $content;
 
        /**
         * Initialises the Class
@@ -112,7 +117,7 @@ class SC_wizard_colorpicker {
                $update = '';
                if ($this->areFieldChangeFunctionsValid()) {
                        unset($fieldChangeFuncArr['alert']);
-                       foreach($fieldChangeFuncArr as $v) {
+                       foreach ($fieldChangeFuncArr as $v) {
                                $update.= '
                                parent.opener.'.$v;
                        }
@@ -162,7 +167,8 @@ class SC_wizard_colorpicker {
         * @return      void
         */
        function main() {
-               if(!t3lib_div::_GP('showPicker')) {     // Show frameset by default:
+                       // Show frameset by default:
+               if (!t3lib_div::_GP('showPicker')) {
                        $this->frameSet();
                } else {
 
@@ -194,8 +200,8 @@ class SC_wizard_colorpicker {
                                </form>';
 
                                // If the save/close button is clicked, then close:
-                       if(t3lib_div::_GP('save_close')) {
-                               $content.=$this->doc->wrapScriptTags('
+                       if (t3lib_div::_GP('save_close')) {
+                               $content .= $this->doc->wrapScriptTags('
                                        setValue(\''.$this->colorValue.'\');
                                        parent.close();
                                ');
@@ -209,7 +215,7 @@ class SC_wizard_colorpicker {
        /**
         * Returnes the sourcecode to the browser
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                $this->content.= $this->doc->endPage();
@@ -222,7 +228,7 @@ class SC_wizard_colorpicker {
         * Took some brains to figure this one out ;-)
         * If Peter wouldn't have been I would've gone insane...
         *
-        * @return      void
+        * @return void
         */
        function frameSet() {
                        // Set doktype:
@@ -257,20 +263,6 @@ class SC_wizard_colorpicker {
 </html>';
        }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
        /************************************
         *
         * Rendering of various color selectors
@@ -280,7 +272,7 @@ class SC_wizard_colorpicker {
        /**
         * Creates a color matrix table
         *
-        * @return      void
+        * @return void
         */
        function colorMatrix() {
                $steps = 51;
@@ -288,9 +280,9 @@ class SC_wizard_colorpicker {
                        // Get colors:
                $color = array();
 
-               for($rr=0;$rr<256;$rr+=$steps) {
-                       for($gg=0;$gg<256;$gg+=$steps) {
-                               for($bb=0;$bb<256;$bb+=$steps) {
+               for ($rr = 0; $rr < 256; $rr+=$steps) {
+                       for ($gg = 0; $gg < 256; $gg+=$steps) {
+                               for ($bb = 0; $bb < 256; $bb+=$steps) {
                                        $color[] = '#'.
                                                substr('0'.dechex($rr), -2).
                                                substr('0'.dechex($gg), -2).
@@ -304,9 +296,9 @@ class SC_wizard_colorpicker {
 
                $rows = 0;
                $tRows = array();
-               while(isset($color[$columns*$rows])) {
+               while (isset($color[$columns*$rows])) {
                        $tCells = array();
-                       for($i=0;$i<$columns;$i++) {
+                       for ($i = 0; $i < $columns; $i++) {
                                $tCells[] = '
                                        <td bgcolor="'.$color[$columns*$rows+$i].'" onclick="document.colorform.colorValue.value = \''.$color[$columns*$rows+$i].'\'; document.colorform.submit();" title="'.$color[$columns*$rows+$i].'">&nbsp;&nbsp;</td>';
                        }
@@ -327,7 +319,7 @@ class SC_wizard_colorpicker {
        /**
         * Creates a selector box with all HTML color names.
         *
-        * @return      void
+        * @return void
         */
        function colorList() {
                        // Initialize variables:
@@ -337,7 +329,7 @@ class SC_wizard_colorpicker {
                $opt[] = '<option value=""></option>';
 
                        // Traverse colors, making option tags for selector box.
-               foreach($colors as $colorName) {
+               foreach ($colors as $colorName) {
                        $opt[] = '<option style="background-color: '.$colorName.';" value="'.htmlspecialchars($colorName).'"'.($currentValue==$colorName ? ' selected="selected"' : '').'>'.htmlspecialchars($colorName).'</option>';
                }
 
@@ -355,13 +347,13 @@ class SC_wizard_colorpicker {
        /**
         * Creates a color image selector
         *
-        * @return      void
+        * @return void
         */
        function colorImage() {
                        // Handling color-picker image if any:
                if (!$this->imageError) {
                        if ($this->pickerImage) {
-                               if(t3lib_div::_POST('coords_x')) {
+                               if (t3lib_div::_POST('coords_x')) {
                                        $this->colorValue = '#'.$this->getIndex(t3lib_stdgraphic::imageCreateFromFile($this->pickerImage), t3lib_div::_POST('coords_x'), t3lib_div::_POST('coords_y'));
                                }
                                $pickerFormImage = '
@@ -382,10 +374,10 @@ class SC_wizard_colorpicker {
         * Gets the HTML (Hex) Color Code for the selected pixel of an image
         * This method handles the correct imageResource no matter what format
         *
-        * @param       pointer         Valid ImageResource returned by t3lib_stdgraphic::imageCreateFromFile
-        * @param       integer         X-Coordinate of the pixel that should be checked
-        * @param       integer         Y-Coordinate of the pixel that should be checked
-        * @return      string          HEX RGB value for color
+        * @param pointer $im Valid ImageResource returned by t3lib_stdgraphic::imageCreateFromFile
+        * @param integer $x X-Coordinate of the pixel that should be checked
+        * @param integer $y Y-Coordinate of the pixel that should be checked
+        * @return string HEX RGB value for color
         * @see colorImage()
         */
        function getIndex($im, $x, $y) {
@@ -395,7 +387,7 @@ class SC_wizard_colorpicker {
                $index['g'] = dechex($colorrgb['green']);
                $index['b'] = dechex($colorrgb['blue']);
                foreach ($index as $value) {
-                       if(strlen($value) == 1) {
+                       if (strlen($value) == 1) {
                                $hexvalue[] = strtoupper('0'.$value);
                        } else {
                                $hexvalue[] = strtoupper($value);
@@ -419,7 +411,7 @@ class SC_wizard_colorpicker {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_colorpicker');
 $SOBE->init();
 $SOBE->main();
index f40350e..6b256f7 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Wizard to edit records from group/select lists in TCEforms
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
 
-
 /**
  * Script Class for redirecting a backend user to the editing form when an "Edit wizard" link was clicked in TCEforms somewhere
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_wizard_edit {
 
                // Internal, static: GPvars
-       var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $doClose;                           // Boolean; if set, the window will be closed by JavaScript
-
-
-
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // Boolean; if set, the window will be closed by JavaScript
+       var $doClose;
 
        /**
         * Initialization of the script
         *
-        * @return      void
+        * @return void
         */
        function init() {
                $this->P = t3lib_div::_GP('P');
-               $this->doClose = t3lib_div::_GP('doClose');             // Used for the return URL to alt_doc.php so that we can close the window.
+                       // Used for the return URL to alt_doc.php so that we can close the window.
+               $this->doClose = t3lib_div::_GP('doClose');
        }
 
        /**
         * Main function
         * Makes a header-location redirect to an edit form IF POSSIBLE from the passed data - otherwise the window will just close.
         *
-        * @return      void
+        * @return void
         */
        function main() {
                if ($this->doClose) {
@@ -92,8 +90,8 @@ class SC_wizard_edit {
 
                                        // Init settings:
                                $allowedTables = $config['type']=='group' ? $config['allowed'] : $config['foreign_table'].','.$config['neg_foreign_table'];
-                               $prependName=1;
-                               $params='';
+                               $prependName = 1;
+                               $params = '';
 
                                        // Selecting selected values into an array:
                                $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
@@ -101,7 +99,7 @@ class SC_wizard_edit {
                                $value = $dbAnalysis->getValueArray($prependName);
 
                                        // Traverse that array and make parameters for alt_doc.php:
-                               foreach($value as $rec) {
+                               foreach ($value as $rec) {
                                        $recTableUidParts = t3lib_div::revExplode('_', $rec, 2);
                                        $params.='&edit['.$recTableUidParts[0].']['.$recTableUidParts[1].']=edit';
                                }
@@ -117,7 +115,7 @@ class SC_wizard_edit {
        /**
         * Printing a little JavaScript to close the open window.
         *
-        * @return      void
+        * @return void
         */
        function closeWindow() {
                echo '<script language="javascript" type="text/javascript">close();</script>';
@@ -125,7 +123,7 @@ class SC_wizard_edit {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_edit');
 $SOBE->init();
 $SOBE->main();
index d9fdc4d..19aecd6 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Wizard to help make forms (fx. for tt_content elements) of type 'form'.
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 
-
-
-
-
-
-
-
-
-
-
-
 /**
  * API comments:
  *
@@ -143,7 +131,7 @@ $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 /**
  * Script Class for rendering the Form Wizard
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -156,29 +144,31 @@ class SC_wizard_forms {
         * @var mediumDoc
         */
        var $doc;
-       var $content;                           // Content accumulation for the module.
-       var $include_once=array();      // List of files to include.
-       var $attachmentCounter = 0;     // Used to numerate attachments automatically.
-
+               // Content accumulation for the module.
+       var $content;
+               // List of files to include.
+       var $include_once = array();
+               // Used to numerate attachments automatically.
+       var $attachmentCounter = 0;
 
                // Internal, static:
-       var $xmlStorage=0;                      // If set, the string version of the content is interpreted/written as XML instead of the original linebased kind. This variable still needs binding to the wizard parameters - but support is ready!
-
+               // If set, the string version of the content is interpreted/written as XML instead of
+               // the original linebased kind. This variable still needs binding to the wizard parameters
+               // - but support is ready!
+       var $xmlStorage = 0;
 
                // Internal, static: GPvars
-       var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $FORMCFG;                           // The array which is constantly submitted by the multidimensional form of this wizard.
-       var $special;                           // Indicates if the form is of a dedicated type, like "formtype_mail" (for tt_content element "Form")
-
-
-
-
-
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // The array which is constantly submitted by the multidimensional form of this wizard.
+       var $FORMCFG;
+               // Indicates if the form is of a dedicated type, like "formtype_mail" (for tt_content element "Form")
+       var $special;
 
        /**
         * Initialization the class
         *
-        * @return      void
+        * @return void
         */
        function init() {
                        // GPvars:
@@ -205,14 +195,14 @@ class SC_wizard_forms {
 
                        // If save command found, include tcemain:
                if ($_POST['savedok_x'] || $_POST['saveandclosedok_x']) {
-                       $this->include_once[]=PATH_t3lib.'class.t3lib_tcemain.php';
+                       $this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';
                }
        }
 
        /**
         * Main function for rendering the form wizard HTML
         *
-        * @return      void
+        * @return void
         */
        function main() {
                if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
@@ -221,22 +211,22 @@ class SC_wizard_forms {
                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('forms_title'), '<span class="typo3-red">' . $GLOBALS['LANG']->getLL('table_noData', 1) . '</span>', 0, 1);
                }
 
-               // Setting up the buttons and markers for docheader
+                       // Setting up the buttons and markers for docheader
                $docHeaderButtons = $this->getButtons();
                $markers['CSH'] = $docHeaderButtons['csh'];
                $markers['CONTENT'] = $this->content;
 
-               // Build the <body> for the module
+                       // Build the <body> for the module
                $this->content = $this->doc->startPage('Form Wizard');
-               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
@@ -245,7 +235,7 @@ class SC_wizard_forms {
        /**
         * Create the panel of buttons for submitting the form or otherwise perform operations.
         *
-        * @return array all available buttons as an assoc. array
+        * @return array All available buttons as an assoc. array
         */
        protected function getButtons() {
                $buttons = array(
@@ -258,24 +248,24 @@ class SC_wizard_forms {
                );
 
                if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
-                       // CSH
+                               // CSH
                        $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz', $GLOBALS['BACK_PATH'], '');
 
-                       // CSH Buttons
+                               // CSH Buttons
                        $buttons['csh_buttons'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons', $GLOBALS['BACK_PATH'], '');
 
-                       // Close
+                               // Close
                        $buttons['close'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(unescape(\'' . rawurlencode(t3lib_div::sanitizeLocalUrl($this->P['returnUrl'])) . '\')); return false;') . '">' .
                                t3lib_iconWorks::getSpriteIcon('actions-document-close', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE))) .
                                '</a>';
 
-                       // Save
+                               // Save
                        $buttons['save'] = '<input type="image" class="c-inputButton" name="savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
 
-                       // Save & Close
+                               // Save & Close
                        $buttons['save_close'] = '<input type="image" class="c-inputButton" name="saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />';
 
-                       // Reload
+                               // Reload
                        $buttons['reload'] = '<input type="image" class="c-inputButton" name="_refresh"' . t3lib_iconWorks::skinImg('', 'gfx/refresh_n.gif') . ' title="' . $GLOBALS['LANG']->getLL('forms_refresh', 1) . '" />';
                }
 
@@ -285,7 +275,7 @@ class SC_wizard_forms {
        /**
         * Draws the form wizard content
         *
-        * @return      string          HTML content for the form.
+        * @return string HTML content for the form.
         */
        function formsWizard() {
 
@@ -295,7 +285,8 @@ class SC_wizard_forms {
                        throw new RuntimeException('Wizard Error: No reference to record', 1294587124);
                }
 
-                       // This will get the content of the form configuration code field to us - possibly cleaned up, saved to database etc. if the form has been submitted in the meantime.
+                       // This will get the content of the form configuration code field to us - possibly
+                       // cleaned up, saved to database etc. if the form has been submitted in the meantime.
                $formCfgArray = $this->getConfigCode($row);
 
                        // Generation of the Form Wizards HTML code:
@@ -305,16 +296,6 @@ class SC_wizard_forms {
                return $content;
        }
 
-
-
-
-
-
-
-
-
-
-
        /****************************
         *
         * Helper functions
@@ -325,8 +306,8 @@ class SC_wizard_forms {
         * Will get and return the configuration code string
         * Will also save (and possibly redirect/exit) the content if a save button has been pressed
         *
-        * @param       array           Current parent record row (passed by value!)
-        * @return      array           Configuration Array
+        * @param array $row Current parent record row (passed by value!)
+        * @return array Configuration Array
         * @access private
         */
        function getConfigCode(&$row) {
@@ -348,7 +329,8 @@ class SC_wizard_forms {
                                        // Convert the input array to a string of configuration code:
                                $bodyText = $this->cfgArray2CfgString($this->FORMCFG['c']);
 
-                                       // Create cfgArr from the string based configuration - that way it is cleaned up and any incompatibilities will be removed!
+                                       // Create cfgArr from the string based configuration - that way it is cleaned
+                                       // up and any incompatibilities will be removed!
                                $cfgArr = $this->cfgString2CfgArray($bodyText);
                        }
 
@@ -357,13 +339,13 @@ class SC_wizard_forms {
 
                                        // Make TCEmain object:
                                $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                               $tce->stripslashes_values=0;
+                               $tce->stripslashes_values = 0;
 
                                        // Put content into the data array:
-                               $data=array();
-                               $data[$this->P['table']][$this->P['uid']][$this->P['field']]=$bodyText;
-                               if ($this->special=='formtype_mail') {
-                                       $data[$this->P['table']][$this->P['uid']]['subheader']=$this->FORMCFG['recipient'];
+                               $data = array();
+                               $data[$this->P['table']][$this->P['uid']][$this->P['field']] = $bodyText;
+                               if ($this->special == 'formtype_mail') {
+                                       $data[$this->P['table']][$this->P['uid']]['subheader'] = $this->FORMCFG['recipient'];
                                }
 
                                        // Perform the update:
@@ -394,23 +376,23 @@ class SC_wizard_forms {
        /**
         * Creates the HTML for the Form Wizard:
         *
-        * @param       string          Form config array
-        * @param       array           Current parent record array
-        * @return      string          HTML for the form wizard
+        * @param string $formCfgArray Form config array
+        * @param array $row Current parent record array
+        * @return string HTML for the form wizard
         * @access private
         */
        function getFormHTML($formCfgArray, $row) {
                        // Initialize variables:
-               $specParts=array();
-               $hiddenFields=array();
-               $tRows=array();
+               $specParts = array();
+               $hiddenFields = array();
+               $tRows = array();
 
                        // Set header row:
-               $cells=array($GLOBALS['LANG']->getLL('forms_preview', 1).':',
+               $cells = array($GLOBALS['LANG']->getLL('forms_preview', 1).':',
                                                $GLOBALS['LANG']->getLL('forms_element', 1).':',
                                                $GLOBALS['LANG']->getLL('forms_config', 1).':',
                );
-               $tRows[]='
+               $tRows[] = '
                        <tr class="bgColor2" id="typo3-formWizardHeader">
                                <td>&nbsp;</td>
                                <td>' . implode('</td>
@@ -418,33 +400,33 @@ class SC_wizard_forms {
                        </tr>';
 
                        // Traverse the number of form elements:
-               $k=0;
-               foreach($formCfgArray as $confData) {
+               $k = 0;
+               foreach ($formCfgArray as $confData) {
 
                                // Initialize:
-                       $cells=array();
+                       $cells = array();
 
                                // If there is a configuration line which is active, then render it:
                        if (!isset($confData['comment'])) {
 
                                        // Special parts:
-                               if ($this->special=='formtype_mail' && t3lib_div::inList('formtype_mail,subject,html_enabled', $confData['fieldname'])) {
+                               if ($this->special == 'formtype_mail' && t3lib_div::inList('formtype_mail,subject,html_enabled', $confData['fieldname'])) {
                                        $specParts[$confData['fieldname']] = $confData['default'];
                                } else {
 
                                                // Render title/field preview COLUMN
-                                       $cells[]=$confData['type']!='hidden' ? '<strong>'.htmlspecialchars($confData['label']).'</strong>' : '';
+                                       $cells[] = $confData['type'] != 'hidden' ? '<strong>'.htmlspecialchars($confData['label']).'</strong>' : '';
 
 
                                                // Render general type/title COLUMN:
-                                       $temp_cells=array();
+                                       $temp_cells = array();
 
                                                // Field type selector:
-                                       $opt=array();
-                                       $opt[]='<option value=""></option>';
+                                       $opt = array();
+                                       $opt[] = '<option value=""></option>';
                                        $types = explode(',', 'input,textarea,select,check,radio,password,file,hidden,submit,property,label');
-                                       foreach($types as $t) {
-                                               $opt[]='
+                                       foreach ($types as $t) {
+                                               $opt[] = '
                                                                <option value="'.$t.'"'.($confData['type']==$t?' selected="selected"':'').'>'.$GLOBALS['LANG']->getLL('forms_type_'.$t, 1).'</option>';
                                        }
                                        $temp_cells[$GLOBALS['LANG']->getLL('forms_type')]='
@@ -464,14 +446,14 @@ class SC_wizard_forms {
                                        }
 
                                                // Put sub-items together into table cell:
-                                       $cells[]=$this->formatCells($temp_cells);
+                                       $cells[] = $this->formatCells($temp_cells);
 
 
                                                // Render specific field configuration COLUMN:
-                                       $temp_cells=array();
+                                       $temp_cells = array();
 
                                                // Fieldname
-                                       if ($this->special=='formtype_mail' && $confData['type']=='file') {
+                                       if ($this->special == 'formtype_mail' && $confData['type'] == 'file') {
                                                $confData['fieldname'] = 'attachment'.(++$this->attachmentCounter);
                                        }
                                        if (!t3lib_div::inList('label', $confData['type'])) {
@@ -481,22 +463,22 @@ class SC_wizard_forms {
                                                // Field configuration depending on the fields type:
                                        switch((string)$confData['type']) {
                                                case 'textarea':
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_cols')]='<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][cols]" value="'.htmlspecialchars($confData['cols']).'" title="'.$GLOBALS['LANG']->getLL('forms_cols', 1).'" />';
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_rows')]='<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][rows]" value="'.htmlspecialchars($confData['rows']).'" title="'.$GLOBALS['LANG']->getLL('forms_rows', 1).'" />';
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_extra')]='<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][extra]" value="OFF"'.($confData['extra']=='OFF'?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_extra', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_cols')] = '<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][cols]" value="'.htmlspecialchars($confData['cols']).'" title="'.$GLOBALS['LANG']->getLL('forms_cols', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_rows')] = '<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][rows]" value="'.htmlspecialchars($confData['rows']).'" title="'.$GLOBALS['LANG']->getLL('forms_rows', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_extra')] = '<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][extra]" value="OFF"'.($confData['extra']=='OFF'?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_extra', 1).'" />';
                                                break;
                                                case 'input':
                                                case 'password':
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_size')]='<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($confData['size']).'" title="'.$GLOBALS['LANG']->getLL('forms_size', 1).'" />';
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_max')]='<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][max]" value="'.htmlspecialchars($confData['max']).'" title="'.$GLOBALS['LANG']->getLL('forms_max', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_size')] = '<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($confData['size']).'" title="'.$GLOBALS['LANG']->getLL('forms_size', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_max')] = '<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][max]" value="'.htmlspecialchars($confData['max']).'" title="'.$GLOBALS['LANG']->getLL('forms_max', 1).'" />';
                                                break;
                                                case 'file':
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_size')]='<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($confData['size']).'" title="'.$GLOBALS['LANG']->getLL('forms_size', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_size')] = '<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($confData['size']).'" title="'.$GLOBALS['LANG']->getLL('forms_size', 1).'" />';
                                                break;
                                                case 'select':
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_size')]='<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($confData['size']).'" title="'.$GLOBALS['LANG']->getLL('forms_size', 1).'" />';
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_autosize')]='<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][autosize]" value="1"'.($confData['autosize']?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_autosize', 1).'" />';
-                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_multiple')]='<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][multiple]" value="1"'.($confData['multiple']?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_multiple', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_size')] = '<input type="text"'.$this->doc->formWidth(5).' name="FORMCFG[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($confData['size']).'" title="'.$GLOBALS['LANG']->getLL('forms_size', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_autosize')] = '<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][autosize]" value="1"'.($confData['autosize']?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_autosize', 1).'" />';
+                                                       $temp_cells[$GLOBALS['LANG']->getLL('forms_multiple')] = '<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][multiple]" value="1"'.($confData['multiple']?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_multiple', 1).'" />';
                                                break;
                                        }
 
@@ -512,41 +494,41 @@ class SC_wizard_forms {
                                        }
 
                                                // Default data
-                                       if ($confData['type']=='select' || $confData['type']=='radio') {
-                                               $temp_cells[$GLOBALS['LANG']->getLL('forms_options')]='<textarea '.$this->doc->formWidthText(15).' rows="4" name="FORMCFG[c]['.(($k+1)*2).'][options]" title="'.$GLOBALS['LANG']->getLL('forms_options', 1).'">'.t3lib_div::formatForTextarea($confData['default']).'</textarea>';
-                                       } elseif ($confData['type']=='check') {
-                                               $temp_cells[$GLOBALS['LANG']->getLL('forms_checked')]='<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][default]" value="1"'.(trim($confData['default'])?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_checked', 1).'" />';
-                                       } elseif ($confData['type'] && $confData['type']!='file') {
-                                               $temp_cells[$GLOBALS['LANG']->getLL('forms_default')]='<input type="text"'.$this->doc->formWidth(15).' name="FORMCFG[c]['.(($k+1)*2).'][default]" value="'.htmlspecialchars($confData['default']).'" title="'.$GLOBALS['LANG']->getLL('forms_default', 1).'" />';
+                                       if ($confData['type'] == 'select' || $confData['type'] == 'radio') {
+                                               $temp_cells[$GLOBALS['LANG']->getLL('forms_options')] = '<textarea '.$this->doc->formWidthText(15).' rows="4" name="FORMCFG[c]['.(($k+1)*2).'][options]" title="'.$GLOBALS['LANG']->getLL('forms_options', 1).'">'.t3lib_div::formatForTextarea($confData['default']).'</textarea>';
+                                       } elseif ($confData['type'] == 'check') {
+                                               $temp_cells[$GLOBALS['LANG']->getLL('forms_checked')] = '<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][default]" value="1"'.(trim($confData['default'])?' checked="checked"':'').' title="'.$GLOBALS['LANG']->getLL('forms_checked', 1).'" />';
+                                       } elseif ($confData['type'] && $confData['type'] != 'file') {
+                                               $temp_cells[$GLOBALS['LANG']->getLL('forms_default')] = '<input type="text"'.$this->doc->formWidth(15).' name="FORMCFG[c]['.(($k+1)*2).'][default]" value="'.htmlspecialchars($confData['default']).'" title="'.$GLOBALS['LANG']->getLL('forms_default', 1).'" />';
                                        }
 
-                                       $cells[]=$confData['type']?$this->formatCells($temp_cells):'';
+                                       $cells[] = $confData['type']?$this->formatCells($temp_cells):'';
 
                                                // CTRL panel for an item (move up/down/around):
-                                       $ctrl='';
-                                       $onClick="document.wizardForm.action+='#ANC_".(($k+1)*2-2)."';";
-                                       $onClick=' onclick="'.htmlspecialchars($onClick).'"';
-// FIXME $inputStyle undefined
-                                       $brTag=$inputStyle?'':'<br />';
-                                       if ($k!=0) {
-                                               $ctrl.='<input type="image" name="FORMCFG[row_up]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_up', 1).'" />'.$brTag;
+                                       $ctrl = '';
+                                       $onClick  ="document.wizardForm.action+='#ANC_".(($k+1)*2-2)."';";
+                                       $onClick = ' onclick="'.htmlspecialchars($onClick).'"';
+                                               // FIXME $inputStyle undefined
+                                       $brTag = $inputStyle?'':'<br />';
+                                       if ($k != 0) {
+                                               $ctrl .= '<input type="image" name="FORMCFG[row_up]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_up', 1).'" />'.$brTag;
                                        } else {
-                                               $ctrl.='<input type="image" name="FORMCFG[row_bottom]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_bottom', 1).'" />'.$brTag;
+                                               $ctrl .= '<input type="image" name="FORMCFG[row_bottom]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_bottom', 1).'" />'.$brTag;
                                        }
-                                       $ctrl.='<input type="image" name="FORMCFG[row_remove]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_removeRow', 1).'" />'.$brTag;
-// FIXME $tLines undefined
-                                       if (($k+1)!=count($tLines)) {
+                                       $ctrl .= '<input type="image" name="FORMCFG[row_remove]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_removeRow', 1).'" />'.$brTag;
+                                               // FIXME $tLines undefined
+                                       if (($k+1) != count($tLines)) {
                                                $ctrl.='<input type="image" name="FORMCFG[row_down]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2down.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_down', 1).'" />'.$brTag;
                                        } else {
                                                $ctrl.='<input type="image" name="FORMCFG[row_top]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_down.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_top', 1).'" />'.$brTag;
                                        }
-                                       $ctrl.='<input type="image" name="FORMCFG[row_add]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/add.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_addRow', 1).'" />'.$brTag;
+                                       $ctrl .= '<input type="image" name="FORMCFG[row_add]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/add.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_addRow', 1).'" />'.$brTag;
 
-                                       $ctrl='<span class="c-wizButtonsV">'.$ctrl.'</span>';
+                                       $ctrl = '<span class="c-wizButtonsV">'.$ctrl.'</span>';
 
                                                // Finally, put together the full row from the generated content above:
                                        $bgC = $confData['type']?' class="bgColor5"':'';
-                                       $tRows[]='
+                                       $tRows[] = '
                                                <tr' . $bgC . '>
                                                        <td><a name="ANC_' . (($k + 1) * 2) . '"></a>' . $ctrl . '</td>
                                                        <td class="bgColor4">' . implode('</td>
@@ -562,16 +544,16 @@ class SC_wizard_forms {
                }
 
                        // If the form is of the special type "formtype_mail" (used for tt_content elements):
-               if ($this->special=='formtype_mail') {
+               if ($this->special == 'formtype_mail') {
 
                                // Blank spacer:
-                       $tRows[]='
+                       $tRows[] = '
                                <tr>
                                        <td colspan="4">&nbsp;</td>
                                </tr>';
 
                                // Header:
-                       $tRows[]='
+                       $tRows[] = '
                                <tr>
                                        <td colspan="2" class="bgColor2">&nbsp;</td>
                                        <td colspan="2" class="bgColor2"><strong>'.$GLOBALS['LANG']->getLL('forms_special_eform', 1).':</strong>'.
@@ -580,7 +562,7 @@ class SC_wizard_forms {
                                </tr>';
 
                                // "FORM type":
-                       $tRows[]='
+                       $tRows[] = '
                                <tr class="bgColor5">
                                        <td>&nbsp;</td>
                                        <td class="bgColor4">&nbsp;</td>
@@ -593,7 +575,7 @@ class SC_wizard_forms {
                                </tr>';
 
                                // "Send HTML mail":
-                       $tRows[]='
+                       $tRows[] = '
                                <tr class="bgColor5">
                                        <td>&nbsp;</td>
                                        <td class="bgColor4">&nbsp;</td>
@@ -606,7 +588,7 @@ class SC_wizard_forms {
                                </tr>';
 
                                // "Subject":
-                       $tRows[]='
+                       $tRows[] = '
                                <tr class="bgColor5">
                                        <td>&nbsp;</td>
                                        <td class="bgColor4">&nbsp;</td>
@@ -619,7 +601,7 @@ class SC_wizard_forms {
                                </tr>';
 
                                // Recipient:
-                       $tRows[]='
+                       $tRows[] = '
                                <tr class="bgColor5">
                                        <td>&nbsp;</td>
                                        <td class="bgColor4">&nbsp;</td>
@@ -633,7 +615,7 @@ class SC_wizard_forms {
                $content = '';
 
                        // Implode all table rows into a string, wrapped in table tags.
-               $content.= '
+               $content .= '
 
                        <!--
                                Form wizard
@@ -643,7 +625,7 @@ class SC_wizard_forms {
                        </table>';
 
                        // Add hidden fields:
-               $content.= implode('', $hiddenFields);
+               $content .= implode('', $hiddenFields);
 
                        // Return content:
                return $content;
@@ -652,7 +634,7 @@ class SC_wizard_forms {
        /**
         * Detects if a control button (up/down/around/delete) has been pressed for an item and accordingly it will manipulate the internal FORMCFG array
         *
-        * @return      void
+        * @return void
         * @access private
         */
        function changeFunc() {
@@ -710,79 +692,82 @@ class SC_wizard_forms {
        /**
         * Converts the input array to a configuration code string
         *
-        * @param       array           Array of form configuration (follows the input structure from the form wizard POST form)
-        * @return      string          The array converted into a string with line-based configuration.
+        * @param array $cfgArr Array of form configuration (follows the input structure from the form wizard POST form)
+        * @return string The array converted into a string with line-based configuration.
         * @see cfgString2CfgArray()
         */
        function cfgArray2CfgString($cfgArr) {
 
                        // Initialize:
-               $inLines=array();
+               $inLines = array();
 
                        // Traverse the elements of the form wizard and transform the settings into configuration code.
-               foreach($cfgArr as $vv) {
-                       if ($vv['comment'])     {       // If "content" is found, then just pass it over.
+               foreach ($cfgArr as $vv) {
+                               // If "content" is found, then just pass it over.
+                       if ($vv['comment'])     {
                                $inLines[]=trim($vv['comment']);
                        } else {        // Begin to put together the single-line configuration code of this field:
 
                                        // Reset:
-                               $thisLine=array();
+                               $thisLine = array();
 
                                        // Set Label:
-                               $thisLine[0]=str_replace('|', '', $vv['label']);
+                               $thisLine[0] = str_replace('|', '', $vv['label']);
 
                                        // Set Type:
                                if ($vv['type']) {
-                                       $thisLine[1]=($vv['required']?'*':'').str_replace(',', '', ($vv['fieldname']?$vv['fieldname'].'=':'').$vv['type']);
+                                       $thisLine[1] = ($vv['required']?'*':'').str_replace(',', '', ($vv['fieldname']?$vv['fieldname'].'=':'').$vv['type']);
 
                                                // Default:
-                                       $tArr=array('', '', '', '', '', '');
+                                       $tArr = array('', '', '', '', '', '');
                                        switch((string)$vv['type']) {
                                                case 'textarea':
-                                                       if (intval($vv['cols']))        $tArr[0]=intval($vv['cols']);
-                                                       if (intval($vv['rows']))        $tArr[1]=intval($vv['rows']);
-                                                       if (trim($vv['extra']))         $tArr[2]=trim($vv['extra']);
+                                                       if (intval($vv['cols']))        $tArr[0] = intval($vv['cols']);
+                                                       if (intval($vv['rows']))        $tArr[1] = intval($vv['rows']);
+                                                       if (trim($vv['extra']))         $tArr[2] = trim($vv['extra']);
                                                        if (strlen($vv['specialEval'])) {
-                                                               $thisLine[2] = '';      // Preset blank default value so position 3 can get a value...
+                                                                       // Preset blank default value so position 3 can get a value...
+                                                               $thisLine[2] = '';
                                                                $thisLine[3] = $vv['specialEval'];
                                                        }
                                                break;
                                                case 'input':
                                                case 'password':
-                                                       if (intval($vv['size']))        $tArr[0]=intval($vv['size']);
-                                                       if (intval($vv['max']))         $tArr[1]=intval($vv['max']);
+                                                       if (intval($vv['size']))        $tArr[0] = intval($vv['size']);
+                                                       if (intval($vv['max']))         $tArr[1] = intval($vv['max']);
                                                        if (strlen($vv['specialEval'])) {
-                                                               $thisLine[2] = '';      // Preset blank default value so position 3 can get a value...
+                                                                       // Preset blank default value so position 3 can get a value...
+                                                               $thisLine[2] = '';
                                                                $thisLine[3] = $vv['specialEval'];
                                                        }
                                                break;
                                                case 'file':
-                                                       if (intval($vv['size']))        $tArr[0]=intval($vv['size']);
+                                                       if (intval($vv['size']))        $tArr[0] = intval($vv['size']);
                                                break;
                                                case 'select':
-                                                       if (intval($vv['size']))        $tArr[0]=intval($vv['size']);
-                                                       if ($vv['autosize'])    $tArr[0]='auto';
-                                                       if ($vv['multiple'])    $tArr[1]='m';
+                                                       if (intval($vv['size']))        $tArr[0] = intval($vv['size']);
+                                                       if ($vv['autosize'])    $tArr[0] = 'auto';
+                                                       if ($vv['multiple'])    $tArr[1] = 'm';
                                                break;
                                        }
                                        $tArr = $this->cleanT($tArr);
                                        if (count($tArr))       $thisLine[1].=','.implode(',', $tArr);
 
-                                       $thisLine[1]=str_replace('|', '', $thisLine[1]);
+                                       $thisLine[1] = str_replace('|', '', $thisLine[1]);
 
                                                // Default:
-                                       if ($vv['type']=='select' || $vv['type']=='radio') {
-                                               $thisLine[2]=str_replace(LF, ', ', str_replace(',', '', $vv['options']));
-                                       } elseif ($vv['type']=='check') {
-                                               if ($vv['default'])     $thisLine[2]=1;
+                                       if ($vv['type'] == 'select' || $vv['type'] == 'radio') {
+                                               $thisLine[2] = str_replace(LF, ', ', str_replace(',', '', $vv['options']));
+                                       } elseif ($vv['type'] == 'check') {
+                                               if ($vv['default'])     $thisLine[2] = 1;
                                        } elseif (strcmp(trim($vv['default']), '')) {
-                                               $thisLine[2]=$vv['default'];
+                                               $thisLine[2] = $vv['default'];
                                        }
-                                       if (isset($thisLine[2]))                $thisLine[2]=str_replace('|', '', $thisLine[2]);
+                                       if (isset($thisLine[2]))                $thisLine[2] = str_replace('|', '', $thisLine[2]);
                                }
 
                                        // Compile the final line:
-                               $inLines[]=preg_replace("/[\n\r]*/", '', implode(' | ', $thisLine));
+                               $inLines[] = preg_replace("/[\n\r]*/", '', implode(' | ', $thisLine));
                        }
                }
                        // Finally, implode the lines into a string, and return it:
@@ -792,21 +777,22 @@ class SC_wizard_forms {
        /**
         * Converts the input configuration code string into an array
         *
-        * @param       string          Configuration code
-        * @return      array           Configuration array
+        * @param string $cfgStr Configuration code
+        * @return array Configuration array
         * @see cfgArray2CfgString()
         */
        function cfgString2CfgArray($cfgStr) {
 
                        // Traverse the number of form elements:
-               $tLines=explode(LF, $cfgStr);
-               foreach($tLines as $k => $v) {
+               $tLines = explode(LF, $cfgStr);
+               foreach ($tLines as $k => $v) {
 
                                // Initialize:
-                       $confData=array();
-                       $val=trim($v);
+                       $confData = array();
+                       $val = trim($v);
 
-                               // Accept a line as configuration if a) it is blank(! - because blank lines indicates new, unconfigured fields) or b) it is NOT a comment.
+                               // Accept a line as configuration if a) it is blank(! - because blank lines indicates new,
+                               // unconfigured fields) or b) it is NOT a comment.
                        if (!$val || strcspn($val, '#/')) {
 
                                        // Split:
@@ -817,8 +803,8 @@ class SC_wizard_forms {
 
                                        // Field:
                                $fParts = t3lib_div::trimExplode(',', $parts[1]);
-                               $fParts[0]=trim($fParts[0]);
-                               if (substr($fParts[0], 0, 1)=='*') {
+                               $fParts[0] = trim($fParts[0]);
+                               if (substr($fParts[0], 0, 1) == '*') {
                                        $confData['required'] = 1;
                                        $fParts[0] = substr($fParts[0], 1);
                                }
@@ -827,13 +813,13 @@ class SC_wizard_forms {
                                $confData['type'] = trim(strtolower(end($typeParts)));
 
                                if ($confData['type']) {
-                                       if (count($typeParts)==1) {
+                                       if (count($typeParts) == 1) {
                                                $confData['fieldname'] = substr(preg_replace('/[^a-zA-Z0-9_]/', '', str_replace(' ', '_', trim($parts[0]))), 0, 30);
 
                                                        // Attachment names...
-                                               if ($confData['type']=='file') {
-                                                       $confData['fieldname']='attachment'.$attachmentCounter;
-                                                       $attachmentCounter=intval($attachmentCounter)+1;
+                                               if ($confData['type'] == 'file') {
+                                                       $confData['fieldname'] = 'attachment'.$attachmentCounter;
+                                                       $attachmentCounter = intval($attachmentCounter)+1;
                                                }
                                        } else {
                                                $confData['fieldname'] = str_replace(' ', '_', trim($typeParts[0]));
@@ -854,7 +840,7 @@ class SC_wizard_forms {
                                                case 'textarea':
                                                        $confData['cols'] = $fParts[1];
                                                        $confData['rows'] = $fParts[2];
-                                                       $confData['extra'] = strtoupper($fParts[3])=='OFF' ? 'OFF' : '';
+                                                       $confData['extra'] = strtoupper($fParts[3]) == 'OFF' ? 'OFF' : '';
                                                        $confData['specialEval'] = trim($parts[3]);
                                                break;
                                                case 'input':
@@ -875,13 +861,13 @@ class SC_wizard_forms {
                                }
                        } else {
                                        // No configuration, only a comment:
-                               $confData=array(
+                               $confData = array(
                                        'comment' => $val
                                );
                        }
 
                                // Adding config array:
-                       $cfgArr[]=$confData;
+                       $cfgArr[] = $confData;
                }
 
                        // Return cfgArr
@@ -891,12 +877,12 @@ class SC_wizard_forms {
        /**
         * Removes any "trailing elements" in the array which consists of whitespace (little like trim() does for strings, so this does for arrays)
         *
-        * @param       array           Single dim array
-        * @return      array           Processed array
+        * @param array $tArr Single dim array
+        * @return array Processed array
         * @access private
         */
        function cleanT($tArr) {
-               for($a=count($tArr);$a>0;$a--) {
+               for($a = count($tArr); $a > 0; $a--) {
                        if (strcmp($tArr[$a-1], '')) {
                                break;
                        } else {
@@ -909,16 +895,16 @@ class SC_wizard_forms {
        /**
         * Wraps items in $fArr in table cells/rows, displaying them vertically.
         *
-        * @param       array           Array of label/HTML pairs.
-        * @return      string          HTML table
+        * @param array $fArr Array of label/HTML pairs.
+        * @return string HTML table
         * @access private
         */
        function formatCells($fArr) {
 
                        // Traverse the elements in $fArr and wrap them in table cells:
-               $lines=array();
-               foreach($fArr as $l => $c) {
-                       $lines[]='
+               $lines = array();
+               foreach ($fArr as $l => $c) {
+                       $lines[] = '
                                <tr>
                                        <td nowrap="nowrap">'.htmlspecialchars($l.':').'&nbsp;</td>
                                        <td>'.$c.'</td>
@@ -926,7 +912,7 @@ class SC_wizard_forms {
                }
 
                        // Add a cell which will set a minimum width:
-               $lines[]='
+               $lines[] = '
                        <tr>
                                <td nowrap="nowrap"><img src="clear.gif" width="70" height="1" alt="" /></td>
                                <td></td>
@@ -944,8 +930,10 @@ class SC_wizard_forms {
 $SOBE = t3lib_div::makeInstance('SC_wizard_forms');
 $SOBE->init();
 
-// Include files?
-foreach($SOBE->include_once as $INC_FILE)      include_once($INC_FILE);
+       // Include files?
+foreach ($SOBE->include_once as $INC_FILE) {
+       include_once($INC_FILE);
+}
 
 $SOBE->main();
 $SOBE->printContent();
index 9212483..12a7485 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Wizard to list records from a page id.
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
 
-
-
-
-
-
-
-
-
-
-
 /**
  * Script Class for redirecting the user to the Web > List module if a wizard-link has been clicked in TCEforms
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_wizard_list {
 
                // Internal, static:
-       var $pid;                                       // PID
+               // PID
+       var $pid;
 
                // Internal, static: GPvars
-       var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $table;                                     // Table to show, if none, then all tables are listed in list module.
-       var $id;                                        // Page id to list.
-
-
-
-
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // Table to show, if none, then all tables are listed in list module.
+       var $table;
+               // Page id to list.
+       var $id;
 
        /**
         * Initialization of the class, setting GPvars.
@@ -86,7 +75,7 @@ class SC_wizard_list {
         * Main function
         * Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
         *
-        * @return      void
+        * @return void
         */
        function main() {
 
@@ -102,7 +91,8 @@ class SC_wizard_list {
                } else $this->pid = intval($this->P['params']['pid']);
 
                        // Make redirect:
-               if (!strcmp($this->pid, '') || strcmp($this->id, ''))   {       // If pid is blank OR if id is set, then return...
+                       // If pid is blank OR if id is set, then return...
+               if (!strcmp($this->pid, '') || strcmp($this->id, '')) {
                        $redirectUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']);
                } else {        // Otherwise, show the list:
                        $urlParameters = array();
@@ -115,7 +105,7 @@ class SC_wizard_list {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_list');
 $SOBE->init();
 $SOBE->main();
index da71ce5..397a9bf 100644 (file)
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 
 t3lib_BEfunc::lockRecords();
 
-
-
-
-
-
-
-
-
-
-
 /**
  * Script Class for rendering the full screen RTE display
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -68,20 +56,21 @@ class SC_wizard_rte {
         * @var mediumDoc
         */
        var $doc;
-       var $content;                           // Content accumulation for the module.
+               // Content accumulation for the module.
+       var $content;
 
                // Internal, static: GPvars
-       var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $popView;                           // If set, launch a new window with the current records pid.
-       var $R_URI;                                     // Set to the URL of this script including variables which is needed to re-display the form. See main()
-
-
-
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // If set, launch a new window with the current records pid.
+       var $popView;
+               // Set to the URL of this script including variables which is needed to re-display the form. See main()
+       var $R_URI;
 
        /**
         * Initialization of the class
         *
-        * @return      void
+        * @return void
         */
        function init() {
                        // Setting GPvars:
@@ -96,17 +85,19 @@ class SC_wizard_rte {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('templates/wizard_rte.html');
-               $this->doc->divClass = '';      // Need to NOT have the page wrapped in DIV since if we do that we destroy the feature that the RTE spans the whole height of the page!!!
+                       // Need to NOT have the page wrapped in DIV since if we do that we destroy
+                       // the feature that the RTE spans the whole height of the page!!!
+               $this->doc->divClass = '';
                $this->doc->form='<form action="tce_db.php" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
        }
 
        /**
         * Main function, rendering the document with the iframe with the RTE in.
         *
-        * @return      void
+        * @return void
         */
        function main() {
-                       // translate id to the workspace version:
+                       // Translate id to the workspace version:
                if ($versionRec = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->P['table'], $this->P['uid'], 'uid')) {
                        $this->P['uid'] = $versionRec['uid'];
                }
@@ -134,12 +125,16 @@ class SC_wizard_rte {
 
                                // Initialize TCeforms - for rendering the field:
                        $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
-                       $tceforms->initDefaultBEMode(); // Init...
-                       $tceforms->disableWizards = 1;  // SPECIAL: Disables all wizards - we are NOT going to need them.
-                       $tceforms->colorScheme[0]=$this->doc->bgColor;  // SPECIAL: Setting background color of the RTE to ordinary background
+                               // Init...
+                       $tceforms->initDefaultBEMode();
+                               // SPECIAL: Disables all wizards - we are NOT going to need them.
+                       $tceforms->disableWizards = 1;
+                               // SPECIAL: Setting background color of the RTE to ordinary background
+                       $tceforms->colorScheme[0] = $this->doc->bgColor;
 
                                // Initialize style for RTE object:
-                       $RTEobj = t3lib_BEfunc::RTEgetObj();    // Getting reference to the RTE object used to render the field!
+                               // Getting reference to the RTE object used to render the field!
+                       $RTEobj = t3lib_BEfunc::RTEgetObj();
                        if ($RTEobj->ID == 'rte') {
                                $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';      // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
                        }
@@ -157,9 +152,9 @@ class SC_wizard_rte {
                                // TSconfig, setting width:
                        $fieldTSConfig = $tceforms->setTSconfig($this->P['table'], $rec, $this->P['field']);
                        if (strcmp($fieldTSConfig['RTEfullScreenWidth'], '')) {
-                               $width=$fieldTSConfig['RTEfullScreenWidth'];
+                               $width = $fieldTSConfig['RTEfullScreenWidth'];
                        } else {
-                               $width='100%';
+                               $width = '100%';
                        }
 
                                // Get the form field and wrap it in the table with the buttons:
@@ -193,14 +188,14 @@ class SC_wizard_rte {
                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('forms_title'), '<span class="typo3-red">' . $GLOBALS['LANG']->getLL('table_noData', 1) . '</span>', 0, 1);
                }
 
-               // Setting up the buttons and markers for docheader
+                       // Setting up the buttons and markers for docheader
                $docHeaderButtons = $this->getButtons();
                $markers['CONTENT'] = $this->content;
 
-               // Build the <body> for the module
+                       // Build the <body> for the module
                $this->content = $this->doc->startPage('');
-               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
 
        }
@@ -208,10 +203,10 @@ class SC_wizard_rte {
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
                echo $this->content;
        }
@@ -219,7 +214,7 @@ class SC_wizard_rte {
        /**
         * Create the panel of buttons for submitting the form or otherwise perform operations.
         *
-        * @return array all available buttons as an assoc. array
+        * @return array All available buttons as an assoc. array
         */
        protected function getButtons() {
                $buttons = array(
@@ -234,41 +229,41 @@ class SC_wizard_rte {
                if ($this->P['table'] && $this->P['field'] && $this->P['uid'] && $this->checkEditAccess($this->P['table'], $this->P['uid'])) {
                        $closeUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']);
 
-                       // Getting settings for the undo button:
+                               // Getting settings for the undo button:
                        $undoButton = 0;
                        $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->P['table'], 'sys_history') . ' AND recuid=' . intval($this->P['uid']), '', 'tstamp DESC', '1');
                        if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) {
                                $undoButton = 1;
                        }
 
-                       // Close
+                               // Close
                        $buttons['close'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(unescape(\'' . rawurlencode($closeUrl) . '\')); return false;') . '">' .
                                        '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" alt="" />' .
                                        '</a>';
 
-                       // Save
+                               // Save
                        $buttons['save'] = '<a href="#" onclick="TBE_EDITOR.checkAndDoSubmit(1); return false;">' .
                                '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" alt="" />' .
                                '</a>';
 
-                       // Save & View
+                               // Save & View
                        if (t3lib_extMgm::isLoaded('cms')) {
                                $buttons['save_view'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '">' .
                                        '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedokshow.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" alt="" />' .
                                        '</a>';
                        }
 
-                       // Save & Close
+                               // Save & Close
                        $buttons['save_close'] = '<input type="image" class="c-inputButton" onclick="' . htmlspecialchars('document.editform.redirect.value=\'' . $closeUrl . '\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />';
 
-                       // Undo/Revert:
+                               // Undo/Revert:
                        if ($undoButton) {
                                $buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'show_rechis.php?element=' . rawurlencode($this->P['table'] . ':' . $this->P['uid']) . '&revert=' . rawurlencode('field:' . $this->P['field']) . '&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;') . '">' .
                                        '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
                                        '</a>';
                        }
 
-                       // Shortcut
+                               // Shortcut
                        if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
                                $buttons['shortcut'] = $this->doc->makeShortcutIcon('P', '', $this->MCONF['name'], 1);
                        }
@@ -280,15 +275,16 @@ class SC_wizard_rte {
        /**
         * Checks access for element
         *
-        * @param       string          Table name
-        * @param       integer         Record uid
-        * @return      void
+        * @param string $table Table name
+        * @param integer $uid Record uid
+        * @return void
         */
        function checkEditAccess($table, $uid) {
                $calcPRec = t3lib_BEfunc::getRecord($table, $uid);
                t3lib_BEfunc::fixVersioningPid($table, $calcPRec);
                if (is_array($calcPRec)) {
-                       if ($table=='pages')    {       // If pages:
+                               // If pages:
+                       if ($table == 'pages') {
                                $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($calcPRec);
                                $hasAccess = $CALC_PERMS&2 ? TRUE : FALSE;
                        } else {
@@ -307,7 +303,7 @@ class SC_wizard_rte {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_rte');
 $SOBE->init();
 $SOBE->main();
index 23a60ab..a8de2d4 100644 (file)
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 
-
-
-
-
-
-
-
-
-
-
 /**
  * Script Class for rendering the Table Wizard
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -67,33 +55,41 @@ class SC_wizard_table {
         * @var mediumDoc
         */
        var $doc;
-       var $content;                           // Content accumulation for the module.
-       var $include_once=array();      // List of files to include.
-       var $inputStyle=0;                      // TRUE, then <input> fields are shown, not textareas.
+               // Content accumulation for the module.
+       var $content;
+               // List of files to include.
+       var $include_once = array();
+               // TRUE, then <input> fields are shown, not textareas.
+       var $inputStyle = 0;
 
 
                // Internal, static:
-       var $xmlStorage=0;                      // If set, the string version of the content is interpreted/written as XML instead of the original linebased kind. This variable still needs binding to the wizard parameters - but support is ready!
-       var $numNewRows=1;                      // Number of new rows to add in bottom of wizard
-       var $colsFieldName='cols';      // Name of field in parent record which MAY contain the number of columns for the table - here hardcoded to the value of tt_content. Should be set by TCEform parameters (from P)
-
+               // If set, the string version of the content is interpreted/written as XML
+               // instead of the original linebased kind. This variable still needs binding
+               // to the wizard parameters - but support is ready!
+       var $xmlStorage = 0;
+               // Number of new rows to add in bottom of wizard
+       var $numNewRows = 1;
+               // Name of field in parent record which MAY contain the number of columns for the table
+               // - here hardcoded to the value of tt_content. Should be set by TCEform parameters (from P)
+       var $colsFieldName = 'cols';
 
                // Internal, static: GPvars
-       var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $TABLECFG;                          // The array which is constantly submitted by the multidimensional form of this wizard.
-
-               // table parsing
-       var $tableParsing_quote;                        // quoting of table cells
-       var $tableParsing_delimiter;            // delimiter between table cells
-
-
-
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // The array which is constantly submitted by the multidimensional form of this wizard.
+       var $TABLECFG;
 
+               // Table parsing
+               // quoting of table cells
+       var $tableParsing_quote;
+               // delimiter between table cells
+       var $tableParsing_delimiter;
 
        /**
         * Initialization of the class
         *
-        * @return      void
+        * @return void
         */
        function init() {
                        // GPvars:
@@ -105,7 +101,7 @@ class SC_wizard_table {
                $this->numNewRows = t3lib_utility_Math::forceIntegerInRange($this->P['params']['numNewRows'], 1, 50, 5);
 
                        // Textareas or input fields:
-               $this->inputStyle=isset($this->TABLECFG['textFields']) ? $this->TABLECFG['textFields'] : 1;
+               $this->inputStyle = isset($this->TABLECFG['textFields']) ? $this->TABLECFG['textFields'] : 1;
 
                        // Document template object:
                $this->doc = t3lib_div::makeInstance('template');
@@ -123,7 +119,7 @@ class SC_wizard_table {
 
                        // If save command found, include tcemain:
                if ($_POST['savedok_x'] || $_POST['saveandclosedok_x']) {
-                       $this->include_once[]=PATH_t3lib.'class.t3lib_tcemain.php';
+                       $this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';
                }
 
                $this->tableParsing_delimiter = '|';
@@ -133,7 +129,7 @@ class SC_wizard_table {
        /**
         * Main function, rendering the table wizard
         *
-        * @return      void
+        * @return void
         */
        function main() {
                if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
@@ -142,22 +138,22 @@ class SC_wizard_table {
                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('table_title'), '<span class="typo3-red">' . $GLOBALS['LANG']->getLL('table_noData', 1) . '</span>', 0, 1);
                }
 
-               // Setting up the buttons and markers for docheader
+                       // Setting up the buttons and markers for docheader
                $docHeaderButtons = $this->getButtons();
                $markers['CSH'] = $docHeaderButtons['csh'];
                $markers['CONTENT'] = $this->content;
 
-               // Build the <body> for the module
+                       // Build the <body> for the module
                $this->content = $this->doc->startPage('Table');
-               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
@@ -166,7 +162,7 @@ class SC_wizard_table {
        /**
         * Create the panel of buttons for submitting the form or otherwise perform operations.
         *
-        * @return array all available buttons as an assoc. array
+        * @return array All available buttons as an assoc. array
         */
        protected function getButtons() {
                $buttons = array(
@@ -179,24 +175,24 @@ class SC_wizard_table {
                );
 
                if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
-                       // CSH
+                               // CSH
                        $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_table_wiz', $GLOBALS['BACK_PATH'], '');
 
-                       // CSH Buttons
+                               // CSH Buttons
                        $buttons['csh_buttons'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_table_wiz_buttons', $GLOBALS['BACK_PATH'], '');
 
-                       // Close
+                               // Close
                        $buttons['close'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(unescape(\'' . rawurlencode(t3lib_div::sanitizeLocalUrl($this->P['returnUrl'])) . '\')); return false;') . '">' .
                                t3lib_iconWorks::getSpriteIcon('actions-document-close', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE))) .
                                '</a>';
 
-                       // Save
+                               // Save
                        $buttons['save'] = '<input type="image" class="c-inputButton" name="savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
 
-                       // Save & Close
+                               // Save & Close
                        $buttons['save_close'] = '<input type="image" class="c-inputButton" name="saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />';
 
-                       // Reload
+                               // Reload
                        $buttons['reload'] = '<input type="image" class="c-inputButton" name="_refresh"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/refresh_n.gif') . ' title="' . $GLOBALS['LANG']->getLL('forms_refresh', 1) . '" />';
                }
 
@@ -206,7 +202,7 @@ class SC_wizard_table {
        /**
         * Draws the table wizard content
         *
-        * @return      string          HTML content for the form.
+        * @return string HTML content for the form.
         */
        function tableWizard() {
 
@@ -216,7 +212,8 @@ class SC_wizard_table {
                        throw new RuntimeException('Wizard Error: No reference to record', 1294587125);
                }
 
-                       // This will get the content of the form configuration code field to us - possibly cleaned up, saved to database etc. if the form has been submitted in the meantime.
+                       // This will get the content of the form configuration code field to us - possibly cleaned up,
+                       // saved to database etc. if the form has been submitted in the meantime.
                $tableCfgArray = $this->getConfigCode($row);
 
                        // Generation of the Table Wizards HTML code:
@@ -226,12 +223,6 @@ class SC_wizard_table {
                return $content;
        }
 
-
-
-
-
-
-
        /***************************
         *
         * Helper functions
@@ -242,13 +233,13 @@ class SC_wizard_table {
         * Will get and return the configuration code string
         * Will also save (and possibly redirect/exit) the content if a save button has been pressed
         *
-        * @param       array           Current parent record row
-        * @return      array           Table config code in an array
+        * @param array $row Current parent record row
+        * @return array Table config code in an array
         * @access private
         */
        function getConfigCode($row) {
 
-                       // get delimiter settings
+                       // Get delimiter settings
                $flexForm = t3lib_div::xml2array($row['pi_flexform']);
 
                if (is_array($flexForm)) {
@@ -262,7 +253,6 @@ class SC_wizard_table {
                                // Process incoming:
                        $this->changeFunc();
 
-
                                // Convert to string (either line based or XML):
                        if ($this->xmlStorage) {
                                        // Convert the input array to XML:
@@ -286,8 +276,8 @@ class SC_wizard_table {
                                $tce->stripslashes_values=0;
 
                                        // Put content into the data array:
-                               $data=array();
-                               $data[$this->P['table']][$this->P['uid']][$this->P['field']]=$bodyText;
+                               $data = array();
+                               $data[$this->P['table']][$this->P['uid']][$this->P['field']] = $bodyText;
 
                                        // Perform the update:
                                $tce->start($data, array());
@@ -313,28 +303,28 @@ class SC_wizard_table {
        /**
         * Creates the HTML for the Table Wizard:
         *
-        * @param       array           Table config array
-        * @param       array           Current parent record array
-        * @return      string          HTML for the table wizard
+        * @param array $cfgArr Table config array
+        * @param array $row Current parent record array
+        * @return string HTML for the table wizard
         * @access private
         */
        function getTableHTML($cfgArr, $row) {
                        // Traverse the rows:
-               $tRows=array();
-               $k=0;
-               foreach($cfgArr as $cellArr) {
+               $tRows = array();
+               $k = 0;
+               foreach ($cfgArr as $cellArr) {
                        if (is_array($cellArr)) {
                                        // Initialize:
-                               $cells=array();
-                               $a=0;
+                               $cells = array();
+                               $a = 0;
 
                                        // Traverse the columns:
-                               foreach($cellArr as $cellContent) {
+                               foreach ($cellArr as $cellContent) {
                                        if ($this->inputStyle) {
-                                               $cells[]='<input type="text"'.$this->doc->formWidth(20).' name="TABLE[c]['.(($k+1)*2).']['.(($a+1)*2).']" value="'.htmlspecialchars($cellContent).'" />';
+                                               $cells[] = '<input type="text"'.$this->doc->formWidth(20).' name="TABLE[c]['.(($k+1)*2).']['.(($a+1)*2).']" value="'.htmlspecialchars($cellContent).'" />';
                                        } else {
-                                               $cellContent=preg_replace('/<br[ ]?[\/]?>/i', LF, $cellContent);
-                                               $cells[]='<textarea '.$this->doc->formWidth(20).' rows="5" name="TABLE[c]['.(($k+1)*2).']['.(($a+1)*2).']">'.t3lib_div::formatForTextarea($cellContent).'</textarea>';
+                                               $cellContent = preg_replace('/<br[ ]?[\/]?>/i', LF, $cellContent);
+                                               $cells[] = '<textarea '.$this->doc->formWidth(20).' rows="5" name="TABLE[c]['.(($k+1)*2).']['.(($a+1)*2).']">'.t3lib_div::formatForTextarea($cellContent).'</textarea>';
                                        }
 
                                                // Increment counter:
@@ -342,27 +332,27 @@ class SC_wizard_table {
                                }
 
                                        // CTRL panel for a table row (move up/down/around):
-                               $onClick="document.wizardForm.action+='#ANC_".(($k+1)*2-2)."';";
-                               $onClick=' onclick="'.htmlspecialchars($onClick).'"';
-                               $ctrl='';
+                               $onClick = "document.wizardForm.action+='#ANC_".(($k+1)*2-2)."';";
+                               $onClick = ' onclick="'.htmlspecialchars($onClick).'"';
+                               $ctrl = '';
 
-                               $brTag=$this->inputStyle?'':'<br />';
-                               if ($k!=0) {
-                                       $ctrl.='<input type="image" name="TABLE[row_up]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_up', 1).'" />'.$brTag;
+                               $brTag = $this->inputStyle?'':'<br />';
+                               if ($k != 0) {
+                                       $ctrl .= '<input type="image" name="TABLE[row_up]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_up', 1).'" />'.$brTag;
                                } else {
-                                       $ctrl.='<input type="image" name="TABLE[row_bottom]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_bottom', 1).'" />'.$brTag;
+                                       $ctrl .= '<input type="image" name="TABLE[row_bottom]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_up.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_bottom', 1).'" />'.$brTag;
                                }
-                               $ctrl.='<input type="image" name="TABLE[row_remove]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_removeRow', 1).'" />'.$brTag;
+                               $ctrl .= '<input type="image" name="TABLE[row_remove]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_removeRow', 1).'" />'.$brTag;
 
-// FIXME what is $tLines? See wizard_forms.php for the same.
-                               if (($k+1)!=count($tLines)) {
-                                       $ctrl.='<input type="image" name="TABLE[row_down]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2down.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_down', 1).'" />'.$brTag;
+                                       // FIXME what is $tLines? See wizard_forms.php for the same.
+                               if (($k+1) != count($tLines)) {
+                                       $ctrl .= '<input type="image" name="TABLE[row_down]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2down.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_down', 1).'" />'.$brTag;
                                } else {
-                                       $ctrl.='<input type="image" name="TABLE[row_top]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_down.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_top', 1).'" />'.$brTag;
+                                       $ctrl .= '<input type="image" name="TABLE[row_top]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_down.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_top', 1).'" />'.$brTag;
                                }
-                               $ctrl.='<input type="image" name="TABLE[row_add]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/add.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_addRow', 1).'" />'.$brTag;
+                               $ctrl .= '<input type="image" name="TABLE[row_add]['.(($k+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/add.gif', '').$onClick.' title="'.$GLOBALS['LANG']->getLL('table_addRow', 1).'" />'.$brTag;
 
-                               $tRows[]='
+                               $tRows[] = '
                                        <tr class="bgColor4">
                                                <td class="bgColor5"><a name="ANC_'.(($k+1)*2).'"></a><span class="c-wizButtonsV">'.$ctrl.'</span></td>
                                                <td>' . implode('</td>
@@ -375,37 +365,37 @@ class SC_wizard_table {
                }
 
                        // CTRL panel for a table column (move left/right/around/delete)
-               $cells=array();
-               $cells[]='';
+               $cells = array();
+               $cells[] = '';
                        // Finding first row:
                $firstRow = reset($cfgArr);
                if (is_array($firstRow)) {
 
                                // Init:
-                       $a=0;
-                       $cols=count($firstRow);
+                       $a = 0;
+                       $cols = count($firstRow);
 
                                // Traverse first row:
-                       foreach($firstRow as $temp) {
-                               $ctrl='';
-                               if ($a!=0) {
-                                       $ctrl.='<input type="image" name="TABLE[col_left]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2left.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_left', 1).'" />';
+                       foreach ($firstRow as $temp) {
+                               $ctrl = '';
+                               if ($a != 0) {
+                                       $ctrl .= '<input type="image" name="TABLE[col_left]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2left.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_left', 1).'" />';
                                } else {
-                                       $ctrl.='<input type="image" name="TABLE[col_end]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_left.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_end', 1).'" />';
+                                       $ctrl .= '<input type="image" name="TABLE[col_end]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_left.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_end', 1).'" />';
                                }
-                               $ctrl.='<input type="image" name="TABLE[col_remove]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_removeColumn', 1).'" />';
-                               if (($a+1)!=$cols) {
-                                       $ctrl.='<input type="image" name="TABLE[col_right]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2right.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_right', 1).'" />';
+                               $ctrl .= '<input type="image" name="TABLE[col_remove]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_removeColumn', 1).'" />';
+                               if (($a+1) != $cols) {
+                                       $ctrl .= '<input type="image" name="TABLE[col_right]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/pil2right.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_right', 1).'" />';
                                } else {
-                                       $ctrl.='<input type="image" name="TABLE[col_start]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_right.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_start', 1).'" />';
+                                       $ctrl .= '<input type="image" name="TABLE[col_start]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/turn_right.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_start', 1).'" />';
                                }
-                               $ctrl.='<input type="image" name="TABLE[col_add]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/add.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_addColumn', 1).'" />';
-                               $cells[]='<span class="c-wizButtonsH">'.$ctrl.'</span>';
+                               $ctrl .= '<input type="image" name="TABLE[col_add]['.(($a+1)*2).']"'.t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/add.gif', '').' title="'.$GLOBALS['LANG']->getLL('table_addColumn', 1).'" />';
+                               $cells[] = '<span class="c-wizButtonsH">'.$ctrl.'</span>';
 
                                        // Incr. counter:
                                $a++;
                        }
-                       $tRows[]='
+                       $tRows[] = '
                                <tr class="bgColor5">
                                        <td align="center">' . implode('</td>
                                        <td align="center">', $cells) . '</td>
@@ -415,7 +405,7 @@ class SC_wizard_table {
                $content = '';
 
                        // Implode all table rows into a string, wrapped in table tags.
-               $content.= '
+               $content .= '
 
 
                        <!--
@@ -426,7 +416,7 @@ class SC_wizard_table {
                        </table>';
 
                        // Input type checkbox:
-               $content.= '
+               $content .= '
 
                        <!--
                                Input mode check box:
@@ -448,57 +438,61 @@ class SC_wizard_table {
        /**
         * Detects if a control button (up/down/around/delete) has been pressed for an item and accordingly it will manipulate the internal TABLECFG array
         *
-        * @return      void
+        * @return void
         * @access private
         */
        function changeFunc() {
                if ($this->TABLECFG['col_remove']) {
                        $kk = key($this->TABLECFG['col_remove']);
-                       $cmd='col_remove';
+                       $cmd = 'col_remove';
                } elseif ($this->TABLECFG['col_add']) {
                        $kk = key($this->TABLECFG['col_add']);
-                       $cmd='col_add';
+                       $cmd = 'col_add';
                } elseif ($this->TABLECFG['col_start']) {
                        $kk = key($this->TABLECFG['col_start']);
-                       $cmd='col_start';
+                       $cmd = 'col_start';
                } elseif ($this->TABLECFG['col_end']) {
                        $kk = key($this->TABLECFG['col_end']);
-                       $cmd='col_end';
+                       $cmd = 'col_end';
                } elseif ($this->TABLECFG['col_left']) {
                        $kk = key($this->TABLECFG['col_left']);
-                       $cmd='col_left';
+                       $cmd = 'col_left';
                } elseif ($this->TABLECFG['col_right']) {
                        $kk = key($this->TABLECFG['col_right']);
-                       $cmd='col_right';
+                       $cmd = 'col_right';
                } elseif ($this->TABLECFG['row_remove']) {
                        $kk = key($this->TABLECFG['row_remove']);
-                       $cmd='row_remove';
+                       $cmd = 'row_remove';
                } elseif ($this->TABLECFG['row_add']) {
                        $kk = key($this->TABLECFG['row_add']);
-                       $cmd='row_add';
+                       $cmd = 'row_add';
                } elseif ($this->TABLECFG['row_top']) {
                        $kk = key($this->TABLECFG['row_top']);
-                       $cmd='row_top';
+                       $cmd = 'row_top';
                } elseif ($this->TABLECFG['row_bottom']) {
                        $kk = key($this->TABLECFG['row_bottom']);
-                       $cmd='row_bottom';
+                       $cmd = 'row_bottom';
                } elseif ($this->TABLECFG['row_up']) {
                        $kk = key($this->TABLECFG['row_up']);
-                       $cmd='row_up';
+                       $cmd = 'row_up';
                } elseif ($this->TABLECFG['row_down']) {
                        $kk = key($this->TABLECFG['row_down']);
-                       $cmd='row_down';
+                       $cmd = 'row_down';
                }
 
                if ($cmd && t3lib_utility_Math::canBeInterpretedAsInteger($kk)) {
-                       if (substr($cmd, 0, 4)=='row_') {
+                       if (substr($cmd, 0, 4) == 'row_') {
                                switch($cmd) {
                                        case 'row_remove':
                                                unset($this->TABLECFG['c'][$kk]);
                                        break;
                                        case 'row_add':
-                                               for($a=1;$a<=$this->numNewRows;$a++) {
-                                                       if (!isset($this->TABLECFG['c'][$kk+$a]))       {       // Checking if set: The point is that any new row inbetween existing rows will be TRUE after one row is added while if rows are added in the bottom of the table there will be no existing rows to stop the addition of new rows which means it will add up to $this->numNewRows rows then.
+                                               for ($a = 1; $a <= $this->numNewRows; $a++) {
+                                                               // Checking if set: The point is that any new row inbetween existing rows
+                                                               // will be TRUE after one row is added while if rows are added in the bottom
+                                                               // of the table there will be no existing rows to stop the addition of new rows
+                                                               // which means it will add up to $this->numNewRows rows then.
+                                                       if (!isset($this->TABLECFG['c'][$kk+$a])) {
                                                                $this->TABLECFG['c'][$kk+$a] = array();
                                                        } else {
                                                                break;
@@ -531,7 +525,7 @@ class SC_wizard_table {
                                                        unset($this->TABLECFG['c'][$cAK][$kk]);
                                                break;
                                                case 'col_add':
-                                                       $this->TABLECFG['c'][$cAK][$kk+1]='';
+                                                       $this->TABLECFG['c'][$cAK][$kk+1] = '';
                                                break;
                                                case 'col_start':
                                                        $this->TABLECFG['c'][$cAK][1]=$this->TABLECFG['c'][$cAK][$kk];
@@ -566,8 +560,8 @@ class SC_wizard_table {
        /**
         * Converts the input array to a configuration code string
         *
-        * @param       array           Array of table configuration (follows the input structure from the table wizard POST form)
-        * @return      string          The array converted into a string with line-based configuration.
+        * @param array $cfgArr Array of table configuration (follows the input structure from the table wizard POST form)
+        * @return string The array converted into a string with line-based configuration.
         * @see cfgString2CfgArray()
         */
        function cfgArray2CfgString($cfgArr) {
@@ -577,11 +571,11 @@ class SC_wizard_table {
 
                        // Traverse the elements of the table wizard and transform the settings into configuration code.
                foreach ($this->TABLECFG['c'] as $a => $value) {
-                       $thisLine=array();
+                       $thisLine = array();
                        foreach ($this->TABLECFG['c'][$a] as $b => $value) {
-                               $thisLine[]=$this->tableParsing_quote.str_replace($this->tableParsing_delimiter, '', $this->TABLECFG['c'][$a][$b]).$this->tableParsing_quote;
+                               $thisLine[] = $this->tableParsing_quote.str_replace($this->tableParsing_delimiter, '', $this->TABLECFG['c'][$a][$b]).$this->tableParsing_quote;
                        }
-                       $inLines[]=implode($this->tableParsing_delimiter, $thisLine);
+                       $inLines[] = implode($this->tableParsing_delimiter, $thisLine);
                }
 
                        // Finally, implode the lines into a string:
@@ -594,35 +588,36 @@ class SC_wizard_table {
        /**
         * Converts the input configuration code string into an array
         *
-        * @param       string          Configuration code
-        * @param       integer         Default number of columns
-        * @return      array           Configuration array
+        * @param string $cfgStr Configuration code
+        * @param integer $cols Default number of columns
+        * @return array Configuration array
         * @see cfgArray2CfgString()
         */
        function cfgString2CfgArray($cfgStr, $cols) {
 
                        // Explode lines in the configuration code - each line is a table row.
-               $tLines=explode(LF, $cfgStr);
+               $tLines = explode(LF, $cfgStr);
 
                        // Setting number of columns
-               if (!$cols && trim($tLines[0])) {       // auto...
+                       // auto...
+               if (!$cols && trim($tLines[0])) {
                        $cols = count(explode($this->tableParsing_delimiter, $tLines[0]));
                }
-               $cols=$cols?$cols:4;
+               $cols = $cols ? $cols : 4;
 
                        // Traverse the number of table elements:
-               $cfgArr=array();
-               foreach($tLines as $k => $v) {
+               $cfgArr = array();
+               foreach ($tLines as $k => $v) {
 
                                // Initialize:
                        $vParts = explode($this->tableParsing_delimiter, $v);
 
                                // Traverse columns:
-                       for ($a=0;$a<$cols;$a++) {
+                       for ($a = 0; $a < $cols; $a++) {
                                if ($this->tableParsing_quote && substr($vParts[$a], 0, 1) == $this->tableParsing_quote && substr($vParts[$a], -1, 1) == $this->tableParsing_quote) {
                                        $vParts[$a] = substr(trim($vParts[$a]), 1, -1);
                                }
-                               $cfgArr[$k][$a]=$vParts[$a];
+                               $cfgArr[$k][$a] = $vParts[$a];
                        }
                }
 
@@ -631,12 +626,14 @@ class SC_wizard_table {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_table');
 $SOBE->init();
 
-// Include files?
-foreach($SOBE->include_once as $INC_FILE)      include_once($INC_FILE);
+       // Include files?
+foreach($SOBE->include_once as $INC_FILE) {
+       include_once($INC_FILE);
+}
 
 $SOBE->main();
 $SOBE->printContent();
index 1aff710..ee33388 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Wizard for inserting TSconfig in form fields. (page,user or TS)
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-$GLOBALS['BACK_PATH']='';
-require ('init.php');
-require ('template.php');
+$GLOBALS['BACK_PATH'] = '';
+require('init.php');
+require('template.php');
 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 
-
-
-
-
-
-
 /**
  * TypoScript parser extension class.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -58,27 +51,18 @@ class ext_TSparser extends t3lib_tsparser_ext {
        /**
         * Pass through of incoming value for link.
         *
-        * @param       array           P array
-        * @return      string          The "_LINK" key value, straight away.
+        * @param array $P P array
+        * @return string The "_LINK" key value, straight away.
         */
        function makeHtmlspecialchars($P) {
                return $P['_LINK'];
        }
 }
 
-
-
-
-
-
-
-
-
-
 /**
  * Script Class for rendering the TSconfig/TypoScript property browser.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -91,23 +75,25 @@ class SC_wizard_tsconfig {
         * @var mediumDoc
         */
        var $doc;
-       var $content;                           // Content accumulation for the module.
+               // Content accumulation for the module.
+       var $content;
 
                // Internal, static: GPvars
-       var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
-       var $mode;                                      // "page", "tsref" or "beuser"
-       var $show;                                      // Pointing to an entry in static_tsconfig_help to show.
-       var $objString;                         // Object path - for display.
-       var $onlyProperty;                      // If set, the "mixed-field" is not shown and you can select only one property at a time.
-
-
-
-
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
+               // "page", "tsref" or "beuser"
+       var $mode;
+               // Pointing to an entry in static_tsconfig_help to show.
+       var $show;
+               // Object path - for display.
+       var $objString;
+               // If set, the "mixed-field" is not shown and you can select only one property at a time.
+       var $onlyProperty;
 
        /**
         * Initialization of the class
         *
-        * @return      void
+        * @return void
         */
        function init() {
                        // Check if the tsconfig_help extension is loaded - which is mandatory for this wizard to work.
@@ -125,15 +111,15 @@ class SC_wizard_tsconfig {
                }
                unset($this->P['fieldChangeFunc']['alert']);
                $update='';
-               foreach($this->P['fieldChangeFunc'] as $k=>$v) {
-                       $update.= '
+               foreach ($this->P['fieldChangeFunc'] as $k=>$v) {
+                       $update .= '
                        window.opener.'.$v;
                }
 
                        // Init the document table object:
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->form='<form action="" name="editform">';
+               $this->doc->form = '<form action="" name="editform">';
 
                        // Adding Styles (should go into stylesheet?)
                $this->doc->inDocStylesArray[] = '
@@ -250,13 +236,13 @@ class SC_wizard_tsconfig {
 
 
                        // Start the page:
-               $this->content.=$this->doc->startPage($GLOBALS['LANG']->getLL('tsprop'));
+               $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('tsprop'));
        }
 
        /**
         * Main function, rendering the content of the TypoScript property browser, including links to online resources
         *
-        * @return      void
+        * @return void
         */
        function main() {
                        // Adding module content:
@@ -279,10 +265,10 @@ class SC_wizard_tsconfig {
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
                echo $this->content;
        }
@@ -290,61 +276,63 @@ class SC_wizard_tsconfig {
        /**
         * Create the content of the module:
         *
-        * @param       string          Object string
-        * @param       integer         Pointing to an entry in static_tsconfig_help to show.
-        * @return      string          HTML
+        * @param string $mode Object string
+        * @param integer $show Pointing to an entry in static_tsconfig_help to show.
+        * @return string HTML
         */
        function browseTSprop($mode, $show) {
                        // Get object tree:
                $objTree = $this->getObjTree();
 
                        // Show single element, if show is set.
-               $out='';
+               $out = '';
                if ($show) {
                                // Get the entry data:
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'static_tsconfig_help', 'uid='.intval($show));
                        $rec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
                        $table = unserialize($rec['appdata']);
-                       $obj_string = strtr($this->objString, '()', '[]');      // Title:
+                               // Title:
+                       $obj_string = strtr($this->objString, '()', '[]');
 
                                // Title and description:
-                       $out.='<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('show'=>''))).'" class="typo3-goBack">'.
+                       $out .= '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('show'=>''))).'" class="typo3-goBack">'.
                                        t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
                                        htmlspecialchars($obj_string).
                                        '</a><br />';
-                       if ($rec['title'])      $out.= '<strong>'.htmlspecialchars($rec['title']).': </strong>';
-                       if ($rec['description'])        $out.= nl2br(htmlspecialchars(trim($rec['description']))).'<br />';
+                       if ($rec['title'])      $out .= '<strong>'.htmlspecialchars($rec['title']).': </strong>';
+                       if ($rec['description'])        $out .= nl2br(htmlspecialchars(trim($rec['description']))).'<br />';
 
                                // Printing the content:
-                       $out.= '<br />'.$this->printTable($table, $obj_string, $objTree[$mode.'.']);
-                       $out.='<hr />';
+                       $out .= '<br />'.$this->printTable($table, $obj_string, $objTree[$mode.'.']);
+                       $out .='<hr />';
 
                                // Printing the "mixer-field":
                        if (!$this->onlyProperty) {
-                               $links=array();
-                               $links[]='<a href="#" onclick="mixerField(\'Indent\');return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_indent', 1).'</a>';
-                               $links[]='<a href="#" onclick="mixerField(\'Outdent\');return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_outdent', 1).'</a>';
-                               $links[]='<a href="#" onclick="mixerField(\'Wrap\',unescape(\''.rawurlencode($obj_string).'\'));return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_wrap', 1).'</a>';
-                               $links[]='<a href="#" onclick="mixerField(\'Transfer\');return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_transfer', 1).'</a>';
-                               $out.='<textarea rows="5" name="mixer" wrap="off"'.$this->doc->formWidthText(48, '', 'off').' class="fixed-font enable-tab"></textarea>';
-                               $out.='<br /><strong>'.implode('&nbsp; | &nbsp;', $links).'</strong>';
-                               $out.='<hr />';
+                               $links = array();
+                               $links[] = '<a href="#" onclick="mixerField(\'Indent\');return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_indent', 1).'</a>';
+                               $links[] = '<a href="#" onclick="mixerField(\'Outdent\');return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_outdent', 1).'</a>';
+                               $links[] = '<a href="#" onclick="mixerField(\'Wrap\',unescape(\''.rawurlencode($obj_string).'\'));return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_wrap', 1).'</a>';
+                               $links[] = '<a href="#" onclick="mixerField(\'Transfer\');return false;">'.$GLOBALS['LANG']->getLL('tsprop_mixer_transfer', 1).'</a>';
+                               $out .= '<textarea rows="5" name="mixer" wrap="off"'.$this->doc->formWidthText(48, '', 'off').' class="fixed-font enable-tab"></textarea>';
+                               $out .= '<br /><strong>'.implode('&nbsp; | &nbsp;', $links).'</strong>';
+                               $out .= '<hr />';
                        }
                }
 
 
                        // SECTION: Showing property tree:
                $tmpl = t3lib_div::makeInstance('ext_TSparser');
-               $tmpl->tt_track = 0;    // Do not log time-performance information
-               $tmpl->fixedLgd=0;
-               $tmpl->linkObjects=0;
-               $tmpl->bType='';
-               $tmpl->ext_expandAllNotes=1;
-               $tmpl->ext_noPMicons=1;
-               $tmpl->ext_noSpecialCharsOnLabels=1;
+                       // Do not log time-performance information
+               $tmpl->tt_track = 0;
+               $tmpl->fixedLgd = 0;
+               $tmpl->linkObjects = 0;
+               $tmpl->bType = '';
+               $tmpl->ext_expandAllNotes = 1;
+               $tmpl->ext_noPMicons = 1;
+               $tmpl->ext_noSpecialCharsOnLabels = 1;
 
                if (is_array($objTree[$mode.'.'])) {
-                       $out.='
+                       $out .= '
 
 
                        <!--
@@ -361,12 +349,6 @@ class SC_wizard_tsconfig {
                return $out;
        }
 
-
-
-
-
-
-
        /***************************
         *
         * Module functions
@@ -376,19 +358,19 @@ class SC_wizard_tsconfig {
        /**
         * Create object tree from static_tsconfig_help table
         *
-        * @return      array           Object tree.
+        * @return array Object tree.
         * @access private
         */
        function getObjTree() {
-               $objTree=array();
+               $objTree = array();
 
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,obj_string,title', 'static_tsconfig_help', '');
-               while($rec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+               while ($rec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $rec['obj_string'] = $this->revertFromSpecialChars($rec['obj_string']);
                        $p = explode(';', $rec['obj_string']);
                        foreach ($p as $v) {
                                $p2 = t3lib_div::trimExplode(':', $v, 1);
-                               $subp=t3lib_div::trimExplode('/', $p2[1], 1);
+                               $subp = t3lib_div::trimExplode('/', $p2[1], 1);
                                foreach ($subp as $v2) {
                                        $this->setObj($objTree, explode('.', $p2[0].'.'.$v2), array($rec, $v2));
                                }
@@ -401,19 +383,19 @@ class SC_wizard_tsconfig {
         * Sets the information from a static_tsconfig_help record in the object array.
         * Makes recursive calls.
         *
-        * @param       array           Object tree array, passed by value!
-        * @param       array           Array of elements from object path (?)
-        * @param       array           Array with record and something else (?)
-        * @return      void
+        * @param array $objTree Object tree array, passed by value!
+        * @param array $strArr Array of elements from object path (?)
+        * @param array $params Array with record and something else (?)
+        * @return void
         * @access private
         * @see getObjTree()
         */
        function setObj(&$objTree, $strArr, $params) {
                $key = current($strArr);
                reset($strArr);
-               if (count($strArr)>1) {
+               if (count($strArr) > 1) {
                        array_shift($strArr);
-                       if (!isset($objTree[$key.'.'])) $objTree[$key.'.']=array();
+                       if (!isset($objTree[$key.'.'])) $objTree[$key.'.'] = array();
                        $this->setObj($objTree[$key.'.'], $strArr, $params);
                } else {
                        $objTree[$key]=$params;
@@ -424,8 +406,8 @@ class SC_wizard_tsconfig {
        /**
         * Converts &gt; and &lt; to > and <
         *
-        * @param       string          Input string
-        * @return      string          Output string
+        * @param string $str Input string
+        * @return string Output string
         * @access private
         */
        function revertFromSpecialChars($str) {
@@ -437,8 +419,8 @@ class SC_wizard_tsconfig {
        /**
         * Creates a link based on input params array:
         *
-        * @param       array           Parameters
-        * @return      string          The link.
+        * @param array $params Parameters
+        * @return string The link.
         * @access private
         */
        function doLink($params) {
@@ -450,8 +432,8 @@ class SC_wizard_tsconfig {
        /**
         * Remove pointer strings from an array
         *
-        * @param       array           Input array
-        * @return      array           Modified input array
+        * @param array $objArray Input array
+        * @return array Modified input array
         * @access private
         */
        function removePointerObjects($objArray) {
@@ -467,32 +449,32 @@ class SC_wizard_tsconfig {
        /**
         * Linking string to object by UID
         *
-        * @param       string          String to link
-        * @param       integer         UID of a static_tsconfig_help record.
-        * @param       string          Title string for that record!
-        * @return      string          Linked string
+        * @param string $str String to link
+        * @param integer $uid UID of a static_tsconfig_help record.
+        * @param string $objString Title string for that record!
+        * @return string Linked string
         */
-       function linkToObj($str, $uid, $objString='') {
-               $aOnClick='jump(\''.rawurlencode($uid).'\',\''.rawurlencode($objString).'\');return false;';
+       function linkToObj($str, $uid, $objString = '') {
+               $aOnClick = 'jump(\''.rawurlencode($uid).'\',\''.rawurlencode($objString).'\');return false;';
                return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.htmlspecialchars($str).'</a>';
        }
 
        /**
         * Creates a table of properties:
         *
-        * @param       array           Array with properties for the current object path
-        * @param       string          Object path
-        * @param       array           Object tree
-        * @return      string          HTML content.
+        * @param array $table Array with properties for the current object path
+        * @param string $objString Object path
+        * @param array $objTree Object tree
+        * @return string HTML content.
         */
        function printTable($table, $objString, $objTree) {
                if (is_array($table['rows'])) {
 
                                // Initialize:
-                       $lines=array();
+                       $lines = array();
 
                                // Adding header:
-                       $lines[]='
+                       $lines[] = '
                                <tr class="t3-row-header">
                                        <td>Property:</td>
                                        <td>Data type:</td>
@@ -501,21 +483,21 @@ class SC_wizard_tsconfig {
                                </tr>';
 
                                // Traverse the content of "rows":
-                       foreach($table['rows'] as $i => $row) {
+                       foreach ($table['rows'] as $i => $row) {
 
                                        // Linking:
-                               $lP=t3lib_div::trimExplode(LF, $row['property'], 1);
-                               $lP2=array();
+                               $lP = t3lib_div::trimExplode(LF, $row['property'], 1);
+                               $lP2 = array();
                                foreach ($lP as $k => $lStr) {
                                        $lP2[$k] = $this->linkProperty($lStr, $lStr, $objString, $row['datatype']);
                                }
-                               $linkedProperties=implode('<hr />', $lP2);
+                               $linkedProperties = implode('<hr />', $lP2);
 
                                        // Data type:
                                $dataType = $row['datatype'];
 
                                        // Generally "->[something]"
-                               $reg=array();
+                               $reg = array();
                                preg_match('/->[[:alnum:]_]*/', $dataType, $reg);
                                if ($reg[0] && is_array($objTree[$reg[0]])) {
                                        $dataType = str_replace($reg[0], '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('show' => $objTree[$reg[0]][0]['uid'], 'objString' => $objString . '.' . $lP[0]))) . '">' . htmlspecialchars($reg[0]) . '</a>', $dataType);
@@ -527,8 +509,7 @@ class SC_wizard_tsconfig {
                                        $dataType = str_replace('stdWrap', '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('show'=>$objTree['->stdWrap'][0]['uid'], 'objString'=>$objString.'.'.$lP[0]))).'">stdWrap</a>', $dataType);
                                }
 
-
-                               $lines[]='
+                               $lines[] = '
                                        <tr class="t3-row ' . ($i % 2 ? 't3-row-even' : 't3-row-odd') . '">
                                                <td valign="top" class="bgColor4-20" nowrap="nowrap"><strong>'.$linkedProperties.'</strong></td>
                                                <td valign="top">'.nl2br($dataType.'&nbsp;').'</td>
@@ -553,24 +534,25 @@ class SC_wizard_tsconfig {
        /**
         * Creates a link on a property.
         *
-        * @param       string          String to link
-        * @param       string          Property value.
-        * @param       string          Object path prefix to value
-        * @param       string          Data type
-        * @return      string          Linked $str
+        * @param string $str String to link
+        * @param string $propertyName Property value.
+        * @param string $prefix Object path prefix to value
+        * @param string $datatype Data type
+        * @return string Linked $str
         */
        function linkProperty($str, $propertyName, $prefix, $datatype) {
-               $out='';
+               $out = '';
 
                        // Setting preset value:
                if (strstr($datatype, 'boolean')) {
-                       $propertyVal='1';       // preset "1" to boolean values.
+                               // preset "1" to boolean values.
+                       $propertyVal = '1';
                }
 
                        // Adding mixer features; The plus icon:
-               if(!$this->onlyProperty) {
+               if (!$this->onlyProperty) {
                        $aOnClick = 'document.editform.mixer.value=unescape(\'  '.rawurlencode($propertyName.'='.$propertyVal).'\')+\'\n\'+document.editform.mixer.value; return false;';
-                       $out.= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
+                       $out .= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
                                        t3lib_iconWorks::getSpriteIcon('actions-edit-add', array('title' => $GLOBALS['LANG']->getLL('tsprop_addToList', TRUE))) .
                        '</a>';
                        $propertyName = $prefix.'.'.$propertyName;
@@ -578,7 +560,7 @@ class SC_wizard_tsconfig {
 
                        // Wrap string:
                $aOnClick = 'setValue(unescape(\''.rawurlencode($propertyName).'\'), unescape(\''.rawurlencode($propertyVal).'\')); return false;';
-               $out.= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$str.'</a>';
+               $out .= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$str.'</a>';
 
                        // Return link:
                return $out;
@@ -598,10 +580,10 @@ class SC_wizard_tsconfig {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_tsconfig');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
+?>
\ No newline at end of file