Merge "[BUGFIX] Missing behaviour of options.workspaces.changeStageMode"
authorTolleiv Nietsch <info@tolleiv.de>
Fri, 8 Jul 2011 18:40:58 +0000 (20:40 +0200)
committerGerrit Code Review <gerrit@review.typo3.org>
Fri, 8 Jul 2011 18:40:58 +0000 (20:40 +0200)
22 files changed:
typo3/sysext/version/Resources/Private/Language/locallang_emails.xlf [new file with mode: 0644]
typo3/sysext/version/Resources/Private/Language/locallang_emails.xml [deleted file]
typo3/sysext/version/class.tx_version_cm1.php
typo3/sysext/version/class.tx_version_tcemain.php
typo3/sysext/version/cli/conf.php [deleted file]
typo3/sysext/version/cm1/index.php [changed mode: 0755->0644]
typo3/sysext/version/ext_conf_template.txt [deleted file]
typo3/sysext/version/ext_tables.php [changed mode: 0755->0644]
typo3/sysext/version/locallang.xlf [new file with mode: 0644]
typo3/sysext/version/locallang.xml [deleted file]
typo3/sysext/version/ws/class.wslib.php
typo3/sysext/version/ws/class.wslib_gui.php [deleted file]
typo3/sysext/version/ws/clear.gif [deleted file]
typo3/sysext/version/ws/cli/conf.php [deleted file]
typo3/sysext/version/ws/conf.php [deleted file]
typo3/sysext/version/ws/index.php [deleted file]
typo3/sysext/version/ws/progress.gif [deleted file]
typo3/sysext/version/ws/publish.php [deleted file]
typo3/sysext/version/ws/sys_workspace.gif [deleted file]
typo3/sysext/version/ws/sys_workspace.png [deleted file]
typo3/sysext/version/ws/workspaceforms.php [deleted file]
typo3/sysext/version/ws/wsol_preview.php [deleted file]

