[TASK] Fix CGL "InlineCommentWrongStyle" in sysext "version"
[Packages/TYPO3.CMS.git] / typo3 / sysext / version / ws / index.php
index e015d4e..7334922 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
+*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
        // 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,48 +128,46 @@ 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
-               if($versionExtconf['showDraftWorkspace']) {
+               if ($versionExtconf['showDraftWorkspace']) {
                        $this->showDraftWorkspace = TRUE;
                }
 
                        // 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:
                if ($GLOBALS['BE_USER']->workspace===0) {       // Spend time on this only in online workspace because it might take time:
                        $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
-                       foreach($workspaces as $rec)    {
+                       foreach ($workspaces as $rec) {
                                if ($GLOBALS['BE_USER']->checkWorkspace($rec))  {
                                        $this->MOD_MENU['display'][$rec['uid']] = '[' . $rec['uid'] . '] ' . htmlspecialchars($rec['title']);
                                }
@@ -186,17 +184,15 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
        function execute()      {
                $post = t3lib_div::_POST();
 
-#              debug($post);
-
                if ($post['_with_selected_do']) {
                        if (is_array($post['items']) && count($post['items']))  {
                                $cmdArray = array();
 
-                               foreach($post['items'] as $item => $v)  {
+                               foreach ($post['items'] as $item => $v) {
                                        list($table,$uid) = explode(':',$item,2);
 
-                                       if ($GLOBALS['TCA'][$table] && t3lib_div::testInt($uid))        {
-                                               switch($post['_with_selected_do'])      {
+                                       if ($GLOBALS['TCA'][$table] && t3lib_utility_Math::canBeInterpretedAsInteger($uid)) {
+                                               switch ($post['_with_selected_do']) {
                                                        case "stage_-1":
                                                                $cmdArray[$table][$uid]['version']['action'] = 'setStage';
                                                                $cmdArray[$table][$uid]['version']['stageId'] = -1;
@@ -252,14 +248,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 +285,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 +297,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 +319,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 +339,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 +361,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 +370,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 +398,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,24 +410,24 @@ 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:
                $title = '';
                $description = '';
-               switch($GLOBALS['BE_USER']->workspace)  {
+               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,21 +440,21 @@ 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
                        if (t3lib_div::_POST('_previewLink'))   {
                                $ttlHours = intval($GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours'));
                                $ttlHours = ($ttlHours ? $ttlHours : 24*2);
-                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . 'index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'],60*60*$ttlHours,$GLOBALS['BE_USER']->workspace).'&id='.intval($GLOBALS['BE_USER']->workspaceRec['db_mountpoints']);
+                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . '/index.php?ADMCMD_prev=' . t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], 60*60*$ttlHours, $GLOBALS['BE_USER']->workspace) . '&id=' . intval($GLOBALS['BE_USER']->workspaceRec['db_mountpoints']);
                                $actionLinks.= '<br />Any user can browse the workspace frontend using this link for the next ' . $ttlHours . ' hours (does not require backend login):<br /><br /><a target="_blank" href="' . htmlspecialchars($previewUrl) . '">' . $previewUrl . '</a>';
                        } else {
                                $actionLinks.= '<input type="submit" name="_previewLink" value="Generate Workspace Preview Link" />';
@@ -478,20 +467,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 />
@@ -541,7 +530,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $wslibGuiObj = t3lib_div::makeInstance('wslib_gui');
                $wslibGuiObj->diff = $this->MOD_SETTINGS['diff'];
                $wslibGuiObj->expandSubElements = $this->MOD_SETTINGS['expandSubElements'];
-               $wslibGuiObj->alwaysDisplayHeader = true;
+               $wslibGuiObj->alwaysDisplayHeader = TRUE;
                return $wslibGuiObj->getWorkspaceOverview($this->doc, $wsid, $filter);
        }
 
@@ -584,8 +573,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 +594,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 +606,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
@@ -662,21 +649,21 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // Live
                $wksp = $this->workspaceList_createFakeWorkspaceRecord(0);
                $wksp = $GLOBALS['BE_USER']->checkWorkspace($wksp);
-               if (false !== $wksp) {
+               if (FALSE !== $wksp) {
                        $availableWorkspaces[] = $wksp;
                }
 
                        // Draft
                $wksp = $this->workspaceList_createFakeWorkspaceRecord(-1);
                $wksp = $GLOBALS['BE_USER']->checkWorkspace($wksp);
-               if (false !== $wksp) {
+               if (FALSE !== $wksp) {
                        $availableWorkspaces[] = $wksp;
                }
 
                        // Custom
-               foreach($workspaces as $rec)    {
+               foreach ($workspaces as $rec) {
                                // see if user can access this workspace in any way
-                       if (false !== ($result = $GLOBALS['BE_USER']->checkWorkspace($rec)))    {
+                       if (FALSE !== ($result = $GLOBALS['BE_USER']->checkWorkspace($rec)))    {
                                $availableWorkspaces[] = $result;       // `$result` contains `$rec` plus access type through '_ACCESS' key
                        }
                }
@@ -693,31 +680,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>';
                }
-               else if ($GLOBALS['BE_USER']->isAdmin()) {
+               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>';
 
@@ -738,7 +723,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                if ($wksp['uid'] == -1) {
                                // draft workspace
                        return $GLOBALS['LANG']->getLL('workspace_list_db_mount_point_draft');
-               } else if ($wksp['uid'] == 0) {
+               } elseif ($wksp['uid'] == 0) {
                                // live workspace
                        return $GLOBALS['LANG']->getLL('workspace_list_db_mount_point_live');
                }
@@ -746,13 +731,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);
@@ -792,7 +777,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                if ($wksp['uid'] == -1) {
                                // draft workspace - none!
                        return $GLOBALS['LANG']->getLL('workspace_list_file_mount_point_draft');
-               } else if ($wksp['uid'] == 0) {
+               } elseif ($wksp['uid'] == 0) {
                                // live workspace
                        return $GLOBALS['LANG']->getLL('workspace_list_file_mount_point_live');
                }
@@ -800,13 +785,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 +827,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 +846,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 {
@@ -922,7 +904,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
 
                                // get user names and sort
                        $regExp = '/^(be_[^_]+)_(\d+)$/';
-                       $groups = false;
+                       $groups = FALSE;
                        foreach ($userIDs as $userUID)  {
                                $id = $userUID;
 
@@ -945,7 +927,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                        }
                                        else {
                                                // group
-                                               if (false === $groups) {
+                                               if (FALSE === $groups) {
                                                        $groups = t3lib_BEfunc::getGroupNames();
                                                }
                                                $content_array[] = $this->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage($table, $groups[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"'), $table, $id, 2) .
@@ -984,27 +966,25 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
        /**
         * Creates a list of icons for workspace.
         *
-        * @param       boolean         <code>true</code> if current workspace
+        * @param       boolean         <code>TRUE</code> if current workspace
         * @param       array           Workspace record
         * @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 +992,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 +1000,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;
@@ -1034,7 +1014,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * <code>_ACCESS</code> attribute of the workspace.
         *
         * @param       array           Workspace record
-        * @return      boolean         <code>true</code> if user can modify workspace parameters
+        * @return      boolean         <code>TRUE</code> if user can modify workspace parameters
         */
        function workspaceList_hasEditAccess(&$wksp)    {
                $access = &$wksp['_ACCESS'];
@@ -1049,15 +1029,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' => '',
@@ -1078,8 +1056,8 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
 }
 
 
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/index.php'])    {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/index.php']);
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/index.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/index.php']);
 }
 
 
@@ -1091,4 +1069,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>