Project

General

Profile

Feature #9819 » 9946.patch

Tolleiv Nietsch, 2010-12-11 17:56

View differences:

Classes/Controller/PreviewController.php (working copy)
* @return void
*/
public function indexAction() {
// @todo language doesn't always come throught the L parameter
// @todo Evaluate how the intval() call can be used with Extbase validators/filters
$language = intval(t3lib_div::_GP('L'));
......
$this->view->assign('wsUrl', $wsBaseUrl . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $GLOBALS['BE_USER']->workspace);
$this->view->assign('wsSettingsUrl', $wsSettingsUrl);
$this->view->assign('wsHelpUrl', $wsHelpUrl);
$this->view->assign('backendDomain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
$GLOBALS['BE_USER']->setAndSaveSessionData('workspaces.backend_domain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
$this->pageRenderer->addJsInlineCode("workspaces.preview.lll" , "TYPO3.LLL.Workspaces = {
visualPreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.visualPreview', true) . "',
listView: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.listView', true) . "',
helpView: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.helpView', true) . "'
};\n");
}
/**
Classes/Service/Fehooks.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
* 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!
***************************************************************/
/**
* @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
* @package Workspaces
* @subpackage Service
*/
class tx_Workspaces_Service_Fehooks {
/**
* @param tslib_fe $pObj
* @return void
*/
public function hook_eofe($params, $pObj) {
if ($pObj->fePreview != 2) {
return;
}
echo $GLOBALS['TSFE']->cObj->cObjGetSingle(
'FLUIDTEMPLATE',
array(
'file' => 'EXT:workspaces/Resources/Private/Templates/Preview/Preview.html',
'variables.' => array(
'backendDomain' => 'TEXT',
'backendDomain.' => array('value' => $GLOBALS['BE_USER']->getSessionData('workspaces.backend_domain'))
)
)
);
}
}
ext_localconf.php (working copy)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:tx_Workspaces_Service_Tcemain';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:tx_Workspaces_Service_Befunc';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = 'EXT:workspaces/Classes/Service/Fehooks.php:tx_Workspaces_Service_Fehooks->hook_eofe';
?>
Resources/Private/Language/locallang.xml (working copy)
<label index="warning.oldStyleWorkspaceInUser">It seems that you're still using old-style workspace. Please use the update scripts in the TYPO3 Install Tool to run the necessary updates. If you continue using this module without migrating your workspace you might loose data.</label>
<label index="info.newpage">New Page!</label>
<label index="info.newpage.detail">The previewed page has been created in a workspace and has no live counterpart.</label>
<label index="preview.visualPreview">Visual preview</label>
<label index="preview.listView">List view</label>
<label index="preview.helpView">Help</label>
</languageKey>
</data>
</T3locallang>
Resources/Private/Layouts/popup.html (working copy)
var wsUrl = '{wsUrl}';
var wsSettingsUrl = '{wsSettingsUrl}';
var wsHelpUrl = '{wsHelpUrl}';
document.domain = '{backendDomain}';
function resize(height) {
// poor way to avoid that we require any scrollbars within the frames
var finalHeight = height * 1.1;
Ext.getCmp('visualPanel').setHeight(finalHeight);
Ext.getCmp('wsPanel').setHeight(finalHeight);
Ext.getCmp('livePanel').setHeight(finalHeight);
}
</script>
Resources/Private/Templates/Preview/Preview.html (revision 0)
<script type="text/javascript">
document.domain = '{backendDomain}';
// @todo redirect to split module if this is opened standalone
parent.resize(document.height);
</script>
Resources/Public/JavaScript/preview.js (working copy)
Ext.onReady(function() {
var viewport = new Ext.Viewport({
layout: 'border',
items: [
{
items: [{
xtype: 'tabpanel',
region: 'center', // a center region is ALWAYS required for border layout
id: 'preview',
activeTab: 0,
items: [
{
title: 'Workspace preview',
id: 'workspaceRegion',
items: [{
title: TYPO3.LLL.Workspaces.visualPreview,
layout: 'fit',
items: [{
layout: 'fit',
x: 0, y:0,
anchor: '100% 100%',
autoScroll: true,
items: [{
xtype: 'iframePanel',
id: 'wsPanel',
doMask: false,
src: wsUrl
layout: 'absolute',
id: 'visualPanel',
items: [{
x: 0, y:0,
anchor: '100% 100%',
id: 'wsContainer',
layout: 'absolute',
autoScroll: false,
items:[{
xtype: 'iframePanel',
x: 0, y:0,
id: 'wsPanel',
doMask: false,
src: wsUrl,
autoScroll: false
}]
},{
x: 0, y:0,
anchor: '100% 0%',
id: 'liveContainer',
layout: 'absolute',
bodyStyle: 'height:0px',
autoScroll: false,
items:[{
xtype: 'iframePanel',
x: 0, y:0,
id: 'livePanel',
doMask: false,
src: liveUrl,
autoScroll: false
}]
}]
}]
}, {
title: 'Live site',
id: 'liveRegion',
layout: 'fit',
items: [{
xtype: 'iframePanel',
id: 'livePanel',
doMask: false,
src: liveUrl
}]
},{
title: 'List view',
id: 'wsSettings',
layout: 'fit',
items: [{
xtype: 'iframePanel',
id: 'settingsPanel',
doMask: false,
src: wsSettingsUrl
}]
},{
title: 'Help',
id: 'wsHelp',
layout: 'fit',
items: [{
xtype: 'iframePanel',
id: 'settingsPanel',
doMask: false,
src: wsHelpUrl
}]
}
]
}]
},{
title: TYPO3.LLL.Workspaces.listView,
id: 'wsSettings',
layout: 'fit',
items: [{
xtype: 'iframePanel',
id: 'settingsPanel',
doMask: false,
src: wsSettingsUrl
}]
},{
title: TYPO3.LLL.Workspaces.helpView,
id: 'wsHelp',
layout: 'fit',
items: [{
xtype: 'iframePanel',
id: 'settingsPanel',
doMask: false,
src: wsHelpUrl
}]
}],
tbar:[{
xtype: 'tbfill'
},
'-',
{
xtype: 'slider',
id: 'sizeSlider',
style: 'margin: 0 5px;',
maxValue: 100,
minValue: 0,
value: 0,
width: 200,
listeners: {
change: {
fn: function resizeFromValue(slider, newValue, thumb) {
var height = Ext.getCmp('wsPanel').getHeight();
Ext.getCmp('liveContainer').setHeight(height * newValue/100);
Ext.getCmp('visualPanel').setHeight(height);
}
}
}
}]
}]
});
});
(3-3/7)