[TASK] Remove global declarations inside methods
authorXavier Perseguers <typo3@perseguers.ch>
Wed, 13 Apr 2011 20:21:07 +0000 (22:21 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 17 Jun 2011 06:59:05 +0000 (08:59 +0200)
Global declaration such as global $TCA or global $BE_USER should
be changed to $GLOBALS['TCA'], $GLOBALS['BE_USER'], ...

Relates: #25334

Change-Id: I5ee61b0704cf95513d0419a5e58532a72f8e63de

typo3/sysext/version/class.tx_version_cm1.php
typo3/sysext/version/class.tx_version_tcemain.php
typo3/sysext/version/cm1/index.php
typo3/sysext/version/ws/class.wslib.php
typo3/sysext/version/ws/class.wslib_gui.php
typo3/sysext/version/ws/index.php
typo3/sysext/version/ws/workspaceforms.php

index 881b570..4d33391 100755 (executable)
@@ -63,13 +63,11 @@ class tx_version_cm1 {
         * @return      array           Modified menuItems array
         */
        function main(&$backRef,$menuItems,$table,$uid) {
-               global $BE_USER,$TCA,$LANG;
-
                $localItems = Array();
-               if (!$backRef->cmLevel && $uid>0 && $BE_USER->check('modules','web_txversionM1'))       {
+               if (!$backRef->cmLevel && $uid > 0 && $GLOBALS['BE_USER']->check('modules', 'web_txversionM1')) {
 
                                // Returns directly, because the clicked item was not from the pages table
-                       if (in_array('versioning', $backRef->disabledItems) || !$TCA[$table] || !$TCA[$table]['ctrl']['versioningWS']) {
+                       if (in_array('versioning', $backRef->disabledItems) || !$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
                                return $menuItems;
                        }
 
@@ -121,9 +119,7 @@ class tx_version_cm1 {
         * @return      array           Local lang array
         */
        function includeLL()    {
-               global $LANG;
-
-               return $LANG->includeLLFile('EXT:version/locallang.xml',FALSE);
+               return $GLOBALS['LANG']->includeLLFile('EXT:version/locallang.xml',FALSE);
        }
 }
 
index 65430e9..8dcdf72 100644 (file)
@@ -260,7 +260,6 @@ class tx_version_tcemain {
         * @param       $table  the table
         */
        public function moveRecord($table, $uid, $destPid, array $propArr, array $moveRec, $resolvedPid, &$recordWasMoved, t3lib_TCEmain $tcemainObj) {
-               global $TCA;
 
                        // Only do something in Draft workspace
                if ($tcemainObj->BE_USER->workspace !== 0) {
@@ -270,7 +269,7 @@ class tx_version_tcemain {
                        $WSversion = t3lib_BEfunc::getWorkspaceVersionOfRecord($tcemainObj->BE_USER->workspace, $table, $uid, 'uid,t3ver_oid');
 
                                // If no version exists and versioningWS is in version 2, a new placeholder is made automatically:
-                       if (!$WSversion['uid'] && (int)$TCA[$table]['ctrl']['versioningWS']>=2 && (int)$moveRec['t3ver_state']!=3)      {
+                       if (!$WSversion['uid'] && (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2 && (int)$moveRec['t3ver_state'] != 3) {
                                $tcemainObj->versionizeRecord($table, $uid, 'Placeholder version for moving record');
                                $WSversion = t3lib_BEfunc::getWorkspaceVersionOfRecord($tcemainObj->BE_USER->workspace, $table, $uid, 'uid,t3ver_oid'); // Will not create new versions in live workspace though...
                        }
@@ -281,7 +280,7 @@ class tx_version_tcemain {
                        $recIsNewVersion = (int)$moveRec['t3ver_state']>0;
 
                        $destRes = $tcemainObj->BE_USER->workspaceAllowLiveRecordsInPID($resolvedPid, $table);
-                       $canMoveRecord = $recIsNewVersion || (int)$TCA[$table]['ctrl']['versioningWS'] >= 2;
+                       $canMoveRecord = $recIsNewVersion || (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2;
 
                                // Workspace source check:
                        if (!$recIsNewVersion) {
@@ -308,7 +307,7 @@ class tx_version_tcemain {
                        if (!count($workspaceAccessBlocked)) {
                                        // If the move operation is done on a versioned record, which is
                                        // NOT new/deleted placeholder and versioningWS is in version 2, then...
-                               if ($WSversion['uid'] && !$recIsNewVersion && (int)$TCA[$table]['ctrl']['versioningWS'] >= 2) {
+                               if ($WSversion['uid'] && !$recIsNewVersion && (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2) {
                                        $this->moveRecord_wsPlaceholders($table, $uid, $destPid, $WSversion['uid'], $tcemainObj);
                                } else {
                                        // moving not needed, just behave like in live workspace
@@ -676,8 +675,6 @@ class tx_version_tcemain {
         * @see copyPages()
         */
        protected function versionizePages($uid, $label, $versionizeTree, t3lib_TCEmain $tcemainObj) {
-               global $TCA;
-
                $uid = intval($uid);
                        // returns the branch
                $brExist = $tcemainObj->doesBranchExist('', $uid, $tcemainObj->pMap['show'], 1);
@@ -687,9 +684,9 @@ class tx_version_tcemain {
 
                                // Make list of tables that should come along with a new version of the page:
                        $verTablesArray = array();
-                       $allTables = array_keys($TCA);
+                       $allTables = array_keys($GLOBALS['TCA']);
                        foreach ($allTables as $tableName) {
-                               if ($tableName != 'pages' && ($versionizeTree > 0 || $TCA[$tableName]['ctrl']['versioning_followPages'])) {
+                               if ($tableName != 'pages' && ($versionizeTree > 0 || $GLOBALS['TCA'][$tableName]['ctrl']['versioning_followPages'])) {
                                        $verTablesArray[] = $tableName;
                                }
                        }
@@ -741,7 +738,6 @@ class tx_version_tcemain {
         * @return void
         */
        protected function version_swap($table, $id, $swapWith, $swapIntoWS=0, t3lib_TCEmain $tcemainObj) {
-               global $TCA;
 
                        // First, check if we may actually edit the online record
                if ($tcemainObj->checkRecordUpdateAccess($table, $id)) {
@@ -777,13 +773,13 @@ class tx_version_tcemain {
 
                                                                                        // Find fields to keep
                                                                                $keepFields = $tcemainObj->getUniqueFields($table);
-                                                                               if ($TCA[$table]['ctrl']['sortby']) {
-                                                                                       $keepFields[] = $TCA[$table]['ctrl']['sortby'];
+                                                                               if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
+                                                                                       $keepFields[] = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
                                                                                }
                                                                                        // l10n-fields must be kept otherwise the localization
                                                                                        // will be lost during the publishing
-                                                                               if (!isset($TCA[$table]['ctrl']['transOrigPointerTable']) && $TCA[$table]['ctrl']['transOrigPointerField']) {
-                                                                                       $keepFields[] = $TCA[$table]['ctrl']['transOrigPointerField'];
+                                                                               if (!isset($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable']) && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) {
+                                                                                       $keepFields[] = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'];
                                                                                }
 
                                                                                        // Swap "keepfields"
@@ -825,8 +821,9 @@ class tx_version_tcemain {
                                                                                }
 
                                                                                        // Moving element.
-                                                                               if ((int)$TCA[$table]['ctrl']['versioningWS']>=2)       {               //  && $t3ver_state['swapVersion']==4   // Maybe we don't need this?
-                                                                                       if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $id, 't3ver_state,pid,uid' . ($TCA[$table]['ctrl']['sortby'] ? ',' . $TCA[$table]['ctrl']['sortby'] : ''))) {
+                                                                               if ((int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2)  {
+                                                                                       //  && $t3ver_state['swapVersion']==4   // Maybe we don't need this?
+                                                                                       if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $id, 't3ver_state,pid,uid' . ($GLOBALS['TCA'][$table]['ctrl']['sortby'] ? ',' . $GLOBALS['TCA'][$table]['ctrl']['sortby'] : ''))) {
                                                                                                $movePlhID = $plhRec['uid'];
                                                                                                $movePlh['pid'] = $swapVersion['pid'];
                                                                                                $swapVersion['pid'] = intval($plhRec['pid']);
@@ -834,10 +831,10 @@ class tx_version_tcemain {
                                                                                                $curVersion['t3ver_state'] = intval($swapVersion['t3ver_state']);
                                                                                                $swapVersion['t3ver_state'] = 0;
 
-                                                                                               if ($TCA[$table]['ctrl']['sortby']) {
+                                                                                               if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
                                                                                                                // sortby is a "keepFields" which is why this will work...
-                                                                                                       $movePlh[$TCA[$table]['ctrl']['sortby']] = $swapVersion[$TCA[$table]['ctrl']['sortby']];
-                                                                                                       $swapVersion[$TCA[$table]['ctrl']['sortby']] = $plhRec[$TCA[$table]['ctrl']['sortby']];
+                                                                                                       $movePlh[$GLOBALS['TCA'][$table]['ctrl']['sortby']] = $swapVersion[$GLOBALS['TCA'][$table]['ctrl']['sortby']];
+                                                                                                       $swapVersion[$GLOBALS['TCA'][$table]['ctrl']['sortby']] = $plhRec[$GLOBALS['TCA'][$table]['ctrl']['sortby']];
                                                                                                }
                                                                                        }
                                                                                }
@@ -947,10 +944,10 @@ class tx_version_tcemain {
                                                                                        if ($table=='pages' && $swapVersion['t3ver_swapmode'] >= 0) {
 
                                                                                                        // Collect table names that should be copied along with the tables:
-                                                                                               foreach ($TCA as $tN => $tCfg)  {
+                                                                                               foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
                                                                                                                // For "Branch" publishing swap ALL,
                                                                                                                // otherwise for "page" publishing, swap only "versioning_followPages" tables
-                                                                                                       if ($swapVersion['t3ver_swapmode'] > 0 || $TCA[$tN]['ctrl']['versioning_followPages']) {
+                                                                                                       if ($swapVersion['t3ver_swapmode'] > 0 || $GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages']) {
                                                                                                                $temporaryPid = -($id+1000000);
 
                                                                                                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($tN, 'pid=' . intval($id), array('pid' => $temporaryPid));
@@ -1084,8 +1081,6 @@ class tx_version_tcemain {
         * @return      void
         */
        protected function version_clearWSID($table, $id, $flush = FALSE, t3lib_TCEmain $tcemainObj) {
-               global $TCA;
-
                if ($errorCode = $tcemainObj->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
                        $tcemainObj->newlog('Attempt to reset workspace for record failed: ' . $errorCode, 1);
                } elseif ($tcemainObj->checkRecordUpdateAccess($table, $id)) {
@@ -1112,7 +1107,7 @@ class tx_version_tcemain {
                                }
 
                                        // Remove the move-placeholder if found for live record.
-                               if ((int)$TCA[$table]['ctrl']['versioningWS'] >= 2) {
+                               if ((int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2) {
                                        if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $liveRec['uid'], 'uid')) {
                                                $tcemainObj->deleteEl($table, $plhRec['uid'], TRUE, TRUE);
                                        }
@@ -1139,12 +1134,10 @@ class tx_version_tcemain {
         * @see versionizePages()
         */
        protected function rawCopyPageContent($oldPageId, $newPageId, array $copyTablesArray, t3lib_TCEmain $tcemainObj) {
-               global $TCA;
-
                if ($newPageId) {
                        foreach ($copyTablesArray as $table) {
                                                // all records under the page is copied.
-                               if ($table && is_array($TCA[$table]) && $table != 'pages') {
+                               if ($table && is_array($GLOBALS['TCA'][$table]) && $table !== 'pages') {
                                        $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                                'uid',
                                                $table,
@@ -1173,8 +1166,6 @@ class tx_version_tcemain {
         * @return array Element data. Key is table name, values are array with first element as online UID, second - offline UID
         */
        public function findPageElementsForVersionSwap($table, $id, $offlineId) {
-               global  $TCA;
-
                $rec = t3lib_BEfunc::getRecord($table, $offlineId, 't3ver_wsid');
                $workspaceId = $rec['t3ver_wsid'];
 
@@ -1193,8 +1184,8 @@ class tx_version_tcemain {
                        }
 
                        // Traversing all tables supporting versioning:
-                       foreach ($TCA as $table => $cfg) {
-                               if ($TCA[$table]['ctrl']['versioningWS'] && $table != 'pages') {
+                       foreach ($GLOBALS['TCA'] as $table => $cfg) {
+                               if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $table !== 'pages') {
                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('A.uid AS offlineUid, B.uid AS uid',
                                                        $table . ' A,' . $table . ' B',
                                                        'A.pid=-1 AND B.pid=' . $pageId . ' AND A.t3ver_wsid=' . $workspaceId .
@@ -1222,12 +1213,10 @@ class tx_version_tcemain {
         * @return void
         */
        public function findPageElementsForVersionStageChange(array $pageIdList, $workspaceId, array &$elementList) {
-               global $TCA;
-
                if ($workspaceId != 0) {
                                // Traversing all tables supporting versioning:
-                       foreach ($TCA as $table => $cfg)        {
-                               if ($TCA[$table]['ctrl']['versioningWS'] && $table != 'pages')  {
+                       foreach ($GLOBALS['TCA'] as $table => $cfg) {
+                               if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $table !== 'pages') {
                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT A.uid',
                                                $table . ' A,' . $table . ' B',
                                                'A.pid=-1' .            // Offline version
@@ -1321,8 +1310,6 @@ class tx_version_tcemain {
         * @see moveRecord()
         */
        protected function moveRecord_wsPlaceholders($table, $uid, $destPid, $wsUid, t3lib_TCEmain $tcemainObj) {
-               global $TCA;
-
                if ($plh = t3lib_BEfunc::getMovePlaceholder($table, $uid, 'uid')) {
                                // If already a placeholder exists, move it:
                        $tcemainObj->moveRecord_raw($table, $plh['uid'], $destPid);
@@ -1330,14 +1317,14 @@ class tx_version_tcemain {
                                // First, we create a placeholder record in the Live workspace that
                                // represents the position to where the record is eventually moved to.
                        $newVersion_placeholderFieldArray = array();
-                       if ($TCA[$table]['ctrl']['crdate']) {
-                               $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']] = $GLOBALS['EXEC_TIME'];
+                       if ($GLOBALS['TCA'][$table]['ctrl']['crdate']) {
+                               $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['crdate']] = $GLOBALS['EXEC_TIME'];
                        }
-                       if ($TCA[$table]['ctrl']['cruser_id']) {
-                               $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['cruser_id']] = $tcemainObj->userid;
+                       if ($GLOBALS['TCA'][$table]['ctrl']['cruser_id']) {
+                               $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']] = $tcemainObj->userid;
                        }
-                       if ($TCA[$table]['ctrl']['tstamp']) {
-                               $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
+                       if ($GLOBALS['TCA'][$table]['ctrl']['tstamp']) {
+                               $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
                        }
 
                        if ($table == 'pages') {
@@ -1359,7 +1346,7 @@ class tx_version_tcemain {
 
                                // Setting workspace - only so display of place holders can filter out those from other workspaces.
                        $newVersion_placeholderFieldArray['t3ver_wsid'] = $tcemainObj->BE_USER->workspace;
-                       $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['label']] = '[MOVE-TO PLACEHOLDER for #' . $uid . ', WS#' . $tcemainObj->BE_USER->workspace . ']';
+                       $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['label']] = '[MOVE-TO PLACEHOLDER for #' . $uid . ', WS#' . $tcemainObj->BE_USER->workspace . ']';
 
                                // moving localized records requires to keep localization-settings for the placeholder too
                        if (array_key_exists('languageField', $GLOBALS['TCA'][$table]['ctrl']) && array_key_exists('transOrigPointerField', $GLOBALS['TCA'][$table]['ctrl'])) {
@@ -1433,4 +1420,4 @@ class tx_version_tcemain {
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain.php'])) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain.php']);
 }
-?>
\ No newline at end of file
+?>
index bfcf81f..b84f369 100755 (executable)
@@ -81,7 +81,7 @@ unset($MCONF);
 require ('conf.php');
 require ($BACK_PATH.'init.php');
 require ($BACK_PATH.'template.php');
-$LANG->includeLLFile('EXT:version/locallang.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:version/locallang.xml');
        // DEFAULT initialization of a module [END]
 
 require_once('../ws/class.wslib.php');
@@ -187,8 +187,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      void
         */
        function main() {
-               global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-
                        // Template markers
                $markers = array(
                        'CSH' => '',
@@ -204,10 +202,10 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                        // Draw the header.
                $this->doc = t3lib_div::makeInstance('template');
-               $this->doc->backPath = $BACK_PATH;
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('templates/version.html');
 
-               // Add styles
+                       // Add styles
                $this->doc->inDocStylesArray[$GLOBALS['MCONF']['name']] = '
 .version-diff-1 { background-color: green; }
 .version-diff-2 { background-color: red; }
@@ -243,7 +241,7 @@ class tx_version_cm1 extends t3lib_SCbase {
                $pidValue = $this->table==='pages' ? $this->uid : $record['pid'];
 
                        // Checking access etc.
-               if ($this->recordFound && $TCA[$this->table]['ctrl']['versioningWS'])   {
+               if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) {
                        $this->doc->form='<form action="" method="post">';
                        $this->uid = $record['uid'];    // Might have changed if new live record was found!
 
@@ -252,7 +250,7 @@ class tx_version_cm1 extends t3lib_SCbase {
                        $this->pageinfo = t3lib_BEfunc::readPageAccess($pidValue,$this->perms_clause);
                        $access = is_array($this->pageinfo) ? 1 : 0;
 
-                       if (($pidValue && $access) || ($BE_USER->user['admin'] && !$pidValue))  {
+                       if (($pidValue && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$pidValue)) {
 
                                        // JavaScript
                                $this->doc->JScode.= '
@@ -281,11 +279,11 @@ class tx_version_cm1 extends t3lib_SCbase {
                                ';
 
                                        // If another page module was specified, replace the default Page module with the new one
-                               $newPageModule = trim($BE_USER->getTSConfigVal('options.overridePageModule'));
+                               $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
                                $this->pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
 
                                        // Setting publish access permission for workspace:
-                               $this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace);
+                               $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);
 
                                        // Render content:
                                if ($this->id)  {
@@ -305,14 +303,14 @@ class tx_version_cm1 extends t3lib_SCbase {
                        $markers['CONTENT'] = $this->content;
                } else {
                                // If no access or id value, create empty document
-                       $this->content = $this->doc->section($LANG->getLL('clickAPage_header'), $LANG->getLL('clickAPage_content'), 0, 1);
+                       $this->content = $this->doc->section($GLOBALS['LANG']->getLL('clickAPage_header'), $GLOBALS['LANG']->getLL('clickAPage_content'), 0, 1);
 
                                // Setting up the buttons and markers for docheader
                        $docHeaderButtons = $this->getButtons();
                        $markers['CONTENT'] = $this->content;
                }
                        // Build the <body> for the module
-               $this->content = $this->doc->startPage($LANG->getLL('title'));
+               $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
                $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
                $this->content.= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
@@ -333,8 +331,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      array   all available buttons as an assoc. array
         */
        protected function getButtons() {
-               global $TCA, $LANG, $BACK_PATH, $BE_USER;
-
                $buttons = array(
                        'csh' => '',
                        'view' => '',
@@ -344,14 +340,14 @@ class tx_version_cm1 extends t3lib_SCbase {
                        // CSH
                //$buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txversionM1', '', $GLOBALS['BACK_PATH']);
 
-               if ($this->recordFound && $TCA[$this->table]['ctrl']['versioningWS']) {
+               if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) {
                                // View page
-                       $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' .
+                       $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' .
                                                t3lib_iconWorks::getSpriteIcon('actions-document-view') .
                                        '</a>';
 
                                // Shortcut
-                       if ($BE_USER->mayMakeShortcut())        {
+                       if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
                                $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
                        }
 
@@ -387,7 +383,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      void
         */
        function versioningMgm()        {
-               global $TCA;
 
                        // Diffing:
                $diff_1 = t3lib_div::_POST('diff_1');
@@ -411,7 +406,9 @@ class tx_version_cm1 extends t3lib_SCbase {
                                                                        </tr>
                                                                ';
                                        foreach($diff_1_record as $fN => $fV)   {
-                                               if ($TCA[$this->table]['columns'][$fN] && $TCA[$this->table]['columns'][$fN]['config']['type']!='passthrough' && !t3lib_div::inList('t3ver_label',$fN)) {
+                                               if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough'
+                                                               && !t3lib_div::inList('t3ver_label', $fN)) {
+
                                                        if (strcmp($diff_1_record[$fN],$diff_2_record[$fN]))    {
 
                                                                $diffres = $t3lib_diff_Obj->makeDiffDisplay(
@@ -552,20 +549,24 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      string          Table with content if any
         */
        function pageSubContent($pid,$c=0)      {
-               global $TCA;
-
-               $tableNames = t3lib_div::removeArrayEntryByValue(array_keys($TCA),'pages');
+               $tableNames = t3lib_div::removeArrayEntryByValue(array_keys($GLOBALS['TCA']), 'pages');
                $tableNames[] = 'pages';
 
                foreach($tableNames as $tN)     {
                                // Basically list ALL tables - not only those being copied might be found!
-                       #if ($TCA[$tN]['ctrl']['versioning_followPages'] || $tN=='pages')       {
-                               $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $tN, 'pid='.intval($pid).t3lib_BEfunc::deleteClause($tN), '', ($TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : ''));
+                       #if ($GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'] || $tN=='pages')    {
+                               $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                       '*',
+                                       $tN,
+                                       'pid=' . intval($pid) . t3lib_BEfunc::deleteClause($tN),
+                                       '',
+                                       ($GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : '')
+                               );
 
                                if ($GLOBALS['TYPO3_DB']->sql_num_rows($mres))  {
                                        $content.='
                                                <tr>
-                                                       <td colspan="4" class="'.($TCA[$tN]['ctrl']['versioning_followPages'] ? 'bgColor6' : ($tN=='pages' ? 'bgColor5' : 'bgColor-10')).'"'.(!$TCA[$tN]['ctrl']['versioning_followPages'] && $tN!='pages' ? ' style="color: #666666; font-style:italic;"':'').'>'.$tN.'</td>
+                                                       <td colspan="4" class="' . ($GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'] ? 'bgColor6' : ($tN == 'pages' ? 'bgColor5' : 'bgColor-10')) . '"' . (!$GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'] && $tN !== 'pages' ? ' style="color: #666666; font-style:italic;"' : '') . '>' . $tN . '</td>
                                                </tr>';
                                        while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres))  {
                                                $ownVer = $this->lookForOwnVersions($tN,$subrow['uid']);
@@ -606,8 +607,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      integer         Number of versions for record, FALSE if none.
         */
        function lookForOwnVersions($table,$uid)        {
-               global $TCA;
-
                $versions = t3lib_BEfunc::selectVersionsOfRecord($table, $uid, 'uid');
                if (is_array($versions))        {
                        return count($versions);
@@ -623,7 +622,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      string          HTML link tags.
         */
        function adminLinks($table,$row)        {
-               global $BE_USER;
 
                        // Edit link:
                $adminLink = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick('&edit['.$table.']['.$row['uid'].']=edit',$this->doc->backPath)).'" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', TRUE) . '">'.
@@ -640,12 +638,12 @@ class tx_version_cm1 extends t3lib_SCbase {
                if ($table == 'pages')  {
 
                                // If another page module was specified, replace the default Page module with the new one
-                       $newPageModule = trim($BE_USER->getTSConfigVal('options.overridePageModule'));
+                       $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
                        $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
 
                                // Perform some acccess checks:
-                       $a_wl = $BE_USER->check('modules','web_list');
-                       $a_wp = t3lib_extMgm::isLoaded('cms') && $BE_USER->check('modules',$pageModule);
+                       $a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
+                       $a_wp = t3lib_extMgm::isLoaded('cms') && $GLOBALS['BE_USER']->check('modules', $pageModule);
 
                        $adminLink.='<a href="#" onclick="top.loadEditId('.$row['uid'].');top.goToModule(\''.$pageModule.'\'); return false;">'.
                                                        t3lib_iconWorks::getSpriteIcon('actions-page-open') .
@@ -721,7 +719,7 @@ class tx_version_cm1 extends t3lib_SCbase {
                $actionLinks.= $this->displayWorkspaceOverview_allStageCmd();
 
                if ($actionLinks || count($errors))     {
-                       $this->content .= $this->doc->section('', $actionLinks . (count($errors) ? '<h3>' . $GLOABLS['LANG']->getLL('errors') . '</h3><br />' . implode('<br />', $errors) . '<hr />' : ''), 0, 1);
+                       $this->content .= $this->doc->section('', $actionLinks . (count($errors) ? '<h3>' . $GLOBALS['LANG']->getLL('errors') . '</h3><br />' . implode('<br />', $errors) . '<hr />' : ''), 0, 1);
                }
 
                if (t3lib_div::_POST('_previewLink'))   {
@@ -840,7 +838,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      array           Table rows, see displayWorkspaceOverview()
         */
        function displayWorkspaceOverview_list($pArray) {
-               global $TCA;
 
                        // If there ARE elements on this level, print them:
                $warnAboutVersions_nonPages = FALSE;
@@ -858,7 +855,7 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                                                // Online version display:
                                                // Create the main cells which will span over the number of versions there is.
-                                       $verLinkUrl = $TCA[$table]['ctrl']['versioningWS'];
+                                       $verLinkUrl = $GLOBALS['TCA'][$table]['ctrl']['versioningWS'];
                                        $origElement = $icon.
                                                ($verLinkUrl ? '<a href="'.htmlspecialchars('index.php?table='.$table.'&uid='.$rec_on['uid']).'">' : '').
                                                t3lib_BEfunc::getRecordTitle($table,$rec_on,TRUE).
@@ -1259,9 +1256,8 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      string          HTML content.
         */
        function subElements($uid,$treeLevel,$origId=0) {
-               global $TCA;
-
-               if (!$this->details && ($GLOBALS['BE_USER']->workspace===0 || !$this->MOD_SETTINGS['expandSubElements']))       {       // In online workspace we have a reduced view because otherwise it will bloat the listing:
+                       // In online workspace we have a reduced view because otherwise it will bloat the listing:
+               if (!$this->details && ($GLOBALS['BE_USER']->workspace === 0 || !$this->MOD_SETTINGS['expandSubElements'])) {
                        return '<br />
                                        <img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/joinbottom.gif','width="18" height="16"').' align="top" alt="" title="" />'.
                                        ($origId ?
@@ -1274,8 +1270,8 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                                // Find records that follow pages when swapping versions:
                        $recList = array();
-                       foreach($TCA as $tN => $tCfg)   {
-                               if ($tN!='pages' && ($treeLevel>0 || $TCA[$tN]['ctrl']['versioning_followPages']))      {
+                       foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
+                               if ($tN !== 'pages' && ($treeLevel > 0 || $GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'])) {
                                        $this->subElements_getNonPageRecords($tN, $uid, $recList);
                                }
                        }
@@ -1321,7 +1317,7 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                                                // Find all records from page and collect in $recList:
                                        $recList = array();
-                                       foreach($TCA as $tN => $tCfg)   {
+                                       foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
                                                if ($tN!=='pages')      {
                                                        $this->subElements_getNonPageRecords($tN, $data['row']['uid'], $recList);
                                                }
@@ -1362,16 +1358,14 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      void
         */
        function subElements_getNonPageRecords($tN, $uid, &$recList)    {
-               global $TCA;
-
                $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                        '*',
                        $tN,
                        'pid='.intval($uid).
-                               ($TCA[$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '').
+                               ($GLOBALS['TCA'][$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '') .
                                t3lib_BEfunc::deleteClause($tN),
                        '',
-                       $TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($TCA[$tN]['ctrl']['default_sortby'])
+                       $GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($GLOBALS['TCA'][$tN]['ctrl']['default_sortby'])
                );
 
                foreach($records as $rec)       {
@@ -1392,10 +1386,9 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      void            (Content accumulated in $tCell!)
         */
        function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)      {
-               global $TCA;
 
                        // Initialize:
-               $origUidFields = $TCA[$tN]['ctrl']['origUid'];
+               $origUidFields = $GLOBALS['TCA'][$tN]['ctrl']['origUid'];
                $diffCode = '';
 
                if ($origUidFields)     {       // If there is a field for this table with original uids we will use that to connect records:
@@ -1483,7 +1476,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      array           Array with two keys (0/1) with HTML content / percentage integer (if -1, then it means N/A) indicating amount of change
         */
        function createDiffView($table, $diff_1_record, $diff_2_record) {
-               global $TCA;
 
                        // Initialize:
                $pctChange = 'N/A';
@@ -1510,16 +1502,17 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                                // Traversing the first record and process all fields which are editable:
                        foreach($diff_1_record as $fN => $fV)   {
-                               if ($TCA[$table]['columns'][$fN] && $TCA[$table]['columns'][$fN]['config']['type']!='passthrough' && !t3lib_div::inList('t3ver_label',$fN))     {
+                               if ($GLOBALS['TCA'][$table]['columns'][$fN] && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] !== 'passthrough'
+                                       && !t3lib_div::inList('t3ver_label', $fN)) {
 
                                                // Check if it is files:
                                        $isFiles = FALSE;
-                                       if (strcmp(trim($diff_1_record[$fN]),trim($diff_2_record[$fN])) &&
-                                                       $TCA[$table]['columns'][$fN]['config']['type']=='group' &&
-                                                       $TCA[$table]['columns'][$fN]['config']['internal_type']=='file')        {
+                                       if (strcmp(trim($diff_1_record[$fN]), trim($diff_2_record[$fN]))
+                                                       && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] === 'group'
+                                                       && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['internal_type'] === 'file') {
 
                                                        // Initialize:
-                                               $uploadFolder = $TCA[$table]['columns'][$fN]['config']['uploadfolder'];
+                                               $uploadFolder = $GLOBALS['TCA'][$table]['columns'][$fN]['config']['uploadfolder'];
                                                $files1 = array_flip(t3lib_div::trimExplode(',', $diff_1_record[$fN],1));
                                                $files2 = array_flip(t3lib_div::trimExplode(',', $diff_2_record[$fN],1));
 
@@ -1854,4 +1847,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>
index bc31b6f..b1741f6 100755 (executable)
@@ -125,15 +125,13 @@ class wslib {
         * @return      array           Array of all records uids etc. First key is table name, second key incremental integer. Records are associative arrays with uid, t3ver_oid and t3ver_swapmode fields. The REAL pid of the online record is found as "realpid"
         */
        function selectVersionsInWorkspace($wsid,$filter=0,$stage=-99,$pageId=-1)       {
-               global $TCA;
-
                $wsid = intval($wsid);
                $filter = intval($filter);
                $output = array();
 
                        // Traversing all tables supporting versioning:
-               foreach($TCA as $table => $cfg) {
-                       if ($TCA[$table]['ctrl']['versioningWS'])       {
+               foreach ($GLOBALS['TCA'] as $table => $cfg) {
+                       if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
 
                                        // Select all records from this table in the database from the workspace
                                        // This joins the online version with the offline version as tables A and B
@@ -198,8 +196,6 @@ class wslib {
         * @return      void
         */
        function autoPublishWorkspaces()        {
-               global $TYPO3_CONF_VARS;
-
                        // Temporarily set admin rights
                        // FIXME: once workspaces are cleaned up a better solution should be implemented
                $currentAdminStatus = $GLOBALS['BE_USER']->user['admin'];
@@ -242,4 +238,4 @@ class wslib {
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib.php'])) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib.php']);
 }
-?>
\ No newline at end of file
+?>
index aa1947c..2306ab9 100644 (file)
@@ -70,8 +70,8 @@
  */
 
 require_once('class.wslib.php');
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
-$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
 
 /**
  * Library with Workspace GUI related functionality. It is used by main workspace
@@ -127,8 +127,6 @@ class wslib_gui {
         * @return      string          Generated HTML
         */
        function getWorkspaceOverview(&$doc, $wsid = NULL, $filter = 0, $pageId = -1) {
-               global  $LANG;
-
                // Setup
                $this->workspaceId = (!is_null($wsid) ? $wsid : $GLOBALS['BE_USER']->workspace);
                $this->showWorkspaceCol = $GLOBALS['BE_USER']->workspace == 0 && $this->workspaceId <= -98;
@@ -187,32 +185,32 @@ class wslib_gui {
                        $tableRows = array();
                        $tableHeader = '
                                <tr class="t3-row-header">
-                                       <td nowrap="nowrap" width="100">' . $LANG->getLL('label_pagetree') . '</td>
-                                       <td nowrap="nowrap" colspan="2">' . $LANG->getLL('label_live_version') . '</td>
-                                       <td nowrap="nowrap" colspan="2">' . $LANG->getLL('label_draft_versions') . '</td>
-                                       <td nowrap="nowrap">' . $LANG->getLL('label_stage') . '</td>
-                                       <td nowrap="nowrap">' . $LANG->getLL('label_publish') . '</td>
-                                       <td><select name="_with_selected_do" onchange="if (confirm(\'' . $LANG->getLL('submit_apply_action_on_selected_elements') . '\')) {document.forms[0].submit();}">
-                                               <option value="_">' . $LANG->getLL('label_doaction_default') . '</option>';
+                                       <td nowrap="nowrap" width="100">' . $GLOBALS['LANG']->getLL('label_pagetree') . '</td>
+                                       <td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('label_live_version') . '</td>
+                                       <td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('label_draft_versions') . '</td>
+                                       <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_stage') . '</td>
+                                       <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_publish') . '</td>
+                                       <td><select name="_with_selected_do" onchange="if (confirm(\'' . $GLOBALS['LANG']->getLL('submit_apply_action_on_selected_elements') . '\')) {document.forms[0].submit();}">
+                                               <option value="_">' . $GLOBALS['LANG']->getLL('label_doaction_default') . '</option>';
 
                        if ($this->publishAccess && !($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1)) {
-                               $tableHeader .= '<option value="publish">' . $LANG->getLL('label_doaction_publish') . '</option>';
+                               $tableHeader .= '<option value="publish">' . $GLOBALS['LANG']->getLL('label_doaction_publish') . '</option>';
                                if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                                       $tableHeader .= '<option value="swap">' . $LANG->getLL('label_doaction_swap') . '</option>';
+                                       $tableHeader .= '<option value="swap">' . $GLOBALS['LANG']->getLL('label_doaction_swap') . '</option>';
                                }
                        }
                        if ($GLOBALS['BE_USER']->workspace !== 0) {
-                               $tableHeader .= '<option value="release">' . $LANG->getLL('label_doaction_release') . '</option>';
+                               $tableHeader .= '<option value="release">' . $GLOBALS['LANG']->getLL('label_doaction_release') . '</option>';
                        }
-                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('-1') ? '<option value="stage_-1">' . $LANG->getLL('label_doaction_stage_reject') . '</option>' : '';
-                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('0') ? '<option value="stage_0">' . $LANG->getLL('label_doaction_stage_editing') . '</option>' : '';
-                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('1') ? '<option value="stage_1">' . $LANG->getLL('label_doaction_stage_review') . '</option>' : '';
-                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('10') ? '<option value="stage_10">' . $LANG->getLL('label_doaction_stage_publish') . '</option>' : '';
+                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('-1') ? '<option value="stage_-1">' . $GLOBALS['LANG']->getLL('label_doaction_stage_reject') . '</option>' : '';
+                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('0') ? '<option value="stage_0">' . $GLOBALS['LANG']->getLL('label_doaction_stage_editing') . '</option>' : '';
+                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('1') ? '<option value="stage_1">' . $GLOBALS['LANG']->getLL('label_doaction_stage_review') . '</option>' : '';
+                       $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('10') ? '<option value="stage_10">' . $GLOBALS['LANG']->getLL('label_doaction_stage_publish') . '</option>' : '';
 
-                       $tableHeader .= '<option value="flush">' . $LANG->getLL('label_doaction_flush') . '</option>
+                       $tableHeader .= '<option value="flush">' . $GLOBALS['LANG']->getLL('label_doaction_flush') . '</option>
                                        </select></td>
-                                       <td>' . $LANG->getLL('label_lifecycle') . '</td>
-                                       '.($this->showWorkspaceCol ? '<td>' . $LANG->getLL('label_workspace') . '</td>' : '').'
+                                       <td>' . $GLOBALS['LANG']->getLL('label_lifecycle') . '</td>
+                                       '.($this->showWorkspaceCol ? '<td>' . $GLOBALS['LANG']->getLL('label_workspace') . '</td>' : '').'
                                </tr>';
                        $tableRows[] = $tableHeader;
 
@@ -344,8 +342,6 @@ class wslib_gui {
         * @return      array           Table rows, see displayWorkspaceOverview()
         */
        function displayWorkspaceOverview_list($pArray, $tableRows=array(), $c=0, $warnAboutVersions=FALSE)     {
-               global $TCA, $LANG;
-
                // Initialize:
                $fullColSpan = $this->showWorkspaceCol ? 10 : 9;
 
@@ -390,7 +386,7 @@ class wslib_gui {
 
                                                                // MAIN CELL / Online version display:
                                                                // Create the main cells which will span over the number of versions there is. If the table is "pages" then it will show the page tree icon and title (which was not shown by the code above)
-                                                               $verLinkUrl = t3lib_extMgm::isLoaded('version') && $TCA[$table]['ctrl']['versioningWS'];
+                                                               $verLinkUrl = t3lib_extMgm::isLoaded('version') && $GLOBALS['TCA'][$table]['ctrl']['versioningWS'];
                                                                $origElement = $icon.
                                                                ($verLinkUrl ? '<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?table='.$table.'&uid='.$rec_on['uid']).'">' : '').
                                                                                                t3lib_BEfunc::getRecordTitle($table,$rec_on,TRUE).
@@ -436,17 +432,17 @@ class wslib_gui {
                                                                                $diffCode = '';
                                                                                list($diffHTML,$diffPct) = $this->createDiffView($table, $rec_off, $rec_on);
                                                                                if ($rec_on['t3ver_state']==1)  {       // New record:
-                                                                                       $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_newrecord') . '<br />';
+                                                                                       $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('label_newrecord') . '<br />';
                                                                                        $diffCode.= $diffHTML;
                                                                                } elseif ($rec_off['t3ver_state']==2)   {
-                                                                                       $diffCode.= $this->doc->icons(2) . $LANG->getLL('label_deletedrecord') . '<br/>';
+                                                                                       $diffCode.= $this->doc->icons(2) . $GLOBALS['LANG']->getLL('label_deletedrecord') . '<br/>';
                                                                                } elseif ($rec_on['t3ver_state']==3)    {
-                                                                                       $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_moveto_placeholder') . '<br/>';
+                                                                                       $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('label_moveto_placeholder') . '<br/>';
                                                                                } elseif ($rec_off['t3ver_state']==4)   {
-                                                                                       $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_moveto_pointer') . '<br/>';
+                                                                                       $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('label_moveto_pointer') . '<br/>';
                                                                                } else {
-                                                                                       $diffCode .= ($diffPct < 0 ? $LANG->getLL('label_notapplicable') :
-                                                                                               ($diffPct ? sprintf($LANG->getLL('label_percentChange'), $diffPct) : ''));
+                                                                                       $diffCode .= ($diffPct < 0 ? $GLOBALS['LANG']->getLL('label_notapplicable') :
+                                                                                               ($diffPct ? sprintf($GLOBALS['LANG']->getLL('label_percentChange'), $diffPct) : ''));
                                                                                        $diffCode.= $diffHTML;
                                                                                }
 
@@ -454,17 +450,17 @@ class wslib_gui {
 
                                                                        switch($vType) {
                                                                                case 'element':
-                                                                                       $swapLabel = ' ['.$LANG->getLL('label_element').']';
+                                                                                       $swapLabel = ' [' . $GLOBALS['LANG']->getLL('label_element') . ']';
                                                                                        $swapClass = 'ver-element';     // Do not translate!
                                                                                        $warnAboutVersions_nonPages = $warnAboutVersions_page;  // Setting this if sub elements are found with a page+content (must be rendered prior to this of course!)
                                                                                        break;
                                                                                case 'page':
-                                                                                       $swapLabel = ' ['.$LANG->getLL('label_page').']';
+                                                                                       $swapLabel = ' [' . $GLOBALS['LANG']->getLL('label_page') . ']';
                                                                                        $swapClass = 'ver-page';        // Do not translate!
                                                                                        $warnAboutVersions_page = !$this->showWorkspaceCol;             // This value is TRUE only if multiple workspaces are shown and we need the opposite here.
                                                                                        break;
                                                                                case 'branch':
-                                                                                       $swapLabel = ' ['.$LANG->getLL('label_branch').']';
+                                                                                       $swapLabel = ' [' . $GLOBALS['LANG']->getLL('label_branch') . ']';
                                                                                        $swapClass = 'ver-branch';      // Do not translate!
                                                                                        $warnAboutVersions_next = !$this->showWorkspaceCol;             // This value is TRUE only if multiple workspaces are shown and we need the opposite here.
                                                                                        break;
@@ -480,9 +476,9 @@ class wslib_gui {
 
                                                                        // Create version element:
                                                                        $versionsInOtherWS = $this->versionsInOtherWS($table, $rec_on['uid']);
-                                                                       $versionsInOtherWSWarning = $versionsInOtherWS && $GLOBALS['BE_USER']->workspace !== 0 ? '<br />' . $this->doc->icons(2) . $LANG->getLL('label_otherversions') . ' ' . $versionsInOtherWS : '';
-                                                                       $multipleWarning = (!$mainCell && $GLOBALS['BE_USER']->workspace !==0 ? '<br />' . $this->doc->icons(3) . '<strong>' . $LANG->getLL('label_multipleversions') . '</strong>' : '');
-                                                                       $verWarning = $warnAboutVersions || ($warnAboutVersions_nonPages && $GLOBALS['TCA'][$table]['ctrl']['versioning_followPages']) ? '<br />' . $this->doc->icons(3) . '<strong>' . $LANG->getLL('label_nestedversions') . '</strong>' : '';
+                                                                       $versionsInOtherWSWarning = $versionsInOtherWS && $GLOBALS['BE_USER']->workspace !== 0 ? '<br />' . $this->doc->icons(2) . $GLOBALS['LANG']->getLL('label_otherversions') . ' ' . $versionsInOtherWS : '';
+                                                                       $multipleWarning = (!$mainCell && $GLOBALS['BE_USER']->workspace !==0 ? '<br />' . $this->doc->icons(3) . '<strong>' . $GLOBALS['LANG']->getLL('label_multipleversions') . '</strong>' : '');
+                                                                       $verWarning = $warnAboutVersions || ($warnAboutVersions_nonPages && $GLOBALS['TCA'][$table]['ctrl']['versioning_followPages']) ? '<br />' . $this->doc->icons(3) . '<strong>' . $GLOBALS['LANG']->getLL('label_nestedversions') . '</strong>' : '';
                                                                        $verElement = $icon.
                                                                                '<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?id='.($table==='pages'?$rec_on['uid']:$rec_on['pid']).'&details='.rawurlencode($table.':'.$rec_off['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
                                                                                t3lib_BEfunc::getRecordTitle($table,$rec_off,TRUE).
@@ -666,8 +662,6 @@ class wslib_gui {
         * @return      array           Array with two keys (0/1) with HTML content / percentage integer (if -1, then it means N/A) indicating amount of change
         */
        function createDiffView($table, $diff_1_record, $diff_2_record) {
-               global $TCA, $LANG;
-
                // Initialize:
                $pctChange = 'N/A';
 
@@ -682,8 +676,8 @@ class wslib_gui {
                        $tRows = array();
                        $tRows[] = '
                                <tr class="bgColor5 tableheader">
-                                       <td>' . $LANG->getLL('diffview_label_field_name') . '</td>
-                                       <td width="98%" nowrap="nowrap">' . $LANG->getLL('diffview_label_colored_diff_view') . '</td>
+                                       <td>' . $GLOBALS['LANG']->getLL('diffview_label_field_name') . '</td>
+                                       <td width="98%" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('diffview_label_colored_diff_view') . '</td>
                                </tr>
                        ';
 
@@ -693,16 +687,17 @@ class wslib_gui {
 
                        // Traversing the first record and process all fields which are editable:
                        foreach($diff_1_record as $fN => $fV)   {
-                               if ($TCA[$table]['columns'][$fN] && $TCA[$table]['columns'][$fN]['config']['type']!='passthrough' && !t3lib_div::inList('t3ver_label',$fN))     {
+                               if ($GLOBALS['TCA'][$table]['columns'][$fN] && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] !== 'passthrough'
+                                               && !t3lib_div::inList('t3ver_label', $fN)) {
 
                                        // Check if it is files:
                                        $isFiles = FALSE;
-                                       if (strcmp(trim($diff_1_record[$fN]),trim($diff_2_record[$fN])) &&
-                                       $TCA[$table]['columns'][$fN]['config']['type']=='group' &&
-                                       $TCA[$table]['columns'][$fN]['config']['internal_type']=='file')        {
+                                       if (strcmp(trim($diff_1_record[$fN]), trim($diff_2_record[$fN]))
+                                                       && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] === 'group'
+                                                       && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['internal_type'] === 'file') {
 
                                                // Initialize:
-                                               $uploadFolder = $TCA[$table]['columns'][$fN]['config']['uploadfolder'];
+                                               $uploadFolder = $GLOBALS['TCA'][$table]['columns'][$fN]['config']['uploadfolder'];
                                                $files1 = array_flip(t3lib_div::trimExplode(',', $diff_1_record[$fN],1));
                                                $files2 = array_flip(t3lib_div::trimExplode(',', $diff_2_record[$fN],1));
 
@@ -764,12 +759,12 @@ class wslib_gui {
                        $pctChange = $allStrLen ? ceil($diffStrLen*100/$allStrLen) : -1;
 
                        // Create visual representation of result:
-                       if (count($tRows)>1)    {
-                               $content.= '<table border="0" cellpadding="1" cellspacing="1" class="diffTable">'.implode('',$tRows).'</table>';
+                       if (count($tRows) > 1) {
+                               $content .= '<table border="0" cellpadding="1" cellspacing="1" class="diffTable">' . implode('', $tRows) . '</table>';
                        } else {
-                               $content.= '<span class="nobr">'.$this->doc->icons(1).$LANG->getLL('diffview_complete_match').'</span>';
+                               $content .= '<span class="nobr">' . $this->doc->icons(1) . $GLOBALS['LANG']->getLL('diffview_complete_match') . '</span>';
                        }
-               } else $content.= $this->doc->icons(3).$LANG->getLL('diffview_cannot_find_records');
+               } else $content .= $this->doc->icons(3) . $GLOBALS['LANG']->getLL('diffview_cannot_find_records');
 
                // Return value:
                return array($content,$pctChange);
@@ -812,8 +807,6 @@ class wslib_gui {
         * @return      string          HTML code.
         */
        function showStageChangeLog($table,$id,$stageCommands)  {
-               global  $LANG;
-
                $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                                'log_data,tstamp,userid',
                                'sys_log',
@@ -829,23 +822,23 @@ class wslib_gui {
 
                        switch($data['stage'])  {
                                case 1:
-                                       $text = $LANG->getLL('stage_sent_to_review');
+                                       $text = $GLOBALS['LANG']->getLL('stage_sent_to_review');
                                        break;
                                case 10:
-                                       $text = $LANG->getLL('stage_approved_for_publish');
+                                       $text = $GLOBALS['LANG']->getLL('stage_approved_for_publish');
                                        break;
                                case -1:
-                                       $text = $LANG->getLL('stage_rejected');
+                                       $text = $GLOBALS['LANG']->getLL('stage_rejected');
                                        break;
                                case 0:
-                                       $text = $LANG->getLL('stage_reset_to_editing');
+                                       $text = $GLOBALS['LANG']->getLL('stage_reset_to_editing');
                                        break;
                                default:
-                                       $text = $LANG->getLL('stage_undefined');
+                                       $text = $GLOBALS['LANG']->getLL('stage_undefined');
                                        break;
                        }
                        $text = t3lib_BEfunc::datetime($dat['tstamp']).': ' . sprintf($text, htmlspecialchars($username));
-                       $text.= ($data['comment'] ? '<br />' . $LANG->getLL('stage_label_user_comment') . ' <em>' . htmlspecialchars($data['comment']) . '</em>' : '');
+                       $text.= ($data['comment'] ? '<br />' . $GLOBALS['LANG']->getLL('stage_label_user_comment') . ' <em>' . htmlspecialchars($data['comment']) . '</em>' : '');
 
                        $entry[] = $text;
                }
@@ -864,59 +857,57 @@ class wslib_gui {
         * @return      string          HTML content, mainly link tags and images.
         */
        function displayWorkspaceOverview_commandLinks($table,&$rec_on,&$rec_off,$vType)        {
-               global  $LANG;
-
                if ($this->publishAccess && (!($GLOBALS['BE_USER']->workspaceRec['publish_access']&1) || (int)$rec_off['t3ver_stage']===-10))   {
                        $actionLinks =
                                '<a href="'.htmlspecialchars($this->doc->issueCommand(
                                '&cmd['.$table.']['.$rec_on['uid'].'][version][action]=swap'.
                                '&cmd['.$table.']['.$rec_on['uid'].'][version][swapWith]='.$rec_off['uid']
-                               )).' " title="' . $LANG->getLL('img_title_publish') . '">'.
+                               )).' " title="' . $GLOBALS['LANG']->getLL('img_title_publish') . '">'.
                                  t3lib_iconWorks::getSpriteIcon('actions-version-workspace-sendtostage') .
                                '</a>';
                        if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                               $actionLinks.=
+                               $actionLinks .=
                                        '<a href="'.htmlspecialchars($this->doc->issueCommand(
-                                       '&cmd['.$table.']['.$rec_on['uid'].'][version][action]=swap'.
-                                       '&cmd['.$table.']['.$rec_on['uid'].'][version][swapWith]='.$rec_off['uid'].
-                                       '&cmd['.$table.']['.$rec_on['uid'].'][version][swapIntoWS]=1'
-                                                               )).'" title="' . $LANG->getLL('img_title_swap') . '">'.
-                                         t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace') .
-                                       '</a>';
+                                               '&cmd[' . $table . '][' . $rec_on['uid'] . '][version][action]=swap'
+                                               . '&cmd[' . $table . '][' . $rec_on['uid'] . '][version][swapWith]=' . $rec_off['uid']
+                                               . '&cmd[' . $table . '][' . $rec_on['uid'] . '][version][swapIntoWS]=1'
+                                       )) . '" title="' . $GLOBALS['LANG']->getLL('img_title_swap') . '">'
+                                       . t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace')
+                                       '</a>';
                        }
                }
 
                if (!$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off)) {
                        if ($GLOBALS['BE_USER']->workspace!==0) {
                                // Release
-                               $confirm = $LANG->JScharCode($LANG->getLL('remove_from_ws_confirmation'));
+                               $confirm = $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('remove_from_ws_confirmation'));
                                $actionLinks.=
-                               '<a href="'.htmlspecialchars($this->doc->issueCommand('&cmd['.$table.']['.$rec_off['uid'].'][version][action]=clearWSID')).'" onclick="return confirm(' . $confirm . ');" title="' . $LANG->getLL('img_title_remove_from_ws') . '">'.
-                                 t3lib_iconWorks::getSpriteIcon('actions-version-document-remove') .
-                               '</a>';
+                                       '<a href="'.htmlspecialchars($this->doc->issueCommand('&cmd['.$table.']['.$rec_off['uid'].'][version][action]=clearWSID')).'" onclick="return confirm(' . $confirm . ');" title="' . $GLOBALS['LANG']->getLL('img_title_remove_from_ws') . '">'
+                                       . t3lib_iconWorks::getSpriteIcon('actions-version-document-remove')
+                                       . '</a>';
                        }
 
                        // Edit
                        if ($table==='pages' && $vType!=='element')     {
                                $tempUid = ($vType==='branch' || $GLOBALS['BE_USER']->workspace===0 ? $rec_off['uid'] : $rec_on['uid']);
                                $actionLinks.=
-                                       '<a href="#" onclick="top.loadEditId('.$tempUid.');top.goToModule(\''.$this->pageModule.'\'); return false;" title="' . $LANG->getLL('img_title_edit_page') . '">'.
-                                         t3lib_iconWorks::getSpriteIcon('actions-page-open') .
-                                       '</a>';
+                                       '<a href="#" onclick="top.loadEditId(' . $tempUid . ');top.goToModule(\'' . $this->pageModule . '\'); return false;" title="' . $GLOBALS['LANG']->getLL('img_title_edit_page') . '">'
+                                       . t3lib_iconWorks::getSpriteIcon('actions-page-open')
+                                       '</a>';
                        } else {
                                $params = '&edit['.$table.']['.$rec_off['uid'].']=edit';
                                $actionLinks.=
-                                       '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->doc->backPath)).'" title="' . $LANG->getLL('img_title_edit_element') . '">'.
-                                         t3lib_iconWorks::getSpriteIcon('actions-document-open') .
-                                       '</a>';
+                                       '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('img_title_edit_element') . '">'
+                                       . t3lib_iconWorks::getSpriteIcon('actions-document-open')
+                                       '</a>';
                        }
                }
 
                // History/Log
                $actionLinks.=
-                       '<a href="'.htmlspecialchars($this->doc->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$rec_off['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'" title="' . $LANG->getLL('img_title_show_log') . '">' .
-                         t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
-                       '</a>';
+                       '<a href="' . htmlspecialchars($this->doc->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $rec_off['uid']) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '" title="' . $GLOBALS['LANG']->getLL('img_title_show_log') . '">'
+                       . t3lib_iconWorks::getSpriteIcon('actions-document-history-open')
+                       '</a>';
 
                // View
                if ($table==='pages')   {
@@ -937,19 +928,17 @@ class wslib_gui {
         * @return      string          String translation of count.
         */
        function formatCount($count)    {
-               global  $LANG;
-
                // Render, if not cached:
                if (!isset($this->formatCount_cache[$count]))   {
                        switch($count)  {
                                case 0:
-                                       $this->formatCount_cache[$count] = $LANG->getLL('workspace_list_publishing_count_draft');
+                                       $this->formatCount_cache[$count] = $GLOBALS['LANG']->getLL('workspace_list_publishing_count_draft');
                                        break;
                                case 1:
-                                       $this->formatCount_cache[$count] = $LANG->getLL('workspace_list_publishing_count_archive');
+                                       $this->formatCount_cache[$count] = $GLOBALS['LANG']->getLL('workspace_list_publishing_count_archive');
                                        break;
                                default:
-                                       $this->formatCount_cache[$count] = sprintf($LANG->getLL('workspace_list_publishing_count'), $count);
+                                       $this->formatCount_cache[$count] = sprintf($GLOBALS['LANG']->getLL('workspace_list_publishing_count'), $count);
                                        break;
                        }
                }
@@ -967,23 +956,21 @@ class wslib_gui {
         * @return      string          HTML content.
         */
        function subElements($uid,$treeLevel,$origId=0) {
-               global $TCA, $LANG;
-
                if ($GLOBALS['BE_USER']->workspace===0 || !$this->expandSubElements)    {       // In online workspace we have a reduced view because otherwise it will bloat the listing:
                        return '<br />
                                        <img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/joinbottom.gif','width="18" height="16"').' align="top" alt="" title="" />'.
                        ($origId ?
                        '<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?id='.$uid.'&details='.rawurlencode('pages:'.$uid).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
-                       '<span class="typo3-dimmed"><em>['.$LANG->getLL('label_subelementsdetails').']</em><span></a>' :
-                       '<span class="typo3-dimmed"><em>['.$LANG->getLL('label_subelements').']</em><span>');
+                       '<span class="typo3-dimmed"><em>[' . $GLOBALS['LANG']->getLL('label_subelementsdetails') . ']</em><span></a>' :
+                       '<span class="typo3-dimmed"><em>[' . $GLOBALS['LANG']->getLL('label_subelements') . ']</em><span>');
                } else {        // For an offline workspace, show sub elements:
 
                        $tCell = array();
 
                        // Find records that follow pages when swapping versions:
                        $recList = array();
-                       foreach($TCA as $tN => $tCfg)   {
-                               if ($tN!='pages' && ($treeLevel>0 || $TCA[$tN]['ctrl']['versioning_followPages']))      {
+                       foreach($GLOBALS['TCA'] as $tN => $tCfg) {
+                               if ($tN !== 'pages' && ($treeLevel > 0 || $GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'])) {
                                        $this->subElements_getNonPageRecords($tN, $uid, $recList);
                                }
                        }
@@ -1008,6 +995,7 @@ class wslib_gui {
                        if ($treeLevel>0) {
 
                                // Drawing tree:
+                               /** @var $tree t3lib_pageTree */
                                $tree = t3lib_div::makeInstance('t3lib_pageTree');
                                $tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));
                                $tree->makeHTML = 2;            // 2=Also rendering depth-data into the result array
@@ -1029,7 +1017,7 @@ class wslib_gui {
 
                                        // Find all records from page and collect in $recList:
                                        $recList = array();
-                                       foreach($TCA as $tN => $tCfg)   {
+                                       foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
                                                if ($tN!=='pages')      {
                                                        $this->subElements_getNonPageRecords($tN, $data['row']['uid'], $recList);
                                                }
@@ -1070,16 +1058,14 @@ class wslib_gui {
         * @return      void
         */
        function subElements_getNonPageRecords($tN, $uid, &$recList)    {
-               global $TCA;
-
                $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                        '*',
                        $tN,
                        'pid='.intval($uid).
-                       ($TCA[$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '').
+                       ($GLOBALS['TCA'][$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '') .
                        t3lib_BEfunc::deleteClause($tN),
                        '',
-                       $TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($TCA[$tN]['ctrl']['default_sortby'])
+                       $GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($GLOBALS['TCA'][$tN]['ctrl']['default_sortby'])
                );
 
                foreach($records as $rec)       {
@@ -1100,10 +1086,9 @@ class wslib_gui {
         * @return      void            (Content accumulated in $tCell!)
         */
        function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)      {
-               global $TCA;
 
                // Initialize:
-               $origUidFields = $TCA[$tN]['ctrl']['origUid'];
+               $origUidFields = $GLOBALS['TCA'][$tN]['ctrl']['origUid'];
                $diffCode = '';
 
                if ($origUidFields)     {       // If there is a field for this table with original uids we will use that to connect records:
@@ -1173,31 +1158,29 @@ class wslib_gui {
         * @return      string          HTML content, mainly link tags and images.
         */
        function displayWorkspaceOverview_commandLinksSub($table,$rec,$origId)  {
-               global $LANG;
-
                $uid = $rec['uid'];
                if ($origId || $GLOBALS['BE_USER']->workspace===0)      {
                        if (!$GLOBALS['BE_USER']->workspaceCannotEditRecord($table,$rec))       {
                                // Edit
                                if ($table==='pages')   {
-                                       $actionLinks.=
-                                               '<a href="#" onclick="top.loadEditId('.$uid.');top.goToModule(\''.$this->pageModule.'\'); return false;" title="' . $LANG->getLL('img_title_edit_page') . '">'.
-                                                 t3lib_iconWorks::getSpriteIcon('actions-page-open') .
-                                               '</a>';
+                                       $actionLinks .=
+                                               '<a href="#" onclick="top.loadEditId(' . $uid . ');top.goToModule(\'' . $this->pageModule . '\'); return false;" title="' . $GLOBALS['LANG']->getLL('img_title_edit_page') . '">'
+                                               . t3lib_iconWorks::getSpriteIcon('actions-page-open')
+                                               '</a>';
                                } else {
                                        $params = '&edit['.$table.']['.$uid.']=edit';
-                                       $actionLinks.=
-                                               '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->doc->backPath)).'" title="' . $LANG->getLL('img_title_edit_element') . '">'.
-                                                 t3lib_iconWorks::getSpriteIcon('actions-document-open') .
-                                               '</a>';
+                                       $actionLinks .=
+                                               '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('img_title_edit_element') . '">'
+                                               . t3lib_iconWorks::getSpriteIcon('actions-document-open')
+                                               '</a>';
                                }
                        }
 
                        // History/Log
                        $actionLinks.=
-                               '<a href="'.htmlspecialchars($this->doc->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$uid).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'" title="' . $LANG->getLL('img_title_show_log') . '">'.
-                                 t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
-                               '</a>';
+                               '<a href="' . htmlspecialchars($this->doc->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $uid) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '" title="' . $GLOBALS['LANG']->getLL('img_title_show_log') . '">'
+                               . t3lib_iconWorks::getSpriteIcon('actions-document-history-open')
+                               '</a>';
                }
 
                // View
@@ -1220,36 +1203,34 @@ class wslib_gui {
         * @return      string          HTML content, mainly link tags and images.
         */
        function displayWorkspaceOverview_stageCmd($table,&$rec_off)    {
-               global $LANG;
-
                switch((int)$rec_off['t3ver_stage'])    {
                        case 0:
                                $sId = 1;
-                               $sLabel = $LANG->getLL('stage_editing');
+                               $sLabel = $GLOBALS['LANG']->getLL('stage_editing');
                                $color = '#666666';     // TODO Use CSS?
-                               $label = $LANG->getLL('label_commentforreviewer');
-                               $titleAttrib = $LANG->getLL('label_sendtoreview');
+                               $label = $GLOBALS['LANG']->getLL('label_commentforreviewer');
+                               $titleAttrib = $GLOBALS['LANG']->getLL('label_sendtoreview');
                                break;
                        case 1:
                                $sId = 10;
-                               $sLabel = $LANG->getLL('label_review');
+                               $sLabel = $GLOBALS['LANG']->getLL('label_review');
                                $color = '#6666cc';     // TODO Use CSS?
-                               $label = $LANG->getLL('label_commentforpublisher');
-                               $titleAttrib = $LANG->getLL('label_approveforpublishing');
+                               $label = $GLOBALS['LANG']->getLL('label_commentforpublisher');
+                               $titleAttrib = $GLOBALS['LANG']->getLL('label_approveforpublishing');
                                break;
                        case 10:
-                               $sLabel = $LANG->getLL('label_publish');
+                               $sLabel = $GLOBALS['LANG']->getLL('label_publish');
                                $color = '#66cc66';     // TODO Use CSS?
                                break;
                        case -1:
-                               $sLabel = $this->doc->icons(2).$LANG->getLL('label_rejected');
+                               $sLabel = $this->doc->icons(2) . $GLOBALS['LANG']->getLL('label_rejected');
                                $sId = 0;
                                $color = '#ff0000';     // TODO Use CSS?
-                               $label = $LANG->getLL('stage_label_user_comment');
-                               $titleAttrib = $LANG->getLL('label_resetstage');
+                               $label = $GLOBALS['LANG']->getLL('stage_label_user_comment');
+                               $titleAttrib = $GLOBALS['LANG']->getLL('label_resetstage');
                                break;
                        default:
-                               $sLabel = $LANG->getLL('label_undefined');
+                               $sLabel = $GLOBALS['LANG']->getLL('label_undefined');
                                $sId = 0;
                                $color = '';
                                break;
@@ -1259,17 +1240,18 @@ class wslib_gui {
                $raiseOk = !$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off);
 
                if ($raiseOk && $rec_off['t3ver_stage'] != -1 && $GLOBALS['BE_USER']->workspaceCheckStageForCurrent($sId))      {
-                       $onClick = 'var commentTxt=window.prompt("'.$LANG->getLL('explain_reject').'","");
-                                                       if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand(
-                       '&cmd['.$table.']['.$rec_off['uid'].'][version][action]=setStage'.
-                       '&cmd['.$table.']['.$rec_off['uid'].'][version][stageId]=-1'
-                                                       ).'&cmd['.$table.']['.$rec_off['uid'].'][version][comment]="+escape(commentTxt);}'.
-                       ' return false;';
+                       $onClick = 'var commentTxt=window.prompt("' . $GLOBALS['LANG']->getLL('explain_reject') . '","");
+                                       if (commentTxt!=null) {window.location.href="'
+                               . $this->doc->issueCommand(
+                                       '&cmd[' . $table . '][' . $rec_off['uid'] . '][version][action]=setStage'
+                                       . '&cmd[' . $table . '][' . $rec_off['uid'] . '][version][stageId]=-1'
+                               ).'&cmd[' . $table . '][' . $rec_off['uid'] . '][version][comment]="+escape(commentTxt);}'
+                               . ' return false;';
                        // Reject:
                        $actionLinks.=
-                       '<a href="#" onclick="'.htmlspecialchars($onClick).'"title="'.$LANG->getLL('label_reject').'"> '.
-                         t3lib_iconWorks::getSpriteIcon('actions-move-down') .
-                       '</a>';
+                               '<a href="#" onclick="' . htmlspecialchars($onClick) . '"title="' . $GLOBALS['LANG']->getLL('label_reject') . '"> '
+                               . t3lib_iconWorks::getSpriteIcon('actions-move-down')
+                               . '</a>';
                } else {
                        // Reject:
                        $actionLinks.=
@@ -1306,4 +1288,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib_gui.php']);
 }
 
-?>
\ No newline at end of file
+?>
index 0e6a91a..f9dab04 100755 (executable)
        // Initialize module:
 unset($MCONF);
 require ('conf.php');
-require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
-$BE_USER->modAccess($MCONF,1);
+require ($GLOBALS['BACK_PATH'].'init.php');
+require ($GLOBALS['BACK_PATH'].'template.php');
+$GLOBALS['BE_USER']->modAccess($MCONF,1);
 
        // Include libraries of various kinds used inside:
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
-$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
 require_once('class.wslib.php');
 require_once('class.wslib_gui.php');
 
@@ -128,8 +128,6 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      void
         */
        function menuConfig()   {
-               global  $LANG;
-
                        // fetches the configuration of the version extension
                $versionExtconf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['version']);
                        // show draft workspace only if enabled in the version extensions config
@@ -140,30 +138,30 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // Menu items:
                $this->MOD_MENU = array(
                        'function' => array(
-                               'publish' => $LANG->getLL('menuitem_review'),
-                               'workspaces' => $LANG->getLL('menuitem_workspaces'),
+                               'publish' => $GLOBALS['LANG']->getLL('menuitem_review'),
+                               'workspaces' => $GLOBALS['LANG']->getLL('menuitem_workspaces'),
                        ),
                        'filter' => array(
-                               1 => $LANG->getLL('filter_drafts'),
-                               2 => $LANG->getLL('filter_archive'),
-                               0 => $LANG->getLL('filter_all'),
+                               1 => $GLOBALS['LANG']->getLL('filter_drafts'),
+                               2 => $GLOBALS['LANG']->getLL('filter_archive'),
+                               0 => $GLOBALS['LANG']->getLL('filter_all'),
                        ),
                        'display' => array(
-                               0 => '['.$LANG->getLL('shortcut_onlineWS').']',
-                               -98 => $LANG->getLL('label_offlineWSes'),
-                               -99 => $LANG->getLL('label_allWSes')
+                               0 => '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']',
+                               -98 => $GLOBALS['LANG']->getLL('label_offlineWSes'),
+                               -99 => $GLOBALS['LANG']->getLL('label_allWSes')
                        ),
                        'diff' => array(
-                               0 => $LANG->getLL('diff_no_diff'),
-                               1 => $LANG->getLL('diff_show_inline'),
-                               2 => $LANG->getLL('diff_show_popup'),
+                               0 => $GLOBALS['LANG']->getLL('diff_no_diff'),
+                               1 => $GLOBALS['LANG']->getLL('diff_show_inline'),
+                               2 => $GLOBALS['LANG']->getLL('diff_show_popup'),
                        ),
                        'expandSubElements' => '',
                );
 
                        // check if draft workspace was enabled, and if the user has access to it
                if ($this->showDraftWorkspace === TRUE && $GLOBALS['BE_USER']->checkWorkspace(array('uid' => -1))) {
-                       $this->MOD_MENU['display'][-1] = '[' . $LANG->getLL('shortcut_offlineWS') . ']';
+                       $this->MOD_MENU['display'][-1] = '[' . $GLOBALS['LANG']->getLL('shortcut_offlineWS') . ']';
                }
 
                        // Add workspaces:
@@ -252,14 +250,13 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      void
         */
        function init() {
-               global $BACK_PATH, $BE_USER;
 
                        // Setting module configuration:
                $this->MCONF = $GLOBALS['MCONF'];
 
                        // Initialize Document Template object:
                $this->doc = t3lib_div::makeInstance('template');
-               $this->doc->backPath = $BACK_PATH;
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('templates/ws.html');
 
                        // JavaScript
@@ -290,7 +287,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $this->doc->getContextMenuCode();
 
                        // Setting publish access permission for workspace:
-               $this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace);
+               $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);
 
                        // Parent initialization:
                parent::init();
@@ -302,16 +299,14 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      void
         */
        function main() {
-               global $LANG, $BE_USER, $BACK_PATH;
-
                // See if we need to switch workspace
                $changeWorkspace = t3lib_div::_GET('changeWorkspace');
                if ($changeWorkspace != '') {
-                       $BE_USER->setWorkspace($changeWorkspace);
-                       $this->content .= $this->doc->wrapScriptTags('top.location.href="' . $BACK_PATH . t3lib_BEfunc::getBackendScript() . '";');
+                       $GLOBALS['BE_USER']->setWorkspace($changeWorkspace);
+                       $this->content .= $this->doc->wrapScriptTags('top.location.href="' . $GLOBALS['BACK_PATH'] . t3lib_BEfunc::getBackendScript() . '";');
                } else {
                                // Starting page:
-                       $this->content.=$this->doc->header($LANG->getLL('title'));
+                       $this->content.=$this->doc->header($GLOBALS['LANG']->getLL('title'));
                        $this->content.=$this->doc->spacer(5);
 
                        // Get usernames and groupnames
@@ -326,11 +321,11 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // Build top menu:
                        $menuItems = array();
                        $menuItems[] = array(
-                               'label' => $LANG->getLL('menuitem_review'),
+                               'label' => $GLOBALS['LANG']->getLL('menuitem_review'),
                                'content' => $this->moduleContent_publish()
                        );
                        $menuItems[] = array(
-                               'label' => $LANG->getLL('menuitem_workspaces'),
+                               'label' => $GLOBALS['LANG']->getLL('menuitem_workspaces'),
                                'content' => $this->moduleContent_workspaceList()
                        );
 
@@ -346,7 +341,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $markers['CONTENT'] = $this->content;
 
                        // Build the <body> for the module
-               $this->content = $this->doc->startPage($LANG->getLL('title'));
+               $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
                $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
                $this->content.= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
@@ -368,8 +363,6 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      array   all available buttons as an assoc. array
         */
        protected function getButtons() {
-               global $LANG, $BACK_PATH;
-
                $buttons = array(
                        'new_record' => '',
                );
@@ -379,7 +372,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // workspace creation link
                if ($GLOBALS['BE_USER']->isAdmin() || 0 != ($GLOBALS['BE_USER']->groupData['workspace_perms'] & 4))     {
                        $buttons['new_record'] = '<a href="' . $newWkspUrl . '">' .
-                                               '<img ' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/add_workspaces.gif') . ' alt="' . $LANG->getLL('img_title_create_new_workspace') . '" id="ver-wl-new-workspace-icon" />' .
+                                               '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/add_workspaces.gif') . ' alt="' . $GLOBALS['LANG']->getLL('img_title_create_new_workspace') . '" id="ver-wl-new-workspace-icon" />' .
                                                '</a>';
                }
                return $buttons;
@@ -407,8 +400,6 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      string          HTML content
         */
        function moduleContent_publish()        {
-               global  $LANG;
-
                        // Initialize:
                $content = '';
                $details = t3lib_div::_GP('details');
@@ -421,7 +412,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                }
                $menu.= t3lib_BEfunc::getFuncMenu(0,'SET[diff]',$this->MOD_SETTINGS['diff'],$this->MOD_MENU['diff']);
                if ($GLOBALS['BE_USER']->workspace!==0) {
-                       $menu.= t3lib_BEfunc::getFuncCheck(0,'SET[expandSubElements]',$this->MOD_SETTINGS['expandSubElements'],'','','id="checkExpandSubElements"').' <label for="checkExpandSubElements">'.$LANG->getLL('label_showsubelements').'</label> ';
+                       $menu .= t3lib_BEfunc::getFuncCheck(0, 'SET[expandSubElements]', $this->MOD_SETTINGS['expandSubElements'], '', '', 'id="checkExpandSubElements"') . ' <label for="checkExpandSubElements">' . $GLOBALS['LANG']->getLL('label_showsubelements') . '</label> ';
                }
 
                        // Create header:
@@ -429,16 +420,16 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $description = '';
                switch($GLOBALS['BE_USER']->workspace)  {
                        case 0:
-                               $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"').'['.$LANG->getLL('shortcut_onlineWS').']';
-                               $description = $LANG->getLL('workspace_description_live');
+                               $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']';
+                               $description = $GLOBALS['LANG']->getLL('workspace_description_live');
                        break;
                        case -1:
-                               $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"').'['.$LANG->getLL('shortcut_offlineWS').']';
-                               $description = $LANG->getLL('workspace_description_draft');
+                               $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $GLOBALS['LANG']->getLL('shortcut_offlineWS') . ']';
+                               $description = $GLOBALS['LANG']->getLL('workspace_description_draft');
                        break;
                        case -99:
-                               $title = $this->doc->icons(3).'[' . $LANG->getLL('shortcut_noWSfound') . ']';
-                               $description = $LANG->getLL('workspace_description_no_access');
+                               $title = $this->doc->icons(3) . '[' . $GLOBALS['LANG']->getLL('shortcut_noWSfound') . ']';
+                               $description = $GLOBALS['LANG']->getLL('workspace_description_no_access');
                        break;
                        default:
                                $title = t3lib_iconWorks::getIconImage('sys_workspace', $GLOBALS['BE_USER']->workspaceRec, $this->doc->backPath, ' align="top"').
@@ -451,14 +442,14 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $actionLinks = '';
                if ($GLOBALS['BE_USER']->workspace!==0) {
                        if ($this->publishAccess)       {
-                               $confirmation = $LANG->JScharCode($LANG->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_publish_workspace_confirmation_1' :  'submit_publish_workspace_confirmation_2'));
-                               $actionLinks.= '<input type="submit" name="_publish" value="' . $LANG->getLL('submit_publish_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=0\';return false"/>';
+                               $confirmation = $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_publish_workspace_confirmation_1' : 'submit_publish_workspace_confirmation_2'));
+                               $actionLinks.= '<input type="submit" name="_publish" value="' . $GLOBALS['LANG']->getLL('submit_publish_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=0\';return false"/>';
                                if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                                       $confirmation = $LANG->JScharCode($LANG->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_swap_workspace_confirmation_1' :  'submit_swap_workspace_confirmation_2'));
-                                       $actionLinks.= '<input type="submit" name="_swap" value="' . $LANG->getLL('submit_swap_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=1\';return false ;" />';
+                                       $confirmation = $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_swap_workspace_confirmation_1' :  'submit_swap_workspace_confirmation_2'));
+                                       $actionLinks.= '<input type="submit" name="_swap" value="' . $GLOBALS['LANG']->getLL('submit_swap_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=1\';return false ;" />';
                                }
                        } else {
-                               $actionLinks.= $this->doc->icons(1) . $LANG->getLL('no_publish_permission');
+                               $actionLinks.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('no_publish_permission');
                        }
 
                                // Preview of workspace link
@@ -478,20 +469,20 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $content = '
                <table border="0" cellpadding="0" cellspacing="0" id="t3-user-ws-wsinfotable" class="t3-table t3-table-info">
                        <tr>
-                               <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_workspace') . '&nbsp;</th>
+                               <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_workspace') . '&nbsp;</th>
                                <td nowrap="nowrap">' . $title . '</td>
                        </tr>
                        <tr>' . ($description ? '
-                               <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_description') . '&nbsp;</td>
+                               <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_description') . '&nbsp;</td>
                                <td>' . $description . '</td>
                        </tr>' : '') . ($GLOBALS['BE_USER']->workspace!=-99 && !$details ? '
                        <tr>
-                               <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_options') . '&nbsp;</td>
+                               <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_options') . '&nbsp;</td>
                                <td>' . $menu . $actionLinks . '</td>
                        </tr>
                        <tr>
-                               <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_status') . '&nbsp;</td>
-                               <td>' . $LANG->getLL('label_access_level') . ' ' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wsAccess['_ACCESS']) . '</td>
+                               <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_status') . '&nbsp;</td>
+                               <td>' . $GLOBALS['LANG']->getLL('label_access_level') . ' ' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wsAccess['_ACCESS']) . '</td>
                        </tr>' : '').'
                </table>
                <br />
@@ -584,8 +575,6 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      string          Generated HTML code
         */
        function workspaceList_displayUserWorkspaceList()       {
-               global  $BACK_PATH, $LANG;
-
                        // table header
                $content = $this->workspaceList_displayUserWorkspaceListHeader();
 
@@ -607,7 +596,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        $content .= '<td>' .
                                                '<a href="javascript:expandCollapse(' . $rowNum . ')">' .
                                                t3lib_iconWorks::getSpriteIcon('actions-view-table-expand', array(
-                                                       'title' => $LANG->getLL('img_title_show_more'),
+                                                       'title' => $GLOBALS['LANG']->getLL('img_title_show_more'),
                                                        'id' => 'spanw1_' . $rowNum
                                                )) .
                                                '</a></td>';
@@ -619,7 +608,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
 
                                // row #1, column #3: current workspace indicator
                        $content .= '<td nowrap="nowrap" style="text-align: center">';  // Mozilla Firefox will attempt wrap due to `width="1"` on topmost column
-                       $content .= (!$currentWksp ? '&nbsp;' : '<img ' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/icon_ok.gif', 'width="18" height="16"') . ' id="wl_' . $rowNum . 'i" border="0" hspace="1" alt="' . $LANG->getLL('img_title_current_workspace') . '" />');
+                       $content .= (!$currentWksp ? '&nbsp;' : '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_ok.gif', 'width="18" height="16"') . ' id="wl_' . $rowNum . 'i" border="0" hspace="1" alt="' . $GLOBALS['LANG']->getLL('img_title_current_workspace') . '" />');
                        $content .= '</td>';
 
                                // row #1, column #4 and 5: title and description
@@ -693,31 +682,29 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      string          Formatted workspace information
         */
        function workspaceList_formatWorkspaceData(&$wksp)      {
-               global $LANG;
-
                $content = '<table cellspacing="0" cellpadding="0" width="100%" class="ver-wl-details-table">' .
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_file_mountpoints') . '</strong></td>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_file_mountpoints') . '</strong></td>' .
                                '<td class="ver-wl-details">' . $this->workspaceList_getFileMountPoints($wksp) . '</td></tr>' .
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_db_mountpoints') . '</strong></td>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_db_mountpoints') . '</strong></td>' .
                                '<td class="ver-wl-details">' . $this->workspaceList_getWebMountPoints($wksp) . '</td></tr>';
                if ($wksp['uid'] > 0) {
                        // Displaying information below makes sence only for custom workspaces
                        $content .=
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_frozen') . '</strong></td>' .
-                               '<td class="ver-wl-details">' . $LANG->getLL($wksp['freeze'] ? 'workspace_list_label_frozen_yes' : 'workspace_list_label_frozen_no') . '</td></tr>' .
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_publish_date') . '</strong></td>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_frozen') . '</strong></td>' .
+                               '<td class="ver-wl-details">' . $GLOBALS['LANG']->getLL($wksp['freeze'] ? 'workspace_list_label_frozen_yes' : 'workspace_list_label_frozen_no') . '</td></tr>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_publish_date') . '</strong></td>' .
                                '<td class="ver-wl-details">' . ($wksp['publish_time'] == 0 ? '&nbsp;&ndash;' : t3lib_BEfunc::datetime($wksp['publish_time'])) . '</td></tr>' .
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_unpublish_date') . '</strong></td>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_unpublish_date') . '</strong></td>' .
                                '<td class="ver-wl-details">' . ($wksp['unpublish_time'] == 0 ? '&nbsp;&ndash;' : t3lib_BEfunc::datetime($wksp['unpublish_time'])) . '</td></tr>' .
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_your_access') . '</strong></td>' .
-                               '<td class="ver-wl-details">' . $LANG->getLL('workspace_list_access_' . $wksp['_ACCESS']) . '</td></tr>' .
-                               '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_workspace_users') . '</strong></td>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_your_access') . '</strong></td>' .
+                               '<td class="ver-wl-details">' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wksp['_ACCESS']) . '</td></tr>' .
+                               '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_users') . '</strong></td>' .
                                '<td class="ver-wl-details">' . $this->workspaceList_getUserList($wksp) . '</td></tr>';
                }
                elseif ($GLOBALS['BE_USER']->isAdmin()) {
                        // show users for draft/live workspace only to admin users
-                       $content .=     '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_workspace_users') . '</strong></td>' .
-                               '<td class="ver-wl-details">' . $this->workspaceList_getUserList($wksp) . '</td></tr>';
+                       $content .= '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_users') . '</strong></td>'
+                               '<td class="ver-wl-details">' . $this->workspaceList_getUserList($wksp) . '</td></tr>';
                }
                $content .= '</table>';
 
@@ -746,13 +733,13 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
 
                        // We need to fetch user's mount point list (including MPS mounted from groups).
                        // This list must not be affects by current user's workspace. It means we cannot use
-                       // $BE_USER->isInWebMount() to check mount points.
+                       // $GLOBALS['BE_USER']->isInWebMount() to check mount points.
                $mountpointList = $GLOBALS['BE_USER']->groupData['webmounts'];
                        // If there are DB mountpoints in the workspace record,
-                       // then only show the ones that are allowed there (and that are in the users' webmounts) 
+                       // then only show the ones that are allowed there (and that are in the users' webmounts)
                if (trim($wksp['db_mountpoints'])) {
                        $userMountpoints = explode(',', $mountpointList);
-                               // now filter the users' to only keep the mountpoints 
+                               // now filter the users' to only keep the mountpoints
                                // that are also in the workspaces' db_mountpoints
                        $workspaceMountpoints = explode(',', $wksp['db_mountpoints']);
                        $filteredMountpoints = array_intersect($userMountpoints, $workspaceMountpoints);
@@ -800,13 +787,13 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
 
                        // We need to fetch user's mount point list (including MPS mounted from groups).
                        // This list must not be affects by current user's workspace. It means we cannot use
-                       // $BE_USER->isInWebMount() to check mount points.
+                       // $GLOBALS['BE_USER']->isInWebMount() to check mount points.
                $mountpointList = implode(',', $GLOBALS['BE_USER']->groupData['filemounts']);
                        // If there are file mountpoints in the workspace record,
-                       // then only show the ones that are allowed there (and that are in the users' file mounts) 
+                       // then only show the ones that are allowed there (and that are in the users' file mounts)
                if (trim($wksp['file_mountpoints'])) {
                        $userMountpoints = explode(',', $mountpointList);
-                               // now filter the users' to only keep the mountpoints 
+                               // now filter the users' to only keep the mountpoints
                                // that are also in the workspaces' file_mountpoints
                        $workspaceMountpoints = explode(',', $wksp['file_mountpoints']);
                        $filteredMountpoints = array_intersect($userMountpoints, $workspaceMountpoints);
@@ -842,15 +829,14 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      string          Generated content
         */
        function workspaceList_displayUserWorkspaceListHeader() {
-               global  $LANG;
                // TODO CSH lables?
                return '<table border="0" cellpadding="0" cellspacing="0" class="workspace-overview">
                        <tr class="t3-row-header">
                                <td width="1">&nbsp;</td>
                                <td width="1">&nbsp;</td>
-                               <td nowrap="nowrap">' . $LANG->getLL('workspace_list_label_current_workspace') . '</td>
-                               <td nowrap="nowrap">' . $LANG->getLL('workspace_list_label_workspace_title') . '</td>
-                               <td nowrap="nowrap">' . $LANG->getLL('workspace_list_label_workspace_description') . '</td>
+                               <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('workspace_list_label_current_workspace') . '</td>
+                               <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_title') . '</td>
+                               <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_description') . '</td>
                        </tr>';
        }
 
@@ -862,17 +848,15 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      string          Generated content
         */
        function workspaceList_getUserList(&$wksp) {
-               global  $LANG;
-
                if ($wksp['uid'] > 0) {
                        // custom workspaces
-                       $content = $this->workspaceList_getUserListWithAccess($wksp['adminusers'], $LANG->getLL('workspace_list_label_owners')); // owners
-                       $content .= $this->workspaceList_getUserListWithAccess($wksp['members'], $LANG->getLL('workspace_list_label_members')); // members
-                       $content .= $this->workspaceList_getUserListWithAccess($wksp['reviewers'], $LANG->getLL('workspace_list_label_reviewers')); // reviewers
+                       $content = $this->workspaceList_getUserListWithAccess($wksp['adminusers'], $GLOBALS['LANG']->getLL('workspace_list_label_owners')); // owners
+                       $content .= $this->workspaceList_getUserListWithAccess($wksp['members'], $GLOBALS['LANG']->getLL('workspace_list_label_members')); // members
+                       $content .= $this->workspaceList_getUserListWithAccess($wksp['reviewers'], $GLOBALS['LANG']->getLL('workspace_list_label_reviewers')); // reviewers
                        if ($content != '')     {
                                $content = '<table cellpadding="0" cellspacing="1" width="100%" class="lrPadding workspace-overview">' . $content . '</table>';
                        } else {
-                               $content = $LANG->getLL($wksp['uid'] > 0 ? 'workspace_list_access_admins_only' : 'workspace_list_access_anyone');
+                               $content = $GLOBALS['LANG']->getLL($wksp['uid'] > 0 ? 'workspace_list_access_admins_only' : 'workspace_list_access_anyone');
                        }
                }
                else {
@@ -989,22 +973,20 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      string          Generated content
         */
        function workspaceList_displayIcons($currentWorkspace, &$wksp)  {
-               global  $BACK_PATH, $LANG;
-
                $content = '';
                        // `edit workspace` button
                if ($this->workspaceList_hasEditAccess($wksp))  {
                                // User can modify workspace parameters, display corresponding link and icon
                        $editUrl = 'workspaceforms.php?action=edit&amp;wkspId=' . $wksp['uid'];
 
-                       $content .= '<a href="' . $editUrl . '" title="'. $LANG->getLL('workspace_list_icon_title_edit_workspace') .'"/>' .
-                                       t3lib_iconWorks::getSpriteIcon('actions-document-open') .
-                       '</a>';
+                       $content .= '<a href="' . $editUrl . '" title="' . $GLOBALS['LANG']->getLL('workspace_list_icon_title_edit_workspace') . '"/>'
+                               . t3lib_iconWorks::getSpriteIcon('actions-document-open')
+                               . '</a>';
                } else {
                                // User can NOT modify workspace parameters, display space
                                // Get only withdth and height from skinning API
                        $content .= '<img src="clear.gif" ' .
-                                       t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/edit2.gif', 'width="11" height="12"', 2) .
+                                       t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"', 2) .
                                        ' border="0" alt="" hspace="1" align="middle" />';
                }
                        // `switch workspace` button
@@ -1012,7 +994,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                // Workspace switching button
                        $content .= '<a href="' .
                                        t3lib_div::getIndpEnv('SCRIPT_NAME') .
-                                       '?changeWorkspace=' . $wksp['uid'] . '" title="'. $LANG->getLL('workspace_list_icon_title_switch_workspace') . '"/>' .
+                                       '?changeWorkspace=' . $wksp['uid'] . '" title="'. $GLOBALS['LANG']->getLL('workspace_list_icon_title_switch_workspace') . '"/>' .
                                        t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace') .
                                        '</a>';
                } else {
@@ -1020,7 +1002,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                //
                                // Here get only width and height from skinning API
                        $content .= '<img src="clear.gif" ' .
-                                       t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/switch.png', 'width="18" height="16"', 2) .
+                                       t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/switch.png', 'width="18" height="16"', 2) .
                                        ' border="0" alt="" hspace="1" align="middle" alt="" />';
                }
                return $content;
@@ -1049,15 +1031,13 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @return      array           Generated record (see <code>sys_workspaces</code> for structure)
         */
        function workspaceList_createFakeWorkspaceRecord($uid)  {
-               global  $BE_USER, $LANG;
-
                $record = array(
                        'uid' => $uid,
                        'pid' => 0,                             // always 0!
                        'tstamp' => 0,                  // does not really matter
                        'deleted' => 0,
-                       'title' => ($uid == 0 ? '['.$LANG->getLL('shortcut_onlineWS').']' : '['.$LANG->getLL('shortcut_offlineWS').']'),
-                       'description' => ($uid == 0 ? $LANG->getLL('shortcut_onlineWS') : $LANG->getLL('shortcut_offlineWS')),
+                       'title' => ($uid == 0 ? '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']' : '[' . $GLOBALS['LANG']->getLL('shortcut_offlineWS').']'),
+                       'description' => ($uid == 0 ? $GLOBALS['LANG']->getLL('shortcut_onlineWS') : $GLOBALS['LANG']->getLL('shortcut_offlineWS')),
                        'adminusers' => '',
                        'members' => '',
                        'reviewers' => '',
@@ -1091,4 +1071,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>
index 0c74e4e..cb36bce 100644 (file)
@@ -75,7 +75,7 @@ require($BACK_PATH.'template.php');
 $BE_USER->modAccess($MCONF,1);
 
 // Include libraries of various kinds used inside:
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
 
 /**
  * Module: Workspace forms for editing/creating workspaces.
@@ -158,8 +158,6 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
         * @return      void
         */
        function main() {
-               global  $LANG;
-
                // see what we have to do and get parameters (call before processing data!!!)
                $this->getModuleParameters();
 
@@ -174,7 +172,7 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                        $this->content .= $this->doc->startPage($title);
                        $this->content .= $this->doc->header($title);
                        $this->content .= $this->doc->spacer(5);
-                       $this->content .= $LANG->getLL($this->isEditAction ? 'edit_workspace_no_permission' : 'create_workspace_no_permission');
+                       $this->content .= $GLOBALS['LANG']->getLL($this->isEditAction ? 'edit_workspace_no_permission' : 'create_workspace_no_permission');
                        $this->content .= $this->doc->spacer(5);
                        $goBack = $GLOBALS['LANG']->getLL('edit_workspace_go_back');
                        $this->content .= t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
@@ -237,8 +235,6 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
         * @return      array   all available buttons as an assoc. array
         */
        protected function getButtons() {
-               global $LANG;
-
                $buttons = array(
                        'close' => '',
                        'save' => '',
@@ -246,11 +242,11 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                );
 
                        // Close,  `n` below is simply to prevent caching
-               $buttons['close'] = '<a href="index.php?n=' . uniqid('wksp') . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>';
+               $buttons['close'] = '<a href="index.php?n=' . uniqid('wksp') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>';
                        // Save
-               $buttons['save'] = '<input type="image" class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" value="_savedok" />';
+               $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) . '" value="_savedok" />';
                        // Save & Close
-               $buttons['save_close'] = '<input type="image" class="c-inputButton" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" value="_saveandclosedok" />';
+               $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) . '" value="_saveandclosedok" />';
 
                return $buttons;
        }
@@ -477,12 +473,13 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
         * @return      string          User record formatted for TCEForms
         */
        function getOwnerUser($uid) {
+               /** @var $loadDB t3lib_loadDBGroup */
                $loadDB = t3lib_div::makeInstance('t3lib_loadDBGroup');
-               // Make sure that `sys_workspace` is in $TCA
+               // Make sure that `sys_workspace` is in $GLOBALS['TCA']
                t3lib_div::loadTCA('sys_workspace');
                // shortcut to `config` of `adminusers` field -- shorter code and better PHP performance
                $config = &$GLOBALS['TCA']['sys_workspace']['columns']['adminusers']['config'];
-               // Notice: $config['MM'] is not set in the current version of $TCA but
+               // Notice: $config['MM'] is not set in the current version of $GLOBALS['TCA'] but
                // we still pass it to ensure compatibility with feature versions!
                $loadDB->start($GLOBALS['BE_USER']->user['uid'], $config['allowed'], $config['MM'], $uid, 'sys_workspace', $config);
                $loadDB->getFromDB();
@@ -503,6 +500,7 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
         * @return      void
         */
        function processData() {
+               /** @var $tce t3lib_TCEmain */
                $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                $tce->stripslashes_values = 0;
 
@@ -542,7 +540,7 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
 
 
        /**
-        * Fixes various <code>$TCA</code> fields for better visual representation of workspace editor.
+        * Fixes various <code>$GLOBALS['TCA']</code> fields for better visual representation of workspace editor.
         *
         * @return      void
         */
@@ -553,7 +551,7 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
 
 
        /**
-        * "Fixes" <code>$TCA</code> to enable blinding for users/groups for non-admin users only.
+        * "Fixes" <code>$GLOBALS['TCA']</code> to enable blinding for users/groups for non-admin users only.
         *
         * @param       string          $fieldName      Name of the field to change
         * @return      void
@@ -601,9 +599,9 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
 class user_SC_mod_user_ws_workspaceForms {
 
        /**
-        * Callback function to blind user and group accounts. Used as <code>itemsProcFunc</code> in <code>$TCA</code>.
+        * Callback function to blind user and group accounts. Used as <code>itemsProcFunc</code> in <code>$GLOBALS['TCA']</code>.
         *
-        * @param       array           $conf   Configuration array. The following elements are set:<ul><li>items - initial set of items (empty in our case)</li><li>config - field config from <code>$TCA</code></li><li>TSconfig - this function name</li><li>table - table name</li><li>row - record row (???)</li><li>field - field name</li></ul>
+        * @param       array           $conf   Configuration array. The following elements are set:<ul><li>items - initial set of items (empty in our case)</li><li>config - field config from <code>$GLOBALS['TCA']</code></li><li>TSconfig - this function name</li><li>table - table name</li><li>row - record row (???)</li><li>field - field name</li></ul>
         * @param       object          $tceforms       <code>t3lib_div::TCEforms</code> object
         * @return      void
         */