diff --git a/typo3/sysext/version/Resources/Private/Language/locallang_emails.xlf b/typo3/sysext/version/Resources/Private/Language/locallang_emails.xlf
new file mode 100644 (file)
index 0000000..759f79a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+  <file source-language="EN" target-language="vn" datatype="plaintext" original="messages" date="Tue Jun  7 20:28:57 UTC 2011" product-name="version">
+    <header/>
+    <body>
+      <trans-unit id="subject">
+        <source>TYPO3 Workspace Note: Stage Change for ###ELEMENT_NAME###</source>
+        <target approved="yes">TYPO3 Workspace Note: Stage Change for ###ELEMENT_NAME###</target>
+      </trans-unit>
+      <trans-unit id="message">
+        <source>At the TYPO3 site "###SITE_NAME###" (###SITE_URL###)
+in workspace "###WORKSPACE_TITLE###" (###WORKSPACE_UID###)
+the stage has changed for the element(s) "###RECORD_TITLE###" (###ELEMENT_NAME###) at location "###RECORD_PATH###" in the page tree:
+
+=&gt; ###NEXT_STAGE###
+
+User Comment:
+"###COMMENT###"
+
+State was changed by ###USER_FULLNAME### (username: ###USER_USERNAME###)</source>
+        <target approved="yes">At the TYPO3 site "###SITE_NAME###" (###SITE_URL###)
+in workspace "###WORKSPACE_TITLE###" (###WORKSPACE_UID###)
+the stage has changed for the element(s) "###RECORD_TITLE###" (###ELEMENT_NAME###) at location "###RECORD_PATH###" in the page tree:
+
+=&gt; ###NEXT_STAGE###
+
+User Comment:
+"###COMMENT###"
+
+State was changed by ###USER_FULLNAME### (username: ###USER_USERNAME###)</target>
+      </trans-unit>
+    </body>
+  </file>
+</xliff>
diff --git a/typo3/sysext/version/Resources/Private/Language/locallang_emails.xml b/typo3/sysext/version/Resources/Private/Language/locallang_emails.xml
deleted file mode 100644 (file)
index f4f49ee..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<T3locallang>
-       <meta type="array">
-               <description>Module labels</description>
-               <type>module</type>
-       </meta>
-       <data type="array">
-               <languageKey index="default" type="array">
-                       <label index="subject">TYPO3 Workspace Note: Stage Change for ###ELEMENT_NAME###</label>
-                       <label index="message">At the TYPO3 site "###SITE_NAME###" (###SITE_URL###)
-in workspace "###WORKSPACE_TITLE###" (###WORKSPACE_UID###)
-the stage has changed for the element(s) "###RECORD_TITLE###" (###ELEMENT_NAME###) at location "###RECORD_PATH###" in the page tree:
-
-=> ###NEXT_STAGE###
-
-User Comment:
-"###COMMENT###"
-
-State was changed by ###USER_FULLNAME### (username: ###USER_USERNAME###)</label>
-               </languageKey>
-       </data>
-</T3locallang>
index 881b570..d6b283d 100755 (executable)
  *
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   54: class tx_version_cm1
- *   65:     function main(&$backRef,$menuItems,$table,$uid)
- *  111:     function includeLL()
- *
- * TOTAL FUNCTIONS: 2
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
 
 
 
@@ -63,13 +50,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 +106,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
+?>
diff --git a/typo3/sysext/version/cli/conf.php b/typo3/sysext/version/cli/conf.php
deleted file mode 100644 (file)
index 9bd9650..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
-// DO NOT REMOVE OR CHANGE THESE 3 LINES:
-define('TYPO3_MOD_PATH', 'sysext/version/ws/cli/');
-$BACK_PATH = '../../../../';
-$MCONF['name'] = '_CLI_user_ws';
-
-?>
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index bfcf81f..8911de3
  * Versioning module
  *
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *  102: class tx_version_cm1 extends t3lib_SCbase
- *
- *              SECTION: Standard module initialization
- *  138:     function menuConfig()
- *  175:     function main()
- *  236:     function jumpToUrl(URL)
- *  296:     function printContent()
- *
- *              SECTION: Versioning management
- *  322:     function versioningMgm()
- *  485:     function pageSubContent($pid,$c=0)
- *  539:     function lookForOwnVersions($table,$uid)
- *  556:     function adminLinks($table,$row)
- *
- *              SECTION: Workspace management
- *  628:     function workspaceMgm()
- *  688:     function displayWorkspaceOverview()
- *  758:     function displayWorkspaceOverview_list($pArray)
- *  923:     function displayWorkspaceOverview_setInPageArray(&$pArray,$table,$row)
- *  936:     function displayWorkspaceOverview_allStageCmd()
- *
- *              SECTION: Helper functions (REDUNDANT FROM user/ws/index.php - someone could refactor this...)
- *  986:     function formatVerId($verId)
- *  996:     function formatWorkspace($wsid)
- * 1023:     function formatCount($count)
- * 1050:     function versionsInOtherWS($table,$uid)
- * 1080:     function showStageChangeLog($table,$id,$stageCommands)
- * 1129:     function subElements($uid,$treeLevel,$origId=0)
- * 1232:     function subElements_getNonPageRecords($tN, $uid, &$recList)
- * 1262:     function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)
- * 1331:     function markupNewOriginals()
- * 1353:     function createDiffView($table, $diff_1_record, $diff_2_record)
- * 1470:     function displayWorkspaceOverview_stageCmd($table,&$rec_off)
- * 1557:     function displayWorkspaceOverview_commandLinks($table,&$rec_on,&$rec_off,$vType)
- * 1627:     function displayWorkspaceOverview_commandLinksSub($table,$rec,$origId)
- *
- *              SECTION: Processing
- * 1683:     function publishAction()
- *
- * TOTAL FUNCTIONS: 27
- * (This index is automatically created/updated by the extension "extdeveval")
- *
  */
 
 
@@ -81,7 +33,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');
@@ -121,12 +73,6 @@ class tx_version_cm1 extends t3lib_SCbase {
        var $be_user_Array = array();
        var $stageIndex = array();
        var $recIndex = array();
-       protected $showDraftWorkspace = FALSE; // Determines whether to show the dummy draft workspace
-
-
-
-
-
 
        /*********************************
         *
@@ -141,42 +87,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         */
        function menuConfig()   {
 
-                       // 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']) {
-                       $this->showDraftWorkspace = TRUE;
-               }
-
-                       // Menu items:
-               $this->MOD_MENU = array(
-                       'filter' => array(
-                               1 => $GLOBALS['LANG']->getLL('filter_drafts'),
-                               2 => $GLOBALS['LANG']->getLL('filter_archive'),
-                               0 => $GLOBALS['LANG']->getLL('filter_all'),
-                       ),
-                       'display' => array(
-                               0 => $GLOBALS['LANG']->getLL('liveWorkspace'),
-                               -98 => $GLOBALS['LANG']->getLL('draftWorkspaces'),
-                               -99 => $GLOBALS['LANG']->getLL('filter_all'),
-                       ),
-                       'diff' => ''
-               );
-
-               if($this->showDraftWorkspace === TRUE) {
-                       $this->MOD_MENU['display'][-1] = $GLOBALS['LANG']->getLL('defaultDraft');
-               }
-
-                       // Add workspaces (only if the live workspace is currently active):
-               if (t3lib_extMgm::isLoaded('workspaces') && $GLOBALS['BE_USER']->workspace ===0 ) {
-                       $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)    {
-                               if ($GLOBALS['BE_USER']->checkWorkspace($rec))  {
-                                       $this->MOD_MENU['display'][$rec['uid']] = '['.$rec['uid'].'] '.$rec['title'];
-                               }
-                       }
-               }
-
                        // CLEANSE SETTINGS
                $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], 'ses');
        }
@@ -187,8 +97,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 +112,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; }
@@ -218,13 +126,8 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                        // Getting input data:
                $this->id = intval(t3lib_div::_GP('id'));               // Page id. If set, indicates activation from Web>Versioning module
-               if (!$this->id) {
-                       $this->uid = intval(t3lib_div::_GP('uid'));             // Record uid. Goes with table name to indicate specific record
-                       $this->table = t3lib_div::_GP('table');                 // Record table. Goes with uid to indicate specific record
-               } else {
-                       $this->uid = $this->id;
-                       $this->table = 'pages';
-               }
+               $this->uid = intval(t3lib_div::_GP('uid'));             // Record uid. Goes with table name to indicate specific record
+               $this->table = t3lib_div::_GP('table');                 // Record table. Goes with uid to indicate specific record
                $this->details = t3lib_div::_GP('details');             // Page id. If set, indicates activation from Web>Versioning module
                $this->diffOnly = t3lib_div::_GP('diffOnly');           // Flag. If set, shows only the offline version and with diff-view
 
@@ -243,7 +146,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->id)  {
                        $this->doc->form='<form action="" method="post">';
                        $this->uid = $record['uid'];    // Might have changed if new live record was found!
 
@@ -252,7 +155,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,18 +184,14 @@ 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)  {
-                                       $this->workspaceMgm();
-                               } else {
-                                       $this->versioningMgm();
-                               }
+                               $this->versioningMgm();
                        }
 
                        $this->content.=$this->doc->spacer(10);
@@ -301,18 +200,17 @@ class tx_version_cm1 extends t3lib_SCbase {
                        $docHeaderButtons = $this->getButtons();
                        $markers['CSH'] = $docHeaderButtons['csh'];
                        $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
-                       $markers['WS_MENU'] = $this->workspaceMenu();
                        $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 +231,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 +240,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 +283,6 @@ class tx_version_cm1 extends t3lib_SCbase {
         * @return      void
         */
        function versioningMgm()        {
-               global $TCA;
 
                        // Diffing:
                $diff_1 = t3lib_div::_POST('diff_1');
@@ -411,7 +306,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 +449,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 +507,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 +522,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 +538,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') .
@@ -671,1170 +569,6 @@ class tx_version_cm1 extends t3lib_SCbase {
 
                return $adminLink;
        }
-
-
-
-
-
-
-
-
-
-
-
-       /******************************
-        *
-        * Workspace management
-        *
-        ******************************/
-
-       /**
-        * Management of workspace for page ID
-        * Called when $this->id is set.
-        *
-        * @return      void
-        */
-       function workspaceMgm() {
-
-                       // Perform workspace publishing action if buttons are pressed:
-               $errors = $this->publishAction();
-
-                       // Generate workspace overview:
-               $WSoverview = $this->displayWorkspaceOverview();
-
-                       // Buttons for publish / swap:
-               $actionLinks = '<br />';
-               if ($GLOBALS['BE_USER']->workspace!==0) {
-                       if ($this->publishAccess)       {
-                               $actionLinks.= '<input type="submit" name="_publish" value="' . $GLOBALS['LANG']->getLL('publishPage') . '" onclick="return confirm(\'' . sprintf($GLOBALS['LANG']->getLL('publishPageQuestion'), $GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1 ? $GLOBALS['LANG']->getLL('publishPageQuestionStage') : '') . '\');"/>';
-                               if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                                       $actionLinks.= '<input type="submit" name="_swap" value="' . $GLOBALS['LANG']->getLL('swapPage') . '" onclick="return confirm(\'' . sprintf($GLOBALS['LANG']->getLL('swapPageQuestion'), $GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1 ? $GLOBALS['LANG']->getLL('publishPageQuestionStage') : '') . '\');" />';
-                               }
-                       } else {
-                               $actionLinks.= $this->doc->icons(1) . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:no_publish_permission');
-                       }
-               }
-
-               $actionLinks.= '<input type="submit" name="_" value="' . $GLOBALS['LANG']->getLL('refresh') . '" />';
-               $actionLinks.= '<input type="submit" name="_previewLink" value="' . $GLOBALS['LANG']->getLL('previewLink') . '" />';
-               $actionLinks.= '<input type="checkbox" class="checkbox" name="_previewLink_wholeWorkspace" id="_previewLink_wholeWorkspace" value="1" /><label for="_previewLink_wholeWorkspace">' . $GLOBALS['LANG']->getLL('allowPreviewOfWholeWorkspace') . '</label>';
-               $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);
-               }
-
-               if (t3lib_div::_POST('_previewLink'))   {
-                       $ttlHours = intval($GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours'));
-                       $ttlHours = ($ttlHours ? $ttlHours : 24*2);
-
-                       if (t3lib_div::_POST('_previewLink_wholeWorkspace'))    {
-                               $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($this->id);
-                       } else {
-                               $params = 'id='.$this->id.'&ADMCMD_previewWS='.$GLOBALS['BE_USER']->workspace;
-                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . '/index.php?ADMCMD_prev=' . t3lib_BEfunc::compilePreviewKeyword($params, $GLOBALS['BE_USER']->user['uid'], 60*60*$ttlHours);
-                       }
-                       $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('previewUrl'), sprintf($GLOBALS['LANG']->getLL('previewInstruction'), $ttlHours) . '<br /><br /><a target="_blank" href="' . htmlspecialchars($previewUrl) . '">' . $previewUrl . '</a>', 0, 1);
-               }
-
-                       // Output overview content:
-               $this->content.= $this->doc->spacer(15);
-               $this->content.= $this->doc->section($this->details ? $GLOBALS['LANG']->getLL('versionDetails') : $GLOBALS['LANG']->getLL('wsManagement'), $WSoverview,0,1);
-
-       }
-
-       function workspaceMenu() {
-               if($this->id) {
-                       $menu = '';
-                       if ($GLOBALS['BE_USER']->workspace===0) {
-                               $menu.= t3lib_BEfunc::getFuncMenu($this->id,'SET[filter]',$this->MOD_SETTINGS['filter'],$this->MOD_MENU['filter']);
-                               $menu.= t3lib_BEfunc::getFuncMenu($this->id,'SET[display]',$this->MOD_SETTINGS['display'],$this->MOD_MENU['display']);
-                       }
-                       if (!$this->details && $GLOBALS['BE_USER']->workspace && !$this->diffOnly)      {
-                               $menu.= t3lib_BEfunc::getFuncCheck($this->id,'SET[diff]',$this->MOD_SETTINGS['diff'],'','','id="checkDiff"').' <label for="checkDiff">' . $GLOBALS['LANG']->getLL('showDiffView') . '</label>';
-                       }
-
-                       if ($menu)      {
-                               return $menu;
-                       }
-               }
-       }
-
-       /**
-        * Rendering the overview of versions in the current workspace
-        *
-        * @return      string          HTML (table)
-        * @see ws/index.php for sister function!
-        */
-       function displayWorkspaceOverview()     {
-
-                       // Initialize variables:
-               $this->showWorkspaceCol = $GLOBALS['BE_USER']->workspace===0 && $this->MOD_SETTINGS['display']<=-98;
-
-                       // Get usernames and groupnames
-               $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
-               $groupArray = array_keys($be_group_Array);
-               $this->be_user_Array = t3lib_BEfunc::getUserNames();
-               if (!$GLOBALS['BE_USER']->isAdmin())            $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array,$groupArray,1);
-
-                       // Initialize Workspace ID and filter-value:
-               if ($GLOBALS['BE_USER']->workspace===0) {
-                       $wsid = $this->details ? -99 : $this->MOD_SETTINGS['display'];          // Set wsid to the value from the menu (displaying content of other workspaces)
-                       $filter = $this->details ? 0 : $this->MOD_SETTINGS['filter'];
-               } else {
-                       $wsid = $GLOBALS['BE_USER']->workspace;
-                       $filter = 0;
-               }
-
-                       // Initialize workspace object and request all pending versions:
-               $wslibObj = t3lib_div::makeInstance('wslib');
-
-                       // Selecting ALL versions belonging to the workspace:
-               $versions = $wslibObj->selectVersionsInWorkspace($wsid, $filter, -99, $this->uid);      // $this->uid is the page id of LIVE record.
-
-                       // Traverse versions and build page-display array:
-               $pArray = array();
-               foreach($versions as $table => $records)        {
-                       foreach($records as $rec)       {
-                               $pageIdField = $table==='pages' ? 't3ver_oid' : 'realpid';
-                               $this->displayWorkspaceOverview_setInPageArray(
-                                       $pArray,
-                                       $table,
-                                       $rec
-                               );
-                       }
-               }
-
-                       // Make header of overview:
-               $tableRows = array();
-               if (count($pArray))     {
-                       $tableRows[] = '
-                               <tr class="bgColor5 tableheader">
-                                       '.($this->diffOnly?'':'<td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('liveVersion') . '</td>').'
-                                       <td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('wsVersions') . '</td>
-                                       <td nowrap="nowrap"'.($this->diffOnly?' colspan="2"':' colspan="4"').'>' . $GLOBALS['LANG']->getLL('controls') . '</td>
-                               </tr>';
-
-                               // Add lines from overview:
-                       $tableRows = array_merge($tableRows, $this->displayWorkspaceOverview_list($pArray));
-
-                       $table = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding workspace-overview">'.implode('',$tableRows).'</table>';
-               } else $table = '';
-
-               $returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
-               $linkBack = t3lib_div::_GP('returnUrl') ? '<a href="' . htmlspecialchars($returnUrl) . '" class="typo3-goBack">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . $GLOBALS['LANG']->getLL('goBack', TRUE) .
-                       '</a><br /><br />' : '';
-               $resetDiffOnly = $this->diffOnly ? '<a href="index.php?id=' . intval($this->id) . '" class="typo3-goBack">' . $GLOBALS['LANG']->getLL('showAllInformation') . '</a><br /><br />' : '';
-
-               $versionSelector = $GLOBALS['BE_USER']->workspace ? $this->doc->getVersionSelector($this->id) : '';
-
-               return $versionSelector.$linkBack.$resetDiffOnly.$table.$this->markupNewOriginals();
-       }
-
-       /**
-        * Rendering the content for the publish / review overview:
-        * (Made for internal recursive calling)
-        *
-        * @param       array           Storage of the elements to display (see displayWorkspaceOverview() / displayWorkspaceOverview_setInPageArray())
-        * @return      array           Table rows, see displayWorkspaceOverview()
-        */
-       function displayWorkspaceOverview_list($pArray) {
-               global $TCA;
-
-                       // If there ARE elements on this level, print them:
-               $warnAboutVersions_nonPages = FALSE;
-               $warnAboutVersions_page = FALSE;
-               if (is_array($pArray))  {
-                       foreach($pArray as $table => $oidArray) {
-                               foreach($oidArray as $oid => $recs)     {
-
-                                               // Get CURRENT online record and icon based on "t3ver_oid":
-                                       $rec_on = t3lib_BEfunc::getRecord($table,$oid);
-                                       $icon = t3lib_iconWorks::getSpriteIconForRecord($table, $rec_on, array('title' => t3lib_BEfunc::getRecordIconAltText($rec_on,$table)));
-                                       if ($GLOBALS['BE_USER']->workspace===0) {       // Only edit online records if in ONLINE workspace:
-                                               $icon = $this->doc->wrapClickMenuOnIcon($icon, $table, $rec_on['uid'], 1, '', '+edit,view,info,delete');
-                                       }
-
-                                               // Online version display:
-                                               // Create the main cells which will span over the number of versions there is.
-                                       $verLinkUrl = $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).
-                                               ($verLinkUrl ? '</a>' : '');
-                                       $mainCell_rowSpan = count($recs)>1 ? ' rowspan="'.count($recs).'"' : '';
-                                       $mainCell = '
-                                                               <td align="center"'.$mainCell_rowSpan.'>'.$this->formatVerId($rec_on['t3ver_id']).'</td>
-                                                               <td nowrap="nowrap"'.$mainCell_rowSpan.'>'.
-                                                                       $origElement.
-                                                                       '###SUB_ELEMENTS###'.   // For substitution with sub-elements, if any.
-                                                               '</td>';
-
-                                               // Offline versions display:
-                                               // Traverse the versions of the element
-                                       foreach($recs as $rec)  {
-
-                                                       // Get the offline version record and icon:
-                                               $rec_off = t3lib_BEfunc::getRecord($table,$rec['uid']);
-
-                                               // Prepare swap-mode values:
-                                               if ($table==='pages' && $rec_off['t3ver_swapmode']!=-1) {
-                                                       if ($rec_off['t3ver_swapmode']>0)       {
-                                                               $vType = 'branch';
-                                                       } else {
-                                                               $vType = 'page';
-                                                       }
-                                               } else {
-                                                       $vType = 'element';
-                                               }
-
-                                               // Get icon
-                                               $icon = t3lib_iconWorks::getSpriteIconForRecord($table, $rec_off, array('title' => t3lib_BEfunc::getRecordIconAltText($rec_off, $table)));
-                                               $tempUid = ($table != 'pages' || $vType==='branch' || $GLOBALS['BE_USER']->workspace===0 ? $rec_off['uid'] : $rec_on['uid']);
-                                               $icon = $this->doc->wrapClickMenuOnIcon($icon, $table, $tempUid, 1, '', '+edit,' . ($table == 'pages' ? 'view,info,' : '') . 'delete');
-
-                                                       // Prepare diff-code:
-                                               if ($this->MOD_SETTINGS['diff'] || $this->diffOnly)     {
-                                                       $diffCode = '';
-                                                       list($diffHTML,$diffPct) = $this->createDiffView($table, $rec_off, $rec_on);
-                                                       if ($rec_on['t3ver_state']==1)  {       // New record:
-                                                               $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('newElement') . '<br />';
-                                                               $diffCode.= $diffHTML;
-                                                       } elseif ($rec_off['t3ver_state']==2)   {
-                                                               $diffCode.= $this->doc->icons(2) . $GLOBALS['LANG']->getLL('deletedElement') . '<br />';
-                                                       } elseif ($rec_on['t3ver_state']==3)    {
-                                                               $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('moveToPlaceholder') . '<br />';
-                                                       } elseif ($rec_off['t3ver_state']==4)   {
-                                                               $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('moveToPointer') . '<br />';
-                                                       } else {
-                                                               $diffCode.= ($diffPct<0 ? $GLOBALS['LANG']->getLL('notAvailable') : ($diffPct ? $diffPct . '% ' . $GLOBALS['LANG']->getLL('change') : ''));
-                                                               $diffCode.= $diffHTML;
-                                                       }
-                                               } else $diffCode = '';
-
-                                               switch($vType) {
-                                                       case 'element':
-                                                               $swapLabel = $GLOBALS['LANG']->getLL('element');
-                                                               $swapClass = 'ver-element';
-                                                               $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 = $GLOBALS['LANG']->getLL('page');
-                                                               $swapClass = 'ver-page';
-                                                               $warnAboutVersions_page = !$this->showWorkspaceCol;             // This value is TRUE only if multiple workspaces are shown and we need the opposite here.
-                                                       break;
-                                                       case 'branch':
-                                                               $swapLabel = $GLOBALS['LANG']->getLL('branch');
-                                                               $swapClass = 'ver-branch';
-                                                       break;
-                                               }
-
-                                                       // Modify main cell based on first version shown:
-                                               $subElements = array();
-                                               if ($table==='pages' && $rec_off['t3ver_swapmode']!=-1 && $mainCell)    {       // For "Page" and "Branch" swap modes where $mainCell is still carrying content (only first version)
-                                                       $subElements['on'] = $this->subElements($rec_on['uid'], $rec_off['t3ver_swapmode']);
-                                                       $subElements['off'] = $this->subElements($rec_off['uid'],$rec_off['t3ver_swapmode'],$rec_on['uid']);
-                                               }
-                                               $mainCell = str_replace('###SUB_ELEMENTS###', $subElements['on'], $mainCell);
-
-                                                       // Create version element:
-                                               $versionsInOtherWS = $this->versionsInOtherWS($table, $rec_on['uid']);
-                                               $versionsInOtherWSWarning = $versionsInOtherWS && $GLOBALS['BE_USER']->workspace !== 0 ? '<br />' . $this->doc->icons(2) . $GLOBALS['LANG']->getLL('otherVersions') . $versionsInOtherWS : '';
-                                               $multipleWarning = (!$mainCell && $GLOBALS['BE_USER']->workspace !== 0 ? '<br />' . $this->doc->icons(3) . '<strong>' . $GLOBALS['LANG']->getLL('multipleVersions') . '</strong>' : '');
-                                               $verWarning = $warnAboutVersions || ($warnAboutVersions_nonPages && $GLOBALS['TCA'][$table]['ctrl']['versioning_followPages']) ? '<br />' . $this->doc->icons(3) . '<strong>' . $GLOBALS['LANG']->getLL('versionInVersion') . '</strong>' : '';
-                                               $verElement = $icon.
-                                                       (!$this->details ? '<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($this->REQUEST_URI)).'">' : '').
-                                                       t3lib_BEfunc::getRecordTitle($table,$rec_off,TRUE).
-                                                       (!$this->details ? '</a>' : '').
-                                                       $versionsInOtherWSWarning.
-                                                       $multipleWarning.
-                                                       $verWarning;
-
-                                               $ctrlTable = '
-                                                               <td nowrap="nowrap">'.$this->showStageChangeLog($table,$rec_off['uid'],$this->displayWorkspaceOverview_stageCmd($table,$rec_off)).'</td>
-                                                               <td nowrap="nowrap" class="'.$swapClass.'">'.
-                                                                       $this->displayWorkspaceOverview_commandLinks($table,$rec_on,$rec_off,$vType).
-                                                                       htmlspecialchars($swapLabel).
-                                                                       '&nbsp;&nbsp;</td>
-                                                               '.(!$this->diffOnly?'<td nowrap="nowrap"><strong>' . $GLOBALS['LANG']->getLL('lifecycle')  . ':</strong> '.htmlspecialchars($this->formatCount($rec_off['t3ver_count'])).'</td>'.               // Lifecycle
-                                                                       ($this->showWorkspaceCol ? '
-                                                               <td nowrap="nowrap">&nbsp;&nbsp;<strong>' . $GLOBALS['LANG']->getLL('workspace')  . ':</strong> '.htmlspecialchars($this->formatWorkspace($rec_off['t3ver_wsid'])).'</td>' : ''):'');
-
-                                               if ($diffCode)  {
-                                                       $verElement = $verElement.'
-                                                       <br /><strong>' . $GLOBALS['LANG']->getLL('diffToLiveElement') . '</strong>
-                                                       <table border="0" cellpadding="0" cellspacing="0" class="ver-verElement">
-                                                               <tr>
-                                                                       <td class="c-diffCell">'.$diffCode.'</td>
-                                                               </tr>
-                                                       </table>';
-                                               }
-
-
-                                                       // Create version cell:
-                                               $verCell = '
-                                                               <td align="center">'.$this->formatVerId($rec_off['t3ver_id']).'</td>
-                                                               <td nowrap="nowrap">'.
-                                                                       $verElement.
-                                                                       $subElements['off'].
-                                                                       '</td>
-                                                               ';
-
-                                                       // Compile table row:
-                                               $tableRows[] = '
-                                                       <tr class="bgColor4">
-                                                               '.
-                                                               ($this->diffOnly?'':$mainCell).
-                                                               $verCell.
-                                                               $ctrlTable.
-                                                               '
-                                                       </tr>';
-
-                                                       // Reset the main cell:
-                                               $mainCell = '';
-
-                                       }
-                               }
-                       }
-               }
-
-               return $tableRows;
-       }
-
-       /**
-        * Building up of the $pArray
-        * (Internal)
-        *
-        * @param       array           Array that is built up with the page tree structure
-        * @param       string          Table name
-        * @param       array           Table row
-        * @return      void            $pArray is passed by reference and modified internally
-        */
-       function displayWorkspaceOverview_setInPageArray(&$pArray,$table,$row)  {
-               if (!$this->details || $this->details==$table.':'.$row['uid'])  {
-                       $pArray[$table][$row['t3ver_oid']][] = $row;
-               }
-       }
-
-       /**
-        * Links to stage change of a version
-        *
-        * @param       string          Table name
-        * @param       array           Offline record (version)
-        * @return      string          HTML content, mainly link tags and images.
-        */
-       function displayWorkspaceOverview_allStageCmd() {
-
-               $table = t3lib_div::_GP('table');
-               if ($table && $table!='pages')  {
-                       $uid = t3lib_div::_GP('uid');
-                       if ($rec_off = t3lib_BEfunc::getRecordWSOL($table,$uid)) {
-                               $uid = $rec_off['_ORIG_uid'];
-                       }
-               } else $table = '';
-
-               if ($table)     {
-                       if ($uid && $this->recIndex[$table][$uid])      {
-                               $sId = $this->recIndex[$table][$uid];
-                               switch($sId)    {
-                                       case 1:
-                                               $label = $GLOBALS['LANG']->getLL('commentForReviewer');
-                                       break;
-                                       case 10:
-                                               $label = $GLOBALS['LANG']->getLL('commentForPublisher');
-                                       break;
-                               }
-                       } else $sId = 0;
-               } else {
-                       if (count($this->stageIndex[1]))        {       // Review:
-                               $sId = 1;
-                               $color = '#666666';
-                               $label = $GLOBALS['LANG']->getLL('sendItemsToReview') . $GLOBALS['LANG']->getLL('commentForReviewer');
-                               $titleAttrib = $GLOBALS['LANG']->getLL('sendAllToReview');
-                       } elseif(count($this->stageIndex[10]))  {       // Publish:
-                               $sId = 10;
-                               $color = '#6666cc';
-                               $label = $GLOBALS['LANG']->getLL('approveToPublish') . $GLOBALS['LANG']->getLL('commentForPublisher');
-                               $titleAttrib = $GLOBALS['LANG']->getLL('approveAllToPublish');
-                       } else {
-                               $sId = 0;
-                       }
-               }
-
-               if ($sId>0)     {
-                       $issueCmd = '';
-                       $itemCount = 0;
-
-                       if ($table && $uid && $this->recIndex[$table][$uid])    {
-                               $issueCmd.='&cmd['.$table.']['.$uid.'][version][action]=setStage';
-                               $issueCmd.='&cmd['.$table.']['.$uid.'][version][stageId]='.$this->recIndex[$table][$uid];
-                       } else {
-                               foreach($this->stageIndex[$sId] as $table => $uidArray) {
-                                       $issueCmd.='&cmd['.$table.']['.implode(',',$uidArray).'][version][action]=setStage';
-                                       $issueCmd.='&cmd['.$table.']['.implode(',',$uidArray).'][version][stageId]='.$sId;
-                                       $itemCount+=count($uidArray);
-                               }
-                       }
-
-                       $onClick = 'var commentTxt=window.prompt("'.sprintf($label,$itemCount).'","");
-                                                       if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand($issueCmd,$this->REQUEST_URI).'&generalComment="+escape(commentTxt);}';
-
-                       if (t3lib_div::_GP('sendToReview'))     {
-                               $onClick.= ' else {window.location.href = "'.$this->REQUEST_URI.'"}';
-                               $actionLinks.=
-                                       $this->doc->wrapScriptTags($onClick);
-                       } else {
-                               $onClick.= ' return false;';
-                               $actionLinks.=
-                                       '<input type="submit" name="_" value="'.htmlspecialchars($titleAttrib).'" onclick="'.htmlspecialchars($onClick).'" />';
-                       }
-               } elseif (t3lib_div::_GP('sendToReview'))       {
-                       $onClick = 'window.location.href = "'.$this->REQUEST_URI.'";';
-                       $actionLinks.=
-                               $this->doc->wrapScriptTags($onClick);
-               } else $actionLinks = '';
-
-               return $actionLinks;
-       }
-
-
-
-
-
-
-       /**************************************
-        *
-        * Helper functions (REDUNDANT FROM user/ws/index.php - someone could refactor this...)
-        *
-        *************************************/
-
-       /**
-        * Formatting the version number for HTML output
-        *
-        * @param       integer         Version number
-        * @return      string          Version number for output
-        */
-       function formatVerId($verId)    {
-               return '1.'.$verId;
-       }
-
-       /**
-        * Formatting workspace ID into a visual label
-        *
-        * @param       integer         Workspace ID
-        * @return      string          Workspace title
-        */
-       function formatWorkspace($wsid) {
-
-                       // Render, if not cached:
-               if (!isset($this->formatWorkspace_cache[$wsid]))        {
-                       switch($wsid)   {
-                               case -1:
-                                       $this->formatWorkspace_cache[$wsid] = $GLOBALS['LANG']->getLL('offline');
-                               break;
-                               case 0:
-                                       $this->formatWorkspace_cache[$wsid] = '';       // Does not output anything for ONLINE because it might confuse people to think that the elemnet IS online which is not the case - only that it exists as an offline version in the online workspace...
-                               break;
-                               default:
-                                       $titleRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('title', 'sys_workspace', 'uid=' . intval($wsid) . t3lib_BEfunc::deleteClause('sys_workspace'));
-                                       $this->formatWorkspace_cache[$wsid] = '['.$wsid.'] '.$titleRec['title'];
-                               break;
-                       }
-               }
-
-               return $this->formatWorkspace_cache[$wsid];
-       }
-
-       /**
-        * Format publishing count for version (lifecycle state)
-        *
-        * @param       integer         t3ver_count value (number of times it has been online)
-        * @return      string          String translation of count.
-        */
-       function formatCount($count)    {
-
-                       // Render, if not cached:
-               if (!isset($this->formatCount_cache[$count]))   {
-                       switch($count)  {
-                               case 0:
-                                       $this->formatCount_cache[$count] = $GLOBALS['LANG']->getLL('draft');
-                               break;
-                               case 1:
-                                       $this->formatCount_cache[$count] = $GLOBALS['LANG']->getLL('archive');
-                               break;
-                               default:
-                                       $this->formatCount_cache[$count] = sprintf($GLOBALS['LANG']->getLL('publishedXTimes'), $count);
-                               break;
-                       }
-               }
-
-               return $this->formatCount_cache[$count];
-       }
-
-       /**
-        * Looking for versions of a record in other workspaces than the current
-        *
-        * @param       string          Table name
-        * @param       integer         Record uid
-        * @return      string          List of other workspace IDs
-        */
-       function versionsInOtherWS($table,$uid) {
-
-                       // Check for duplicates:
-                       // Select all versions of record NOT in this workspace:
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                       't3ver_wsid',
-                       $table,
-                       'pid=-1
-                               AND t3ver_oid='.intval($uid).'
-                               AND t3ver_wsid!='.intval($GLOBALS['BE_USER']->workspace).'
-                               AND (t3ver_wsid=-1 OR t3ver_wsid>0)'.
-                               t3lib_BEfunc::deleteClause($table),
-                       '',
-                       't3ver_wsid',
-                       '',
-                       't3ver_wsid'
-               );
-               if (count($rows))       {
-                       return implode(',',array_keys($rows));
-               }
-       }
-
-       /**
-        * Looks up stage changes for version and displays a formatted view on mouseover.
-        *
-        * @param       string          Table name
-        * @param       integer         Record ID
-        * @param       string          HTML string to wrap the mouseover around (should be stage change links)
-        * @return      string          HTML code.
-        */
-       function showStageChangeLog($table,$id,$stageCommands)  {
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                       'log_data,tstamp,userid',
-                       'sys_log',
-                       'action=6 and details_nr=30
-                               AND tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'sys_log').'
-                               AND recuid='.intval($id)
-               );
-
-               $entry = array();
-               foreach($rows as $dat)  {
-                       $data = unserialize($dat['log_data']);
-                       $username = $this->be_user_Array[$dat['userid']] ? $this->be_user_Array[$dat['userid']]['username'] : '['.$dat['userid'].']';
-
-                       switch($data['stage'])  {
-                               case 1:
-                                       $text = $GLOBALS['LANG']->getLL('stage.sentToReview');
-                               break;
-                               case 10:
-                                       $text = $GLOBALS['LANG']->getLL('stage.approvedForPublish');
-                               break;
-                               case -1:
-                                       $text = $GLOBALS['LANG']->getLL('stage.rejectedElement');
-                               break;
-                               case 0:
-                                       $text = $GLOBALS['LANG']->getLL('stage.resetToEdit');
-                               break;
-                               default:
-                                       $text = $GLOBALS['LANG']->getLL('stage.undefined');
-                               break;
-                       }
-                       $text = t3lib_BEfunc::dateTime($dat['tstamp']).': "'.$username.'" '.$text;
-                       $text.= ($data['comment'] ? '<br />' . $GLOBALS['LANG']->getLL('userComment') . ': <em>' . htmlspecialchars($data['comment']) . '</em>' : '');
-
-                       $entry[] = $text;
-               }
-
-               return count($entry) ? '<span onmouseover="document.getElementById(\'log_' . $table . $id . '\').style.visibility = \'visible\';" onmouseout="document.getElementById(\'log_' . $table . $id . '\').style.visibility = \'hidden\';">' . $stageCommands . ' (' . count($entry) . ')</span>' .
-                               '<div class="t3-version-infolayer logLayer" id="log_' . $table . $id . '">' . implode('<hr/>', array_reverse($entry)) . '</div>' : $stageCommands;
-       }
-
-       /**
-        * Creates display of sub elements of a page when the swap mode is either "Page" or "Branch" (0 / ALL)
-        *
-        * @param       integer         Page uid (for either online or offline version, but it MUST have swapmode/treeLevel set to >0 (not -1 indicating element versioning)
-        * @param       integer         The treeLevel value, >0 indicates "branch" while 0 means page+content. (-1 would have meant element versioning, but that should never happen for a call to this function!)
-        * @param       integer         For offline versions; This is t3ver_oid, the original ID of the online page.
-        * @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:
-                       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($this->REQUEST_URI)).'">'.
-                                               '<span class="typo3-dimmed"><em>' . $GLOBALS['LANG']->getLL('subElementsClick')  . '</em><span></a>' :
-                                               '<span class="typo3-dimmed"><em>' . $GLOBALS['LANG']->getLL('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']))      {
-                                       $this->subElements_getNonPageRecords($tN, $uid, $recList);
-                               }
-                       }
-
-                               // Render records collected above:
-                       $elCount = count($recList)-1;
-                       foreach($recList as $c => $comb)        {
-                               list($tN,$rec) = $comb;
-
-                               $this->subElements_renderItem(
-                                       $tCell,
-                                       $tN,
-                                       $uid,
-                                       $rec,
-                                       $origId,
-                                       $c==$elCount && $treeLevel==0 ? 1 : 0,          // If TRUE, will show bottom-join icon.
-                                       ''
-                               );
-                       }
-
-                               // For branch, dive into the subtree:
-                       if ($treeLevel>0) {
-
-                                       // Drawing tree:
-                               $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
-                               $tree->getTree($uid, 99, '');
-
-                                       // Traverse page tree:
-                               foreach($tree->tree as $data)   {
-
-                                               // Render page in table cell:
-                                       $this->subElements_renderItem(
-                                               $tCell,
-                                               'pages',
-                                               $uid,
-                                               t3lib_BEfunc::getRecord('pages',$data['row']['uid']),   // Needs all fields, at least more than what is given in $data['row']...
-                                               $origId,
-                                               2,              // 2=the join icon and icon for the record is not rendered for pages (where all is in $data['HTML']
-                                               $data['HTML']
-                                       );
-
-                                               // Find all records from page and collect in $recList:
-                                       $recList = array();
-                                       foreach($TCA as $tN => $tCfg)   {
-                                               if ($tN!=='pages')      {
-                                                       $this->subElements_getNonPageRecords($tN, $data['row']['uid'], $recList);
-                                               }
-                                       }
-
-                                               // Render records collected above:
-                                       $elCount = count($recList)-1;
-                                       foreach($recList as $c => $comb)        {
-                                               list($tN,$rec) = $comb;
-
-                                               $this->subElements_renderItem(
-                                                       $tCell,
-                                                       $tN,
-                                                       $uid,
-                                                       $rec,
-                                                       $origId,
-                                                       $c==$elCount?1:0,       // If TRUE, will show bottom-join icon.
-                                                       $data['HTML_depthData']
-                                               );
-                                       }
-                               }
-                       }
-
-                       return '
-                                       <!-- Sub-element tree for versions -->
-                                       <table border="0" cellpadding="0" cellspacing="1" class="ver-subtree">
-                                               '.implode('',$tCell).'
-                                       </table>';
-               }
-       }
-
-       /**
-        * Select records from a table and add them to recList
-        *
-        * @param       string          Table name (from TCA)
-        * @param       integer         PID to select records from
-        * @param       array           Array where records are accumulated, passed by reference
-        * @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' : '').
-                               t3lib_BEfunc::deleteClause($tN),
-                       '',
-                       $TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($TCA[$tN]['ctrl']['default_sortby'])
-               );
-
-               foreach($records as $rec)       {
-                       $recList[] = array($tN,$rec);
-               }
-       }
-
-       /**
-        * Render a single item in a subelement list into a table row:
-        *
-        * @param       array           Table rows, passed by reference
-        * @param       string          Table name
-        * @param       integer         Page uid for which the subelements are selected/shown
-        * @param       array           Row of element in list
-        * @param       integer         The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version.
-        * @param       integer         Mode of icon display: 0=not the last, 1= is the last in list (make joinbottom icon then), 2=do not shown icons are all (for pages from the page tree already rendered)
-        * @param       string          Prefix HTML data (icons for tree rendering)
-        * @return      void            (Content accumulated in $tCell!)
-        */
-       function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)      {
-               global $TCA;
-
-                       // Initialize:
-               $origUidFields = $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:
-                       if (!$origId)   {       // In case we are displaying the online originals:
-                               $this->targets['orig_'.$uid.'_'.$tN.'_'.$rec['uid']] = $rec;    // Build up target array (important that
-                               $tdParams =  ' id="orig_'.$uid.'_'.$tN.'_'.$rec['uid'].'" class="typo3-ver"';           // Setting ID of the table row
-                       } else {        // Version branch:
-                               if ($this->targets['orig_'.$origId.'_'.$tN.'_'.$rec[$origUidFields]])   {       // If there IS a corresponding original record...:
-
-                                               // Prepare Table row parameters:
-                                       $tdParams =  ' onmouseover="hlSubelements(\''.$origId.'_'.$tN.'_'.$rec[$origUidFields].'\', \''.$uid.'_'.$tN.'_'.$rec[$origUidFields].'\', 1, '.($this->MOD_SETTINGS['diff']==2?1:0).');"'.
-                                                               ' onmouseout="hlSubelements(\''.$origId.'_'.$tN.'_'.$rec[$origUidFields].'\', \''.$uid.'_'.$tN.'_'.$rec[$origUidFields].'\', 0, '.($this->MOD_SETTINGS['diff']==2?1:0).');"'.
-                                                               ' id="ver_'.$uid.'_'.$tN.'_'.$rec[$origUidFields].'" class="typo3-ver"';
-
-                                               // Create diff view:
-                                       if ($this->MOD_SETTINGS['diff'])        {
-                                               list($diffHTML,$diffPct) = $this->createDiffView($tN, $rec, $this->targets['orig_'.$origId.'_'.$tN.'_'.$rec[$origUidFields]]);
-
-                                               if ($this->MOD_SETTINGS['diff']==2)     {
-                                                       $diffCode =
-                                                               ($diffPct ? '<span class="nobr">'.$diffPct.'% change</span>' : '-').
-                                                               '<div style="visibility: hidden; position: absolute;" id="diff_'.$uid.'_'.$tN.'_'.$rec[$origUidFields].'" class="diffLayer">'.
-                                                               $diffHTML.
-                                                               '</div>';
-                                               } else {
-                                                       $diffCode =
-                                                               ($diffPct<0 ? $GLOBALS['LANG']->getLL('notAvailable') : ($diffPct ? $diffPct . '% ' . $GLOBALS['LANG']->getLL('change') : '')).
-                                                               $diffHTML;
-                                               }
-                                       }
-
-                                               // Unsetting the target fields allows us to mark all originals without a version in the subtree (see ->markupNewOriginals())
-                                       unset($this->targets['orig_'.$origId.'_'.$tN.'_'.$rec[$origUidFields]]);
-                               } else {        // No original record, so must be new:
-                                       $tdParams =  ' class="typo3-ver-new"';
-                               }
-                       }
-               } else {        // If no original uid column is supported for this table we are forced NOT to display any diff or highlighting.
-                       $tdParams = ' class="typo3-ver-noComp"';
-               }
-
-                       // Compile the cell:
-               $tCell[] = '
-                                               <tr'.$tdParams.'>
-                                                       <td class="iconTitle">'.
-                                                               $HTMLdata.
-                                                               ($iconMode < 2 ?
-                                                                       '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/join'.($iconMode ? 'bottom' : '').'.gif','width="18" height="16"').' alt="" />'.
-                                                                       t3lib_iconWorks::getSpriteIconForRecord($tN, $rec) : '').
-                                                               t3lib_BEfunc::getRecordTitle($tN, $rec, TRUE).
-                                                       '</td>
-                                                       <td class="cmdCell">'.
-                                                               $this->displayWorkspaceOverview_commandLinksSub($tN,$rec,$origId).
-                                                       '</td>'.($origId ? '<td class="diffCell">'.
-                                                               $diffCode.
-                                                       '</td>':'').'
-                                               </tr>';
-       }
-
-       /**
-        * JavaScript code to mark up new records that are online (in sub element lists)
-        *
-        * @return      string          HTML javascript section
-        */
-       function markupNewOriginals()   {
-
-               if (count($this->targets))      {
-                       $scriptCode = '';
-                       foreach($this->targets as $key => $rec) {
-                               $scriptCode.='
-                                       document.getElementById(\''.$key.'\').attributes.getNamedItem("class").nodeValue = \'typo3-ver-new\';
-                               ';
-                       }
-
-                       return $this->doc->wrapScriptTags($scriptCode);
-               }
-       }
-
-       /**
-        * Create visual difference view of two records. Using t3lib_diff library
-        *
-        * @param       string          Table name
-        * @param       array           New version record (green)
-        * @param       array           Old version record (red)
-        * @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';
-
-                       // Check that records are arrays:
-               if (is_array($diff_1_record) && is_array($diff_2_record))       {
-
-                               // Load full table description and initialize diff-object:
-                       t3lib_div::loadTCA($table);
-                       $t3lib_diff_Obj = t3lib_div::makeInstance('t3lib_diff');
-
-                               // Add header row:
-                       $tRows = array();
-                       $tRows[] = '
-                               <tr class="bgColor5 tableheader">
-                                       <td>' . $GLOBALS['LANG']->getLL('fieldname')  . ':</td>
-                                       <td width="98%" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('coloredDiffView') . ':</td>
-                               </tr>
-                       ';
-
-                               // Initialize variables to pick up string lengths in:
-                       $allStrLen = 0;
-                       $diffStrLen = 0;
-
-                               // 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))     {
-
-                                               // 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')        {
-
-                                                       // Initialize:
-                                               $uploadFolder = $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));
-
-                                                       // Traverse filenames and read their md5 sum:
-                                               foreach($files1 as $filename => $tmp)   {
-                                                       $files1[$filename] = @is_file(PATH_site.$uploadFolder.'/'.$filename) ? md5(t3lib_div::getUrl(PATH_site.$uploadFolder.'/'.$filename)) : $filename;
-                                               }
-                                               foreach($files2 as $filename => $tmp)   {
-                                                       $files2[$filename] = @is_file(PATH_site.$uploadFolder.'/'.$filename) ? md5(t3lib_div::getUrl(PATH_site.$uploadFolder.'/'.$filename)) : $filename;
-                                               }
-
-                                                       // Implode MD5 sums and set flag:
-                                               $diff_1_record[$fN] = implode(' ',$files1);
-                                               $diff_2_record[$fN] = implode(' ',$files2);
-                                               $isFiles = TRUE;
-                                       }
-
-                                               // If there is a change of value:
-                                       if (strcmp(trim($diff_1_record[$fN]),trim($diff_2_record[$fN])))        {
-
-
-                                                       // Get the best visual presentation of the value and present that:
-                                               $val1 = t3lib_BEfunc::getProcessedValue($table,$fN,$diff_2_record[$fN],0,1);
-                                               $val2 = t3lib_BEfunc::getProcessedValue($table,$fN,$diff_1_record[$fN],0,1);
-
-                                                       // Make diff result and record string lenghts:
-                                               $diffres = $t3lib_diff_Obj->makeDiffDisplay($val1,$val2,$isFiles?'div':'span');
-                                               $diffStrLen+= $t3lib_diff_Obj->differenceLgd;
-                                               $allStrLen+= strlen($val1.$val2);
-
-                                                       // If the compared values were files, substituted MD5 hashes:
-                                               if ($isFiles)   {
-                                                       $allFiles = array_merge($files1,$files2);
-                                                       foreach($allFiles as $filename => $token)       {
-                                                               if (strlen($token)==32 && strstr($diffres,$token))      {
-                                                                       $filename =
-                                                                               t3lib_BEfunc::thumbCode(array($fN=>$filename),$table,$fN,$this->doc->backPath).
-                                                                               $filename;
-                                                                       $diffres = str_replace($token,$filename,$diffres);
-                                                               }
-                                                       }
-                                               }
-
-                                                       // Add table row with result:
-                                               $tRows[] = '
-                                                       <tr class="bgColor4">
-                                                               <td>'.htmlspecialchars($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel($table,$fN))).'</td>
-                                                               <td width="98%">'.$diffres.'</td>
-                                                       </tr>
-                                               ';
-                                       } else {
-                                                       // Add string lengths even if value matched - in this was the change percentage is not high if only a single field is changed:
-                                               $allStrLen+=strlen($diff_1_record[$fN].$diff_2_record[$fN]);
-                                       }
-                               }
-                       }
-
-                               // Calculate final change percentage:
-                       $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>';
-                       } else {
-                               $content.= '<span class="nobr">'.$this->doc->icons(1) . $GLOBALS['LANG']->getLL('completeMatch') . '</span>';
-                       }
-               } else $content.= $this->doc->icons(3) . $GLOBALS['LANG']->getLL('errorRecordsNotFound');
-
-                       // Return value:
-               return array($content,$pctChange);
-       }
-
-       /**
-        * Links to stage change of a version
-        *
-        * @param       string          Table name
-        * @param       array           Offline record (version)
-        * @return      string          HTML content, mainly link tags and images.
-        */
-       function displayWorkspaceOverview_stageCmd($table,&$rec_off)    {
-#debug($rec_off['t3ver_stage']);
-               switch((int)$rec_off['t3ver_stage'])    {
-                       case 0:
-                               $sId = 1;
-                               $sLabel = $GLOBALS['LANG']->getLL('editing');
-                               $color = '#666666';
-                               $label = $GLOBALS['LANG']->getLL('commentForReviewer');
-                               $titleAttrib = $GLOBALS['LANG']->getLL('sendToReview');
-                       break;
-                       case 1:
-                               $sId = 10;
-                               $sLabel = $GLOBALS['LANG']->getLL('review');
-                               $color = '#6666cc';
-                               $label = $GLOBALS['LANG']->getLL('commentForPublisher');
-                               $titleAttrib = $GLOBALS['LANG']->getLL('approveForPublishing');
-                       break;
-                       case 10:
-                               $sLabel = $GLOBALS['LANG']->getLL('publish');
-                               $color = '#66cc66';
-                       break;
-                       case -1:
-                               $sLabel = $this->doc->icons(2) . $GLOBALS['LANG']->getLL('rejected');
-                               $sId = 0;
-                               $color = '#ff0000';
-                               $label = $GLOBALS['LANG']->getLL('comment');
-                               $titleAttrib = $GLOBALS['LANG']->getLL('resetStage');
-                       break;
-                       default:
-                               $sLabel = $GLOBALS['LANG']->getLL('undefined');
-                               $sId = 0;
-                               $color = '';
-                       break;
-               }
-#debug($sId);
-
-               $raiseOk = !$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off);
-
-               if ($raiseOk && $rec_off['t3ver_stage']!=-1)    {
-                       $onClick = 'var commentTxt=window.prompt("' . $GLOBALS['LANG']->getLL('rejectExplain') . '","");
-                                                       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="' . $GLOBALS['LANG']->getLL('reject', TRUE) . '">'.
-                                       t3lib_iconWorks::getSpriteIcon('actions-move-down') .
-                               '</a>';
-               } else {
-                               // Reject:
-                       $actionLinks.=
-                               '<img src="'.$this->doc->backPath.'gfx/clear.gif" width="14" height="14" alt="" align="top" title="" />';
-               }
-
-               $actionLinks.= '<span style="background-color: '.$color.'; color: white;">'.$sLabel.'</span>';
-
-                       // Raise
-               if ($raiseOk)   {
-                       $onClick = 'var commentTxt=window.prompt("'.$label.'","");
-                                                       if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand(
-                                                       '&cmd['.$table.']['.$rec_off['uid'].'][version][action]=setStage'.
-                                                       '&cmd['.$table.']['.$rec_off['uid'].'][version][stageId]='.$sId
-                                                       ).'&cmd['.$table.']['.$rec_off['uid'].'][version][comment]="+escape(commentTxt);}'.
-                                                       ' return false;';
-                       if ($rec_off['t3ver_stage']!=10)        {
-                               $actionLinks.=
-                                       '<a href="#" onclick="'.htmlspecialchars($onClick).'" title="' . htmlspecialchars($titleAttrib) . '">' .
-                                               t3lib_iconWorks::getSpriteIcon('actions-move-up') .
-                                       '</a>';
-
-                               $this->stageIndex[$sId][$table][] = $rec_off['uid'];
-                               $this->recIndex[$table][$rec_off['uid']] = $sId;
-                       }
-               }
-               return $actionLinks;
-       }
-
-       /**
-        * Links to publishing etc of a version
-        *
-        * @param       string          Table name
-        * @param       array           Online record
-        * @param       array           Offline record (version)
-        * @param       string          Swap type, "branch", "page" or "element"
-        * @return      string          HTML content, mainly link tags and images.
-        */
-       function displayWorkspaceOverview_commandLinks($table,&$rec_on,&$rec_off,$vType)        {
-               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="' . $GLOBALS['LANG']->getLL('publish', TRUE) . '">'.
-                                       t3lib_iconWorks::getSpriteIcon('actions-version-swap-version') .
-                               '</a>';
-                       if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                               $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="' . $GLOBALS['LANG']->getLL('swap', TRUE) . '">'.
-                                               t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace') .
-                                       '</a>';
-                       }
-               }
-
-               if (!$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off))   {
-                               // Release
-                       $actionLinks.=
-                               '<a href="'.htmlspecialchars($this->doc->issueCommand('&cmd['.$table.']['.$rec_off['uid'].'][version][action]=clearWSID')).'" onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('removeFromWorkspace', TRUE) . '?\');" title="' . $GLOBALS['LANG']->getLL('removeFromWorkspace', TRUE) . '">'.
-                                       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="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_page', TRUE) . '">'.
-                                               t3lib_iconWorks::getSpriteIcon('actions-version-page-open') .
-                                       '</a>';
-                       } else {
-                               $params = '&edit['.$table.']['.$rec_off['uid'].']=edit';
-                               $actionLinks.=
-                                       '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->doc->backPath)).'" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_element', TRUE). '">'.
-                                               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($this->REQUEST_URI)).'" title="' . $GLOBALS['LANG']->getLL('showLog', TRUE) . '">'.
-                               t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
-                       '</a>';
-
-                       // View
-               if ($table==='pages')   {
-                       $tempUid = ($vType==='branch' || $GLOBALS['BE_USER']->workspace===0 ? $rec_off['uid'] : $rec_on['uid']);
-                       $actionLinks.=
-                               '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($tempUid,$this->doc->backPath,t3lib_BEfunc::BEgetRootLine($tempUid))).'">'.
-                                       t3lib_iconWorks::getSpriteIcon('actions-document-view') .
-                               '</a>';
-               }
-
-               return $actionLinks;
-       }
-
-       /**
-        * Links to publishing etc of a version
-        *
-        * @param       string          Table name
-        * @param       array           Record
-        * @param       integer         The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version.
-        * @return      string          HTML content, mainly link tags and images.
-        */
-       function displayWorkspaceOverview_commandLinksSub($table,$rec,$origId)  {
-               $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="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_page', TRUE) . '">'.
-                                                       t3lib_iconWorks::getSpriteIcon('apps-version-page-open') .
-                                               '</a>';
-                               } else {
-                                       $params = '&edit['.$table.']['.$uid.']=edit';
-                                       $actionLinks.=
-                                               '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->doc->backPath)).'" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_element', TRUE) . '">'.
-                                                       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($this->REQUEST_URI)).'" title="' . $GLOBALS['LANG']->getLL('showLog', TRUE) . '">'.
-                                       t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
-                               '</a>';
-               }
-
-                       // View
-               if ($table==='pages')   {
-                       $actionLinks.=
-                               '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($uid,$this->doc->backPath,t3lib_BEfunc::BEgetRootLine($uid))).'">'.
-                                       t3lib_iconWorks::getSpriteIcon('actions-document-view') .
-                               '</a>';
-               }
-
-               return $actionLinks;
-       }
-
-
-
-
-
-
-
-
-
-       /**********************************
-        *
-        * Processing
-        *
-        **********************************/
-
-       /**
-        * Will publish workspace if buttons are pressed
-        *
-        * @return      void
-        */
-       function publishAction()        {
-
-                       // If "Publish" or "Swap" buttons are pressed:
-               if (t3lib_div::_POST('_publish') || t3lib_div::_POST('_swap'))  {
-
-                       if ($this->table==='pages')     {       // Making sure ->uid is a page ID!
-                                       // Initialize workspace object and request all pending versions:
-                               $wslibObj = t3lib_div::makeInstance('wslib');
-                               $cmd = $wslibObj->getCmdArrayForPublishWS($GLOBALS['BE_USER']->workspace, t3lib_div::_POST('_swap'),$this->uid);
-
-                                       // Execute the commands:
-                               $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                               $tce->stripslashes_values = 0;
-                               $tce->start(array(), $cmd);
-                               $tce->process_cmdmap();
-
-                               t3lib_BEfunc::setUpdateSignal('updatePageTree');
-
-                               return $tce->errorLog;
-                       }
-               }
-       }
 }
 
 
