Fixed bug #14097: Preview in BE opens Workspace-preview
authorSteffen Kamper <info@sk-typo3.de>
Tue, 13 Apr 2010 23:38:38 +0000 (23:38 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 13 Apr 2010 23:38:38 +0000 (23:38 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7359 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
typo3/backend.php
typo3/js/workspacemenu.js

index 0d2503f..b488ef7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
 
 2010-04-13  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14097: Preview in BE opens Workspace-preview
        * Fixed bug #14100: ModuleMenu is too small
        * Added Feature #13940 Added marker in CONTENT object (thanks to Jigal van Hemert)
        * Added testcase for #13698 (thanks to Oliver Klee)
index dfe0191..e4a8021 100644 (file)
@@ -2660,8 +2660,8 @@ final class t3lib_BEfunc {
                $urlPreviewEnabled  = $viewDomain . $viewScriptPreviewEnabled . $id . $addGetVars . $anchor;
                $urlPreviewDisabled = $viewDomain . $viewScriptPreviewDisabled . $id . $addGetVars . $anchor;
 
-               return "previewWin=window.open(top.WorkspaceFrontendPreviewEnabled?'" .
-                       $urlPreviewDisabled . "':'" . $urlPreviewEnabled .
+               return "var previewWin=window.open(top.TYPO3.configuration.inWorkspace !== 0 && top.TYPO3.configuration.workspaceFrontendPreviewEnabled ?'" .
+                       $urlPreviewEnabled . "':'" . $urlPreviewDisabled .
                        "','newTYPO3frontendWindow');" . ( $switchFocus ? 'previewWin.focus();' : '');
        }
 
index ac00c10..b634932 100644 (file)
@@ -365,7 +365,8 @@ class TYPO3backend {
                        'TYPO3_mainDir' => TYPO3_mainDir,
                        'pageModule' => $pageModule,
                        'condensedMode' => $GLOBALS['BE_USER']->uc['condensedMode'] ? 1 : 0 ,
-                       'workspaceFrontendPreviewEnabled' => $GLOBALS['BE_USER']->workspace != 0 && !$GLOBALS['BE_USER']->user['workspace_preview'] ? 0 : 1,
+                       'inWorkspace' => $GLOBALS['BE_USER']->workspace !== 0 ? 1 : 0,
+                       'workspaceFrontendPreviewEnabled' => $GLOBALS['BE_USER']->user['workspace_preview'] ? 1 : 0,
                        'veriCode' => $GLOBALS['BE_USER']->veriCode(),
                        'denyFileTypes' => PHP_EXTENSIONS_DEFAULT,
                        'moduleMenuWidth' => $this->menuWidth - 1,
index ea26bf0..f143001 100644 (file)
@@ -24,7 +24,7 @@
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 
-
+Ext.ns('TYPO3', 'TYPO3.configuration');
 /**
  * class to handle the workspace menu
  *
@@ -112,9 +112,11 @@ var WorkspaceMenu = Class.create({
                                var stateInactiveIcon = $$('#workspace-selector-menu img.state-inactive')[0].cloneNode(true);
 
                                if (response.newWorkspacePreviewState == 1) {
+                                       TYPO3.configuration.workspaceFrontendPreviewEnabled = 1;
                                        Event.element(event).previous().replace(stateActiveIcon);
                                        top.WorkspaceFrontendPreviewEnabled = true;
                                } else {
+                                       TYPO3.configuration.workspaceFrontendPreviewEnabled = 0;
                                        Event.element(event).previous().replace(stateInactiveIcon);
                                        top.WorkspaceFrontendPreviewEnabled = false;
                                }
@@ -142,6 +144,8 @@ var WorkspaceMenu = Class.create({
                new Ajax.Request('ajax.php', {
                        parameters: 'ajaxID=WorkspaceMenu::setWorkspace&workspaceId=' + workspaceId,
                        onSuccess: function(transport, response) {
+                               TYPO3.configuration.inWorkspace = response.setWorkspaceId === 0 ? 0 : 1;
+                               
                                        // first remove all checks, then set the check in front of the selected workspace
                                var stateActiveIcon = $$('#workspace-selector-menu img.state-active')[0].cloneNode(true);
                                var stateInactiveIcon = $$('#workspace-selector-menu img.state-inactive')[0].cloneNode(true);