Index: Classes/Controller/PreviewController.php =================================================================== --- Classes/Controller/PreviewController.php (revision 3104) +++ Classes/Controller/PreviewController.php (working copy) @@ -92,7 +92,13 @@ // @todo - handle new pages here // branchpoints are not handled anymore because this feature is not supposed anymore - $this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1'); + if (tx_Workspaces_Service_Workspaces::isNewPage($this->pageId)) { + $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), $this, 'workspaces', 'web_workspacesworkspaces'); + $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview'; + $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams); + } else { + $this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1'); + } $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); @@ -106,6 +112,19 @@ } /** + * @return void + */ + public function newPageAction() { + $message = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.newpage.detail'), + $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.newpage'), + t3lib_FlashMessage::INFO + ); + t3lib_FlashMessageQueue::addMessage($message); + } + + /** * Generates the JavaScript code for the backend, * and since we're loading a backend module outside of the actual backend * this copies parts of the backend.php Index: Classes/Service/Workspaces.php =================================================================== --- Classes/Service/Workspaces.php (revision 3104) +++ Classes/Service/Workspaces.php (working copy) @@ -423,6 +423,37 @@ } return $oldStyleWorkspaceIsUsed; } + + /** + * Determine whether a specific page is new and not yet available in the LIVE workspace + * + * @static + * @param $id Primary key of the page to check + * @param $language Language for which to check the page + * @return bool + */ + public static function isNewPage($id, $language = 0) { + $isNewPage = FALSE; + // If the language is not default, check state of overlay + if ($language > 0) { + $whereClause = 'pid = ' . $id; + $whereClause .= ' AND ' .$GLOBALS['TCA']['pages_language_overlay']['ctrl']['languageField'] . ' = ' . $language; + $whereClause .= ' AND t3ver_wsid = ' . $GLOBALS['BE_USER']->workspace; + $whereClause .= t3lib_BEfunc::deleteClause('pages_language_overlay'); + $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('t3ver_state', 'pages_language_overlay', $whereClause); + if (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) { + $isNewPage = (int) $row['t3ver_state'] === 1; + } + + // Otherwise check state of page itself + } else { + $rec = t3lib_BEfunc::getRecord('pages', $id, 't3ver_state'); + if (is_array($rec)) { + $isNewPage = (int) $rec['t3ver_state'] === 1; + } + } + return $isNewPage; + } } Index: ext_tables.php =================================================================== --- ext_tables.php (revision 3104) +++ ext_tables.php (working copy) @@ -15,7 +15,7 @@ array( // An array holding the controller-action-combinations that are accessible 'Review' => 'index,fullIndex,singleIndex', - 'Preview' => 'index,help' + 'Preview' => 'index,help,newPage' ), array( 'access' => 'user,group', Index: Resources/Private/Language/locallang.xml =================================================================== --- Resources/Private/Language/locallang.xml (revision 3104) +++ Resources/Private/Language/locallang.xml (working copy) @@ -68,6 +68,8 @@ + + \ No newline at end of file Index: Resources/Private/Layouts/nodoc.html =================================================================== --- Resources/Private/Layouts/nodoc.html (revision 3104) +++ Resources/Private/Layouts/nodoc.html (working copy) @@ -1,8 +1,11 @@ - +{namespace this=Tx_Workspaces_ViewHelpers}