@@ -1854,4 +588,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>
diff --git a/typo3/sysext/version/ext_conf_template.txt b/typo3/sysext/version/ext_conf_template.txt
deleted file mode 100644 (file)
index b666126..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-  # cat=basic//10; type=boolean; label= Show draft workspace: Enable the simplified draft workspace in the menus
-showDraftWorkspace = 0
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index b2a19bb..e27c619
@@ -4,13 +4,11 @@ if (!defined ('TYPO3_MODE')) {
 }
 
 if (TYPO3_MODE=='BE')  {
-       $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][]=array(
-               'name' => 'tx_version_cm1',
-               'path' => t3lib_extMgm::extPath($_EXTKEY).'class.tx_version_cm1.php'
-       );
-
        if (!t3lib_extMgm::isLoaded('workspaces')) {
-               t3lib_extMgm::addModule('web', 'txversionM1', '', t3lib_extMgm::extPath($_EXTKEY) . 'cm1/');
+               $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][]=array(
+                       'name' => 'tx_version_cm1',
+                       'path' => t3lib_extMgm::extPath($_EXTKEY).'class.tx_version_cm1.php'
+               );
        }
 }
-?>
\ No newline at end of file
+?>
diff --git a/typo3/sysext/version/locallang.xlf b/typo3/sysext/version/locallang.xlf
new file mode 100644 (file)
index 0000000..b8f10de
--- /dev/null
@@ -0,0 +1,496 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+  <file source-language="EN" target-language="vn" datatype="plaintext" original="messages" date="Tue Jun  7 20:28:57 UTC 2011" product-name="version">
+    <header/>
+    <body>
+      <trans-unit id="title">
+        <source>Versioning</source>
+        <target approved="yes">Versioning</target>
+      </trans-unit>
+      <trans-unit id="title_review">
+        <source>Send to review/pub</source>
+        <target approved="yes">Send to review/pub</target>
+      </trans-unit>
+      <trans-unit id="mlang_labels_tablabel">
+        <source>Page and content versioning and workspace management for pages.</source>
+        <target approved="yes">Page and content versioning and workspace management for pages.</target>
+      </trans-unit>
+      <trans-unit id="mlang_labels_tabdescr">
+        <source>The Web&gt;Versioning module provides access to versioning features for the page tree.</source>
+        <target approved="yes">The Web&gt;Versioning module provides access to versioning features for the page tree.</target>
+      </trans-unit>
+      <trans-unit id="mlang_tabs_tab">
+        <source>Versioning</source>
+        <target approved="yes">Versioning</target>
+      </trans-unit>
+      <trans-unit id="clickAPage_header">
+        <source>Web&gt;Versioning module</source>
+        <target approved="yes">Web&gt;Versioning module</target>
+      </trans-unit>
+      <trans-unit id="clickAPage_content">
+        <source>Please click a page in the pagetree frame to see the versioning module.</source>
+        <target approved="yes">Please click a page in the pagetree frame to see the versioning module.</target>
+      </trans-unit>
+      <trans-unit id="filter_drafts">
+        <source>Drafts</source>
+        <target approved="yes">Drafts</target>
+      </trans-unit>
+      <trans-unit id="filter_archive">
+        <source>Archive</source>
+        <target approved="yes">Archive</target>
+      </trans-unit>
+      <trans-unit id="filter_all">
+        <source>All</source>
+        <target approved="yes">All</target>
+      </trans-unit>
+      <trans-unit id="diffing">
+        <source>DIFFING</source>
+        <target approved="yes">DIFFING</target>
+      </trans-unit>
+      <trans-unit id="fieldname">
+        <source>Fieldname</source>
+        <target approved="yes">Fieldname</target>
+      </trans-unit>
+      <trans-unit id="coloredDiffView">
+        <source>Colored diff-view</source>
+        <target approved="yes">Colored diff-view</target>
+      </trans-unit>
+      <trans-unit id="recordsMatchesCompletely">
+        <source>Records matches completely on all editable fields!</source>
+        <target approved="yes">Records matches completely on all editable fields!</target>
+      </trans-unit>
+      <trans-unit id="errorRecordsNotFound">
+        <source>ERROR: Records could strangely not be found!</source>
+        <target approved="yes">ERROR: Records could strangely not be found!</target>
+      </trans-unit>
+      <trans-unit id="errorDiffSources">
+        <source>ERROR: You didn't select two sources for diffing!</source>
+        <target approved="yes">ERROR: You didn't select two sources for diffing!</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_title">
+        <source>Title</source>
+        <target approved="yes">Title</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_uid">
+        <source>UID</source>
+        <target approved="yes">UID</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_oid">
+        <source>oid</source>
+        <target approved="yes">oid</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_id">
+        <source>id</source>
+        <target approved="yes">id</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_wsid">
+        <source>wsid</source>
+        <target approved="yes">wsid</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_state">
+        <source>state</source>
+        <target approved="yes">state</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_stage">
+        <source>stage</source>
+        <target approved="yes">stage</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_count">
+        <source>count</source>
+        <target approved="yes">count</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_pid">
+        <source>pid</source>
+        <target approved="yes">pid</target>
+      </trans-unit>
+      <trans-unit id="tblHeader_t3ver_label">
+        <source>Label</source>
+        <target approved="yes">Label</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_title">
+        <source>Header of element</source>
+        <target approved="yes">Header of element</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_uid">
+        <source>Unique ID of element</source>
+        <target approved="yes">Unique ID of element</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_oid">
+        <source>t3ver_oid - Reference to live version UID</source>
+        <target approved="yes">t3ver_oid - Reference to live version UID</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_id">
+        <source>t3ver_id - Version number, incremental integer</source>
+        <target approved="yes">t3ver_id - Version number, incremental integer</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_wsid">
+        <source>t3ver_wsid - Workspace ID. There can be only one version of an element per ID (except ID zero).</source>
+        <target approved="yes">t3ver_wsid - Workspace ID. There can be only one version of an element per ID (except ID zero).</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_state">
+        <source>t3ver_state - Special states of a version: 1=Placeholder for "New". 2=Marked deleted.</source>
+        <target approved="yes">t3ver_state - Special states of a version: 1=Placeholder for "New". 2=Marked deleted.</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_stage">
+        <source>t3ver_stage - Publishing stage: Editing (0), review (1), publish (10), rejected (-1).</source>
+        <target approved="yes">t3ver_stage - Publishing stage: Editing (0), review (1), publish (10), rejected (-1).</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_count">
+        <source>t3ver_count - Life cycle counter. Incremented each time element is unpublished.</source>
+        <target approved="yes">t3ver_count - Life cycle counter. Incremented each time element is unpublished.</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_pid">
+        <source>Page ID</source>
+        <target approved="yes">Page ID</target>
+      </trans-unit>
+      <trans-unit id="tblHeaderDesc_t3ver_label">
+        <source>Label</source>
+        <target approved="yes">Label</target>
+      </trans-unit>
+      <trans-unit id="diff">
+        <source>Diff</source>
+        <target approved="yes">Diff</target>
+      </trans-unit>
+      <trans-unit id="swapWithCurrent">
+        <source>SWAP with current</source>
+        <target approved="yes">SWAP with current</target>
+      </trans-unit>
+      <trans-unit id="currentOnlineVersion">
+        <source>CURRENT ONLINE VERSION!</source>
+        <target approved="yes">CURRENT ONLINE VERSION!</target>
+      </trans-unit>
+      <trans-unit id="cmdPid0">
+        <source>Page: Page + content</source>
+        <target approved="yes">Page: Page + content</target>
+      </trans-unit>
+      <trans-unit id="cmdPid100">
+        <source>Branch: All subpages</source>
+        <target approved="yes">Branch: All subpages</target>
+      </trans-unit>
+      <trans-unit id="cmdPid1">
+        <source>Element: Just record</source>
+        <target approved="yes">Element: Just record</target>
+      </trans-unit>
+      <trans-unit id="createNewVersion">
+        <source>Create new version</source>
+        <target approved="yes">Create new version</target>
+      </trans-unit>
+      <trans-unit id="previewLink">
+        <source>Preview Link</source>
+        <target approved="yes">Preview Link</target>
+      </trans-unit>
+      <trans-unit id="publishPage">
+        <source>Publish Page</source>
+        <target approved="yes">Publish Page</target>
+      </trans-unit>
+      <trans-unit id="swapPage">
+        <source>Swap page</source>
+        <target approved="yes">Swap page</target>
+      </trans-unit>
+      <trans-unit id="publishPageQuestion">
+        <source>Are you sure you want to publish all content %sfrom this page?</source>
+        <target approved="yes">Are you sure you want to publish all content %sfrom this page?</target>
+      </trans-unit>
+      <trans-unit id="swapPageQuestion">
+        <source>Are you sure you want to publish (swap) all content %sfrom this page?</source>
+        <target approved="yes">Are you sure you want to publish (swap) all content %sfrom this page?</target>
+      </trans-unit>
+      <trans-unit id="publishPageQuestionStage">
+        <source>in "Publish" stage </source>
+        <target approved="yes">in "Publish" stage </target>
+      </trans-unit>
+      <trans-unit id="previewUrl">
+        <source>Preview Url:</source>
+        <target approved="yes">Preview Url:</target>
+      </trans-unit>
+      <trans-unit id="previewInstruction">
+        <source>You can preview this page from the workspace using this link for the next %s hours (does not require backend login):</source>
+        <target approved="yes">You can preview this page from the workspace using this link for the next %s hours (does not require backend login):</target>
+      </trans-unit>
+      <trans-unit id="versionDetails">
+        <source>Details for version</source>
+        <target approved="yes">Details for version</target>
+      </trans-unit>
+      <trans-unit id="wsManagement">
+        <source>Workspace management</source>
+        <target approved="yes">Workspace management</target>
+      </trans-unit>
+      <trans-unit id="showDiffView">
+        <source>Show difference view</source>
+        <target approved="yes">Show difference view</target>
+      </trans-unit>
+      <trans-unit id="liveVersion">
+        <source>Live Version:</source>
+        <target approved="yes">Live Version:</target>
+      </trans-unit>
+      <trans-unit id="wsVersions">
+        <source>Workspace Versions:</source>
+        <target approved="yes">Workspace Versions:</target>
+      </trans-unit>
+      <trans-unit id="controls">
+        <source>Controls:</source>
+        <target approved="yes">Controls:</target>
+      </trans-unit>
+      <trans-unit id="goBack">
+        <source>Click here to go back</source>
+        <target approved="yes">Click here to go back</target>
+      </trans-unit>
+      <trans-unit id="showAllInformation">
+        <source>Show all information</source>
+        <target approved="yes">Show all information</target>
+      </trans-unit>
+      <trans-unit id="newElement">
+        <source>New element</source>
+        <target approved="yes">New element</target>
+      </trans-unit>
+      <trans-unit id="deletedElement">
+        <source>Deleted element</source>
+        <target approved="yes">Deleted element</target>
+      </trans-unit>
+      <trans-unit id="moveToPlaceholder">
+        <source>Move-to placeholder (destination)</source>
+        <target approved="yes">Move-to placeholder (destination)</target>
+      </trans-unit>
+      <trans-unit id="moveToPointer">
+        <source>Move-to pointer (source)</source>
+        <target approved="yes">Move-to pointer (source)</target>
+      </trans-unit>
+      <trans-unit id="notAvailable">
+        <source>N/A</source>
+        <target approved="yes">N/A</target>
+      </trans-unit>
+      <trans-unit id="change">
+        <source>change:</source>
+        <target approved="yes">change:</target>
+      </trans-unit>
+      <trans-unit id="element">
+        <source> [Element]</source>
+        <target approved="yes"> [Element]</target>
+      </trans-unit>
+      <trans-unit id="page">
+        <source> [Page]</source>
+        <target approved="yes"> [Page]</target>
+      </trans-unit>
+      <trans-unit id="branch">
+        <source> [Branch]</source>
+        <target approved="yes"> [Branch]</target>
+      </trans-unit>
+      <trans-unit id="otherVersions">
+        <source>Other version(s) in workspace </source>
+        <target approved="yes">Other version(s) in workspace </target>
+      </trans-unit>
+      <trans-unit id="multipleVersions">
+        <source>Multiple versions in same workspace!</source>
+        <target approved="yes">Multiple versions in same workspace!</target>
+      </trans-unit>
+      <trans-unit id="versionInVersion">
+        <source>Version inside version!</source>
+        <target approved="yes">Version inside version!</target>
+      </trans-unit>
+      <trans-unit id="lifecycle">
+        <source>Lifecycle</source>
+        <target approved="yes">Lifecycle</target>
+      </trans-unit>
+      <trans-unit id="workspace">
+        <source>Workspace</source>
+        <target approved="yes">Workspace</target>
+      </trans-unit>
+      <trans-unit id="diffToLiveElement">
+        <source>Difference to live element:</source>
+        <target approved="yes">Difference to live element:</target>
+      </trans-unit>
+      <trans-unit id="commentForReviewer">
+        <source>Comment for Reviewer:</source>
+        <target approved="yes">Comment for Reviewer:</target>
+      </trans-unit>
+      <trans-unit id="commentForPublisher">
+        <source>Comment for Publisher:</source>
+        <target approved="yes">Comment for Publisher:</target>
+      </trans-unit>
+      <trans-unit id="sendItemsToReview">
+        <source>Sending %s item(s) to review. </source>
+        <target approved="yes">Sending %s item(s) to review. </target>
+      </trans-unit>
+      <trans-unit id="sendAllToReview">
+        <source>Send all to Review</source>
+        <target approved="yes">Send all to Review</target>
+      </trans-unit>
+      <trans-unit id="approveToPublish">
+        <source>Approving %s item(s) to publishing. </source>
+        <target approved="yes">Approving %s item(s) to publishing. </target>
+      </trans-unit>
+      <trans-unit id="approveAllToPublish">
+        <source>Approve all for Publishing</source>
+        <target approved="yes">Approve all for Publishing</target>
+      </trans-unit>
+      <trans-unit id="offline">
+        <source>[Offline]</source>
+        <target approved="yes">[Offline]</target>
+      </trans-unit>
+      <trans-unit id="draft">
+        <source>Draft</source>
+        <target approved="yes">Draft</target>
+      </trans-unit>
+      <trans-unit id="archive">
+        <source>Archive</source>
+        <target approved="yes">Archive</target>
+      </trans-unit>
+      <trans-unit id="publishedXTimes">
+        <source>Published %s times</source>
+        <target approved="yes">Published %s times</target>
+      </trans-unit>
+      <trans-unit id="stage.sentToReview">
+        <source>sent element to "Review"</source>
+        <target approved="yes">sent element to "Review"</target>
+      </trans-unit>
+      <trans-unit id="stage.approvedForPublish">
+        <source>approved for "Publish"</source>
+        <target approved="yes">approved for "Publish"</target>
+      </trans-unit>
+      <trans-unit id="stage.rejectedElement">
+        <source>rejected element!</source>
+        <target approved="yes">rejected element!</target>
+      </trans-unit>
+      <trans-unit id="stage.resetToEdit">
+        <source>reset to "Editing"</source>
+        <target approved="yes">reset to "Editing"</target>
+      </trans-unit>
+      <trans-unit id="stage.undefined">
+        <source>[undefined]</source>
+        <target approved="yes">[undefined]</target>
+      </trans-unit>
+      <trans-unit id="userComment">
+        <source>User Comment</source>
+        <target approved="yes">User Comment</target>
+      </trans-unit>
+      <trans-unit id="subElementsClick">
+        <source>[Sub elements, click for details]</source>
+        <target approved="yes">[Sub elements, click for details]</target>
+      </trans-unit>
+      <trans-unit id="subElements">
+        <source>[Sub elements]</source>
+        <target approved="yes">[Sub elements]</target>
+      </trans-unit>
+      <trans-unit id="completeMatch">
+        <source>Complete match on editable fields.</source>
+        <target approved="yes">Complete match on editable fields.</target>
+      </trans-unit>
+      <trans-unit id="editing">
+        <source>Editing</source>
+        <target approved="yes">Editing</target>
+      </trans-unit>
+      <trans-unit id="sendToReview">
+        <source>Send to Review</source>
+        <target approved="yes">Send to Review</target>
+      </trans-unit>
+      <trans-unit id="review">
+        <source>Review</source>
+        <target approved="yes">Review</target>
+      </trans-unit>
+      <trans-unit id="swap">
+        <source>Swap</source>
+        <target approved="yes">Swap</target>
+      </trans-unit>
+      <trans-unit id="approveForPublishing">
+        <source>Approve for Publishing</source>
+        <target approved="yes">Approve for Publishing</target>
+      </trans-unit>
+      <trans-unit id="publish">
+        <source>Publish</source>
+        <target approved="yes">Publish</target>
+      </trans-unit>
+      <trans-unit id="rejected">
+        <source>Rejected</source>
+        <target approved="yes">Rejected</target>
+      </trans-unit>
+      <trans-unit id="comment">
+        <source>Comment:</source>
+        <target approved="yes">Comment:</target>
+      </trans-unit>
+      <trans-unit id="resetStage">
+        <source>Reset stage</source>
+        <target approved="yes">Reset stage</target>
+      </trans-unit>
+      <trans-unit id="undefined">
+        <source>Undefined</source>
+        <target approved="yes">Undefined</target>
+      </trans-unit>
+      <trans-unit id="rejectExplain">
+        <source>Please explain why you reject:</source>
+        <target approved="yes">Please explain why you reject:</target>
+      </trans-unit>
+      <trans-unit id="removeFromWorkspace">
+        <source>Remove from workspace</source>
+        <target approved="yes">Remove from workspace</target>
+      </trans-unit>
+      <trans-unit id="showLog">
+        <source>Show Log</source>
+        <target approved="yes">Show Log</target>
+      </trans-unit>
+      <trans-unit id="liveWorkspace">
+        <source>[Live workspace]</source>
+        <target approved="yes">[Live workspace]</target>
+      </trans-unit>
+      <trans-unit id="draftWorkspaces">
+        <source>Draft Workspaces</source>
+        <target approved="yes">Draft Workspaces</target>
+      </trans-unit>
+      <trans-unit id="defaultDraft">
+        <source>[Default Draft]</source>
+        <target approved="yes">[Default Draft]</target>
+      </trans-unit>
+      <trans-unit id="errors">
+        <source>Errors:</source>
+        <target approved="yes">Errors:</target>
+      </trans-unit>
+      <trans-unit id="refresh">
+        <source>Refresh</source>
+        <target approved="yes">Refresh</target>
+      </trans-unit>
+      <trans-unit id="allowPreviewOfWholeWorkspace">
+        <source>Allow preview of whole workspace</source>
+        <target approved="yes">Allow preview of whole workspace</target>
+      </trans-unit>
+      <trans-unit id="versionId">
+        <source>ID:</source>
+        <target approved="yes">ID:</target>
+      </trans-unit>
+      <trans-unit id="workspaceId">
+        <source>Workspace-Id:</source>
+        <target approved="yes">Workspace-Id:</target>
+      </trans-unit>
+      <trans-unit id="live">
+        <source>LIVE</source>
+        <target approved="yes">LIVE</target>
+      </trans-unit>
+      <trans-unit id="versionSelect.label">
+        <source>Versions of this page:</source>
+        <target approved="yes">Versions of this page:</target>
+      </trans-unit>
+      <trans-unit id="versionSelect.live">
+        <source>LIVE version</source>
+        <target approved="yes">LIVE version</target>
+      </trans-unit>
+      <trans-unit id="versionSelect.publish">
+        <source>Publish page</source>
+        <target approved="yes">Publish page</target>
+      </trans-unit>
+      <trans-unit id="versionSelect.inBranch">
+        <source>Inside branch, no further versioning possible</source>
+        <target approved="yes">Inside branch, no further versioning possible</target>
+      </trans-unit>
+      <trans-unit id="versionSelect.versionsFound">
+        <source>Versions found on page, no "Page" versioning possible</source>
+        <target approved="yes">Versions found on page, no "Page" versioning possible</target>
+      </trans-unit>
+      <trans-unit id="autopublishTask.name">
+        <source>Workspaces auto-publication</source>
+        <target approved="yes">Workspaces auto-publication</target>
+      </trans-unit>
+      <trans-unit id="autopublishTask.description">
+        <source>This tasks checks any workspace that has a publication date set in the past and automatically publishes it.</source>
+        <target approved="yes">This tasks checks any workspace that has a publication date set in the past and automatically publishes it.</target>
+      </trans-unit>
+    </body>
+  </file>
+</xliff>
diff --git a/typo3/sysext/version/locallang.xml b/typo3/sysext/version/locallang.xml
deleted file mode 100755 (executable)
index f81e548..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<T3locallang>
-       <meta type="array">
-               <description>Module labels</description>
-               <type>module</type>
-       </meta>
-       <data type="array">
-               <languageKey index="default" type="array">
-                       <label index="title">Versioning</label>
-                       <label index="title_review">Send to review/pub</label>
-                       <label index="mlang_labels_tablabel">Page and content versioning and workspace management for pages.</label>
-                       <label index="mlang_labels_tabdescr">The Web&gt;Versioning module provides access to versioning features for the page tree.</label>
-                       <label index="mlang_tabs_tab">Versioning</label>
-                       <label index="clickAPage_header">Web&gt;Versioning module</label>
-                       <label index="clickAPage_content">Please click a page in the pagetree frame to see the versioning module.</label>
-                       <label index="filter_drafts">Drafts</label>
-                       <label index="filter_archive">Archive</label>
-                       <label index="filter_all">All</label>
-                       <label index="diffing">DIFFING</label>
-                       <label index="fieldname">Fieldname</label>
-                       <label index="coloredDiffView">Colored diff-view</label>
-                       <label index="recordsMatchesCompletely">Records matches completely on all editable fields!</label>
-                       <label index="errorRecordsNotFound">ERROR: Records could strangely not be found!</label>
-                       <label index="errorDiffSources">ERROR: You didn't select two sources for diffing!</label>
-                       <label index="tblHeader_title">Title</label>
-                       <label index="tblHeader_uid">UID</label>
-                       <label index="tblHeader_t3ver_oid">oid</label>
-                       <label index="tblHeader_t3ver_id">id</label>
-                       <label index="tblHeader_t3ver_wsid">wsid</label>
-                       <label index="tblHeader_t3ver_state">state</label>
-                       <label index="tblHeader_t3ver_stage">stage</label>
-                       <label index="tblHeader_t3ver_count">count</label>
-                       <label index="tblHeader_pid">pid</label>
-                       <label index="tblHeader_t3ver_label">Label</label>
-                       <label index="tblHeaderDesc_title">Header of element</label>
-                       <label index="tblHeaderDesc_uid">Unique ID of element</label>
-                       <label index="tblHeaderDesc_t3ver_oid">t3ver_oid - Reference to live version UID</label>
-                       <label index="tblHeaderDesc_t3ver_id">t3ver_id - Version number, incremental integer</label>
-                       <label index="tblHeaderDesc_t3ver_wsid">t3ver_wsid - Workspace ID. There can be only one version of an element per ID (except ID zero).</label>
-                       <label index="tblHeaderDesc_t3ver_state">t3ver_state - Special states of a version: 1=Placeholder for &quot;New&quot;. 2=Marked deleted.</label>
-                       <label index="tblHeaderDesc_t3ver_stage">t3ver_stage - Publishing stage: Editing (0), review (1), publish (10), rejected (-1).</label>
-                       <label index="tblHeaderDesc_t3ver_count">t3ver_count - Life cycle counter. Incremented each time element is unpublished.</label>
-                       <label index="tblHeaderDesc_pid">Page ID</label>
-                       <label index="tblHeaderDesc_t3ver_label">Label</label>
-                       <label index="diff">Diff</label>
-                       <label index="swapWithCurrent">SWAP with current</label>
-                       <label index="currentOnlineVersion">CURRENT ONLINE VERSION!</label>
-                       <label index="cmdPid0">Page: Page + content</label>
-                       <label index="cmdPid100">Branch: All subpages</label>
-                       <label index="cmdPid1">Element: Just record</label>
-                       <label index="createNewVersion">Create new version</label>
-                       <label index="previewLink">Preview Link</label>
-                       <label index="publishPage">Publish Page</label>
-                       <label index="swapPage">Swap page</label>
-                       <label index="publishPageQuestion">Are you sure you want to publish all content %sfrom this page?</label>
-                       <label index="swapPageQuestion">Are you sure you want to publish (swap) all content %sfrom this page?</label>
-                       <label index="publishPageQuestionStage">in &quot;Publish&quot; stage </label>
-                       <label index="previewUrl">Preview Url:</label>
-                       <label index="previewInstruction">You can preview this page from the workspace using this link for the next %s hours (does not require backend login):</label>
-                       <label index="versionDetails">Details for version</label>
-                       <label index="wsManagement">Workspace management</label>
-                       <label index="showDiffView">Show difference view</label>
-                       <label index="liveVersion">Live Version:</label>
-                       <label index="wsVersions">Workspace Versions:</label>
-                       <label index="controls">Controls:</label>
-                       <label index="goBack">Click here to go back</label>
-                       <label index="showAllInformation">Show all information</label>
-                       <label index="newElement">New element</label>
-                       <label index="deletedElement">Deleted element</label>
-                       <label index="moveToPlaceholder">Move-to placeholder (destination)</label>
-                       <label index="moveToPointer">Move-to pointer (source)</label>
-                       <label index="notAvailable">N/A</label>
-                       <label index="change">change:</label>
-                       <label index="element"> [Element]</label>
-                       <label index="page"> [Page]</label>
-                       <label index="branch"> [Branch]</label>
-                       <label index="otherVersions">Other version(s) in workspace </label>
-                       <label index="multipleVersions">Multiple versions in same workspace!</label>
-                       <label index="versionInVersion">Version inside version!</label>
-                       <label index="lifecycle">Lifecycle</label>
-                       <label index="workspace">Workspace</label>
-                       <label index="diffToLiveElement">Difference to live element:</label>
-                       <label index="commentForReviewer">Comment for Reviewer:</label>
-                       <label index="commentForPublisher">Comment for Publisher:</label>
-                       <label index="sendItemsToReview">Sending %s item(s) to review. </label>
-                       <label index="sendAllToReview">Send all to Review</label>
-                       <label index="approveToPublish">Approving %s item(s) to publishing. </label>
-                       <label index="approveAllToPublish">Approve all for Publishing</label>
-                       <label index="offline">[Offline]</label>
-                       <label index="draft">Draft</label>
-                       <label index="archive">Archive</label>
-                       <label index="publishedXTimes">Published %s times</label>
-                       <label index="stage.sentToReview">sent element to &quot;Review&quot;</label>
-                       <label index="stage.approvedForPublish">approved for &quot;Publish&quot;</label>
-                       <label index="stage.rejectedElement">rejected element!</label>
-                       <label index="stage.resetToEdit">reset to &quot;Editing&quot;</label>
-                       <label index="stage.undefined">[undefined]</label>
-                       <label index="userComment">User Comment</label>
-                       <label index="subElementsClick">[Sub elements, click for details]</label>
-                       <label index="subElements">[Sub elements]</label>
-                       <label index="completeMatch">Complete match on editable fields.</label>
-                       <label index="editing">Editing</label>
-                       <label index="sendToReview">Send to Review</label>
-                       <label index="review">Review</label>
-                       <label index="swap">Swap</label>
-                       <label index="approveForPublishing">Approve for Publishing</label>
-                       <label index="publish">Publish</label>
-                       <label index="rejected">Rejected</label>
-                       <label index="comment">Comment:</label>
-                       <label index="resetStage">Reset stage</label>
-                       <label index="undefined">Undefined</label>
-                       <label index="rejectExplain">Please explain why you reject:</label>
-                       <label index="removeFromWorkspace">Remove from workspace</label>
-                       <label index="showLog">Show Log</label>
-                       <label index="liveWorkspace">[Live workspace]</label>
-                       <label index="draftWorkspaces">Draft Workspaces</label>
-                       <label index="defaultDraft">[Default Draft]</label>
-                       <label index="errors">Errors:</label>
-                       <label index="refresh">Refresh</label>
-                       <label index="allowPreviewOfWholeWorkspace">Allow preview of whole workspace</label>
-                       <label index="versionId">ID:</label>
-                       <label index="workspaceId">Workspace-Id:</label>
-                       <label index="live">LIVE</label>
-                       <label index="versionSelect.label">Versions of this page:</label>
-                       <label index="versionSelect.live">LIVE version</label>
-                       <label index="versionSelect.publish">Publish page</label>
-                       <label index="versionSelect.inBranch">Inside branch, no further versioning possible</label>
-                       <label index="versionSelect.versionsFound">Versions found on page, no "Page" versioning possible</label>
-                       <label index="autopublishTask.name">Workspaces auto-publication</label>
-                       <label index="autopublishTask.description">This tasks checks any workspace that has a publication date set in the past and automatically publishes it.</label>
-               </languageKey>
-       </data>
-</T3locallang>
\ No newline at end of file
index bc31b6f..d675d50 100755 (executable)
  *
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   68: class wslib
- *   81:     function getCmdArrayForPublishWS($wsid, $doSwap,$pageId=0)
- *  127:     function selectVersionsInWorkspace($wsid,$filter=0,$stage=-99,$pageId=-1)
- *
- *              SECTION: CLI functions
- *  183:     function CLI_main()
- *  193:     function autoPublishWorkspaces()
- *
- * TOTAL FUNCTIONS: 4
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
 
 
 
