[TASK] Clean up phpDoc comments in typo3/sysext/
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 14 Jun 2012 20:49:39 +0000 (22:49 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Jun 2012 21:44:02 +0000 (23:44 +0200)
Clean up phpDoc comments for the following classes:

* typo3/sysext/cms/layout/conf.php
* typo3/sysext/cms/layout/db_layout.php
* typo3/sysext/cms/layout/db_new_content_el.php
* typo3/sysext/cms/layout/wizard_backend_layout.php

Clean up provides:

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

Change-Id: I685ede5314f7c603288a4be297a2a946e545addd
Resolves: #38057
Releases: 6.0
Reviewed-on: http://review.typo3.org/12071
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/layout/conf.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/cms/layout/db_new_content_el.php
typo3/sysext/cms/layout/wizard_backend_layout.php

index eae04c8..903b4aa 100755 (executable)
@@ -1,11 +1,11 @@
 <?php
 define('TYPO3_MOD_PATH', 'sysext/cms/layout/');
-$BACK_PATH='../../../';
+$BACK_PATH = '../../../';
 
 $MLANG['default']['tabs_images']['tab'] = 'layout.gif';
-$MLANG['default']['ll_ref']='LLL:EXT:cms/layout/locallang_mod.xml';
+$MLANG['default']['ll_ref'] = 'LLL:EXT:cms/layout/locallang_mod.xml';
 
-$MCONF['script']='db_layout.php';
-$MCONF['access']='user,group';
-$MCONF['name']='web_layout';
+$MCONF['script'] = 'db_layout.php';
+$MCONF['access'] = 'user,group';
+$MCONF['name'] = 'web_layout';
 ?>
\ No newline at end of file
index 1def5a6..53ae2df 100755 (executable)
@@ -24,6 +24,7 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Module: Web>Page
  *
  * 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>
  */
 
-
 unset($MCONF);
 require('conf.php');
 require($BACK_PATH.'init.php');
@@ -45,39 +45,29 @@ require_once(PATH_typo3.'class.db_list.inc');
 require_once('class.tx_cms_layout.php');
 $BE_USER->modAccess($MCONF, 1);
 
-// Will open up records locked by current user. It's assumed that the locking should end if this script is hit.
+       // Will open up records locked by current user. It's assumed that the locking should end if this script is hit.
 t3lib_BEfunc::lockRecords();
 
-// Exits if 'cms' extension is not loaded:
+       // Exits if 'cms' extension is not loaded:
 t3lib_extMgm::isLoaded('cms', 1);
 
-
-
-
-
-
-
-
-
-
-
 /**
  * Local extension of position map class
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class ext_posMap extends t3lib_positionMap {
        var $dontPrintPageInsertIcons = 1;
-       var $l_insertNewRecordHere='newContentElement';
+       var $l_insertNewRecordHere = 'newContentElement';
 
        /**
         * Wrapping the title of the record.
         *
-        * @param       string          The title value.
-        * @param       array           The record row.
-        * @return      string          Wrapped title string.
+        * @param string $str The title value.
+        * @param array $row The record row.
+        * @return string Wrapped title string.
         */
        function wrapRecordTitle($str, $row) {
                $aOnClick = 'jumpToUrl(\''.$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:'.$row['uid'])).'\');return false;';
@@ -87,9 +77,9 @@ class ext_posMap extends t3lib_positionMap {
        /**
         * Wrapping the column header
         *
-        * @param       string          Header value
-        * @param       string          Column info.
-        * @return      string
+        * @param string $str Header value
+        * @param string $vv Column info.
+        * @return string
         * @see printRecordMap()
         */
        function wrapColumnHeader($str, $vv) {
@@ -100,18 +90,18 @@ class ext_posMap extends t3lib_positionMap {
        /**
         * Create on-click event value.
         *
-        * @param array The record.
-        * @param string Column position value.
-        * @param integer Move uid
-        * @param integer PID value.
-        * @param integer System language
+        * @param array $row The record.
+        * @param string $vv Column position value.
+        * @param integer $moveUid Move uid
+        * @param integer $pid PID value.
+        * @param integer $sys_lang System language
         * @return string
         */
        function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
                if (is_array($row)) {
-                       $location=$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:new/-'.$row['uid'].'/'.$row['colPos']));
+                       $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:new/-'.$row['uid'].'/'.$row['colPos']));
                } else {
-                       $location=$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:new/'.$pid.'/'.$vv));
+                       $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:new/'.$pid.'/'.$vv));
                }
                return 'jumpToUrl(\''.$location.'\');return false;';
        }
@@ -119,52 +109,59 @@ class ext_posMap extends t3lib_positionMap {
        /**
         * Wrapping the record header  (from getRecordHeader())
         *
-        * @param       string          HTML content
-        * @param       array           Record array.
-        * @return      string          HTML content
+        * @param string $str HTML content
+        * @param array $row Record array.
+        * @return string HTML content
         */
        function wrapRecordHeader($str, $row) {
-               if ($row['uid']==$this->moveUid) {
+               if ($row['uid'] == $this->moveUid) {
                        return '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/content_client.gif', 'width="7" height="10"').' alt="" />'.$str;
-               } else return $str;
+               } else {
+                       return $str;
+               }
        }
 }
 
-
-
-
-
-
-
-
 /**
  * Script Class for Web > Layout module
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_db_layout {
 
                // Internal, GPvars:
-       var $id;                                        // Page Id for which to make the listing
-       var $pointer;                           // Pointer - for browsing list of records.
-       var $imagemode;                         // Thumbnails or not
-
-       var $search_field;                      // Search-fields
-       var $search_levels;                     // Search-levels
-       var $showLimit;                         // Show-limit
-       var $returnUrl;                         // Return URL
-
-       var $clear_cache;                       // Clear-cache flag - if set, clears page cache for current id.
-       var $popView;                           // PopView id - for opening a window with the page
-       var $edit_record;                       // QuickEdit: Variable, that tells quick edit what to show/edit etc. Format is [tablename]:[uid] with some exceptional values for both parameters (with special meanings).
-       var $new_unique_uid;            // QuickEdit: If set, this variable tells quick edit that the last edited record had this value as UID and we should look up the new, real uid value in sys_log.
+               // Page Id for which to make the listing
+       var $id;
+               // Pointer - for browsing list of records.
+       var $pointer;
+               // Thumbnails or not
+       var $imagemode;
+               // Search-fields
+       var $search_field;
+               // Search-levels
+       var $search_levels;
+               // Show-limit
+       var $showLimit;
+               // Return URL
+       var $returnUrl;
+               // Clear-cache flag - if set, clears page cache for current id.
+       var $clear_cache;
+               // PopView id - for opening a window with the page
+       var $popView;
+               // QuickEdit: Variable, that tells quick edit what to show/edit etc. Format is [tablename]:[uid] with some exceptional values for both parameters (with special meanings).
+       var $edit_record;
+               // QuickEdit: If set, this variable tells quick edit that the last edited record had this value as UID and we should look up the new, real uid value in sys_log.
+       var $new_unique_uid;
 
                // Internal, static:
-       var $perms_clause;                      // Page select perms clause
-       var $modTSconfig;                       // Module TSconfig
-       var $pageinfo;                          // Current ids page record
+               // Page select perms clause
+       var $perms_clause;
+               // Module TSconfig
+       var $modTSconfig;
+               // Current ids page record
+       var $pageinfo;
 
        /**
         * Document template object
@@ -172,33 +169,41 @@ class SC_db_layout {
         * @var mediumDoc
         */
        var $doc;
-       var $backPath;                          // Back path of the module
-
-       var $descrTable;                        // "Pseudo" Description -table name
-       var $colPosList;                        // List of column-integers to edit. Is set from TSconfig, default is "1,0,2,3"
-       var $EDIT_CONTENT;                      // Flag: If content can be edited or not.
-       var $CALC_PERMS;                        // Users permissions integer for this page.
-       var $current_sys_language;      // Currently selected language for editing content elements
-
-       var $MCONF=array();                     // Module configuration
-       var $MOD_MENU=array();          // Menu configuration
-       var $MOD_SETTINGS=array();      // Module settings (session variable)
-       var $include_once=array();      // Array, where files to include is accumulated in the init() function
-       var $externalTables = array();  // Array of tables to be listed by the Web > Page module in addition to the default tables
+               // Back path of the module
+       var $backPath;
+               // "Pseudo" Description -table name
+       var $descrTable;
+               // List of column-integers to edit. Is set from TSconfig, default is "1,0,2,3"
+       var $colPosList;
+               // Flag: If content can be edited or not.
+       var $EDIT_CONTENT;
+               // Users permissions integer for this page.
+       var $CALC_PERMS;
+               // Currently selected language for editing content elements
+       var $current_sys_language;
+               // Module configuration
+       var $MCONF=array();
+               // Menu configuration
+       var $MOD_MENU=array();
+               // Module settings (session variable)
+       var $MOD_SETTINGS=array();
+               // Array, where files to include is accumulated in the init() function
+       var $include_once=array();
+               // Array of tables to be listed by the Web > Page module in addition to the default tables
+       var $externalTables = array();
 
                // Internal, dynamic:
-       var $content;                           // Module output accumulation
-       var $topFuncMenu;                       // Function menu temporary storage
-       var $editIcon;                          // Temporary storage for page edit icon
-
-
-
-
+               // Module output accumulation
+       var $content;
+               // Function menu temporary storage
+       var $topFuncMenu;
+               // Temporary storage for page edit icon
+       var $editIcon;
 
        /**
         * Initializing the module
         *
-        * @return      void
+        * @return void
         */
        function init() {
 
@@ -251,7 +256,7 @@ class SC_db_layout {
        /**
         * Initialize menu array
         *
-        * @return      void
+        * @return void
         */
        function menuConfig() {
                        // MENU-ITEMS:
@@ -270,15 +275,15 @@ class SC_db_layout {
                        )
                );
 
-               // example settings:
-               //      $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
-               //              array ('default' => array(
-               //                              'MENU' => 'LLL:EXT:tx_myext/locallang_db.xml:menuDefault',
-               //                              'fList' =>  'title,description,image',
-               //                              'icon' => TRUE));
+                       // example settings:
+                       //      $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
+                       //              array ('default' => array(
+                       //                              'MENU' => 'LLL:EXT:tx_myext/locallang_db.xml:menuDefault',
+                       //                              'fList' =>  'title,description,image',
+                       //                              'icon' => TRUE));
                if (is_array($this->externalTables)) {
                        foreach ($this->externalTables as $table => $tableSettings) {
-                               // delete the default settings from above
+                                       // delete the default settings from above
                                if (is_array($this->MOD_MENU[$table])) {
                                        unset ($this->MOD_MENU[$table]);
                                }
@@ -292,9 +297,9 @@ class SC_db_layout {
 
                        // First, select all pages_language_overlay records on the current page. Each represents a possibility for a language on the page. Add these to language selector.
                $res = $this->exec_languageQuery($this->id);
-               while($lrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+               while ($lrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        if ($GLOBALS['BE_USER']->checkLanguageAccess($lrow['uid'])) {
-                               $this->MOD_MENU['language'][$lrow['uid']]=($lrow['hidden']?'('.$lrow['title'].')':$lrow['title']);
+                               $this->MOD_MENU['language'][$lrow['uid']] = ($lrow['hidden']?'('.$lrow['title'].')':$lrow['title']);
                        }
                }
 
@@ -340,13 +345,13 @@ class SC_db_layout {
        /**
         * Clears page cache for the current id, $this->id
         *
-        * @return      void
+        * @return void
         */
        function clearCache() {
                if ($this->clear_cache) {
                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                       $tce->stripslashes_values=0;
-                       $tce->start(Array(), Array());
+                       $tce->stripslashes_values = 0;
+                       $tce->start(array(), array());
                        $tce->clear_cacheCmd($this->id);
                }
        }
@@ -355,11 +360,11 @@ class SC_db_layout {
         * Main function.
         * Creates some general objects and calls other functions for the main rendering of module content.
         *
-        * @return      void
+        * @return void
         */
        function main() {
-               // Access check...
-               // The page will show only if there is a valid page and if this page may be viewed by the user
+                       // Access check...
+                       // The page will show only if there is a valid page and if this page may be viewed by the user
                $access = is_array($this->pageinfo) ? 1 : 0;
                if ($this->id && $access) {
 
@@ -482,7 +487,8 @@ class SC_db_layout {
                        $this->languageMenu = (count($this->MOD_MENU['language'])>1 ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.language', 1) . t3lib_BEfunc::getFuncMenu($this->id, 'SET[language]', $this->current_sys_language, $this->MOD_MENU['language'], 'db_layout.php', '') : '');
 
                                // Find columns
-                       $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id, 'mod.SHARED');            // SHARED page-TSconfig settings.
+                               // SHARED page-TSconfig settings.
+                       $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id, 'mod.SHARED');
                        $this->colPosList = strcmp(trim($this->modTSconfig['properties']['tt_content.']['colPos_list']), '') ? trim($this->modTSconfig['properties']['tt_content.']['colPos_list']) : $modTSconfig_SHARED['properties']['colPos_list'];
                        if (!strcmp($this->colPosList, '')) {
                                $backendLayout = t3lib_div::callUserFunction( 'EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->getSelectedBackendLayout', $this->id, $this );
@@ -494,16 +500,19 @@ class SC_db_layout {
                        if (!strcmp($this->colPosList, '')) {
                                $this->colPosList = '1,0,2,3';
                        }
-                       $this->colPosList = implode(',', array_unique(t3lib_div::intExplode(',', $this->colPosList)));          // Removing duplicates, if any
+                               // Removing duplicates, if any
+                       $this->colPosList = implode(',', array_unique(t3lib_div::intExplode(',', $this->colPosList)));
 
                                // Render the primary module content:
-                       if ($this->MOD_SETTINGS['function']==0) {
-                               $body = $this->renderQuickEdit();       // QuickEdit
+                       if ($this->MOD_SETTINGS['function'] == 0) {
+                                       // QuickEdit
+                               $body = $this->renderQuickEdit();
                        } else {
-                               $body = $this->renderListContent();     // All other listings
+                                       // All other listings
+                               $body = $this->renderListContent();
                        }
 
-                       // If page is a folder
+                               // If page is a folder
                        if ($this->pageinfo['doktype'] == 254) {
 
                                        // access to list module
@@ -620,7 +629,7 @@ class SC_db_layout {
        /**
         * Rendering the quick-edit view.
         *
-        * @return      void
+        * @return void
         */
        function renderQuickEdit() {
                        // Alternative template
@@ -638,7 +647,7 @@ class SC_db_layout {
                $edit_record = $this->edit_record;
 
                        // If a command to edit all records in a column is issue, then select all those elements, and redirect to alt_doc.php:
-               if (substr($edit_record, 0, 9)=='_EDIT_COL') {
+               if (substr($edit_record, 0, 9) == '_EDIT_COL') {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                                '*',
                                                'tt_content',
@@ -650,7 +659,7 @@ class SC_db_layout {
                                                'sorting'
                                        );
                        $idListA = array();
-                       while($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                $idListA[] = $cRow['uid'];
                        }
 
@@ -674,19 +683,19 @@ class SC_db_layout {
 
 
                        // Creating the selector box, allowing the user to select which element to edit:
-               $opt=array();
-               $is_selected=0;
-               $languageOverlayRecord='';
+               $opt = array();
+               $is_selected = 0;
+               $languageOverlayRecord = '';
                if ($this->current_sys_language) {
                        list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid='.intval($this->current_sys_language));
                }
                if (is_array($languageOverlayRecord)) {
                        $inValue = 'pages_language_overlay:'.$languageOverlayRecord['uid'];
-                       $is_selected+=intval($edit_record==$inValue);
+                       $is_selected += intval($edit_record==$inValue);
                        $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $GLOBALS['LANG']->getLL('editLanguageHeader', 1) . ' ]</option>';
                } else {
                        $inValue = 'pages:'.$this->id;
-                       $is_selected+=intval($edit_record==$inValue);
+                       $is_selected += intval($edit_record==$inValue);
                        $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $GLOBALS['LANG']->getLL('editPageProperties', 1) . ' ]</option>';
                }
 
@@ -701,9 +710,10 @@ class SC_db_layout {
                                        '',
                                        'colPos,sorting'
                                );
-               $colPos='';
-               $first=1;
-               $prev=$this->id;        // Page is the pid if no record to put this after.
+               $colPos = '';
+               $first = 1;
+                       // Page is the pid if no record to put this after.
+               $prev = $this->id;
                while($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        t3lib_BEfunc::workspaceOL('tt_content', $cRow);
 
@@ -715,21 +725,21 @@ class SC_db_layout {
                                        $first = 0;
                                }
                                if (strcmp($cRow['colPos'], $colPos)) {
-                                       $colPos=$cRow['colPos'];
-                                       $opt[]='<option value=""></option>';
+                                       $colPos = $cRow['colPos'];
+                                       $opt[] = '<option value=""></option>';
                                        $opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $colPos), 1) . ':__</option>';
                                }
                                $inValue = 'tt_content:'.$cRow['uid'];
-                               $is_selected+=intval($edit_record==$inValue);
+                               $is_selected += intval($edit_record == $inValue);
                                $opt[] = '<option value="' . $inValue . '"' .
-                                       ($edit_record == $inValue ?' selected="selected"' : '') .
+                                       ($edit_record == $inValue ? ' selected="selected"' : '') .
                                        '>' . htmlspecialchars(t3lib_div::fixed_lgd_cs(
                                                ($cRow['header']
                                                ? $cRow['header']
                                                : '[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title') . '] ' . strip_tags($cRow['bodytext'])),
                                                $GLOBALS['BE_USER']->uc['titleLen'])
                                        ) . '</option>';
-                               $prev=-$cRow['uid'];
+                               $prev = -$cRow['uid'];
                        }
                }
 
@@ -738,30 +748,27 @@ class SC_db_layout {
                        $edit_record='tt_content:new/'.$prev.'/'.$colPos;
 
                        $inValue = 'tt_content:new/'.$prev.'/'.$colPos;
-                       $is_selected+=intval($edit_record==$inValue);
+                       $is_selected += intval($edit_record == $inValue);
                        $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $GLOBALS['LANG']->getLL('newLabel', 1) . ' ]</option>';
                }
 
                        // If none is yet selected...
                if (!$is_selected) {
-                       $opt[]='<option value=""></option>';
+                       $opt[] = '<option value=""></option>';
                        $opt[] = '<option value="' . $edit_record . '"  selected="selected">[ ' . $GLOBALS['LANG']->getLL('newLabel', 1) . ' ]</option>';
                }
 
-
                        // Splitting the edit-record cmd value into table/uid:
                $this->eRParts = explode(':', $edit_record);
 
-
-
                        // Delete-button flag?
                $this->deleteButton = (t3lib_utility_Math::canBeInterpretedAsInteger($this->eRParts[1]) && $edit_record && (($this->eRParts[0]!='pages' && $this->EDIT_CONTENT) || ($this->eRParts[0]=='pages' && ($this->CALC_PERMS&4))));
 
                        // If undo-button should be rendered (depends on available items in sys_history)
-               $this->undoButton=0;
+               $this->undoButton = 0;
                $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->eRParts[0], 'sys_history').' AND recuid='.intval($this->eRParts[1]), '', 'tstamp DESC', '1');
                if ($this->undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) {
-                       $this->undoButton=1;
+                       $this->undoButton = 1;
                }
 
                        // Setting up the Return URL for coming back to THIS script (if links take the user to another script)
@@ -771,10 +778,11 @@ class SC_db_layout {
                unset($R_URL_getvars['popView']);
                unset($R_URL_getvars['new_unique_uid']);
                $R_URL_getvars['edit_record']=$edit_record;
-               $this->R_URI = $R_URL_parts['path'].'?'.t3lib_div::implodeArrayForUrl('', $R_URL_getvars);
+               $this->R_URI = $R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $R_URL_getvars);
 
                        // Setting close url/return url for exiting this script:
-               $this->closeUrl = $this->local_linkThisScript(array('SET'=>array('function'=>1)));      // Goes to 'Columns' view if close is pressed (default)
+                       // Goes to 'Columns' view if close is pressed (default)
+               $this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1)));
 
                if ($GLOBALS['BE_USER']->uc['condensedMode']) {
                        $this->closeUrl = $GLOBALS['BACK_PATH'] . 'alt_db_navframe.php';
@@ -796,7 +804,7 @@ class SC_db_layout {
                        list($uidVal, $ex_pid, $ex_colPos) = explode('/', $this->eRParts[1]);
 
                                // Convert $uidVal to workspace version if any:
-                       if ($uidVal!='new') {
+                       if ($uidVal != 'new') {
                                if ($draftRecord = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->eRParts[0], $uidVal, 'uid')) {
                                        $uidVal = $draftRecord['uid'];
                                }
@@ -810,13 +818,14 @@ class SC_db_layout {
                                'sys_language_uid' => intval($this->current_sys_language)
                        );
                        $trData->disableRTE = $this->MOD_SETTINGS['disableRTE'];
-                       $trData->lockRecords=1;
-                       $trData->fetchRecord($this->eRParts[0], ($uidVal=='new'?$this->id:$uidVal), $uidVal);   // 'new'
+                       $trData->lockRecords = 1;
+                               // 'new'
+                       $trData->fetchRecord($this->eRParts[0], ($uidVal=='new'?$this->id:$uidVal), $uidVal);
 
                                // Getting/Making the record:
                        reset($trData->regTableItems_data);
                        $rec = current($trData->regTableItems_data);
-                       if ($uidVal=='new') {
+                       if ($uidVal == 'new') {
                                $new_unique_uid = uniqid('NEW');
                                $rec['uid'] = $new_unique_uid;
                                $rec['pid'] = intval($ex_pid)?intval($ex_pid):$this->id;
@@ -832,7 +841,7 @@ class SC_db_layout {
                                        // If no edit access, print error message:
                                $content .= $this->doc->section($GLOBALS['LANG']->getLL('noAccess'), $GLOBALS['LANG']->getLL('noAccess_msg') . '<br /><br />' .
                                                        ($GLOBALS['BE_USER']->errorMsg ? 'Reason: ' . $GLOBALS['BE_USER']->errorMsg . '<br /><br />' : ''), 0, 1);
-                       } elseif (is_array($rec))       {       // If the record is an array (which it will always be... :-)
+                       } elseif (is_array($rec)) {     // If the record is an array (which it will always be... :-)
 
                                        // Create instance of TCEforms, setting defaults:
                                $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
@@ -844,8 +853,10 @@ class SC_db_layout {
                                $tceforms->enableClickMenu = TRUE;
 
                                        // Clipboard is initialized:
-                               $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');                // Start clipboard
-                               $tceforms->clipObj->initializeClipboard();      // Initialize - reads the clipboard content from the user session
+                                       // Start clipboard
+                               $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
+                                       // Initialize - reads the clipboard content from the user session
+                               $tceforms->clipObj->initializeClipboard();
 
 
                                if ($GLOBALS['BE_USER']->uc['edit_showFieldHelp'] !== 'text' && $this->MOD_SETTINGS['showDescriptions']) {
@@ -853,20 +864,21 @@ class SC_db_layout {
                                }
 
                                        // Render form, wrap it:
-                               $panel='';
-                               $panel.=$tceforms->getMainFields($this->eRParts[0], $rec);
-                               $panel=$tceforms->wrapTotal($panel, $rec, $this->eRParts[0]);
+                               $panel = '';
+                               $panel .= $tceforms->getMainFields($this->eRParts[0], $rec);
+                               $panel = $tceforms->wrapTotal($panel, $rec, $this->eRParts[0]);
 
                                        // Add hidden fields:
-                               $theCode=$panel;
-                               if ($uidVal=='new') {
-                                       $theCode.='<input type="hidden" name="data['.$this->eRParts[0].']['.$rec['uid'].'][pid]" value="'.$rec['pid'].'" />';
+                               $theCode = $panel;
+                               if ($uidVal == 'new') {
+                                       $theCode .= '<input type="hidden" name="data['.$this->eRParts[0].']['.$rec['uid'].'][pid]" value="'.$rec['pid'].'" />';
                                }
-                               $theCode.='
-                                       <input type="hidden" name="_serialNumber" value="'.md5(microtime()).'" />
-                                       <input type="hidden" name="_disableRTE" value="'.$tceforms->disableRTE.'" />
-                                       <input type="hidden" name="edit_record" value="'.$edit_record.'" />
-                                       <input type="hidden" name="redirect" value="'.htmlspecialchars($uidVal=='new' ? t3lib_extMgm::extRelPath('cms').'layout/db_layout.php?id='.$this->id.'&new_unique_uid='.$new_unique_uid.'&returnUrl='.rawurlencode($this->returnUrl) : $this->R_URI ).'" />
+                               $theCode .= '
+                                       <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
+                                       <input type="hidden" name="_disableRTE" value="' . $tceforms->disableRTE . '" />
+                                       <input type="hidden" name="edit_record" value="' . $edit_record . '" />
+                                       <input type="hidden" name="redirect" value="' . htmlspecialchars($uidVal == 'new' ? t3lib_extMgm::extRelPath('cms') . 'layout/db_layout.php?id=' .
+                                       $this->id . '&new_unique_uid=' . $new_unique_uid . '&returnUrl=' . rawurlencode($this->returnUrl) : $this->R_URI ) . '" />
                                        ' . t3lib_TCEforms::getHiddenTokenField('tceAction');
 
                                        // Add JavaScript as needed around the form:
@@ -952,7 +964,7 @@ class SC_db_layout {
        /**
         * Rendering all other listings than QuickEdit
         *
-        * @return      void
+        * @return void
         */
        function renderListContent() {
                        // Initialize list object (see "class.db_layout.inc"):
@@ -976,7 +988,9 @@ class SC_db_layout {
                $dblist->option_showBigButtons = ($this->modTSconfig['properties']['disableBigButtons'] === '0');
                $dblist->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
                $dblist->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0;
-               if (!$dblist->nextThree)        $dblist->nextThree = 1;
+               if (!$dblist->nextThree) {
+                       $dblist->nextThree = 1;
+               }
 
                $dblist->externalTables = $this->externalTables;
 
@@ -984,12 +998,13 @@ class SC_db_layout {
                $h_menu = $dblist->getTableMenu($this->id);
 
                        // Initialize other variables:
-               $h_func='';
-               $tableOutput=array();
-               $tableJSOutput=array();
+               $h_func = '';
+               $tableOutput = array();
+               $tableJSOutput = array();
                $CMcounter = 0;
 
-                       // Traverse the list of table names which has records on this page (that array is populated by the $dblist object during the function getTableMenu()):
+                       // Traverse the list of table names which has records on this page (that array is populated
+                       // by the $dblist object during the function getTableMenu()):
                foreach ($dblist->activeTables as $table => $value) {
 
                                // Load full table definitions:
@@ -1006,13 +1021,16 @@ class SC_db_layout {
                                        'id="checkTt_content_showHidden"'
                                ) . '<label for="checkTt_content_showHidden">' .
                                (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('hiddenCE')) : $GLOBALS['LANG']->getLL('hiddenCE') . ' (' . $q_count . ')') . '</label>';
-
-                               $dblist->tt_contentConfig['showCommands'] = 1;  // Boolean: Display up/down arrows and edit icons for tt_content records
-                               $dblist->tt_contentConfig['showInfo'] = 1;              // Boolean: Display info-marks or not
-                               $dblist->tt_contentConfig['single'] = 0;                // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
+                                       // Boolean: Display up/down arrows and edit icons for tt_content records
+                               $dblist->tt_contentConfig['showCommands'] = 1;
+                                       // Boolean: Display info-marks or not
+                               $dblist->tt_contentConfig['showInfo'] = 1;
+                                       // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown
+                                       // in the total width of the page
+                               $dblist->tt_contentConfig['single'] = 0;
 
                                if ($this->MOD_SETTINGS['function'] == 4) {
-                                               // grid view
+                                               // Grid view
                                        $dblist->tt_contentConfig['showAsGrid'] = 1;
                                }
 
@@ -1032,15 +1050,19 @@ class SC_db_layout {
 
                                        // If only one column found, display the single-column view.
                                if (count($colList) === 1 && !$this->MOD_SETTINGS['function'] === 4) {
-                                       $dblist->tt_contentConfig['single'] = 1;        // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
-                                       $dblist->tt_contentConfig['showSingleCol'] = current($colList); // The column(s) to show if single mode (under each other)
+                                               // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol']
+                                               // is shown in the total width of the page
+                                       $dblist->tt_contentConfig['single'] = 1;
+                                               // The column(s) to show if single mode (under each other)
+                                       $dblist->tt_contentConfig['showSingleCol'] = current($colList);
                                }
-                               $dblist->tt_contentConfig['cols'] = implode(',', $colList);             // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
+                                       // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
+                               $dblist->tt_contentConfig['cols'] = implode(',', $colList);
                                $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
                                $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
 
                                        // If the function menu is set to "Language":
-                               if ($this->MOD_SETTINGS['function']==2) {
+                               if ($this->MOD_SETTINGS['function'] == 2) {
                                        $dblist->tt_contentConfig['single'] = 0;
                                        $dblist->tt_contentConfig['languageMode'] = 1;
                                        $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language'];
@@ -1068,9 +1090,9 @@ class SC_db_layout {
 
                                // Adding the list content to the tableOutput variable:
                        $tableOutput[$table]=
-                                                       ($h_func?$h_func.'<br /><img src="clear.gif" width="1" height="4" alt="" /><br />':'').
+                                                       ($h_func ? $h_func . '<br /><img src="clear.gif" width="1" height="4" alt="" /><br />' : '').
                                                        $dblist->HTMLcode.
-                                                       ($h_func_b?'<img src="clear.gif" width="1" height="10" alt="" /><br />'.$h_func_b:'');
+                                                       ($h_func_b ? '<img src="clear.gif" width="1" height="10" alt="" /><br />' . $h_func_b : '');
 
                                // ... and any accumulated JavaScript goes the same way!
                        $tableJSOutput[$table] = $dblist->JScode;
@@ -1079,8 +1101,8 @@ class SC_db_layout {
                        $CMcounter+= $dblist->counter;
 
                                // Reset variables after operation:
-                       $dblist->HTMLcode='';
-                       $dblist->JScode='';
+                       $dblist->HTMLcode = '';
+                       $dblist->JScode = '';
                        $h_func = '';
                        $h_func_b = '';
                }       // END: traverse tables
@@ -1119,8 +1141,8 @@ class SC_db_layout {
                        $dblist->id=$this->id;
                        $sysNotes = $dblist->showSysNotesForPage();
                        if ($sysNotes) {
-                               $content.=$this->doc->spacer(10);
-                               $content.=$this->doc->section($GLOBALS['LANG']->getLL('internalNotes'), $sysNotes, 0, 1);
+                               $content .= $this->doc->spacer(10);
+                               $content .= $this->doc->section($GLOBALS['LANG']->getLL('internalNotes'), $sysNotes, 0, 1);
                        }
 
                                // Add spacer in bottom of page:
@@ -1128,7 +1150,7 @@ class SC_db_layout {
                }
 
                        // Ending page:
-               $content.=$this->doc->spacer(10);
+               $content .= $this->doc->spacer(10);
 
                return $content;
        }
@@ -1136,7 +1158,7 @@ class SC_db_layout {
        /**
         * Print accumulated content of module
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
@@ -1151,8 +1173,8 @@ class SC_db_layout {
        /**
         * Create the panel of buttons for submitting the form or otherwise perform operations.
         *
-        * @param       string  Identifier for function of module
-        * @return      array   all available buttons as an assoc. array
+        * @param string $function Identifier for function of module
+        * @return array all available buttons as an assoc. array
         */
        protected function getButtons($function = '') {
                $buttons = array(
@@ -1271,9 +1293,10 @@ class SC_db_layout {
         ******************************/
 
        /**
-        * Returns the number of hidden elements (including those hidden by start/end times) on the current page (for the current sys_language)
+        * Returns the number of hidden elements (including those hidden by start/end times)
+        * on the current page (for the current sys_language)
         *
-        * @return      void
+        * @return void
         */
        function getNumberOfHiddenElements() {
                return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
@@ -1291,20 +1314,20 @@ class SC_db_layout {
         * Returns URL to the current script.
         * In particular the "popView" and "new_unique_uid" Get vars are unset.
         *
-        * @param       array           Parameters array, merged with global GET vars.
-        * @return      string          URL
+        * @param array $params Parameters array, merged with global GET vars.
+        * @return string URL
         */
        function local_linkThisScript($params) {
-               $params['popView']='';
-               $params['new_unique_uid']='';
+               $params['popView'] = '';
+               $params['new_unique_uid'] = '';
                return t3lib_div::linkThisScript($params);
        }
 
        /**
         * Returns a SQL query for selecting sys_language records.
         *
-        * @param       integer         Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user)
-        * @return      string          Return query string.
+        * @param integer $id Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user)
+        * @return string Return query string.
         */
        function exec_languageQuery($id) {
                if ($id) {
@@ -1328,12 +1351,14 @@ class SC_db_layout {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_db_layout');
 $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->clearCache();
 $SOBE->main();
index 2fc9392..b9eee24 100644 (file)
@@ -24,6 +24,7 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * New content elements wizard
  * (Part of the 'cms' extension)
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compatible.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
 unset($MCONF);
 require('conf.php');
 require($BACK_PATH.'init.php');
@@ -53,16 +53,10 @@ $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG_orig, $LOCAL
        // Exits if 'cms' extension is not loaded:
 t3lib_extMgm::isLoaded('cms', 1);
 
-
-
-
-
-
-
 /**
  * Local position map class
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -72,9 +66,9 @@ class ext_posMap extends t3lib_positionMap {
        /**
         * Wrapping the title of the record - here we just return it.
         *
-        * @param       string          The title value.
-        * @param       array           The record row.
-        * @return      string          Wrapped title string.
+        * @param string $str The title value.
+        * @param array $row The record row.
+        * @return string Wrapped title string.
         */
        function wrapRecordTitle($str, $row) {
                return $str;
@@ -83,52 +77,45 @@ class ext_posMap extends t3lib_positionMap {
        /**
         * Create on-click event value.
         *
-        * @param       array           The record.
-        * @param       string          Column position value.
-        * @param       integer         Move uid
-        * @param       integer         PID value.
-        * @param       integer         System language
-        * @return      string
+        * @param array $row The record.
+        * @param string $vv Column position value.
+        * @param integer $moveUid Move uid
+        * @param integer $pid PID value.
+        * @param integer $sys_lang System language
+        * @return string
         */
-       function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang=0) {
-               $table='tt_content';
+       function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
+               $table = 'tt_content';
 
-               $location=$this->backPath.'alt_doc.php?edit[tt_content]['.(is_array($row)?-$row['uid']:$pid).']=new&defVals[tt_content][colPos]='.$vv.'&defVals[tt_content][sys_language_uid]='.$sys_lang.'&returnUrl='.rawurlencode($GLOBALS['SOBE']->R_URI);
+               $location = $this->backPath.'alt_doc.php?edit[tt_content]['.(is_array($row)?-$row['uid']:$pid).']=new&defVals[tt_content][colPos]='.$vv.'&defVals[tt_content][sys_language_uid]='.$sys_lang.'&returnUrl='.rawurlencode($GLOBALS['SOBE']->R_URI);
 
                return 'window.location.href=\''.$location.'\'+document.editForm.defValues.value; return false;';
        }
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
 /**
  * Script Class for the New Content element wizard
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_db_new_content_el {
 
                // Internal, static (from GPvars):
-       var $id;                                        // Page id
-       var $sys_language=0;            // Sys language
-       var $R_URI='';                          // Return URL.
-       var $colPos;                            // If set, the content is destined for a specific column.
-       var $uid_pid;                           //
+               // Page id
+       var $id;
+               // Sys language
+       var $sys_language = 0;
+               // Return URL.
+       var $R_URI = '';
+               // If set, the content is destined for a specific column.
+       var $colPos;
+       var $uid_pid;
 
                // Internal, static:
-       var $modTSconfig=array();       // Module TSconfig.
+               // Module TSconfig.
+       var $modTSconfig = array();
 
        /**
         * Internal backend template object
@@ -138,16 +125,19 @@ class SC_db_new_content_el {
        var $doc;
 
                // Internal, dynamic:
-       var $include_once = array();    // Includes a list of files to include between init() and main() - see init()
-       var $content;                                   // Used to accumulate the content of the module.
-       var $access;                                    // Access boolean.
-       var $config;                                    // config of the wizard
-
+               // Includes a list of files to include between init() and main() - see init()
+       var $include_once = array();
+               // Used to accumulate the content of the module.
+       var $content;
+               // Access boolean.
+       var $access;
+               // config of the wizard
+       var $config;
 
        /**
         * Constructor, initializing internal variables.
         *
-        * @return      void
+        * @return void
         */
        function init() {
                        // Setting class files to include:
@@ -172,8 +162,8 @@ class SC_db_new_content_el {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('templates/db_new_content_el.html');
-               $this->doc->JScode='';
-               $this->doc->form='<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
+               $this->doc->JScode = '';
+               $this->doc->form = '<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
 
                        // Setting up the context sensitive menu:
                $this->doc->getContextMenuCode();
@@ -187,7 +177,7 @@ class SC_db_new_content_el {
        /**
         * Creating the module output.
         *
-        * @return      void
+        * @return void
         */
        function main() {
                if ($this->id && $this->access) {
@@ -197,12 +187,13 @@ class SC_db_new_content_el {
                        $posMap->cur_sys_language = $this->sys_language;
                        $posMap->backPath = $GLOBALS['BACK_PATH'];
 
-                       if ((string)$this->colPos!='')  {       // If a column is pre-set:
-                               if ($this->uid_pid<0) {
-                                       $row=array();
-                                       $row['uid']=abs($this->uid_pid);
+                               // If a column is pre-set:
+                       if ((string)$this->colPos != '') {
+                               if ($this->uid_pid < 0) {
+                                       $row = array();
+                                       $row['uid'] = abs($this->uid_pid);
                                } else {
-                                       $row='';
+                                       $row = '';
                                }
                                $this->onClickEvent = $posMap->onClickInsertRecord($row, $this->colPos, '', $this->uid_pid, $this->sys_language);
                        } else {
@@ -210,16 +201,16 @@ class SC_db_new_content_el {
                        }
 
 
-                       // ***************************
-                       // Creating content
-                       // ***************************
+                               // ***************************
+                               // Creating content
+                               // ***************************
                                // use a wrapper div
                        $this->content .= '<div id="user-setup-wrapper">';
-                       $this->content.=$this->doc->header($GLOBALS['LANG']->getLL('newContentElement'));
-                       $this->content.=$this->doc->spacer(5);
+                       $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('newContentElement'));
+                       $this->content .= $this->doc->spacer(5);
 
                                // Wizard
-                       $code='';
+                       $code = '';
                        $wizardItems = $this->getWizardItems();
 
                                // Wrapper for wizards
@@ -227,7 +218,7 @@ class SC_db_new_content_el {
                        $this->elementWrapper['section'] = array('<table border="0" cellpadding="1" cellspacing="2">', '</table>');
                        $this->elementWrapper['wizard'] = array('<tr>', '</tr>');
                        $this->elementWrapper['wizardPart'] = array('<td>', '</td>');
-                               // copy wrapper for tabs
+                               // Copy wrapper for tabs
                        $this->elementWrapperForTabs = $this->elementWrapper;
 
 
@@ -245,11 +236,11 @@ class SC_db_new_content_el {
                        }
 
                        if ($this->config['renderMode'] == 'tabs' && $this->elementWrapperForTabs != $this->elementWrapper) {
-                                       // restore wrapper for tabs if they are overwritten in hook
+                                       // Restore wrapper for tabs if they are overwritten in hook
                                $this->elementWrapper = $this->elementWrapperForTabs;
                        }
 
-                               // add document inline javascript
+                               // Add document inline javascript
                        $this->doc->JScode = $this->doc->wrapScriptTags('
                                function goToalt_doc() {        //
                                        ' . $this->onClickEvent . '
@@ -302,13 +293,11 @@ class SC_db_new_content_el {
                                        $cc++;
                                }
                        }
-                               // add closing section-tag
+                               // Add closing section-tag
                        foreach ($menuItems as $key => $val) {
                                $menuItems[$key]['content'] .=  $this->elementWrapper['section'][1];
                        }
 
-
-
                                // Add the wizard table to the content, wrapped in tabs:
                        if ($this->config['renderMode'] == 'tabs') {
                                $this->doc->inDocStylesArray[] = '
@@ -326,14 +315,12 @@ class SC_db_new_content_el {
 
                        $this->content.= $this->doc->section(!$this->onClickEvent ? $GLOBALS['LANG']->getLL('1_selectType') : '', $code, 0, 1);
 
-
-
                                // If the user must also select a column:
                        if (!$this->onClickEvent) {
 
                                        // Add anchor "sel2"
-                               $this->content.= $this->doc->section('', '<a name="sel2"></a>');
-                               $this->content.= $this->doc->spacer(20);
+                               $this->content .= $this->doc->section('', '<a name="sel2"></a>');
+                               $this->content .= $this->doc->spacer(20);
 
                                        // Select position
                                $code = $GLOBALS['LANG']->getLL('sel2', 1) . '<br /><br />';
@@ -344,7 +331,7 @@ class SC_db_new_content_el {
                                $colPosList = implode(',', array_unique(t3lib_div::intExplode(',', $colPosList)));              // Removing duplicates, if any
 
                                        // Finally, add the content of the column selector to the content:
-                               $code.= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI);
+                               $code .= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI);
                                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('2_selectPosition'), $code, 0, 1);
                        }
 
@@ -352,8 +339,8 @@ class SC_db_new_content_el {
                        $this->content .= '</div>';
                } else {                // In case of no access:
                        $this->content = '';
-                       $this->content.= $this->doc->header($GLOBALS['LANG']->getLL('newContentElement'));
-                       $this->content.= $this->doc->spacer(5);
+                       $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('newContentElement'));
+                       $this->content .= $this->doc->spacer(5);
                }
 
                        // Setting up the buttons and markers for docheader
@@ -363,16 +350,16 @@ class SC_db_new_content_el {
 
                        // Build the <body> for the module
                $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('newContentElement'));
-               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
                $this->content .= $this->doc->sectionEnd();
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
         * Print out the accumulated content:
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
@@ -381,7 +368,7 @@ class SC_db_new_content_el {
        /**
         * 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(
@@ -406,25 +393,16 @@ class SC_db_new_content_el {
                return $buttons;
        }
 
-
-
-
-
-
-
-
-
        /***************************
         *
         * OTHER FUNCTIONS:
         *
         ***************************/
 
-
        /**
         * Returns the content of wizardArray() function...
         *
-        * @return      array           Returns the content of wizardArray() function...
+        * @return array Returns the content of wizardArray() function...
         */
        function getWizardItems() {
                return $this->wizardArray();
@@ -434,7 +412,7 @@ class SC_db_new_content_el {
         * Returns the array of elements in the wizard display.
         * For the plugin section there is support for adding elements there from a global variable.
         *
-        * @return      array
+        * @return array
         */
        function wizardArray() {
 
@@ -465,8 +443,8 @@ class SC_db_new_content_el {
                                                        $tmpItem = $this->wizard_getItem($groupKey, $itemKey, $itemConf);
                                                        if ($tmpItem) {
                                                                $groupItems[$groupKey . '_' . $itemKey] = $tmpItem;
-                       }
-               }
+                                                       }
+                                               }
                                        }
                                }
                                if (count($groupItems)) {
@@ -482,6 +460,11 @@ class SC_db_new_content_el {
                return $wizardItems;
        }
 
+       /**
+        *
+        * @param mixed $wizardElements
+        * @return array
+        */
        function wizard_appendWizards($wizardElements) {
                if (!is_array($wizardElements)) {
                        $wizardElements = array();
@@ -502,7 +485,13 @@ class SC_db_new_content_el {
                return $returnElements;
        }
 
-
+       /**
+        *
+        * @param string Not used
+        * @param string Not used
+        * @param array $itemConf
+        * @return array
+        */
        function wizard_getItem($groupKey, $itemKey, $itemConf) {
                $itemConf['title'] = $GLOBALS['LANG']->sL($itemConf['title']);
                $itemConf['description'] = $GLOBALS['LANG']->sL($itemConf['description']);
@@ -511,19 +500,24 @@ class SC_db_new_content_el {
                return $itemConf;
        }
 
+       /**
+        *
+        * @param string Not used
+        * @param array $wizardGroup
+        * @return array
+        */
        function wizard_getGroupHeader($groupKey, $wizardGroup) {
                return array(
                        'header' => $GLOBALS['LANG']->sL($wizardGroup['header'])
                );
        }
 
-
        /**
         * Checks the array for elements which might contain unallowed default values and will unset them!
         * Looks for the "tt_content_defValues" key in each element and if found it will traverse that array as fieldname / value pairs and check. The values will be added to the "params" key of the array (which should probably be unset or empty by default).
         *
-        * @param       array           Wizard items, passed by reference
-        * @return      void
+        * @param array $wizardItems Wizard items, passed by reference
+        * @return void
         */
        function removeInvalidElements(&$wizardItems) {
 
@@ -538,7 +532,7 @@ class SC_db_new_content_el {
 
                $headersUsed = Array();
                        // Traverse wizard items:
-               foreach($wizardItems as $key => $cfg) {
+               foreach ($wizardItems as $key => $cfg) {
 
                                // Exploding parameter string, if any (old style)
                        if ($wizardItems[$key]['params']) {
@@ -556,7 +550,7 @@ class SC_db_new_content_el {
                        if (is_array($wizardItems[$key]['tt_content_defValues'])) {
 
                                        // Traverse field values:
-                               foreach($wizardItems[$key]['tt_content_defValues'] as $fN => $fV) {
+                               foreach ($wizardItems[$key]['tt_content_defValues'] as $fN => $fV) {
                                        if (is_array($GLOBALS['TCA']['tt_content']['columns'][$fN])) {
                                                        // Get information about if the field value is OK:
                                                $config = &$GLOBALS['TCA']['tt_content']['columns'][$fN]['config'];
@@ -587,12 +581,14 @@ class SC_db_new_content_el {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_db_new_content_el');
 $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 658b042..7981596 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Grid wizard
  */
-
 require_once('conf.php');
 require($BACK_PATH . 'init.php');
 require($BACK_PATH . 'template.php');
@@ -36,33 +36,33 @@ $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
 /**
  * Script Class for grid wizard
  *
- * @author     T3UXW09 Team1 <modernbe@cybercraft.de>
+ * @author T3UXW09 Team1 <modernbe@cybercraft.de>
  * @package TYPO3
  * @subpackage core
  */
 class SC_wizard_backend_layout {
 
-       // GET vars:
-       var $P; // Wizard parameters, coming from TCEforms linking to the wizard.
+               // GET vars:
+               // Wizard parameters, coming from TCEforms linking to the wizard.
+       var $P;
 
        /**
-        * document template object
+        * Document template object
         *
         * @var smallDoc
         */
        var $doc;
-       var $content; // Accumulated content.
-
+               // Accumulated content.
+       var $content;
 
        /**
         * Initialises the Class
         *
-        * @return      void
+        * @return void
         */
        function init() {
 
-
-               // Setting GET vars (used in frameset script):
+                       // Setting GET vars (used in frameset script):
                $this->P = t3lib_div::_GP('P', 1);
 
                $this->formName = $this->P['formName'];
@@ -70,7 +70,7 @@ class SC_wizard_backend_layout {
                $this->md5ID = $this->P['md5ID'];
                $uid = intval($this->P['uid']);
 
-               // Initialize document object:
+                       // Initialize document object:
                $this->doc = t3lib_div::makeInstance('noDoc');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
 
@@ -103,7 +103,7 @@ class SC_wizard_backend_layout {
                );
                $pageRenderer->addInlineLanguageLabelArray($languageLabels);
 
-               // select record
+                       // Select record
                $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($this->P['field'], $this->P['table'], 'uid=' . intval($this->P['uid']));
                if (trim($record[0][$this->P['field']]) == '') {
                        $t3GridData = "[[{colspan:1,rowspan:1,spanned:false,name:''}]]";
@@ -111,7 +111,7 @@ class SC_wizard_backend_layout {
                        $rowCount = 1;
                } else {
 
-                       // load TS parser
+                               // load TS parser
                        $parser = t3lib_div::makeInstance('t3lib_TSparser');
                        $parser->parse($record[0][$this->P['field']]);
                        $data = $parser->setup['backend_layout.'];
@@ -185,8 +185,6 @@ class SC_wizard_backend_layout {
                        }
 
                        $t3GridData .= implode(',', $rows) . ']';
-
-
                }
 
                $pageRenderer->enableExtJSQuickTips();
@@ -201,14 +199,13 @@ class SC_wizard_backend_layout {
                        t3Grid.drawTable();
                        ');
 
-
                $this->doc->styleSheetFile_post = TYPO3_MOD_PATH . 'res/grideditor.css';
        }
 
        /**
         * Main Method, rendering either colorpicker or frameset depending on ->showPicker
         *
-        * @return      void
+        * @return void
         */
        function main() {
 
@@ -262,7 +259,7 @@ class SC_wizard_backend_layout {
        /**
         * Returnes the sourcecode to the browser
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->doc->render(
@@ -272,7 +269,7 @@ class SC_wizard_backend_layout {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_backend_layout');
 $SOBE->init();
 $SOBE->main();