@@ -125,15 +108,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 +179,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 +221,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
+?>
diff --git a/typo3/sysext/version/ws/class.wslib_gui.php b/typo3/sysext/version/ws/class.wslib_gui.php
deleted file mode 100644 (file)
index aa1947c..0000000
+++ /dev/null
@@ -1,1309 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Library with Workspace GUI related functionality. It is used by main workspace
- * module but also can be used from extensions. Originally 99.9%% of the code
- * was written by Kasper and only transfered here by Dmitry.
- *
- * $Id: class.wslib_gui.php 9652 2010-11-26 18:07:50Z lolli $
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author     Dmitry Dulepov <dmitry@typo3.org>
- */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   84: class wslib_gui
- *
- *              SECTION: Public functions
- *  128:     function getWorkspaceOverview(&$doc, $wsid = NULL, $filter = 0, $pageId = -1)
- *  192:     function hlSubelements(origId, verId, over, diffLayer)
- *
- *              SECTION: Private functions (do not use outside of this class!)
- *  224:     function initVars()
- *  253:     function displayWorkspaceOverview_setInPageArray(&$pArray, $rlArr, $table, $row)
- *  284:     function markupNewOriginals()
- *  309:     function displayWorkspaceOverview_list($pArray, $tableRows=array(), $c=0, $warnAboutVersions=FALSE)
- *  504:     function displayWorkspaceOverview_pageTreeIconTitle($pageUid, $title, $indentCount)
- *  518:     function formatVerId($verId)
- *  529:     function formatWorkspace($wsid)
- *  559:     function createDiffView($table, $diff_1_record, $diff_2_record)
- *  676:     function versionsInOtherWS($table, $uid)
- *  705:     function showStageChangeLog($table,$id,$stageCommands)
- *  757:     function displayWorkspaceOverview_commandLinks($table,&$rec_on,&$rec_off,$vType)
- *  830:     function formatCount($count)
- *  860:     function subElements($uid,$treeLevel,$origId=0)
- *  963:     function subElements_getNonPageRecords($tN, $uid, &$recList)
- *  993:     function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)
- * 1066:     function displayWorkspaceOverview_commandLinksSub($table,$rec,$origId)
- * 1113:     function displayWorkspaceOverview_stageCmd($table,&$rec_off)
- *
- * TOTAL FUNCTIONS: 19
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
-
-require_once('class.wslib.php');
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
-$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
-
-/**
- * Library with Workspace GUI related functionality. It is used by main workspace
- * module but also can be used from extensions. Originally 99.9%% of the code
- * was written by Kasper and only transfered here by Dmitry.
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author     Dmitry Dulepov <dmitry@typo3.org>
- * @package TYPO3
- * @subpackage core
- */
-class wslib_gui {
-
-       // Static:
-       var $pageTreeIndent = 8;
-       var $pageTreeIndent_titleLgd = 30;
-
-       // Options
-       var     $diff = FALSE;
-       var     $expandSubElements = FALSE;
-       var     $alwaysDisplayHeader = FALSE;
-
-       // Internal
-       var     $showWorkspaceCol = 0;
-       var     $doc;
-       var     $formatWorkspace_cache = array();
-       var     $targets = array();                                             // Accumulation of online targets.
-       var     $be_user_Array = array();
-       var     $pageModule = '';
-       var $formatCount_cache = array();
-       var $stageIndex = array();
-       var     $addHlSubelementsScript = FALSE;
-
-       /*********************************
-        *
-        * Public functions
-        *
-        *********************************/
-
-       /**
-        * Creates HTML to display workspace overview. Can be used to display overview for all possible records or only for single page.
-        *
-        * The following code is <strong>required</strong> in BE module when this function is used:
-        * <code>
-        *      $this->doc->getContextMenuCode();
-        * </code>
-        * or click-menu will not be generated properly!
-        *
-        * @param       object          $doc    Document (to use for formatting)
-        * @param       int             $wsid   Workspace ID, If <code>NULL</code>, the value is obtained from current BE user
-        * @param       int             $filter If 0, than no filtering, if 10 than select for publishing, otherwise stage value
-        * @param       int             $pageId If greater than zero, than it is UID of page in LIVE workspaces to select records for
-        * @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;
-               $this->doc = $doc;
-               $this->initVars();
-
-               // Initialize workspace object and request all pending versions:
-               $wslibObj = t3lib_div::makeInstance('wslib');
-
-               // Selecting ALL versions belonging to the workspace:
-               $versions = $wslibObj->selectVersionsInWorkspace($this->workspaceId, $filter, -99, $pageId);
-
-               // Traverse versions and build page-display array:
-               $pArray = array();
-               $wmArray = array();     // is page in web mount?
-               $rlArray = array();     // root line of page
-               $pagePermsClause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-               foreach($versions as $table => $records)        {
-                       if (is_array($records)) {
-                               foreach($records as $rec)       {
-                                       $pageIdField = $table==='pages' ? 't3ver_oid' : 'realpid';
-                                       $recPageId = $rec[$pageIdField];
-                                       if (!isset($wmArray[$recPageId]))       {
-                                               $wmArray[$recPageId] = $GLOBALS['BE_USER']->isInWebMount($recPageId,$pagePermsClause);
-                                       }
-                                       if ($wmArray[$recPageId])       {
-                                               if (!isset($rlArray[$recPageId]))       {
-                                                       $rlArray[$recPageId] = t3lib_BEfunc::BEgetRootLine($recPageId, 'AND 1=1');
-                                               }
-                                               $this->displayWorkspaceOverview_setInPageArray(
-                                                       $pArray,
-                                                       $rlArray[$recPageId],
-                                                       $table,
-                                                       $rec
-                                               );
-                                       }
-                               }
-                       }
-               }
-
-                       // Page-browser:
-               $resultsPerPage = 50;
-               $pointer = t3lib_div::_GP('browsePointer');
-               $browseStat = $this->cropWorkspaceOverview_list($pArray,$pointer,$resultsPerPage);
-               $browse = '';
-               $browse .= '<h3>Showing ' . $browseStat['begin'] . ' to ' . ($browseStat['end'] ? $browseStat['end'] . ' out of ' . $browseStat['allItems'] : $browseStat['allItems']) . ' versions:</h3>';
-               if (!($browseStat['begin']==1 && !$browseStat['end']))  {
-                       for($a=0;$a<ceil($browseStat['allItems']/$resultsPerPage);$a++) {
-                               $browse.=($a==(int)$pointer?'<strong>':'').'<a href="'.htmlspecialchars('index.php?browsePointer='.rawurlencode($a)).'">['.($a+1).']</a>'.($a==(int)$pointer?'</strong>':'').' ';
-                       }
-               }
-
-               $workspaceOverviewList = $this->displayWorkspaceOverview_list($pArray);
-               if ($workspaceOverviewList || $this->alwaysDisplayHeader) {
-                       // Make header of overview:
-                       $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>';
-
-                       if ($this->publishAccess && !($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1)) {
-                               $tableHeader .= '<option value="publish">' . $LANG->getLL('label_doaction_publish') . '</option>';
-                               if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                                       $tableHeader .= '<option value="swap">' . $LANG->getLL('label_doaction_swap') . '</option>';
-                               }
-                       }
-                       if ($GLOBALS['BE_USER']->workspace !== 0) {
-                               $tableHeader .= '<option value="release">' . $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 .= '<option value="flush">' . $LANG->getLL('label_doaction_flush') . '</option>
-                                       </select></td>
-                                       <td>' . $LANG->getLL('label_lifecycle') . '</td>
-                                       '.($this->showWorkspaceCol ? '<td>' . $LANG->getLL('label_workspace') . '</td>' : '').'
-                               </tr>';
-                       $tableRows[] = $tableHeader;
-
-                       // Add lines from overview:
-                       $tableRows = array_merge($tableRows, $workspaceOverviewList);
-
-                       $table = '<table border="0" cellpadding="0" cellspacing="0" id="t3-user-ws-wsoverview-table" class="typo3-dblist">' . implode('', $tableRows) . '</table>';
-
-                       // script
-                       if ($this->addHlSubelementsScript && !strstr($this->doc->JScode, 'function hlSubelements(')) {
-                               $table = $this->doc->wrapScriptTags('
-                                       function hlSubelements(origId, verId, over, diffLayer)  {
-                                               if (over)       {
-                                                       document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\';
-                                                       document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\';
-                                                       if (diffLayer)  {
-                                                               document.getElementById(\'diff_\'+verId).style.visibility = \'visible\';
-                                                       }
-                                               } else {
-                                                       document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\';
-                                                       document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\';
-                                                       if (diffLayer)  {
-                                                               document.getElementById(\'diff_\'+verId).style.visibility = \'hidden\';
-                                                       }
-                                               }
-                                       }
-                               ') . $table;
-                       }
-
-                       return $browse . $table . $this->markupNewOriginals();
-               }
-               return '';
-       }
-
-       /*********************************
-        *
-        * Private functions (do not use outside of this class!)
-        *
-        *********************************/
-
-       /**
-        * Initializes several class variables
-        *
-        * @return      void
-        */
-       function initVars() {
-               // Init users
-               $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
-               $groupArray = array_keys($be_group_Array);
-               // Need 'admin' field for t3lib_iconWorks::getIconImage()
-               $this->be_user_Array = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,admin,workspace_perms');
-               if (!$GLOBALS['BE_USER']->isAdmin()) {
-                       $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array,$groupArray,1);
-               }
-
-               // If another page module was specified, replace the default Page module with the new one
-               $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 = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);     // FIXME Should be $this->workspaceId here?
-       }
-
-       /**
-        * Building up of the $pArray variable which is a hierarchical storage of table-rows arranged according to the level in the rootline the element was found
-        * (Internal)
-        * Made for recursive calling
-        *
-        * @param       array           Array that is built up with the page tree structure
-        * @param       array           Root line for element (table / row); The element is stored in pArray according to this root line.
-        * @param       string          Table name
-        * @param       array           Table row
-        * @return      void            $pArray is passed by reference and modified internally
-        */
-       function displayWorkspaceOverview_setInPageArray(&$pArray, $rlArr, $table, $row)        {
-               // Initialize:
-               ksort($rlArr);
-               reset($rlArr);
-               if (!$rlArr[0]['uid']) {
-                       array_shift($rlArr);
-               }
-
-               // Get and remove first element in root line:
-               $cEl = current($rlArr);
-               $pUid = $cEl['t3ver_oid'] ? $cEl['t3ver_oid'] : $cEl['uid'];            // Done to pile up "false versions" in the right branch...
-
-               $pArray[$pUid] = $cEl['title'];
-               array_shift($rlArr);
-
-               // If there are elements left in the root line, call this function recursively (to build $pArray in depth)
-               if (count($rlArr))      {
-                       if (!isset($pArray[$pUid.'.'])) {
-                               $pArray[$pUid.'.'] = array();
-                       }
-                       $this->displayWorkspaceOverview_setInPageArray($pArray[$pUid.'.'], $rlArr, $table, $row);
-               } else {        // If this was the last element, set the value:
-                       $pArray[$pUid.'_'][$table][$row['t3ver_oid']][] = $row;
-               }
-       }
-
-       /**
-        * JavaScript code to mark up new records that are online (in sub element lists)
-        *
-        * @return      string          HTML javascript section
-        */
-       function markupNewOriginals()   {
-
-               if (count($this->targets))      {
-                       $scriptCode = '';
-                       foreach($this->targets as $key => $rec) {
-                               $scriptCode.='
-                                       document.getElementById(\''.$key.'\').attributes.getNamedItem("class").nodeValue = \'typo3-ver-new\';
-                               ';
-                       }
-
-                       return $this->doc->wrapScriptTags($scriptCode);
-               }
-       }
-
-
-       /**
-        * Rendering the content for the publish / review overview:
-        * (Made for internal recursive calling)
-        *
-        * @param       array           Hierarchical storage of the elements to display (see displayWorkspaceOverview() / displayWorkspaceOverview_setInPageArray())
-        * @param       array           Existing array of table rows to add to
-        * @param       array           Depth counter
-        * @param       boolean         If set, a warning is shown if versions are found (internal flag)
-        * @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;
-
-               // Traverse $pArray
-               if (is_array($pArray))  {
-                       foreach($pArray as $k => $v)    {
-                               if (t3lib_div::testInt($k))     {
-
-                                       // If there are elements on this level, output a divider row which just creates a little visual space.
-                                       if (is_array($pArray[$k.'_']))  {
-                                               $tableRows[] = '
-                                                       <tr>
-                                                               <td colspan="'.$fullColSpan.'"><img src="clear.gif" width="1" height="3" alt="" /></td>
-                                                       </tr>';
-                                       }
-
-                                       // Printing a level from the page tree with no additional content:
-                                       // If there are NO elements on this level OR if there are NO pages on a level with elements, then show page tree icon and title (otherwise it is shown with the display of the elements)
-                                       if (!is_array($pArray[$k.'_']) || !is_array($pArray[$k.'_']['pages']))  {
-                                               $tableRows[] = '
-                                                       <tr class="bgColor4-20">
-                                                               <td nowrap="nowrap" colspan="'.$fullColSpan.'">'.
-                                                               $this->displayWorkspaceOverview_pageTreeIconTitle($k,$pArray[$k],$c).
-                                                               '</td>
-                                                       </tr>';
-                                       }
-
-                                       // If there ARE elements on this level, print them:
-                                       $warnAboutVersions_next = $warnAboutVersions;
-                                       $warnAboutVersions_nonPages = FALSE;
-                                       $warnAboutVersions_page = FALSE;
-                                       if (is_array($pArray[$k.'_']))  {
-                                               foreach($pArray[$k.'_'] as $table => $oidArray) {
-                                                       foreach($oidArray as $oid => $recs)     {
-
-                                                               // Get CURRENT online record and icon based on "t3ver_oid":
-                                                               $rec_on = t3lib_BEfunc::getRecord($table,$oid);
-                                                               $icon = t3lib_iconWorks::getIconImage($table, $rec_on, $this->doc->backPath,' align="top" title="'.t3lib_BEfunc::getRecordIconAltText($rec_on,$table).'"');
-                                                               if ($GLOBALS['BE_USER']->workspace===0) {       // Only edit online records if in ONLINE workspace:
-                                                                       $icon = $this->doc->wrapClickMenuOnIcon($icon, $table, $rec_on['uid'], 2, '', '+edit,view,info,delete');
-                                                               }
-
-                                                               // 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'];
-                                                               $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).
-                                                                                               ($verLinkUrl ? '</a>' : '');
-                                                               $mainCell_rowSpan = count($recs)>1 ? ' rowspan="'.count($recs).'"' : '';
-                                                               $mainCell = $table==='pages' ? '
-                                                                                       <td class="bgColor4-20" nowrap="nowrap"'.$mainCell_rowSpan.'>'.
-                                                                                       $this->displayWorkspaceOverview_pageTreeIconTitle($k,$pArray[$k],$c).
-                                                                                       '</td>' : '
-                                                                                       <td class="bgColor"'.$mainCell_rowSpan.'></td>';
-                                                               $mainCell.= '
-                                                                                       <td align="center"'.$mainCell_rowSpan.'>'.$this->formatVerId($rec_on['t3ver_id']).'</td>
-                                                                                       <td nowrap="nowrap"'.$mainCell_rowSpan.'>'.
-                                                               $origElement.
-                                                               '###SUB_ELEMENTS###'.   // For substitution with sub-elements, if any.
-                                                               '</td>';
-
-                                                               // Offline versions display:
-                                                               // Traverse the versions of the element
-                                                               foreach($recs as $rec)  {
-
-                                                                       // Get the offline version record:
-                                                                       $rec_off = t3lib_BEfunc::getRecord($table,$rec['uid']);
-
-                                                                       // Prepare swap-mode values:
-                                                                       if ($table==='pages' && $rec_off['t3ver_swapmode']!=-1) {
-                                                                               if ($rec_off['t3ver_swapmode']>0)       {
-                                                                                       $vType = 'branch';      // Do not translate!
-                                                                               } else {
-                                                                                       $vType = 'page';        // Do not translate!
-                                                                               }
-                                                                       } else {
-                                                                               $vType = 'element';     // Do not translate!
-                                                                       }
-
-                                                                       // Get icon:
-                                                                       $icon = t3lib_iconWorks::getIconImage($table, $rec_off, $this->doc->backPath, ' align="top" title="'.t3lib_BEfunc::getRecordIconAltText($rec_off,$table).'"');
-                                                                       $tempUid = ($table != 'pages' || $vType==='branch' || $GLOBALS['BE_USER']->workspace == 0 ? $rec_off['uid'] : $rec_on['uid']);
-                                                                       $icon = $this->doc->wrapClickMenuOnIcon($icon, $table, $tempUid, 2, '', '+edit,' . ($table == 'pages' ? 'view,info,' : '') . 'delete');
-
-                                                                       // Prepare diff-code:
-                                                                       if ($this->diff)        {
-                                                                               $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.= $diffHTML;
-                                                                               } elseif ($rec_off['t3ver_state']==2)   {
-                                                                                       $diffCode.= $this->doc->icons(2) . $LANG->getLL('label_deletedrecord') . '<br/>';
-                                                                               } elseif ($rec_on['t3ver_state']==3)    {
-                                                                                       $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_moveto_placeholder') . '<br/>';
-                                                                               } elseif ($rec_off['t3ver_state']==4)   {
-                                                                                       $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_moveto_pointer') . '<br/>';
-                                                                               } else {
-                                                                                       $diffCode .= ($diffPct < 0 ? $LANG->getLL('label_notapplicable') :
-                                                                                               ($diffPct ? sprintf($LANG->getLL('label_percentChange'), $diffPct) : ''));
-                                                                                       $diffCode.= $diffHTML;
-                                                                               }
-
-                                                                       } else $diffCode = '';
-
-                                                                       switch($vType) {
-                                                                               case 'element':
-                                                                                       $swapLabel = ' ['.$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').']';
-                                                                                       $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').']';
-                                                                                       $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;
-                                                                       }
-
-                                                                       // Modify main cell based on first version shown:
-                                                                       $subElements = array();
-                                                                       if ($table==='pages' && $rec_off['t3ver_swapmode']!=-1 && $mainCell)    {       // For "Page" and "Branch" swap modes where $mainCell is still carrying content (only first version)
-                                                                               $subElements['on'] = $this->subElements($rec_on['uid'], $rec_off['t3ver_swapmode']);
-                                                                               $subElements['off'] = $this->subElements($rec_off['uid'],$rec_off['t3ver_swapmode'],$rec_on['uid']);
-                                                                       }
-                                                                       $mainCell = str_replace('###SUB_ELEMENTS###', $subElements['on'], $mainCell);
-
-                                                                       // 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>' : '';
-                                                                       $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).
-                                                                               '</a>'.
-                                                                               $versionsInOtherWSWarning.
-                                                                               $multipleWarning.
-                                                                               $verWarning;
-                                                                       if ($diffCode)  {
-                                                                               $verElement = '
-                                                                               <table border="0" cellpadding="0" cellspacing="0" class="ver-verElement">
-                                                                                       <tr>
-                                                                                               <td nowrap="nowrap" width="180">'.$verElement.'&nbsp;&nbsp;</td>
-                                                                                               <td class="c-diffCell">'.$diffCode.'</td>
-                                                                                       </tr>
-                                                                               </table>';
-                                                                       }
-
-                                                                       // Create version cell:
-                                                                       $verCell = '
-                                                                                       <td align="center">'.$this->formatVerId($rec_off['t3ver_id']).'</td>
-                                                                                       <td nowrap="nowrap">'.
-                                                                       $verElement.
-                                                                       $subElements['off'].
-                                                                       '</td>';
-
-                                                                       // Compile table row:
-                                                                       $tableRows[] = '
-                                                                               <tr class="bgColor4">
-                                                                                       '.$mainCell.$verCell.'
-                                                                                       <td nowrap="nowrap">'.$this->showStageChangeLog($table,$rec_off['uid'],$this->displayWorkspaceOverview_stageCmd($table,$rec_off)).'</td>
-                                                                                       <td nowrap="nowrap" class="'.$swapClass.'">'.
-                                                                       $this->displayWorkspaceOverview_commandLinks($table,$rec_on,$rec_off,$vType).
-                                                                       htmlspecialchars($swapLabel).
-                                                                       '</td>
-                                                                                       <td nowrap="nowrap" align="center"><input type="checkbox" name="items['.$table.':'.$rec_off['uid'].']" id="items['.$table.':'.$rec_off['uid'].']" value="1"/></td>
-                                                                                       <td nowrap="nowrap">'.htmlspecialchars($this->formatCount($rec_off['t3ver_count'])).'</td>'.            // Lifecycle
-                                                                       ($this->showWorkspaceCol ? '
-                                                                                       <td nowrap="nowrap">'.htmlspecialchars($this->formatWorkspace($rec_off['t3ver_wsid'])).'</td>' : '').'
-                                                                               </tr>';
-
-                                                                       // Reset the main cell:
-                                                                       $mainCell = '';
-                                                               }
-                                                       }
-                                               }
-                                       }
-                                       // Call recursively for sub-rows:
-                                       $tableRows = $this->displayWorkspaceOverview_list($pArray[$k.'.'], $tableRows, $c+1, $warnAboutVersions_next);
-                               }
-                       }
-               }
-               return $tableRows;
-       }
-
-       /**
-        * Filtering out items in pArray according to pointer and result-per-page setting
-        *
-        * @param       array           Hierarchical storage of the elements to display (see displayWorkspaceOverview() / displayWorkspaceOverview_setInPageArray())
-        * @return      array           Returns statistics about the pointer state.
-        */
-       function cropWorkspaceOverview_list(&$pArray,$pointer=0,$resPerPage=50,$stat=array())   {
-
-                       // Traverse $pArray
-               if (is_array($pArray))  {
-                       foreach($pArray as $k => $v)    {
-                               if (t3lib_div::testInt($k))     {
-
-                                       if (is_array($pArray[$k.'_']))  {
-                                               foreach($pArray[$k.'_'] as $table => $oidArray) {
-                                                       foreach($oidArray as $oid => $recs)     {
-
-                                                                       // Check, if the item count has reached the point where we want to set the in-point.
-                                                               $beginWasSet = FALSE;
-                                                               if (!isset($stat['begin']) && (int)$stat['allItems'] >= $pointer*$resPerPage)   {
-                                                                       $stat['begin']=(int)$stat['allItems']+1;
-                                                                       $beginWasSet = TRUE;
-                                                               }
-
-                                                                       // If in-point is not set, unset the previous items.
-                                                               if (!isset($stat['begin']))     {
-                                                                       unset($pArray[$k.'_'][$table][$oid]);
-                                                               }
-
-                                                                       // Increase counter:
-                                                               $stat['allItems']+=count($recs);
-
-                                                                       // Check if end-point is reached:
-                                                               if (!$beginWasSet && !isset($stat['end']) && $stat['allItems'] > ($pointer+1)*$resPerPage)      {
-                                                                       $stat['end']=$stat['allItems']-1;
-                                                               }
-
-                                                                       // If end-point is reached, unset following items.
-                                                               if (isset($stat['end']))        {
-                                                                       unset($pArray[$k.'_'][$table][$oid]);
-                                                               }
-                                                       }
-
-                                                               // Clean-up if no more items:
-                                                       if (!count($pArray[$k.'_'][$table]))    {
-                                                               unset($pArray[$k.'_'][$table]);
-                                                       }
-                                               }
-
-                                                       // Clean-up if no more items:
-                                               if (!count($pArray[$k.'_']))    {
-                                                       unset($pArray[$k.'_']);
-                                               }
-                                       }
-
-                                               // Call recursively for sub-rows:
-                                       if (is_array($pArray[$k.'.']))  {
-                                               $stat = $this->cropWorkspaceOverview_list($pArray[$k.'.'],$pointer,$resPerPage,$stat);
-                                       }
-                               }
-                       }
-               }
-               return $stat;
-       }
-
-       /**
-        * Create indentation, icon and title for the page tree identification for the list.
-        *
-        * @param       integer         Page UID (record will be looked up again)
-        * @param       string          Page title
-        * @param       integer         Depth counter from displayWorkspaceOverview_list() used to indent the icon and title
-        * @return      string          HTML content
-        */
-       function displayWorkspaceOverview_pageTreeIconTitle($pageUid, $title, $indentCount)     {
-               $pRec = t3lib_BEfunc::getRecord('pages',$pageUid);
-               return '<img src="clear.gif" width="1" height="1" hspace="'.($indentCount * $this->pageTreeIndent).'" align="top" alt="" />'.   // Indenting page tree
-                       t3lib_iconWorks::getSpriteIconForRecord('pages', $pRec, array('title'=> t3lib_BEfunc::getRecordIconAltText($pRec,'pages'))) .
-                       htmlspecialchars(t3lib_div::fixed_lgd_cs($title,$this->pageTreeIndent_titleLgd)).
-                       '&nbsp;&nbsp;';
-       }
-
-       /**
-        * Formatting the version number for HTML output
-        *
-        * @param       integer         Version number
-        * @return      string          Version number for output
-        */
-       function formatVerId($verId)    {
-               return '1.'.$verId;
-       }
-
-
-       /**
-        * Formatting workspace ID into a visual label
-        *
-        * @param       integer         Workspace ID
-        * @return      string          Workspace title
-        */
-       function formatWorkspace($wsid) {
-
-               // Render, if not cached:
-               if (!isset($this->formatWorkspace_cache[$wsid]))        {
-                       switch($wsid)   {
-                               case -1:
-                                       $this->formatWorkspace_cache[$wsid] = '[Draft]';
-                                       break;
-                               case 0:
-                                       $this->formatWorkspace_cache[$wsid] = '';       // Does not output anything for ONLINE because it might confuse people to think that the elemnet IS online which is not the case - only that it exists as an offline version in the online workspace...
-                                       break;
-                               default:
-                                       $titleRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('title', 'sys_workspace', 'uid=' . intval($wsid) . t3lib_BEfunc::deleteClause('sys_workspace'));
-                                       $this->formatWorkspace_cache[$wsid] = '['.$wsid.'] '.$titleRec['title'];
-                                       break;
-                       }
-               }
-
-               return $this->formatWorkspace_cache[$wsid];
-       }
-
-
-       /**
-        * Create visual difference view of two records. Using t3lib_diff library
-        *
-        * @param       string          Table name
-        * @param       array           New version record (green)
-        * @param       array           Old version record (red)
-        * @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';
-
-               // Check that records are arrays:
-               if (is_array($diff_1_record) && is_array($diff_2_record))       {
-
-                       // Load full table description and initialize diff-object:
-                       t3lib_div::loadTCA($table);
-                       $t3lib_diff_Obj = t3lib_div::makeInstance('t3lib_diff');
-
-                       // Add header row:
-                       $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>
-                               </tr>
-                       ';
-
-                       // Initialize variables to pick up string lengths in:
-                       $allStrLen = 0;
-                       $diffStrLen = 0;
-
-                       // 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))     {
-
-                                       // 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')        {
-
-                                               // Initialize:
-                                               $uploadFolder = $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));
-
-                                               // Traverse filenames and read their md5 sum:
-                                               foreach($files1 as $filename => $tmp)   {
-                                                       $files1[$filename] = @is_file(PATH_site.$uploadFolder.'/'.$filename) ? md5(t3lib_div::getUrl(PATH_site.$uploadFolder.'/'.$filename)) : $filename;
-                                               }
-                                               foreach($files2 as $filename => $tmp)   {
-                                                       $files2[$filename] = @is_file(PATH_site.$uploadFolder.'/'.$filename) ? md5(t3lib_div::getUrl(PATH_site.$uploadFolder.'/'.$filename)) : $filename;
-                                               }
-
-                                               // Implode MD5 sums and set flag:
-                                               $diff_1_record[$fN] = implode(' ',$files1);
-                                               $diff_2_record[$fN] = implode(' ',$files2);
-                                               $isFiles = TRUE;
-                                       }
-
-                                       // If there is a change of value:
-                                       if (strcmp(trim($diff_1_record[$fN]),trim($diff_2_record[$fN])))        {
-
-
-                                               // Get the best visual presentation of the value and present that:
-                                               $val1 = t3lib_BEfunc::getProcessedValue($table,$fN,$diff_2_record[$fN],0,1);
-                                               $val2 = t3lib_BEfunc::getProcessedValue($table,$fN,$diff_1_record[$fN],0,1);
-
-                                               // Make diff result and record string lenghts:
-                                               $diffres = $t3lib_diff_Obj->makeDiffDisplay($val1,$val2,$isFiles?'div':'span');
-                                               $diffStrLen+= $t3lib_diff_Obj->differenceLgd;
-                                               $allStrLen+= strlen($val1.$val2);
-
-                                               // If the compared values were files, substituted MD5 hashes:
-                                               if ($isFiles)   {
-                                                       $allFiles = array_merge($files1,$files2);
-                                                       foreach($allFiles as $filename => $token)       {
-                                                               if (strlen($token)==32 && strstr($diffres,$token))      {
-                                                                       $filename =
-                                                                       t3lib_BEfunc::thumbCode(array($fN=>$filename),$table,$fN,$this->doc->backPath).
-                                                                       $filename;
-                                                                       $diffres = str_replace($token,$filename,$diffres);
-                                                               }
-                                                       }
-                                               }
-
-                                               // Add table row with result:
-                                               $tRows[] = '
-                                                       <tr class="bgColor4">
-                                                               <td>'.htmlspecialchars($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel($table,$fN))).'</td>
-                                                               <td width="98%">'.$diffres.'</td>
-                                                       </tr>
-                                               ';
-                                       } else {
-                                               // Add string lengths even if value matched - in this was the change percentage is not high if only a single field is changed:
-                                               $allStrLen+=strlen($diff_1_record[$fN].$diff_2_record[$fN]);
-                                       }
-                               }
-                       }
-
-                       // Calculate final change percentage:
-                       $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>';
-                       } else {
-                               $content.= '<span class="nobr">'.$this->doc->icons(1).$LANG->getLL('diffview_complete_match').'</span>';
-                       }
-               } else $content.= $this->doc->icons(3).$LANG->getLL('diffview_cannot_find_records');
-
-               // Return value:
-               return array($content,$pctChange);
-       }
-
-       /**
-        * Looking for versions of a record in other workspaces than the current
-        *
-        * @param       string          Table name
-        * @param       integer         Record uid
-        * @return      string          List of other workspace IDs
-        */
-       function versionsInOtherWS($table, $uid)        {
-               // Check for duplicates:
-               // Select all versions of record NOT in this workspace:
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                               't3ver_wsid',
-                               $table,
-                               'pid=-1
-                               AND t3ver_oid='.intval($uid).'
-                               AND t3ver_wsid!='.intval($GLOBALS['BE_USER']->workspace).// TODO should be $this->workspaceId here???
-                               ' AND (t3ver_wsid=-1 OR t3ver_wsid>0)'.
-                               t3lib_BEfunc::deleteClause($table),
-                               '',
-                               't3ver_wsid',
-                               '',
-                               't3ver_wsid'
-               );
-               if (count($rows)) {
-                       return implode(',',array_keys($rows));
-               }
-       }
-
-       /**
-        * Looks up stage changes for version and displays a formatted view on mouseover.
-        *
-        * @param       string          Table name
-        * @param       integer         Record ID
-        * @param       string          HTML string to wrap the mouseover around (should be stage change links)
-        * @return      string          HTML code.
-        */
-       function showStageChangeLog($table,$id,$stageCommands)  {
-               global  $LANG;
-
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                               'log_data,tstamp,userid',
-                               'sys_log',
-                               'action=6 and details_nr=30
-                               AND tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'sys_log').'
-                               AND recuid='.intval($id)
-               );
-
-               $entry = array();
-               foreach($rows as $dat)  {
-                       $data = unserialize($dat['log_data']);
-                       $username = $this->be_user_Array[$dat['userid']] ? $this->be_user_Array[$dat['userid']]['username'] : '['.$dat['userid'].']';
-
-                       switch($data['stage'])  {
-                               case 1:
-                                       $text = $LANG->getLL('stage_sent_to_review');
-                                       break;
-                               case 10:
-                                       $text = $LANG->getLL('stage_approved_for_publish');
-                                       break;
-                               case -1:
-                                       $text = $LANG->getLL('stage_rejected');
-                                       break;
-                               case 0:
-                                       $text = $LANG->getLL('stage_reset_to_editing');
-                                       break;
-                               default:
-                                       $text = $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>' : '');
-
-                       $entry[] = $text;
-               }
-
-               return count($entry) ? '<span onmouseover="document.getElementById(\'log_' . $table . $id . '\').style.visibility = \'visible\';" onmouseout="document.getElementById(\'log_' . $table . $id . '\').style.visibility = \'hidden\';">' . $stageCommands . ' (' . count($entry) . ')</span>' .
-                               '<div class="t3-version-infolayer logLayer" id="log_' . $table . $id . '">' . implode('<hr/>', $entry) . '</div>' : $stageCommands;
-       }
-
-       /**
-        * Links to publishing etc of a version
-        *
-        * @param       string          Table name
-        * @param       array           Online record
-        * @param       array           Offline record (version)
-        * @param       string          Swap type, "branch", "page" or "element"
-        * @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') . '">'.
-                                 t3lib_iconWorks::getSpriteIcon('actions-version-workspace-sendtostage') .
-                               '</a>';
-                       if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
-                               $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>';
-                       }
-               }
-
-               if (!$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off)) {
-                       if ($GLOBALS['BE_USER']->workspace!==0) {
-                               // Release
-                               $confirm = $LANG->JScharCode($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>';
-                       }
-
-                       // 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>';
-                       } 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>';
-                       }
-               }
-
-               // 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>';
-
-               // View
-               if ($table==='pages')   {
-                       $tempUid = ($vType==='branch' || $GLOBALS['BE_USER']->workspace===0 ? $rec_off['uid'] : $rec_on['uid']);
-                       $actionLinks.=
-                               '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($tempUid,$this->doc->backPath,t3lib_BEfunc::BEgetRootLine($tempUid))).'">'.
-                                 t3lib_iconWorks::getSpriteIcon('actions-document-view') .
-                               '</a>';
-               }
-
-               return $actionLinks;
-       }
-
-       /**
-        * Format publishing count for version (lifecycle state)
-        *
-        * @param       integer         t3ver_count value (number of times it has been online)
-        * @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');
-                                       break;
-                               case 1:
-                                       $this->formatCount_cache[$count] = $LANG->getLL('workspace_list_publishing_count_archive');
-                                       break;
-                               default:
-                                       $this->formatCount_cache[$count] = sprintf($LANG->getLL('workspace_list_publishing_count'), $count);
-                                       break;
-                       }
-               }
-
-               return $this->formatCount_cache[$count];
-       }
-
-
-       /**
-        * Creates display of sub elements of a page when the swap mode is either "Page" or "Branch" (0 / ALL)
-        *
-        * @param       integer         Page uid (for either online or offline version, but it MUST have swapmode/treeLevel set to >0 (not -1 indicating element versioning)
-        * @param       integer         The treeLevel value, >0 indicates "branch" while 0 means page+content. (-1 would have meant element versioning, but that should never happen for a call to this function!)
-        * @param       integer         For offline versions; This is t3ver_oid, the original ID of the online page.
-        * @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>');
-               } 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']))      {
-                                       $this->subElements_getNonPageRecords($tN, $uid, $recList);
-                               }
-                       }
-
-                       // Render records collected above:
-                       $elCount = count($recList)-1;
-                       foreach($recList as $c => $comb)        {
-                               list($tN,$rec) = $comb;
-
-                               $this->subElements_renderItem(
-                                       $tCell,
-                                       $tN,
-                                       $uid,
-                                       $rec,
-                                       $origId,
-                                       $c==$elCount && $treeLevel==0 ? 1 : 0,          // If TRUE, will show bottom-join icon.
-                                       ''
-                               );
-                       }
-
-                       // For branch, dive into the subtree:
-                       if ($treeLevel>0) {
-
-                               // Drawing tree:
-                               $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
-                               $tree->getTree($uid, 99, '');
-
-                               // Traverse page tree:
-                               foreach($tree->tree as $data)   {
-
-                                       // Render page in table cell:
-                                       $this->subElements_renderItem(
-                                               $tCell,
-                                               'pages',
-                                               $uid,
-                                               t3lib_BEfunc::getRecord('pages',$data['row']['uid']),   // Needs all fields, at least more than what is given in $data['row']...
-                                               $origId,
-                                               2,              // 2=the join icon and icon for the record is not rendered for pages (where all is in $data['HTML']
-                                               $data['HTML']
-                                       );
-
-                                       // Find all records from page and collect in $recList:
-                                       $recList = array();
-                                       foreach($TCA as $tN => $tCfg)   {
-                                               if ($tN!=='pages')      {
-                                                       $this->subElements_getNonPageRecords($tN, $data['row']['uid'], $recList);
-                                               }
-                                       }
-
-                                       // Render records collected above:
-                                       $elCount = count($recList)-1;
-                                       foreach($recList as $c => $comb)        {
-                                               list($tN,$rec) = $comb;
-
-                                               $this->subElements_renderItem(
-                                                       $tCell,
-                                                       $tN,
-                                                       $uid,
-                                                       $rec,
-                                                       $origId,
-                                                       $c==$elCount?1:0,       // If TRUE, will show bottom-join icon.
-                                                       $data['HTML_depthData']
-                                               );
-                                       }
-                               }
-                       }
-
-                       return '
-                                       <!-- Sub-element tree for versions -->
-                                       <table border="0" cellpadding="0" cellspacing="1" class="ver-subtree">
-                                               '.implode('',$tCell).'
-                                       </table>';
-               }
-       }
-
-       /**
-        * Select records from a table and add them to recList
-        *
-        * @param       string          Table name (from TCA)
-        * @param       integer         PID to select records from
-        * @param       array           Array where records are accumulated, passed by reference
-        * @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' : '').
-                       t3lib_BEfunc::deleteClause($tN),
-                       '',
-                       $TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($TCA[$tN]['ctrl']['default_sortby'])
-               );
-
-               foreach($records as $rec)       {
-                       $recList[] = array($tN,$rec);
-               }
-       }
-
-       /**
-        * Render a single item in a subelement list into a table row:
-        *
-        * @param       array           Table rows, passed by reference
-        * @param       string          Table name
-        * @param       integer         Page uid for which the subelements are selected/shown
-        * @param       array           Row of element in list
-        * @param       integer         The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version.
-        * @param       integer         Mode of icon display: 0=not the last, 1= is the last in list (make joinbottom icon then), 2=do not shown icons are all (for pages from the page tree already rendered)
-        * @param       string          Prefix HTML data (icons for tree rendering)
-        * @return      void            (Content accumulated in $tCell!)
-        */
-       function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)      {
-               global $TCA;
-
-               // Initialize:
-               $origUidFields = $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:
-                       if (!$origId)   {       // In case we are displaying the online originals:
-                               $this->targets['orig_'.$uid.'_'.$tN.'_'.$rec['uid']] = $rec;    // Build up target array (important that
-                               $tdParams =  ' id="orig_'.$uid.'_'.$tN.'_'.$rec['uid'].'" class="typo3-ver"';           // Setting ID of the table row
-                       } else {        // Version branch:
-                               if ($this->targets['orig_'.$origId.'_'.$tN.'_'.$rec[$origUidFields]])   {       // If there IS a corresponding original record...:
-
-                                       // Prepare Table row parameters:
-                                       $this->addHlSubelementsScript = TRUE;
-                                       $tdParams =  ' onmouseover="hlSubelements(\''.$origId.'_'.$tN.'_'.$rec[$origUidFields].'\', \''.$uid.'_'.$tN.'_'.$rec[$origUidFields].'\', 1, '.($this->diff==2?1:0).');"'.
-                                               ' onmouseout="hlSubelements(\''.$origId.'_'.$tN.'_'.$rec[$origUidFields].'\', \''.$uid.'_'.$tN.'_'.$rec[$origUidFields].'\', 0, '.($this->diff==2?1:0).');"'.
-                                               ' id="ver_'.$uid.'_'.$tN.'_'.$rec[$origUidFields].'" class="typo3-ver"';
-
-                                       // Create diff view:
-                                       if ($this->diff)        {
-                                               list($diffHTML,$diffPct) = $this->createDiffView($tN, $rec, $this->targets['orig_'.$origId.'_'.$tN.'_'.$rec[$origUidFields]]);
-
-                                               if ($this->diff==2)     {
-                                                       $diffCode =
-                                                               ($diffPct ? '<span class="nobr">'.$diffPct.'% change</span>' : '-').
-                                                               '<div style="visibility: hidden; position: absolute;" id="diff_'.$uid.'_'.$tN.'_'.$rec[$origUidFields].'" class="diffLayer">'.
-                                                               $diffHTML.
-                                                               '</div>';
-                                               } else {
-                                                       $diffCode =
-                                                               ($diffPct<0 ? 'N/A' : ($diffPct ? $diffPct.'% change:' : '')).
-                                                               $diffHTML;
-                                               }
-                                       }
-
-                                       // Unsetting the target fields allows us to mark all originals without a version in the subtree (see ->markupNewOriginals())
-                                       unset($this->targets['orig_'.$origId.'_'.$tN.'_'.$rec[$origUidFields]]);
-                               } else {        // No original record, so must be new:
-                                       $tdParams =  ' class="typo3-ver-new"';
-                               }
-                       }
-               } else {        // If no original uid column is supported for this table we are forced NOT to display any diff or highlighting.
-                       $tdParams = ' class="typo3-ver-noComp"';
-               }
-
-               // Compile the cell:
-               $tCell[] = '
-                                               <tr'.$tdParams.'>
-                                                       <td class="iconTitle">'.
-                                                       $HTMLdata.
-                                                       ($iconMode < 2 ?
-                                                       '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/join'.($iconMode ? 'bottom' : '').'.gif','width="18" height="16"').' alt="" />'.
-                                                       t3lib_iconWorks::getIconImage($tN, $rec, $this->doc->backPath,'') : '').
-                                                       t3lib_BEfunc::getRecordTitle($tN, $rec, TRUE).
-                                                       '</td>
-                                                       <td class="cmdCell">'.
-                                                       $this->displayWorkspaceOverview_commandLinksSub($tN,$rec,$origId).
-                                                       '</td>'.($origId ? '<td class="diffCell">'.
-                                                       $diffCode.
-                                                       '</td>':'').'
-                                               </tr>';
-       }
-
-       /**
-        * Links to publishing etc of a version
-        *
-        * @param       string          Table name
-        * @param       array           Record array
-        * @param       integer         The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version.
-        * @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>';
-                               } 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>';
-                               }
-                       }
-
-                       // 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>';
-               }
-
-               // View
-               if ($table==='pages')   {
-                       $actionLinks.=
-                               '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($uid,$this->doc->backPath,t3lib_BEfunc::BEgetRootLine($uid))).'">'.
-                                 t3lib_iconWorks::getSpriteIcon('actions-document-view') .
-                               '</a>';
-               }
-
-               return $actionLinks;
-       }
-
-
-       /**
-        * Links to stage change of a version
-        *
-        * @param       string          Table name
-        * @param       array           Offline record (version)
-        * @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');
-                               $color = '#666666';     // TODO Use CSS?
-                               $label = $LANG->getLL('label_commentforreviewer');
-                               $titleAttrib = $LANG->getLL('label_sendtoreview');
-                               break;
-                       case 1:
-                               $sId = 10;
-                               $sLabel = $LANG->getLL('label_review');
-                               $color = '#6666cc';     // TODO Use CSS?
-                               $label = $LANG->getLL('label_commentforpublisher');
-                               $titleAttrib = $LANG->getLL('label_approveforpublishing');
-                               break;
-                       case 10:
-                               $sLabel = $LANG->getLL('label_publish');
-                               $color = '#66cc66';     // TODO Use CSS?
-                               break;
-                       case -1:
-                               $sLabel = $this->doc->icons(2).$LANG->getLL('label_rejected');
-                               $sId = 0;
-                               $color = '#ff0000';     // TODO Use CSS?
-                               $label = $LANG->getLL('stage_label_user_comment');
-                               $titleAttrib = $LANG->getLL('label_resetstage');
-                               break;
-                       default:
-                               $sLabel = $LANG->getLL('label_undefined');
-                               $sId = 0;
-                               $color = '';
-                               break;
-               }
-               #debug($sId);
-
-               $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;';
-                       // Reject:
-                       $actionLinks.=
-                       '<a href="#" onclick="'.htmlspecialchars($onClick).'"title="'.$LANG->getLL('label_reject').'"> '.
-                         t3lib_iconWorks::getSpriteIcon('actions-move-down') .
-                       '</a>';
-               } else {
-                       // Reject:
-                       $actionLinks.=
-                       '<img src="'.$this->doc->backPath.'gfx/clear.gif" width="14" height="14" alt="" align="top" title="" />';
-               }
-
-               // TODO Use CSS?
-               $actionLinks.= '<span style="background-color: '.$color.'; color: white;">'.$sLabel.'</span>';
-
-               // Raise
-               if ($raiseOk && $GLOBALS['BE_USER']->workspaceCheckStageForCurrent($sId))       {
-                       $onClick = 'var commentTxt=window.prompt("'.$label.'","");
-                                                       if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand(
-                       '&cmd['.$table.']['.$rec_off['uid'].'][version][action]=setStage'.
-                       '&cmd['.$table.']['.$rec_off['uid'].'][version][stageId]='.$sId
-                       ).'&cmd['.$table.']['.$rec_off['uid'].'][version][comment]="+escape(commentTxt);}'.
-                       ' return false;';
-                       if ($rec_off['t3ver_stage']!=10)        {
-                               $actionLinks.=
-                               '<a href="#" onclick="'.htmlspecialchars($onClick).'" title="'.htmlspecialchars($titleAttrib).'">'.
-                                 t3lib_iconWorks::getSpriteIcon('actions-move-up') .
-                               '</a>';
-
-                               $this->stageIndex[$sId][$table][] = $rec_off['uid'];
-                       }
-               }
-
-               return $actionLinks;
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib_gui.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib_gui.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/version/ws/clear.gif b/typo3/sysext/version/ws/clear.gif
deleted file mode 100755 (executable)
index 9ed1269..0000000
Binary files a/typo3/sysext/version/ws/clear.gif and /dev/null differ
diff --git a/typo3/sysext/version/ws/cli/conf.php b/typo3/sysext/version/ws/cli/conf.php
deleted file mode 100755 (executable)
index e26b992..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
-// DO NOT REMOVE OR CHANGE THESE 3 LINES:
-define('TYPO3_MOD_PATH', 'mod/user/ws/cli/');
-$BACK_PATH = '../../../../';
-$MCONF['name'] = '_CLI_user_ws';
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/version/ws/conf.php b/typo3/sysext/version/ws/conf.php
deleted file mode 100755 (executable)
index 8327a31..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-define('TYPO3_MOD_PATH', 'sysext/version/ws/');
-$BACK_PATH='../../../';
-
-$MLANG['default']['tabs_images']['tab'] = 'sys_workspace.gif';
-$MLANG['default']['ll_ref']='LLL:EXT:lang/locallang_mod_user_ws.php';
-
-$MCONF['shy'] = FALSE;
-$MCONF['script'] = 'index.php';
-$MCONF['access']='user,group';
-$MCONF['name']='user_ws';
-?>
\ No newline at end of file
diff --git a/typo3/sysext/version/ws/index.php b/typo3/sysext/version/ws/index.php
deleted file mode 100755 (executable)
index 0e6a91a..0000000
+++ /dev/null
@@ -1,1094 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (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
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-/**
- * Module: Workspace manager
- *
- * $Id: index.php 9427 2010-11-17 08:38:31Z benni $
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author     Dmitry Dulepov <typo3@accio.lv>
- */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *  101: class SC_mod_user_ws_index extends t3lib_SCbase
- *
- *              SECTION: Standard module initialization
- *  128:     function menuConfig()
- *  175:     function init()
- *  233:     function main()
- *  280:     function printContent()
- *
- *              SECTION: Module content: Publish
- *  310:     function moduleContent_publish()
- *  411:     function displayVersionDetails($details)
- *  420:     function displayWorkspaceOverview()
- *
- *              SECTION: Module content: Workspace list
- *  461:     function moduleContent_workspaceList()
- *  476:     function workspaceList_displayUserWorkspaceList()
- *  553:     function workspaceList_getUserWorkspaceList()
- *  592:     function workspaceList_formatWorkspaceData(&$wksp)
- *  634:     function workspaceList_getWebMountPoints(&$wksp)
- *  683:     function workspaceList_getFileMountPoints(&$wksp)
- *  736:     function workspaceList_displayUserWorkspaceListHeader()
- *  756:     function workspaceList_getUserList(&$wksp)
- *  783:     function workspaceList_getUserListForSysWorkspace(&$wksp)
- *  810:     function workspaceList_getUserListWithAccess(&$list, $access)
- *  883:     function workspaceList_displayIcons($currentWorkspace, &$wksp)
- *  931:     function workspaceList_hasEditAccess(&$wksp)
- *  943:     function workspaceList_createFakeWorkspaceRecord($uid)
- *
- * TOTAL FUNCTIONS: 20
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
-
-       // Initialize module:
-unset($MCONF);
-require ('conf.php');
-require ($BACK_PATH.'init.php');
-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');
-$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
-require_once('class.wslib.php');
-require_once('class.wslib_gui.php');
-
-
-
-
-/**
- * Module: Workspace manager
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class SC_mod_user_ws_index extends t3lib_SCbase {
-
-               // Default variables for backend modules
-       var $MCONF = array();                           // Module configuration
-       var $MOD_MENU = array();                        // Module menu items
-       var $MOD_SETTINGS = array();            // Module session settings
-
-       /**
-        * Document Template Object
-        *
-        * @var noDoc
-        */
-       var $doc;
-       var $content;                                           // Accumulated content
-
-
-               // Internal:
-       var $publishAccess = FALSE;
-       var $be_user_Array = array();
-       var $be_user_Array_full = array();      // not blinded, used by workspace listing
-       protected $showDraftWorkspace = FALSE;  // Determines whether the draft workspace is shown
-
-
-       /*********************************
-        *
-        * Standard module initialization
-        *
-        *********************************/
-
-       /**
-        * Initialize menu configuration
-        *
-        * @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']) {
-                       $this->showDraftWorkspace = TRUE;
-               }
-
-                       // Menu items:
-               $this->MOD_MENU = array(
-                       'function' => array(
-                               'publish' => $LANG->getLL('menuitem_review'),
-                               'workspaces' => $LANG->getLL('menuitem_workspaces'),
-                       ),
-                       'filter' => array(
-                               1 => $LANG->getLL('filter_drafts'),
-                               2 => $LANG->getLL('filter_archive'),
-                               0 => $LANG->getLL('filter_all'),
-                       ),
-                       'display' => array(
-                               0 => '['.$LANG->getLL('shortcut_onlineWS').']',
-                               -98 => $LANG->getLL('label_offlineWSes'),
-                               -99 => $LANG->getLL('label_allWSes')
-                       ),
-                       'diff' => array(
-                               0 => $LANG->getLL('diff_no_diff'),
-                               1 => $LANG->getLL('diff_show_inline'),
-                               2 => $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') . ']';
-               }
-
-                       // 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)    {
-                               if ($GLOBALS['BE_USER']->checkWorkspace($rec))  {
-                                       $this->MOD_MENU['display'][$rec['uid']] = '[' . $rec['uid'] . '] ' . htmlspecialchars($rec['title']);
-                               }
-                       }
-               }
-
-                       // CLEANSE SETTINGS
-               $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], 'ses');
-       }
-
-       /**
-        * Executes action for selected elements, if any is sent:
-        */
-       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)  {
-                                       list($table,$uid) = explode(':',$item,2);
-
-                                       if ($GLOBALS['TCA'][$table] && t3lib_div::testInt($uid))        {
-                                               switch($post['_with_selected_do'])      {
-                                                       case "stage_-1":
-                                                               $cmdArray[$table][$uid]['version']['action'] = 'setStage';
-                                                               $cmdArray[$table][$uid]['version']['stageId'] = -1;
-                                                       break;
-                                                       case "stage_0":
-                                                               $cmdArray[$table][$uid]['version']['action'] = 'setStage';
-                                                               $cmdArray[$table][$uid]['version']['stageId'] = 0;
-                                                       break;
-                                                       case "stage_1":
-                                                               $cmdArray[$table][$uid]['version']['action'] = 'setStage';
-                                                               $cmdArray[$table][$uid]['version']['stageId'] = 1;
-                                                       break;
-                                                       case "stage_10":
-                                                               $cmdArray[$table][$uid]['version']['action'] = 'setStage';
-                                                               $cmdArray[$table][$uid]['version']['stageId'] = 10;
-                                                       break;
-                                                       case "publish":
-                                                               if ($onlineRec = t3lib_BEfunc::getLiveVersionOfRecord($table,$uid,'uid'))       {
-                                                                       $cmdArray[$table][$onlineRec['uid']]['version']['action'] = 'swap';
-                                                                       $cmdArray[$table][$onlineRec['uid']]['version']['swapWith'] = $uid;
-                                                               }
-                                                       break;
-                                                       case "swap":
-                                                       if ($onlineRec = t3lib_BEfunc::getLiveVersionOfRecord($table,$uid,'uid'))       {
-                                                               $cmdArray[$table][$onlineRec['uid']]['version']['action'] = 'swap';
-                                                               $cmdArray[$table][$onlineRec['uid']]['version']['swapWith'] = $uid;
-                                                               $cmdArray[$table][$onlineRec['uid']]['version']['swapIntoWS'] = 1;
-                                                       }
-                                                       break;
-                                                       case "release":
-                                                               $cmdArray[$table][$uid]['version']['action'] = 'clearWSID';
-                                                       break;
-                                                       case "flush":
-                                                               $cmdArray[$table][$uid]['version']['action'] = 'flush';
-                                                       break;
-                                               }
-                                       }
-                               }
-
-                               /** @var $tce t3lib_TCEmain */
-                               $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                               $tce->stripslashes_values = 0;
-                               $tce->start(array(), $cmdArray);
-                               $tce->process_cmdmap();
-                               $tce->printLogErrorMessages('');
-                       }
-               }
-       }
-
-       /**
-        * Standard init function of a module.
-        *
-        * @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->setModuleTemplate('templates/ws.html');
-
-                       // JavaScript
-               $this->doc->JScode = $this->doc->wrapScriptTags('
-                       script_ended = 0;
-                       function jumpToUrl(URL) {       //
-                               window.location.href = URL;
-                       }
-
-                       function expandCollapse(rowNumber) {
-                               elementId = "wl_" + rowNumber;
-                               element = document.getElementById(elementId);
-                               image = document.getElementById("spanw1_" + rowNumber);
-                               if (element.style)      {
-                                       if (element.style.display == "none")    {
-                                               element.style.display = "table-row";
-                                               image.className = "t3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-collapse";
-                                       } else {
-                                               element.style.display = "none";
-                                               image.className = "t3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-expand";
-                                       }
-                               }
-                       }
-               ');
-               $this->doc->form = '<form action="index.php" method="post" name="pageform">';
-
-                       // Setting up the context sensitive menu:
-               $this->doc->getContextMenuCode();
-
-                       // Setting publish access permission for workspace:
-               $this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace);
-
-                       // Parent initialization:
-               parent::init();
-       }
-
-       /**
-        * Main function for Workspace Manager module.
-        *
-        * @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() . '";');
-               } else {
-                               // Starting page:
-                       $this->content.=$this->doc->header($LANG->getLL('title'));
-                       $this->content.=$this->doc->spacer(5);
-
-                       // Get usernames and groupnames
-                       $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
-                       $groupArray = array_keys($be_group_Array);
-                       // Need 'admin' field for t3lib_iconWorks::getIconImage()
-                       $this->be_user_Array_full = $this->be_user_Array = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,admin,workspace_perms');
-                       if (!$GLOBALS['BE_USER']->isAdmin()) {
-                               $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array,$groupArray,1);
-                       }
-
-                       // Build top menu:
-                       $menuItems = array();
-                       $menuItems[] = array(
-                               'label' => $LANG->getLL('menuitem_review'),
-                               'content' => $this->moduleContent_publish()
-                       );
-                       $menuItems[] = array(
-                               'label' => $LANG->getLL('menuitem_workspaces'),
-                               'content' => $this->moduleContent_workspaceList()
-                       );
-
-                               // Add hidden fields and create tabs:
-                       $content = $this->doc->getDynTabMenu($menuItems, 'user_ws');
-                       $this->content.=$this->doc->section('',$content,0,1);
-
-                               // Setting up the buttons and markers for docheader
-                       $docHeaderButtons = $this->getButtons();
-                       // $markers['CSH'] = $docHeaderButtons['csh'];
-
-               }
-               $markers['CONTENT'] = $this->content;
-
-                       // Build the <body> for the module
-               $this->content = $this->doc->startPage($LANG->getLL('title'));
-               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-               $this->content.= $this->doc->endPage();
-               $this->content = $this->doc->insertStylesAndJS($this->content);
-
-       }
-
-       /**
-        * Print module content. Called as last thing in the global scope.
-        *
-        * @return      void
-        */
-       function printContent() {
-               echo $this->content;
-       }
-
-       /**
-        * Create the panel of buttons for submitting the form or otherwise perform operations.
-        *
-        * @return      array   all available buttons as an assoc. array
-        */
-       protected function getButtons() {
-               global $LANG, $BACK_PATH;
-
-               $buttons = array(
-                       'new_record' => '',
-               );
-
-               $newWkspUrl = 'workspaceforms.php?action=new';
-
-                       // 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" />' .
-                                               '</a>';
-               }
-               return $buttons;
-       }
-
-
-
-
-
-
-
-
-
-
-
-       /*********************************
-        *
-        * Module content: Publish
-        *
-        *********************************/
-
-       /**
-        * Rendering the content for the publish and review panel in the workspace manager
-        *
-        * @return      string          HTML content
-        */
-       function moduleContent_publish()        {
-               global  $LANG;
-
-                       // Initialize:
-               $content = '';
-               $details = t3lib_div::_GP('details');
-
-                       // Create additional menus:
-               $menu = '';
-               if ($GLOBALS['BE_USER']->workspace===0) {
-                       $menu.= t3lib_BEfunc::getFuncMenu(0,'SET[filter]',$this->MOD_SETTINGS['filter'],$this->MOD_MENU['filter']);
-                       $menu.= t3lib_BEfunc::getFuncMenu(0,'SET[display]',$this->MOD_SETTINGS['display'],$this->MOD_MENU['display']);
-               }
-               $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> ';
-               }
-
-                       // Create header:
-               $title = '';
-               $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');
-                       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');
-                       break;
-                       case -99:
-                               $title = $this->doc->icons(3).'[' . $LANG->getLL('shortcut_noWSfound') . ']';
-                               $description = $LANG->getLL('workspace_description_no_access');
-                       break;
-                       default:
-                               $title = t3lib_iconWorks::getIconImage('sys_workspace', $GLOBALS['BE_USER']->workspaceRec, $this->doc->backPath, ' align="top"').
-                                                       '['.$GLOBALS['BE_USER']->workspace.'] '.t3lib_BEfunc::getRecordTitle('sys_workspace',$GLOBALS['BE_USER']->workspaceRec,TRUE);
-                               $description = $GLOBALS['BE_USER']->workspaceRec['description'];
-                       break;
-               }
-
-                       // Buttons for publish / swap:
-               $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"/>';
-                               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 ;" />';
-                               }
-                       } else {
-                               $actionLinks.= $this->doc->icons(1) . $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']);
-                               $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" />';
-                       }
-               }
-
-               $wsAccess = $GLOBALS['BE_USER']->checkWorkspace($GLOBALS['BE_USER']->workspaceRec);
-
-                       // Add header to content variable:
-               $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 nowrap="nowrap">' . $title . '</td>
-                       </tr>
-                       <tr>' . ($description ? '
-                               <td class="t3-col-header" nowrap="nowrap">' . $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>' . $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>
-                       </tr>' : '').'
-               </table>
-               <br />
-               ';
-
-                       // Add publishing and review overview:
-               if ($GLOBALS['BE_USER']->workspace!=-99)        {
-                       if ($details)   {
-                               $content.= $this->displayVersionDetails($details);
-                       } else {
-                               $content.= $this->displayWorkspaceOverview();
-                       }
-                       $content .= '<br />';
-               }
-
-                       // Return content:
-               return $content;
-       }
-
-       /**
-        * Display details for a single version from workspace
-        *
-        * @param       string          Version identification, made of table and uid
-        * @return      string          HTML string
-        */
-       function displayVersionDetails($details)        {
-               return 'TODO: Show details for version "'.$details.'"<hr/><a href="index.php">BACK</a>';
-       }
-
-       /**
-        * Rendering the overview of versions in the current workspace
-        *
-        * @return      string